Datasets:
Tasks:
Token Classification
Modalities:
Text
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
100K - 1M
ArXiv:
License:
Create new file
Browse files- get_model_list.py +48 -0
get_model_list.py
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
import requests
|
4 |
+
|
5 |
+
import pandas as pd
|
6 |
+
|
7 |
+
|
8 |
+
def download(filename, url):
|
9 |
+
try:
|
10 |
+
with open(filename) as f:
|
11 |
+
json.load(f)
|
12 |
+
except Exception:
|
13 |
+
os.makedirs(os.path.dirname(filename), exist_ok=True)
|
14 |
+
with open(filename, "wb") as f:
|
15 |
+
r = requests.get(url)
|
16 |
+
f.write(r.content)
|
17 |
+
with open(filename) as f:
|
18 |
+
tmp = json.load(f)
|
19 |
+
return tmp
|
20 |
+
|
21 |
+
|
22 |
+
"https://huggingface.co/tner/roberta-large-tweetner7-all/raw/main/eval/metric.test_2021.json"
|
23 |
+
|
24 |
+
models = [
|
25 |
+
"tner/roberta-large-tweetner7-all",
|
26 |
+
"tner/roberta-base-tweetner7-all",
|
27 |
+
"tner/twitter-roberta-base-2019-90m-tweetner7-all",
|
28 |
+
"tner/twitter-roberta-base-dec2020-tweetner7-all",
|
29 |
+
"tner/twitter-roberta-base-dec2021-tweetner7-all"
|
30 |
+
"tner/roberta-large-tweetner7-2020",
|
31 |
+
"tner/roberta-base-tweetner7-2020",
|
32 |
+
"tner/twitter-roberta-base-2019-90m-tweetner7-2020",
|
33 |
+
"tner/twitter-roberta-base-dec2020-tweetner7-2020",
|
34 |
+
"tner/twitter-roberta-base-dec2021-tweetner7-2020"
|
35 |
+
]
|
36 |
+
|
37 |
+
os.makedirs("metric_files", exist_ok=True)
|
38 |
+
|
39 |
+
metrics = []
|
40 |
+
for i in models:
|
41 |
+
model_type = "all (2020 + 2021)" if i.endswith("all") else "2020 only"
|
42 |
+
url = f"https://huggingface.co/{i}/raw/main/metric_summary.json"
|
43 |
+
model_url = f"https://huggingface.co/{i}"
|
44 |
+
metric = download(f"metric_files/{os.path.basename(i)}.json", url)
|
45 |
+
metrics.append({"model": f"[{i}]({model_url})", "training data": model_type, "F1": metric["test/eval_f1"], "F1 (macro)": metric["test/eval_f1_macro"], "Accuracy": metric["test/eval_accuracy"]})
|
46 |
+
|
47 |
+
df = pd.DataFrame(metrics)
|
48 |
+
print(df.to_markdown(index=False))
|