Spaces:
Runtime error
Runtime error
meteor
#3
by
awais126
- opened
- README.md +1 -1
- meteor.py +2 -10
- requirements.txt +1 -1
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🤗
|
|
4 |
colorFrom: blue
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
tags:
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.0.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
tags:
|
meteor.py
CHANGED
@@ -15,18 +15,12 @@
|
|
15 |
|
16 |
import datasets
|
17 |
import numpy as np
|
|
|
18 |
from nltk.translate import meteor_score
|
19 |
-
from packaging import version
|
20 |
|
21 |
import evaluate
|
22 |
|
23 |
|
24 |
-
if evaluate.config.PY_VERSION < version.parse("3.8"):
|
25 |
-
import importlib_metadata
|
26 |
-
else:
|
27 |
-
import importlib.metadata as importlib_metadata
|
28 |
-
|
29 |
-
|
30 |
NLTK_VERSION = version.parse(importlib_metadata.version("nltk"))
|
31 |
if NLTK_VERSION >= version.Version("3.6.4"):
|
32 |
from nltk import word_tokenize
|
@@ -120,9 +114,7 @@ class Meteor(evaluate.Metric):
|
|
120 |
import nltk
|
121 |
|
122 |
nltk.download("wordnet")
|
123 |
-
if NLTK_VERSION >= version.Version("3.
|
124 |
-
nltk.download("punkt_tab")
|
125 |
-
elif NLTK_VERSION >= version.Version("3.6.5"):
|
126 |
nltk.download("punkt")
|
127 |
if NLTK_VERSION >= version.Version("3.6.6"):
|
128 |
nltk.download("omw-1.4")
|
|
|
15 |
|
16 |
import datasets
|
17 |
import numpy as np
|
18 |
+
from datasets.config import importlib_metadata, version
|
19 |
from nltk.translate import meteor_score
|
|
|
20 |
|
21 |
import evaluate
|
22 |
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
NLTK_VERSION = version.parse(importlib_metadata.version("nltk"))
|
25 |
if NLTK_VERSION >= version.Version("3.6.4"):
|
26 |
from nltk import word_tokenize
|
|
|
114 |
import nltk
|
115 |
|
116 |
nltk.download("wordnet")
|
117 |
+
if NLTK_VERSION >= version.Version("3.6.5"):
|
|
|
|
|
118 |
nltk.download("punkt")
|
119 |
if NLTK_VERSION >= version.Version("3.6.6"):
|
120 |
nltk.download("omw-1.4")
|
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
git+https://github.com/huggingface/evaluate@
|
2 |
nltk
|
|
|
1 |
+
git+https://github.com/huggingface/evaluate@940d6dee3b4a23eabb0c81e4117c9533cd7c458a
|
2 |
nltk
|