2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
callPackage,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
cython,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
spacy,
|
|
|
|
numpy,
|
|
|
|
transformers,
|
|
|
|
torch,
|
|
|
|
srsly,
|
|
|
|
spacy-alignments,
|
|
|
|
pytestCheckHook,
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy-transformers";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.3.5";
|
|
|
|
pyproject = true;
|
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
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "explosion";
|
|
|
|
repo = "spacy-transformers";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-+KCRbjY4P52SWawU1NoMoe+HOV7iujFkwqVe87fWVTE=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2021-05-20 23:08:51 +00:00
|
|
|
spacy
|
2024-05-15 15:35:15 +00:00
|
|
|
numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
transformers
|
2024-05-15 15:35:15 +00:00
|
|
|
torch
|
|
|
|
srsly
|
|
|
|
spacy-alignments
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "transformers" ];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Test fails due to missing arguments for trfs2arrays().
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +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;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ nickcao ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|