Spaces:
Runtime error
Runtime error
app.py
Browse files- app.py +11 -0
- span_metric.py +2 -2
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
|
3 |
+
import evaluate
|
4 |
+
from evaluate.utils import launch_gradio_widget
|
5 |
+
|
6 |
+
|
7 |
+
sys.path = [p for p in sys.path if p != "/home/user/app"]
|
8 |
+
module = evaluate.load("dannashao/span_metric")
|
9 |
+
sys.path = ["/home/user/app"] + sys.path
|
10 |
+
|
11 |
+
launch_gradio_widget(module)
|
span_metric.py
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
"""This metric calculates both Token Overlap and Span Agreement precision, recall and f1 scores."""
|
15 |
|
16 |
import datasets
|
17 |
-
|
18 |
|
19 |
|
20 |
_CITATION = """\
|
@@ -55,7 +55,7 @@ Returns:
|
|
55 |
"""
|
56 |
|
57 |
|
58 |
-
@
|
59 |
class SpanAgree(datasets.Metric):
|
60 |
"""Calculates span agreement metric."""
|
61 |
|
|
|
14 |
"""This metric calculates both Token Overlap and Span Agreement precision, recall and f1 scores."""
|
15 |
|
16 |
import datasets
|
17 |
+
import evaluate
|
18 |
|
19 |
|
20 |
_CITATION = """\
|
|
|
55 |
"""
|
56 |
|
57 |
|
58 |
+
@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
|
59 |
class SpanAgree(datasets.Metric):
|
60 |
"""Calculates span agreement metric."""
|
61 |
|