2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2023-04-12 12:48:02 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2021-10-06 13:57:05 +00:00
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, spacy
|
|
|
|
, spacy-alignments
|
|
|
|
, srsly
|
|
|
|
, transformers
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy-transformers";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "1.2.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-Up9ZlLlAM0CDXEYDI95KsLzA0TBz/uZFqEgZLmNIABA=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
torch
|
2021-05-20 23:08:51 +00:00
|
|
|
spacy
|
|
|
|
spacy-alignments
|
|
|
|
srsly
|
|
|
|
transformers
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"transformers"
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Test fails due to missing arguments for trfs2arrays().
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"spacy_transformers"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
passthru.tests.annotation = callPackage ./annotation-test { };
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "spaCy pipelines for pretrained BERT, XLNet and GPT-2";
|
|
|
|
homepage = "https://github.com/explosion/spacy-transformers";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/explosion/spacy-transformers/releases/tag/v${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.mit;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|