commit 4180bfe30084cb4eebacd5b26d695341bfa37590
parent 2f8d8e157009b579c4d376db7a71f626950cb853
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Sun, 10 Oct 2021 22:39:27 +0300
Add pytorchtext
Diffstat:
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -244,6 +244,7 @@ lib.makeScope newScope (
odict = callPackage ./linguistics/odict { };
opendict = callPackage ./linguistics/opendict { };
python-hfst = callPackage ./linguistics/python-hfst { };
+ pytorchtext = callPackage ./linguistics/pytorchtext { };
redict = libsForQt5.callPackage ./linguistics/redict { };
revtok = callPackage ./linguistics/revtok { };
stardict-tools = callPackage ./linguistics/stardict-tools { };
diff --git a/pkgs/linguistics/pytorchtext/default.nix b/pkgs/linguistics/pytorchtext/default.nix
@@ -0,0 +1,44 @@
+{ lib, fetchFromGitHub, python3Packages, cmake, which, revtok }:
+
+python3Packages.buildPythonPackage rec {
+ pname = "pytorchtext";
+ version = "0.10.1";
+
+ src = fetchFromGitHub {
+ owner = "pytorch";
+ repo = "text";
+ rev = "v${version}";
+ sha256 = "sha256-UCH/12jVeUY+h3Qop/RPtjIeXdddA1upsWIiwAs8+bc=";
+ fetchSubmodules = true;
+ };
+
+ nativeBuildInputs = [ cmake which ];
+
+ buildInputs = with python3Packages; [ pybind11 ];
+
+ propagatedBuildInputs = with python3Packages; [
+ defusedxml
+ nltk
+ pytorch
+ requests
+ revtok
+ sacremoses
+ spacy
+ tqdm
+ ];
+
+ checkInputs = with python3Packages; [ pytestCheckHook ];
+
+ dontUseCmakeConfigure = true;
+
+ doCheck = false;
+
+ pythonImportsCheck = [ "torchtext" ];
+
+ meta = with lib; {
+ description = "Text utilities and datasets for PyTorch";
+ inherit (src.meta) homepage;
+ license = licenses.bsd3;
+ maintainers = [ maintainers.sikmir ];
+ };
+}