Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
English
Size:
10K - 100K
ArXiv:
License:
Delete loading script auxiliary file
Browse files- get_model_list.py +0 -48
get_model_list.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 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 |
-
|
| 23 |
-
models = [
|
| 24 |
-
"cardiffnlp/roberta-large-tweet-topic-multi-all",
|
| 25 |
-
"cardiffnlp/roberta-base-tweet-topic-multi-all",
|
| 26 |
-
"cardiffnlp/twitter-roberta-base-2019-90m-tweet-topic-multi-all",
|
| 27 |
-
"cardiffnlp/twitter-roberta-base-dec2020-tweet-topic-multi-all",
|
| 28 |
-
"cardiffnlp/twitter-roberta-base-dec2021-tweet-topic-multi-all",
|
| 29 |
-
"cardiffnlp/roberta-large-tweet-topic-multi-2020",
|
| 30 |
-
"cardiffnlp/roberta-base-tweet-topic-multi-2020",
|
| 31 |
-
"cardiffnlp/twitter-roberta-base-2019-90m-tweet-topic-multi-2020",
|
| 32 |
-
"cardiffnlp/twitter-roberta-base-dec2020-tweet-topic-multi-2020",
|
| 33 |
-
"cardiffnlp/twitter-roberta-base-dec2021-tweet-topic-multi-2020"
|
| 34 |
-
]
|
| 35 |
-
|
| 36 |
-
os.makedirs("metric_files", exist_ok=True)
|
| 37 |
-
|
| 38 |
-
metrics = []
|
| 39 |
-
for i in models:
|
| 40 |
-
model_type = "all (2020 + 2021)" if i.endswith("all") else "2020 only"
|
| 41 |
-
url = f"https://huggingface.co/{i}/raw/main/metric_summary.json"
|
| 42 |
-
model_url = f"https://huggingface.co/{i}"
|
| 43 |
-
metric = download(f"metric_files/{os.path.basename(i)}.json", url)
|
| 44 |
-
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"]})
|
| 45 |
-
|
| 46 |
-
df = pd.DataFrame(metrics)
|
| 47 |
-
print(df.to_markdown(index=False))
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|