Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
1k<10K
ArXiv:
Tags:
License:
asahi417 commited on
Commit
e7a1529
1 Parent(s): 081c653

Create new file

Browse files
Files changed (1) hide show
  1. get_model_list.py +47 -0
get_model_list.py ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-single-all",
25
+ "cardiffnlp/roberta-base-tweet-topic-single-all",
26
+ "cardiffnlp/twitter-roberta-base-2019-90m-tweet-topic-single-all",
27
+ "cardiffnlp/twitter-roberta-base-dec2020-tweet-topic-single-all",
28
+ "cardiffnlp/twitter-roberta-base-dec2021-tweet-topic-single-all",
29
+ "cardiffnlp/roberta-large-tweet-topic-single-2020",
30
+ "cardiffnlp/roberta-base-tweet-topic-single-2020",
31
+ "cardiffnlp/twitter-roberta-base-2019-90m-tweet-topic-single-2020",
32
+ "cardiffnlp/twitter-roberta-base-dec2020-tweet-topic-single-2020",
33
+ "cardiffnlp/twitter-roberta-base-dec2021-tweet-topic-single-2020"
34
+ ]
35
+
36
+ os.makedirs("metric_files", exists_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))