guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: gnu: Add python-sacrebleu.


From: guix-commits
Subject: 02/03: gnu: Add python-sacrebleu.
Date: Fri, 9 Jun 2023 10:56:50 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit 6dc44cc963b88cb13f012deea17fdb7021a3119b
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Jun 8 11:49:10 2023 +0200

    gnu: Add python-sacrebleu.
    
    * gnu/packages/machine-learning.scm (python-sacrebleu): New variable.
---
 gnu/packages/machine-learning.scm | 45 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index 827bcd597b..cc20ef68dd 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -708,6 +708,51 @@ SentencePiece allows us to make a purely end-to-end system 
that does not
 depend on language-specific pre- or post-processing.")
     (license license:asl2.0)))
 
+(define-public python-sacrebleu
+  (package
+    (name "python-sacrebleu")
+    (version "2.3.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mjpost/sacrebleu";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1al4qf9wsq5l453qqb6clims62ns0s07wb9rfbf4hbpr1f2iv7zv"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      ;; These all need internet access.
+      '(list "-k" "not test_api_get_source \
+and not test_api_get_reference \
+and not test_maybe_download \
+and not test_process_to_text \
+and not test_get_files_and_fieldnames \
+and not test_source_and_references \
+and not test_wmt22_references")
+      #:phases
+      '(modify-phases %standard-phases
+         ;; Needed for tests.
+         (add-before 'check 'set-HOME
+           (lambda _ (setenv "HOME" "/tmp"))))))
+    (propagated-inputs (list python-colorama
+                             python-lxml
+                             python-numpy
+                             python-portalocker
+                             python-regex
+                             python-tabulate))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/mjpost/sacrebleu";)
+    (synopsis
+     "Compute shareable, comparable, and reproducible BLEU, chrF, and TER 
scores")
+    (description
+     "This is a package for hassle-free computation of shareable, comparable,
+and reproducible BLEU, chrF, and TER scores for natural language processing.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]