Spaces:
Running
Running
Minor
Browse files
README.md
CHANGED
@@ -34,14 +34,14 @@ Sem-F1 takes 2 mandatory arguments:
|
|
34 |
from evaluate import load
|
35 |
|
36 |
predictions = [
|
37 |
-
["I go to School.
|
38 |
["I love adventure sports."],
|
39 |
]
|
40 |
references = [
|
41 |
-
["I go to School.
|
42 |
["I love outdoor sports."],
|
43 |
]
|
44 |
-
metric = load("semf1")
|
45 |
results = metric.compute(predictions=predictions, references=references)
|
46 |
for score in results:
|
47 |
print(f"Precision: {score.precision}, Recall: {score.recall}, F1: {score.f1}")
|
@@ -58,11 +58,12 @@ Sem-F1 also accepts multiple optional arguments:
|
|
58 |
- `batch_size (int)`: Batch size for encoding. Default: 32.
|
59 |
- `verbose (bool)`: Flag to indicate verbose output. Default: False.
|
60 |
|
61 |
-
Refer to the inputs descriptions for more detailed usage as follows
|
|
|
62 |
```python
|
63 |
import evaluate
|
64 |
-
metric = evaluate.load("semf1")
|
65 |
-
metric.inputs_description
|
66 |
```
|
67 |
|
68 |
|
|
|
34 |
from evaluate import load
|
35 |
|
36 |
predictions = [
|
37 |
+
["I go to School. You are stupid."],
|
38 |
["I love adventure sports."],
|
39 |
]
|
40 |
references = [
|
41 |
+
["I go to School. You are stupid."],
|
42 |
["I love outdoor sports."],
|
43 |
]
|
44 |
+
metric = load("nbansal/semf1")
|
45 |
results = metric.compute(predictions=predictions, references=references)
|
46 |
for score in results:
|
47 |
print(f"Precision: {score.precision}, Recall: {score.recall}, F1: {score.f1}")
|
|
|
58 |
- `batch_size (int)`: Batch size for encoding. Default: 32.
|
59 |
- `verbose (bool)`: Flag to indicate verbose output. Default: False.
|
60 |
|
61 |
+
Refer to the inputs descriptions for more detailed usage as follows:
|
62 |
+
|
63 |
```python
|
64 |
import evaluate
|
65 |
+
metric = evaluate.load("nbansal/semf1")
|
66 |
+
print(metric.inputs_description)
|
67 |
```
|
68 |
|
69 |
|