DarrenChensformer
commited on
Commit
•
728db8d
1
Parent(s):
4d4c4d4
Update readme
Browse files
README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
---
|
2 |
title: action_generation
|
3 |
datasets:
|
4 |
-
-
|
5 |
tags:
|
6 |
- evaluate
|
7 |
- metric
|
@@ -23,6 +22,32 @@ pinned: false
|
|
23 |
*Give general statement of how to use the metric*
|
24 |
|
25 |
*Provide simplest possible example for using the metric*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
### Inputs
|
28 |
*List all input arguments in the format below*
|
|
|
1 |
---
|
2 |
title: action_generation
|
3 |
datasets:
|
|
|
4 |
tags:
|
5 |
- evaluate
|
6 |
- metric
|
|
|
22 |
*Give general statement of how to use the metric*
|
23 |
|
24 |
*Provide simplest possible example for using the metric*
|
25 |
+
```python
|
26 |
+
import evaluate
|
27 |
+
|
28 |
+
valid_labels = [
|
29 |
+
"/開箱",
|
30 |
+
"/教學",
|
31 |
+
"/表達",
|
32 |
+
"/分享/外部資訊",
|
33 |
+
"/分享/個人資訊",
|
34 |
+
"/推薦/產品",
|
35 |
+
"/推薦/服務",
|
36 |
+
"/推薦/其他",
|
37 |
+
""
|
38 |
+
]
|
39 |
+
predictions = [
|
40 |
+
["/開箱/xxx", "/教學/yyy", "/表達/zzz"],
|
41 |
+
["/分享/外部資訊/aaa", "/教學/yyy", "/表達/zzz", "/分享/個人資訊/bbb"]
|
42 |
+
]
|
43 |
+
references = [
|
44 |
+
["/開箱/xxx", "/教學/yyy", "/表達/zzz"],
|
45 |
+
["/推薦/產品/bbb", "/教學/yyy", "/表達/zzz"]
|
46 |
+
]
|
47 |
+
metric = evaluate.load("DarrenChensformer/action_generation")
|
48 |
+
result = metric.compute(predictions=predictions, references=references, valid_labels=valid_labels, detailed_scores=True)
|
49 |
+
print(result)
|
50 |
+
```
|
51 |
|
52 |
### Inputs
|
53 |
*List all input arguments in the format below*
|