blob: a3628b7ec7379430d590b0b6ae698f66e365c9e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
{
lib,
fetchPypi,
fetchFromGitHub,
buildPythonPackage,
setuptools,
absl-py,
nltk,
numpy,
six,
pytestCheckHook,
}:
let
testdata = fetchFromGitHub {
owner = "google-research";
repo = "google-research";
sparseCheckout = [ "rouge/testdata" ];
rev = "1d4d2f1aa6f2883a790d2ae46a6ee8ab150d8f31";
hash = "sha256-ojqk6U2caS7Xz4iGUC9aQVHrKb2QNvMlPuQAL/jJat0=";
};
in
buildPythonPackage rec {
pname = "rouge-score";
version = "0.1.2";
pyproject = true;
src = fetchPypi {
pname = "rouge_score";
inherit version;
extension = "tar.gz";
hash = "sha256-x9TaJoPmjJq/ATXvkV1jpGZDZm+EjlWKG59+rRf/DwQ=";
};
# the tar file from pypi doesn't come with the test data
postPatch = ''
substituteInPlace rouge_score/test_util.py \
--replace-fail \
'os.path.join(os.path.dirname(__file__), "testdata")' \
'"${testdata}/rouge/testdata/"'
'';
build-system = [ setuptools ];
dependencies = [
absl-py
nltk
numpy
six
];
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = [
# https://github.com/google-research/google-research/issues/1203
"testRougeLSumSentenceSplitting"
# tries to download external tokenizers via nltk
"testRougeLsumLarge"
];
pythonImportsCheck = [ "rouge_score" ];
meta = {
description = "Python ROUGE Implementation";
homepage = "https://github.com/google-research/google-research/tree/master/rouge";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ nviets ];
};
}
|