Sfarzi commited on
Commit
16ce187
·
1 Parent(s): 537a06a

Initial clone with modifications

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .ipynb_checkpoints/Gen_llm_eval_output-checkpoint.py +117 -0
  2. .ipynb_checkpoints/app-checkpoint.py +1144 -0
  3. .ipynb_checkpoints/preprocess_models_output-checkpoint.py +290 -0
  4. app.py +18 -13
  5. csv_new2/llm_scores_p1_final.xlsx +0 -0
  6. csv_new2/llm_scores_p2_final.xlsx +0 -0
  7. csv_new2/llm_scores_p3_final.xlsx +0 -0
  8. csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__0shot-checkpoint.txt +23 -0
  9. csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__10shot-checkpoint.txt +23 -0
  10. csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__it__0shot-checkpoint.txt +27 -0
  11. csv_new2/output/.ipynb_checkpoints/epfl-llm__meditron-7b__en__0shot-checkpoint.txt +23 -0
  12. csv_new2/output/Henrychur__MMed-Llama-3-8B__en__0shot.txt +23 -0
  13. csv_new2/output/Henrychur__MMed-Llama-3-8B__en__10shot.txt +23 -0
  14. csv_new2/output/Henrychur__MMed-Llama-3-8B__gr__0shot.txt +11 -0
  15. csv_new2/output/Henrychur__MMed-Llama-3-8B__gr__10shot.txt +11 -0
  16. csv_new2/output/Henrychur__MMed-Llama-3-8B__it__0shot.txt +27 -0
  17. csv_new2/output/Henrychur__MMed-Llama-3-8B__it__10shot.txt +27 -0
  18. csv_new2/output/Henrychur__MMed-Llama-3-8B__pl__0shot.txt +11 -0
  19. csv_new2/output/Henrychur__MMed-Llama-3-8B__pl__10shot.txt +11 -0
  20. csv_new2/output/Henrychur__MMed-Llama-3-8B__sk__0shot.txt +11 -0
  21. csv_new2/output/Henrychur__MMed-Llama-3-8B__sk__10shot.txt +11 -0
  22. csv_new2/output/Henrychur__MMed-Llama-3-8B__sl__0shot.txt +11 -0
  23. csv_new2/output/Henrychur__MMed-Llama-3-8B__sl__10shot.txt +11 -0
  24. csv_new2/output/HiTZ__Medical-mT5-large__en__0shot.txt +23 -0
  25. csv_new2/output/HiTZ__Medical-mT5-large__en__10shot.txt +23 -0
  26. csv_new2/output/HiTZ__Medical-mT5-large__gr__0shot.txt +11 -0
  27. csv_new2/output/HiTZ__Medical-mT5-large__gr__10shot.txt +11 -0
  28. csv_new2/output/HiTZ__Medical-mT5-large__it__0shot.txt +26 -0
  29. csv_new2/output/HiTZ__Medical-mT5-large__it__10shot.txt +27 -0
  30. csv_new2/output/HiTZ__Medical-mT5-large__pl__0shot.txt +11 -0
  31. csv_new2/output/HiTZ__Medical-mT5-large__pl__10shot.txt +11 -0
  32. csv_new2/output/HiTZ__Medical-mT5-large__sk__0shot.txt +11 -0
  33. csv_new2/output/HiTZ__Medical-mT5-large__sk__10shot.txt +11 -0
  34. csv_new2/output/HiTZ__Medical-mT5-large__sl__0shot.txt +11 -0
  35. csv_new2/output/HiTZ__Medical-mT5-large__sl__10shot.txt +11 -0
  36. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__en__0shot.txt +23 -0
  37. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__en__10shot.txt +23 -0
  38. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__gr__0shot.txt +11 -0
  39. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__gr__10shot.txt +11 -0
  40. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__it__0shot.txt +27 -0
  41. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__it__10shot.txt +27 -0
  42. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__pl__0shot.txt +11 -0
  43. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__pl__10shot.txt +11 -0
  44. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sk__0shot.txt +11 -0
  45. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sk__10shot.txt +11 -0
  46. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sl__0shot.txt +11 -0
  47. csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sl__10shot.txt +11 -0
  48. csv_new2/output/Qwen__Qwen2.5-32B-Instruct__en__0shot.txt +25 -0
  49. csv_new2/output/Qwen__Qwen2.5-32B-Instruct__en__10shot.txt +24 -0
  50. csv_new2/output/Qwen__Qwen2.5-32B-Instruct__gr__0shot.txt +11 -0
.ipynb_checkpoints/Gen_llm_eval_output-checkpoint.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+
3
+ #python Gen_llm_eval_output.py --p1 csv_files/llm_scores_p1.xlsx --p2 csv_files/llm_scores_p2.xlsx --p3 csv_files/llm_scores_p3.xlsx --output-dir csv_files/outputs
4
+ import argparse
5
+ import os
6
+ import re
7
+ import math
8
+ import pandas as pd
9
+ import numpy as np
10
+
11
+ REQUIRED_COLS = ["model", "task", "language", "configuration", "prompts", "f1"]
12
+
13
+ def read_scores(path: str) -> pd.DataFrame:
14
+ df = pd.read_excel(path)
15
+ # normalize columns
16
+ df.columns = [c.strip().lower() for c in df.columns]
17
+ if "prompts" not in df.columns and "prompt" in df.columns:
18
+ df["prompts"] = df["prompt"]
19
+ missing = [c for c in REQUIRED_COLS if c not in df.columns]
20
+ if missing:
21
+ raise ValueError(f"{path} is missing required columns: {missing}")
22
+ # keep only required, coerce f1 to numeric
23
+ df = df[REQUIRED_COLS].copy()
24
+ df["f1"] = pd.to_numeric(df["f1"], errors="coerce")
25
+ df = df.dropna(subset=["f1"])
26
+ return df
27
+
28
+ def sanitize_filename(s: str) -> str:
29
+ return re.sub(r"[^0-9A-Za-z._\-+]+", "_", str(s).strip())
30
+
31
+ def format_float(x):
32
+ if x is None or (isinstance(x, float) and (math.isnan(x) or math.isinf(x))):
33
+ return "nan"
34
+ return f"{x:.4f}"
35
+
36
+ def prompt_order_key(label: str):
37
+ # Sort by the number in "prompt-<n>" if present; fallback to string
38
+ m = re.search(r"(\d+)", str(label))
39
+ return (0, int(m.group(1))) if m else (1, str(label))
40
+
41
+ def render_group_table(g: pd.DataFrame, model: str, language: str, configuration: str) -> str:
42
+ # Collect all prompt-level f1 values (across tasks and prompts)
43
+ prompt_values = g["f1"].to_numpy(dtype=float)
44
+ if prompt_values.size > 0:
45
+ gen_value = float(np.mean(prompt_values))
46
+ gen_stderr = float(np.std(prompt_values, ddof=1) / math.sqrt(len(prompt_values))) if len(prompt_values) > 1 else 0.0
47
+ else:
48
+ gen_value, gen_stderr = float("nan"), 0.0
49
+
50
+ # Build table text
51
+ if configuration=="0shot" : configuration='0'
52
+ if configuration=="10shot" : configuration='10'
53
+ model = model.split("__")[0]+'/'+model.split("__")[1]
54
+ #if model =='Henrychur__MMed-Llama-3-8B' : model='Henrychur/MMed-Llama-3-8B'
55
+ #if model =='HiTZ__Medical-mT5-large' : model=''
56
+ #if model =='Qwen__Qwen2.5-14B-Instruct-1M' : model='Qwen/'+model
57
+ #if model =='Qwen__Qwen2.5-32B-Instruct' : model='Qwen/'+model
58
+ #if model =='Qwen__Qwen3-30B-A3B-Instruct-2507' : model='Qwen/'+model
59
+ #if model =='deepseek-ai__DeepSeek-R1-Distill-Qwen-32B' : model=''
60
+ #if model =='epfl-llm__meditron-7b' : model=''
61
+ #if model =='google__gemma-2-9b-it' : model=''
62
+ #if model =='google__gemma-3-27b-it' : model=''
63
+ #if model =='google__medgemma-27b-text-it' : model=''
64
+ #if model =='google__medgemma-4b-it' : model=''
65
+ #if model =='microsoft__MediPhi-Clinical' : model=''
66
+ #if model =='microsoft__MediPhi-Instruct' : model=''
67
+ #if model =='mistralai__Mistral-7B-Instruct-v0.2' : model=''
68
+ #if model =='mistralai__Mistral-Nemo-Instruct-2407' : model=''
69
+ #if model =='tiiuae__Falcon3-10B-Instruct' : model=''
70
+ #if model =='unsloth__phi-4' : model=''
71
+ #if model =='Henrychur__MMed-Llama-3-8B' : model=''
72
+
73
+ header = f"hf (pretrained={model} ), num_fewshot: {configuration}, batch_size: 1"
74
+ lines = [
75
+ "|Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|",
76
+ "|-------|-------|------|------|------|----|------|---|------|",
77
+ #f"|Gen | | | |f1 | |{format_float(gen_value)} |---| {format_float(gen_stderr)} |",
78
+ ]
79
+
80
+ # For each task, add task row (mean over prompts) then prompt rows
81
+ for task, df_task in g.groupby("task", sort=False):
82
+ f1s = df_task["f1"].to_numpy(dtype=float)
83
+ task_mean = float(np.mean(f1s)) if f1s.size else float("nan")
84
+ lines.append(f"| - {task.upper()} | | | |f1 | | {format_float(task_mean)} | |0 |")
85
+
86
+ # Prompt-level rows, sorted by prompt number if available
87
+ df_task = df_task.copy()
88
+ df_task["_order"] = df_task["prompts"].map(prompt_order_key)
89
+ df_task = df_task.sort_values("_order")
90
+ for _, r in df_task.iterrows():
91
+ prompt_label = str(r["prompts"])
92
+ lines.append(f"| - {prompt_label} | | | |f1 | | {format_float(r['f1'])} | | 0 |")
93
+
94
+ return header + "\n" + "\n".join(lines) + "\n"
95
+
96
+ def main():
97
+ ap = argparse.ArgumentParser(description="Build per-(model,language,configuration) summaries from three prompt Excel files.")
98
+ ap.add_argument("--p1", required=True, help="Path to llm_scores_p1.xlsx")
99
+ ap.add_argument("--p2", required=True, help="Path to llm_scores_p2.xlsx")
100
+ ap.add_argument("--p3", required=True, help="Path to llm_scores_p3.xlsx")
101
+ ap.add_argument("--output-dir", required=True, help="Directory to write output files")
102
+ args = ap.parse_args()
103
+
104
+ os.makedirs(args.output_dir, exist_ok=True)
105
+
106
+ df = pd.concat([read_scores(args.p1), read_scores(args.p2), read_scores(args.p3)], ignore_index=True)
107
+
108
+ # One file per (model, language, configuration)
109
+ for (model, language, config), g in df.groupby(["model", "language", "configuration"], sort=False):
110
+ content = render_group_table(g, model, language, config)
111
+ fname = f"{sanitize_filename(model)}__{sanitize_filename(language)}__{sanitize_filename(config)}.txt"
112
+ out_path = os.path.join(args.output_dir, fname)
113
+ with open(out_path, "w", encoding="utf-8") as f:
114
+ f.write(content)
115
+
116
+ if __name__ == "__main__":
117
+ main()
.ipynb_checkpoints/app-checkpoint.py ADDED
@@ -0,0 +1,1144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_leaderboard import Leaderboard, ColumnFilter, SelectColumns
3
+ import pandas as pd
4
+ from apscheduler.schedulers.background import BackgroundScheduler
5
+ from huggingface_hub import snapshot_download
6
+ from src.about import CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, EVALUATION_QUEUE_TEXT, INTRODUCTION_TEXT, LLM_BENCHMARKS_TEXT, TITLE
7
+ from src.tasks import TASK_DESCRIPTIONS, MEASURE_DESCRIPTION
8
+ from src.display.css_html_js import custom_css
9
+ from src.display.utils import BENCHMARK_COLS, COLS, EVAL_COLS, EVAL_TYPES, AutoEvalColumn, ModelType, fields, WeightType, Precision
10
+ from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
11
+ from src.populate import get_evaluation_queue_df, get_leaderboard_df
12
+ from src.submission.submit import add_new_eval
13
+ import random
14
+ import matplotlib.pyplot as plt
15
+ import re
16
+ import plotly.express as px
17
+ import plotly.graph_objects as go
18
+ import numpy as np
19
+
20
+
21
+
22
+
23
+ # === NEW: helper for prompt sensitivity (simple: only NER/REL and 3 prompts) ===
24
+ def calculate_prompt_sensitivity(dataframe, tasks, prompt_ids):
25
+ """
26
+ Computes a simple Prompt Sensitivity Index (PSI) over the tasks
27
+ using the distribution of 'Best Prompt Id' across the provided prompt_ids.
28
+ """
29
+ cv_per_task = []
30
+ for task in tasks:
31
+ prompt_col = f"{task} Best Prompt Id"
32
+ task_accuracies = []
33
+ for pid in prompt_ids:
34
+ total = len(dataframe[prompt_col].dropna()) if prompt_col in dataframe.columns else 0
35
+ count = (dataframe[prompt_col] == pid).sum() if prompt_col in dataframe.columns else 0
36
+ acc = (count / total * 100) if total > 0 else 0
37
+ task_accuracies.append(acc)
38
+ if task_accuracies:
39
+ mean_acc = np.mean(task_accuracies)
40
+ std_acc = np.std(task_accuracies)
41
+ cv_per_task.append((std_acc / mean_acc) if mean_acc > 0 else 0)
42
+ else:
43
+ cv_per_task.append(0)
44
+ mean_cv = np.mean(cv_per_task) if cv_per_task else 0
45
+ psi = 1.0 if mean_cv >= 0.5 else (mean_cv / 0.5)
46
+ return psi, mean_cv, cv_per_task
47
+
48
+ def create_best_model_comparison_table(dataframe, lang: str | None = None, shot: str | None = None):
49
+ """
50
+ Table with best overall model per task and the model with the best prompt score.
51
+ Applies optional filters:
52
+ - lang in {EN, IT, SL, SK, GR, PL} or None/"All"
53
+ - shot in {"0","10"} or None/"All" (mapped to IS_FS False/True)
54
+ """
55
+ tasks = ["NER", "REL", "RML", "HIS", "DIA"]
56
+ df = dataframe.copy()
57
+
58
+ if lang and lang != "All" and "LANG" in df.columns:
59
+ df = df[df["LANG"] == lang]
60
+ if shot and shot != "All" and "IS_FS" in df.columns:
61
+ df = df[df["IS_FS"] == (shot == "10")]
62
+
63
+ table_data = {'Task': [], 'Best Overall Model': [], 'CPS': [], 'Best Prompt Model': [], 'Acc.': []}
64
+
65
+ for task in tasks:
66
+ if task not in df.columns or df.empty:
67
+ continue
68
+ # Best overall on task
69
+ #max_idx = df[task].idxmax()
70
+ max_idx = pd.to_numeric(df[task], errors='coerce').idxmax()
71
+ try:
72
+ model_raw = df.loc[max_idx, 'Model']
73
+ except Exception as e:
74
+ break
75
+
76
+ if isinstance(model_raw, str) and '<' in model_raw:
77
+ match = re.search(r'>([^<]+)<', model_raw)
78
+ model_name = match.group(1) if match else model_raw
79
+ else:
80
+ model_name = str(model_raw)
81
+ comb_perf_value = df.loc[max_idx, task]
82
+
83
+ # Best prompt row for task
84
+ best_prompt_column = f"{task} Best Prompt"
85
+ if best_prompt_column in df.columns and df[best_prompt_column].notna().any():
86
+ best_prompt_idx= pd.to_numeric(df[best_prompt_column],errors='coerce').idxmax()
87
+ try:
88
+ best_prompt_model_raw = df.loc[best_prompt_idx, 'Model']
89
+ except Exception as e:
90
+ break
91
+ if isinstance(best_prompt_model_raw, str) and '<' in best_prompt_model_raw:
92
+ match = re.search(r'>([^<]+)<', best_prompt_model_raw)
93
+ best_prompt_model = match.group(1) if match else best_prompt_model_raw
94
+ else:
95
+ best_prompt_model = str(best_prompt_model_raw)
96
+ best_prompt_accuracy = df.loc[best_prompt_idx, best_prompt_column]
97
+ else:
98
+ best_prompt_model = "n/a"
99
+ best_prompt_accuracy = float('nan')
100
+
101
+ table_data['Task'].append(task)
102
+ table_data['Best Overall Model'].append(model_name)
103
+ table_data['CPS'].append(f"{comb_perf_value:.2f}")
104
+ table_data['Best Prompt Model'].append(best_prompt_model)
105
+ table_data['Acc.'].append(f"{best_prompt_accuracy:.2f}" if isinstance(best_prompt_accuracy, (int, float)) else "n/a")
106
+
107
+ fig = go.Figure(data=[go.Table(
108
+ columnwidth=[60, 220, 60, 220, 60],
109
+ header=dict(
110
+ values=[f'<b>{col}</b>' for col in table_data.keys()],
111
+ fill_color=['#2171b5', '#2171b5', '#2171b5', '#4292c6', '#4292c6'],
112
+ font=dict(color='white', size=12, family='Arial'),
113
+ align='center', height=30
114
+ ),
115
+ cells=dict(
116
+ values=list(table_data.values()),
117
+ fill_color=[['#f0f0f0' if i % 2 == 0 else 'white' for i in range(len(table_data['Task']))]],
118
+ font=dict(color='#2c3e50', size=11, family='Arial'),
119
+ align=['center', 'left', 'center', 'left', 'center'],
120
+ height=30
121
+ )
122
+ )])
123
+
124
+ subtitle = []
125
+ subtitle.append(lang if (lang and lang != "All") else "All languages")
126
+ subtitle.append(f"{shot}-shot" if (shot and shot != "All") else "All shots")
127
+
128
+ fig.update_layout(
129
+ title={'text': f"Top Model per Task: CPS & Best Prompt — {', '.join(subtitle)}",
130
+ 'font': {'family': 'Arial', 'size': 14, 'color': '#2c3e50'}},
131
+ font=dict(family="Arial", size=11),
132
+ height=420, margin=dict(l=20, r=20, t=50, b=80)
133
+ )
134
+ return fig
135
+
136
+
137
+
138
+ # === NEW: Best-model comparison table (only NER, REL) ===
139
+ def create_best_model_comparison_table_without_lang(dataframe):
140
+ """
141
+ Table with the best overall model per task (NER, REL,) and the model that
142
+ achieves the best score with its own best prompt.
143
+ """
144
+ tasks = ["NER", "REL", "RML", "HIS", "DIA"]
145
+ table_data = {'Task': [], 'Best Overall Model': [], 'CPS': [], 'Best Prompt Model': [], 'Acc.': []}
146
+
147
+ for task in tasks:
148
+ if task not in dataframe.columns:
149
+ continue
150
+
151
+ # Best overall on the task's combined performance
152
+ max_idx = dataframe[task].idxmax()
153
+ model_raw = dataframe.loc[max_idx, 'Model']
154
+ if isinstance(model_raw, str) and '<' in model_raw:
155
+ match = re.search(r'>([^<]+)<', model_raw)
156
+ model_name = match.group(1) if match else model_raw
157
+ else:
158
+ model_name = str(model_raw)
159
+ comb_perf_value = dataframe.loc[max_idx, task]
160
+
161
+ # Model with the best prompt for this task
162
+ best_prompt_column = f"{task} Best Prompt"
163
+ if best_prompt_column in dataframe.columns:
164
+ best_prompt_idx = dataframe[best_prompt_column].idxmax()
165
+ best_prompt_model_raw = dataframe.loc[best_prompt_idx, 'Model']
166
+ if isinstance(best_prompt_model_raw, str) and '<' in best_prompt_model_raw:
167
+ match = re.search(r'>([^<]+)<', best_prompt_model_raw)
168
+ best_prompt_model = match.group(1) if match else best_prompt_model_raw
169
+ else:
170
+ best_prompt_model = str(best_prompt_model_raw)
171
+ best_prompt_accuracy = dataframe.loc[best_prompt_idx, best_prompt_column]
172
+ else:
173
+ best_prompt_model = "n/a"
174
+ best_prompt_accuracy = float('nan')
175
+
176
+ table_data['Task'].append(task)
177
+ table_data['Best Overall Model'].append(model_name)
178
+ table_data['CPS'].append(f"{comb_perf_value:.2f}")
179
+ table_data['Best Prompt Model'].append(best_prompt_model)
180
+ table_data['Acc.'].append(f"{best_prompt_accuracy:.2f}" if isinstance(best_prompt_accuracy, (int, float)) else "n/a")
181
+
182
+ fig = go.Figure(data=[go.Table(
183
+ columnwidth=[60, 220, 60, 220, 60],
184
+ header=dict(
185
+ values=[f'<b>{col}</b>' for col in table_data.keys()],
186
+ fill_color=['#2171b5', '#2171b5', '#2171b5', '#4292c6', '#4292c6'],
187
+ font=dict(color='white', size=12, family='Arial'),
188
+ align='center', height=30
189
+ ),
190
+ cells=dict(
191
+ values=list(table_data.values()),
192
+ fill_color=[['#f0f0f0' if i % 2 == 0 else 'white' for i in range(len(table_data['Task']))]],
193
+ font=dict(color='#2c3e50', size=11, family='Arial'),
194
+ align=['center', 'left', 'center', 'left', 'center'],
195
+ height=30
196
+ )
197
+ )])
198
+ fig.update_layout(
199
+ title={'text': "Top Model per Task: CPS & Best Prompt (NER/REL)",
200
+ 'font': {'family': 'Arial', 'size': 14, 'color': '#2c3e50'}},
201
+ font=dict(family="Arial", size=11),
202
+ height=420, margin=dict(l=20, r=20, t=50, b=80)
203
+ )
204
+ fig.add_annotation(
205
+ text=("Best Overall Model uses the task's primary metric (CPS). "
206
+ "Best Prompt Model is the one whose own best prompt yields the highest score."),
207
+ xref="paper", yref="paper", x=0.5, y=-0.20, showarrow=False,
208
+ font=dict(size=11, color="gray", family="Arial"), align="center", xanchor="center"
209
+ )
210
+ return fig
211
+
212
+ def create_prompt_heatmap(dataframe, lang: str | None = None, shot: str | None = None):
213
+ """
214
+ Heatmap of share (%) of models whose BEST prompt is each pid, for NER/REL with prompts p1..p3.
215
+ Optional filters:
216
+ - lang: None or one of EN/IT/SL/SK/GR/PL (None means All)
217
+ - shot: None or "0"/"10" (None means All) mapped to IS_FS False/True
218
+ """
219
+ tasks = ["NER", "REL", "RML", "HIS", "DIA"]
220
+
221
+ df = dataframe.copy()
222
+ # Language filter
223
+ if lang and lang != "All" and "LANG" in df.columns:
224
+ df = df[df["LANG"] == lang]
225
+ # Shot filter -> IS_FS (10-shot=True, 0-shot=False)
226
+ if shot and shot != "All" and "IS_FS" in df.columns:
227
+ df = df[df["IS_FS"] == (shot == "10")]
228
+
229
+ # Collect prompt ids present, normalize labels to p1..p3
230
+ def label_for(pid):
231
+ if isinstance(pid, str): return pid
232
+ try: return f"p{int(pid)}"
233
+ except Exception: return str(pid)
234
+
235
+ all_ids = set()
236
+ for task in tasks:
237
+ col = f"{task} Best Prompt Id"
238
+ if col in df.columns:
239
+ all_ids.update(df[col].dropna().unique())
240
+ prompt_ids_raw = sorted(list(all_ids), key=lambda x: int(re.sub(r'[^0-9]', '', str(x)) or 0))
241
+ prompt_ids_raw = [pid for pid in prompt_ids_raw if label_for(pid) in {"p1", "p2", "p3"}] or [1, 2, 3]
242
+ y_tick_labels = [label_for(pid) for pid in prompt_ids_raw]
243
+
244
+ matrix, hovers = [], []
245
+ for pid in prompt_ids_raw:
246
+ row, hover_row = [], []
247
+ for task in tasks:
248
+ col = f"{task} Best Prompt Id"
249
+ if col in df.columns and len(df[col].dropna()) > 0:
250
+ series = df[col].dropna()
251
+
252
+ def same_pid(v):
253
+ a = re.sub(r'[^0-9]', '', str(v))
254
+ b = re.sub(r'[^0-9]', '', str(pid))
255
+ return a == b and a != ""
256
+
257
+ total = len(series)
258
+ count = sum(same_pid(v) for v in series)
259
+ pct = (count / total * 100) if total > 0 else 0
260
+ row.append(pct)
261
+ hover_row.append(f"<b>{task} — {label_for(pid)}</b><br>Models: {count}/{total}<br>Percentage: {pct:.1f}%")
262
+ else:
263
+ row.append(0); hover_row.append(f"<b>{task} — {label_for(pid)}</b><br>No data")
264
+ matrix.append(row); hovers.append(hover_row)
265
+
266
+ fig = go.Figure(data=go.Heatmap(
267
+ z=matrix, x=tasks, y=y_tick_labels,
268
+ colorscale=[[0,'#f7fbff'],[0.2,'#deebf7'],[0.4,'#9ecae1'],[0.6,'#4292c6'],[0.8,'#2171b5'],[1,'#08519c']],
269
+ text=[[f"{val:.0f}%" if val is not None else "" for val in row] for row in matrix],
270
+ texttemplate="%{text}", textfont={"size": 11, "family": "Arial"},
271
+ hovertemplate='%{customdata}<extra></extra>', customdata=hovers,
272
+ colorbar=dict(title="% Models", ticksuffix="%"),
273
+ zmin=0, zmax=100
274
+ ))
275
+
276
+ title_parts = []
277
+ title_parts.append(lang if (lang and lang != "All") else "All languages")
278
+ title_parts.append(f"{shot}-shot" if (shot and shot != "All") else "All shots")
279
+ fig.update_layout(
280
+ title={'text': f"Most Effective Prompts — {', '.join(title_parts)}",
281
+ 'font': {'family': 'Arial', 'size': 14, 'color': '#2c3e50'}},
282
+ xaxis_title="Task", yaxis_title="Prompt",
283
+ font=dict(family="Arial", size=11), margin=dict(b=100),
284
+ template="plotly_white", dragmode=False, height=420
285
+ )
286
+ fig.update_xaxes(fixedrange=True); fig.update_yaxes(fixedrange=True)
287
+ return fig
288
+
289
+
290
+ # === NEW: Prompt heatmap (only NER, REL; 3 prompts p1, p2, p3) ===
291
+ def create_prompt_heatmap_without_lang(dataframe):
292
+ """
293
+ Heatmap of the share of models (in %) whose BEST prompt for the task is each prompt id,
294
+ for tasks NER and REL, with exactly 3 prompts (p1, p2, p3). It supports columns storing
295
+ ids as integers (1/2/3) or strings ('p1'/'p2'/'p3').
296
+ """
297
+ tasks = ["NER", "REL", "RML", "HIS", "DIA"]
298
+
299
+ # Collect unique prompt ids as they appear (int or 'pX'); restrict to 3 prompts
300
+ all_ids = set()
301
+ for task in tasks:
302
+ col = f"{task} Best Prompt Id"
303
+ if col in dataframe.columns:
304
+ all_ids.update(dataframe[col].dropna().unique())
305
+
306
+ # Normalize to display labels and preserve the original values as keys
307
+ def label_for(pid):
308
+ if isinstance(pid, str):
309
+ return pid # e.g., 'p1'
310
+ try:
311
+ return f"p{int(pid)}"
312
+ except Exception:
313
+ return str(pid)
314
+
315
+ prompt_ids_raw = sorted(list(all_ids), key=lambda x: int(re.sub(r'[^0-9]', '', str(x)) or 0))
316
+ # Optional: hard-limit to p1/p2/p3 if extra noise exists
317
+ prompt_ids_raw = [pid for pid in prompt_ids_raw if label_for(pid) in {"p1", "p2", "p3"}]
318
+
319
+ if not prompt_ids_raw:
320
+ # Fallback to p1..p3
321
+ prompt_ids_raw = [1, 2, 3]
322
+
323
+ y_tick_labels = [label_for(pid) for pid in prompt_ids_raw]
324
+
325
+ matrix, hovers = [], []
326
+ for pid in prompt_ids_raw:
327
+ row, hover_row = [], []
328
+ for task in tasks:
329
+ col = f"{task} Best Prompt Id"
330
+ if col in dataframe.columns:
331
+ series = dataframe[col].dropna()
332
+ # match values regardless of 'p1' vs 1 vs '1'
333
+ def same_pid(v):
334
+ a = re.sub(r'[^0-9]', '', str(v))
335
+ b = re.sub(r'[^0-9]', '', str(pid))
336
+ return a == b and a != ""
337
+ total = len(series)
338
+ count = sum(same_pid(v) for v in series)
339
+ pct = (count / total * 100) if total > 0 else 0
340
+ row.append(pct)
341
+ hover_row.append(
342
+ f"<b>{task} — {label_for(pid)}</b><br>Models: {count}/{total}<br>Percentage: {pct:.1f}%"
343
+ )
344
+ else:
345
+ row.append(0); hover_row.append(f"<b>{task} — {label_for(pid)}</b><br>No data")
346
+ matrix.append(row)
347
+ hovers.append(hover_row)
348
+
349
+ fig = go.Figure(data=go.Heatmap(
350
+ z=matrix, x=tasks, y=y_tick_labels,
351
+ colorscale=[[0,'#f7fbff'],[0.2,'#deebf7'],[0.4,'#9ecae1'],[0.6,'#4292c6'],[0.8,'#2171b5'],[1,'#08519c']],
352
+ text=[[f"{val:.0f}%" if val is not None else "" for val in row] for row in matrix],
353
+ texttemplate="%{text}",
354
+ textfont={"size": 11, "family": "Arial"},
355
+ hovertemplate='%{customdata}<extra></extra>',
356
+ customdata=hovers,
357
+ colorbar=dict(title="% Models", ticksuffix="%"),
358
+ zmin=0, zmax=100
359
+ ))
360
+ fig.update_layout(
361
+ title={'text': "Most Effective Prompts Across Models (NER/REL)",
362
+ 'font': {'family': 'Arial', 'size': 14, 'color': '#2c3e50'}},
363
+ xaxis_title="Task", yaxis_title="Prompt",
364
+ font=dict(family="Arial", size=11),
365
+ margin=dict(b=120), template="plotly_white", dragmode=False, height=420
366
+ )
367
+
368
+ # PSI (optional info line)
369
+ psi, mean_cv, _ = calculate_prompt_sensitivity(
370
+ dataframe, tasks, prompt_ids_raw
371
+ )
372
+ fig.add_annotation(
373
+ text=f"Prompt Sensitivity (mean CV): {mean_cv:.2f}",
374
+ xref="paper", yref="paper", x=0.3, y=1.12, showarrow=False,
375
+ font=dict(size=11, color="#2c3e50", family="Arial")
376
+ )
377
+
378
+ fig.update_xaxes(fixedrange=True); fig.update_yaxes(fixedrange=True)
379
+ return fig
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+ def mean_of_max_per_field(df):
388
+ """
389
+ Calcola il massimo per ciascun campo e poi la media dei massimi.
390
+
391
+ Args:
392
+ df (pd.DataFrame): DataFrame con colonne TE, SA, HS, AT, WIC, FAQ, LS, SU, NER, REL, RML, DIA, HIS
393
+
394
+ Returns:
395
+ float: media dei valori massimi dei campi
396
+ """
397
+ #fields = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
398
+ fields = ["NER", "REL", "RML", "DIA", "HIS"]
399
+ #print(df.columns)
400
+
401
+ # Controlla che tutte le colonne esistano nel DataFrame
402
+ missing = [f for f in fields if f not in df.columns]
403
+ if missing:
404
+ raise ValueError(f"Le seguenti colonne mancano nel DataFrame: {missing}")
405
+
406
+ # Calcola il massimo per ciascun campo
407
+ max_values = df[fields].apply(pd.to_numeric, errors='coerce').max(skipna=True)
408
+
409
+ # Calcola la media dei massimi
410
+ mean_max = max_values.mean()
411
+
412
+ return mean_max
413
+
414
+
415
+ def barplot_mean_few_minus_zero_shot(dataframe, tasks=None):
416
+ if tasks is None:
417
+ tasks = [ "NER", "REL", "RML", "DIA", "HIS"]
418
+
419
+ task_means = {}
420
+
421
+ for task in tasks:
422
+ if task not in dataframe.columns:
423
+ continue
424
+
425
+ # Separa few-shot e zero-shot
426
+ few_shot = dataframe[dataframe['IS_FS'] == True][["Model", task]]
427
+ zero_shot = dataframe[dataframe['IS_FS'] == False][["Model", task]]
428
+
429
+ # Allinea i modelli
430
+ merged = pd.merge(few_shot, zero_shot, on="Model", suffixes=("_few", "_zero"))
431
+
432
+ # Rimuovi righe con valori mancanti
433
+ merged = merged.dropna(subset=[f"{task}_few", f"{task}_zero"])
434
+
435
+ if merged.empty:
436
+ continue
437
+
438
+ # Calcola differenza few - zero
439
+ diff = merged[f"{task}_few"] - merged[f"{task}_zero"]
440
+
441
+ # Calcola la media
442
+ task_means[task] = diff.mean()
443
+
444
+ # Crea barplot
445
+ fig = go.Figure([go.Bar(
446
+ x=list(task_means.keys()),
447
+ y=list(task_means.values()),
448
+ marker_color="#ff7f0e",
449
+ text=[f"{v:.2f}" for v in task_means.values()],
450
+ textposition="outside",
451
+ hovertemplate="<b>%{x}</b><br>Mean Delta Accuracy: %{y:.2f}%<extra></extra>"
452
+ )])
453
+
454
+ # Linea di riferimento a 0
455
+ '''
456
+ fig.add_shape(
457
+ type="line",
458
+ x0=-0.5, x1=len(task_means) - 0.5,
459
+ y0=0, y1=0,
460
+ line=dict(color="black", width=2, dash="dash"),
461
+ xref="x", yref="y"
462
+ )
463
+ '''
464
+
465
+ fig.update_layout(
466
+ title="Mean Accuracy Difference (Few-shot − Zero-shot) per Task",
467
+ xaxis_title="",
468
+ yaxis_title="Mean Delta Combined Performance",
469
+ template="plotly_white",
470
+ font=dict(family="Arial", size=13),
471
+ #margin=dict(b=100)
472
+ )
473
+
474
+ fig.add_annotation(
475
+ text="10-shot learning generally outperforms zero-shot. <br>"
476
+ "",
477
+ xref="paper", yref="paper",
478
+ x=0, y=-0.2,
479
+ showarrow=False,
480
+ font=dict(size=11, color="gray"),
481
+ align="left"
482
+ )
483
+
484
+ return fig
485
+
486
+
487
+ def boxplot_per_task(dataframe=None, baselines=None, references=None):
488
+
489
+ #print(dataframe.columns)
490
+
491
+ #tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
492
+ tasks =["NER", "REL", "RML", "HIS", "DIA"]
493
+ if dataframe is None:
494
+ np.random.seed(42)
495
+ dataframe = pd.DataFrame({
496
+ task: np.random.uniform(0.4, 0.9, 20) * 100
497
+ for task in tasks
498
+ })
499
+
500
+ if baselines is None:
501
+ baselines = {task: np.random.randint(50, 70) for task in tasks}
502
+
503
+ colors = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
504
+ "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]
505
+
506
+ fig = go.Figure()
507
+
508
+ for i, task in enumerate(tasks):
509
+ if task in dataframe.columns:
510
+ y_data = dataframe[task].dropna().tolist()
511
+
512
+ # boxplot
513
+ fig.add_trace(go.Box(
514
+ y=y_data,
515
+ name=task,
516
+ marker=dict(color=colors[i]),
517
+ line=dict(color="black", width=2),
518
+ fillcolor=colors[i],
519
+ opacity=0.7,
520
+ hovertemplate="<b>"+task+"</b><br>Accuracy: %{y:.2f}%<extra></extra>",
521
+ width=0.6,
522
+ whiskerwidth=0.2,
523
+ quartilemethod="linear"
524
+ ))
525
+
526
+ # baseline
527
+ #if task in baselines and baselines[task] is not None:
528
+ #fig.add_shape(
529
+ # type="line",
530
+ # x0=i - 0.3, x1=i + 0.3,
531
+ # y0=baselines[task], y1=baselines[task],
532
+ # line=dict(color="black", width=2, dash="dot"), # più visibile
533
+ # xref="x", yref="y"
534
+ #)
535
+ #'''
536
+ #fig.add_annotation(
537
+ #x=i, y=baselines[task],
538
+ #text=f"{baselines[task]}%",
539
+ #showarrow=False,
540
+ #yshift=10,
541
+ #font=dict(size=10, color="black")
542
+ #)
543
+ #'''
544
+
545
+ # reference GPT-4o
546
+ # if task in references and references[task] is not None:
547
+ # fig.add_shape(
548
+ # type="line",
549
+ # x0=i - 0.3, x1=i + 0.3,
550
+ # y0=references[task], y1=references[task],
551
+ # line=dict(color="red", width=2, dash="dashdot"),
552
+ # xref="x", yref="y"
553
+ # )
554
+
555
+ fig.update_layout(
556
+ title="Distribution of Model Accuracy by Task",
557
+ xaxis_title="Task",
558
+ yaxis_title="Combined Performance",
559
+ template="plotly_white",
560
+ boxmode="group",
561
+ dragmode=False,
562
+ font=dict(family="Arial", size=10),
563
+ margin=dict(b=80),
564
+ )
565
+
566
+ fig.add_annotation(
567
+ text=(""
568
+ #"In tasks like TE and SA, models approach the accuracy of supervised <br>"
569
+ #"models at EVALITA (dashed black line); in NER and REL they remain lower. <br>"
570
+ # "Dashed red lines show GPT-4o reference results for generative tasks."
571
+ ),
572
+ xref="paper", yref="paper",
573
+ x=0.5, y=-0.30,
574
+ showarrow=False,
575
+ font=dict(size=11, color="gray"),
576
+ align="left"
577
+ )
578
+
579
+ fig.update_yaxes(range=[0, 100], fixedrange=True)
580
+
581
+ return fig
582
+
583
+ # EVALITA results
584
+ BASELINES = {
585
+ "TE":71.00, "SA": 66.38, "HS": 80.88, "AT": 82.40, "WIC": 85.00,
586
+ "LS": 38.82, "SU": 38.91, "NER":88.00, "REL": 62.99
587
+ }
588
+
589
+ # GPT-4o
590
+ REFERENCES = {
591
+ "NER": 79.11,
592
+ "REL": 63.32,
593
+ "LS": 59.25,
594
+ "SU": 33.04
595
+
596
+ }
597
+
598
+
599
+ def boxplot_prompts_per_task(dataframe, tasks=None):
600
+ if tasks is None:
601
+ tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
602
+
603
+ # Lista delle colonne da aggiornare
604
+ cols_to_update = ["REL Best Prompt Id", "NER Best Prompt Id", "SU Best Prompt Id", "LS Best Prompt Id"]
605
+ # Applichiamo la trasformazione
606
+ for col in cols_to_update:
607
+ dataframe[col] = dataframe[col].replace({1: 7, 2: 8})
608
+
609
+ fig = go.Figure()
610
+
611
+ # Liste per creare una sola voce in legenda per Average e Best
612
+ avg_x, avg_y = [], []
613
+ best_x, best_y, best_text = [], [], []
614
+
615
+ for task in tasks:
616
+ avg_col = f"{task} Prompt Average"
617
+ best_col = f"{task} Best Prompt"
618
+ best_id_col = f"{task} Best Prompt Id"
619
+
620
+ if all(col in dataframe.columns for col in [avg_col, best_col, best_id_col]):
621
+ avg_value = dataframe[avg_col].mean()
622
+ avg_x.append(task)
623
+ avg_y.append(avg_value)
624
+
625
+ best_value = dataframe[best_col].mean()
626
+ best_x.append(task)
627
+ best_y.append(best_value)
628
+ best_id = dataframe[best_id_col].mode()[0] # Most frequent best prompt id
629
+ best_text.append(f"P:{best_id}")
630
+
631
+ # Barre Average Accuracy (azzurro)
632
+ fig.add_trace(go.Bar(
633
+ x=avg_x,
634
+ y=avg_y,
635
+ name="Avg. Accuracy",
636
+ marker_color="#1f77b4",
637
+ ))
638
+
639
+ # Barre Best Prompt (rosso)
640
+ fig.add_trace(go.Bar(
641
+ x=best_x,
642
+ y=best_y,
643
+ name="Best Prompt",
644
+ marker_color="#d62728",
645
+ ))
646
+
647
+ # Testo sopra barre Best Prompt con ID
648
+ for x, y, text in zip(best_x, best_y, best_text):
649
+ fig.add_annotation(
650
+ x=x,
651
+ y=y + 3, # leggermente sopra la barra
652
+ text=text,
653
+ showarrow=False,
654
+ font=dict(size=12, color="black")
655
+ )
656
+
657
+ fig.update_layout(
658
+ title= "Prompt Accuracy: Avg vs Best",
659
+ xaxis_title="Task",
660
+ yaxis_title="Combined Performance",
661
+ barmode='group',
662
+ template="plotly_white",
663
+ font=dict(family="Arial", size=10),
664
+ yaxis=dict(range=[0, 100], fixedrange=True)
665
+ )
666
+
667
+ # caption come annotazione separata
668
+ fig.add_annotation(
669
+ text="There is no single prompt that performs best across all tasks.<br>"
670
+ "Different prompts achieve the highest accuracy on different tasks.",
671
+ xref="paper", yref="paper",
672
+ x=0.5, y=-0.3,
673
+ showarrow=False,
674
+ font=dict(size=11, color="gray"),
675
+ align="center",
676
+ xanchor="center"
677
+ )
678
+
679
+ return fig
680
+
681
+
682
+ def line_chart(dataframe):
683
+
684
+ # Normalizza le dimensioni per avere marker non troppo piccoli né enormi
685
+ def scale_sizes(values, min_size=8, max_size=30):
686
+ vmin, vmax = min(values), max(values)
687
+ return [
688
+ min_size + (val - vmin) / (vmax - vmin) * (max_size - min_size) if vmax > vmin else (min_size + max_size) / 2
689
+ for val in values
690
+ ]
691
+
692
+ # dati in base a IS_FS
693
+ df_true = dataframe[dataframe['IS_FS'] == True]
694
+ df_false = dataframe[dataframe['IS_FS'] == False]
695
+
696
+ # Estrai valori x, y e labels
697
+ x_true = df_true['#Params (B)'].tolist()
698
+ y_true = df_true['Avg. Comb. Perf. ⬆️'].tolist()
699
+ labels_true = [re.search(r'>([^<]+)<', m).group(1) for m in df_true['Model'].tolist()]
700
+
701
+ x_false = df_false['#Params (B)'].tolist()
702
+ y_false = df_false['Avg. Comb. Perf. ⬆️'].tolist()
703
+ labels_false = [re.search(r'>([^<]+)<', m).group(1) for m in df_false['Model'].tolist()]
704
+
705
+ fig = go.Figure()
706
+
707
+ # Punti IS_FS=True
708
+ fig.add_trace(go.Scatter(
709
+ x=x_true,
710
+ y=y_true,
711
+ mode='markers',
712
+ name='10-Shot',
713
+ marker=dict(
714
+ color='blue',
715
+ size=scale_sizes(x_true)
716
+ ),
717
+ hovertemplate='<b>%{customdata}</b><br>#Params: %{x}<br>Performance: %{y}<extra></extra>',
718
+ customdata=labels_true
719
+ ))
720
+
721
+ # Punti IS_FS=False
722
+ fig.add_trace(go.Scatter(
723
+ x=x_false,
724
+ y=y_false,
725
+ mode='markers',
726
+ name='0-Shot',
727
+ marker=dict(
728
+ color='red',
729
+ size=scale_sizes(x_false)
730
+ ),
731
+ hovertemplate='<b>%{customdata}</b><br>#Params: %{x}<br>Performance: %{y}<extra></extra>',
732
+ customdata=labels_false
733
+ ))
734
+
735
+ # Trova il massimo tra tutti i modelli
736
+ all_y = y_true + y_false
737
+ all_x = x_true + x_false
738
+ all_labels = labels_true + labels_false
739
+ max_idx = all_y.index(max(all_y))
740
+ max_x = all_x[max_idx]
741
+ max_y = all_y[max_idx]
742
+ max_label = all_labels[max_idx]
743
+
744
+ # Aggiungi annotazione visibile per il modello migliore
745
+ fig.add_annotation(
746
+ x=max_x,
747
+ y=max_y,
748
+ #text=f"Top: {max_label} ({max_y:.1f}%)",
749
+ text=f"{max_label}",
750
+ showarrow=True,
751
+ arrowhead=2,
752
+ arrowsize=1,
753
+ arrowwidth=2,
754
+ arrowcolor="black",
755
+ font=dict(size=11, color="black"),
756
+ xshift=10,
757
+ yshift=10,
758
+ ax = -30, ay = -20, # sposta la label a sinistra e sopra il punto
759
+ xanchor = "right" # allinea la label a destra rispetto al punto
760
+ )
761
+
762
+ fig.update_layout(
763
+ title="Avg. Combined Performance vs #Params",
764
+ xaxis_title="#Params (B)",
765
+ yaxis_title="Avg. Combined Performance",
766
+ template="plotly_white",
767
+ hovermode="closest",
768
+ font=dict(family="Arial", size=10),
769
+ dragmode=False,
770
+ xaxis=dict(
771
+ tickvals=[0, 25, 50, 75, 100, 125],
772
+ ticktext=["0", "25", "50", "75", "100"]
773
+ ),
774
+ yaxis=dict(
775
+ tickvals=[0, 20, 40, 60, 80, 100], # 👈 tick fissi
776
+ range=[0, 100] # 👈 range bloccato
777
+ )
778
+ )
779
+
780
+ # Caption
781
+ fig.add_annotation(
782
+ text="Accuracy generally rises with #Params, but smaller models <br>"
783
+ "with 10-shot can outperform larger zero-shot models.",
784
+ xref="paper", yref="paper",
785
+ x=0.5, y=-0.3, # 👈 centrata
786
+ showarrow=False,
787
+ font=dict(size=11, color="gray"),
788
+ align="center",
789
+ xanchor="center" # 👈 ancora centrata rispetto al testo
790
+ )
791
+
792
+ fig.update_xaxes(fixedrange=True, rangeslider_visible=False)
793
+ fig.update_yaxes(fixedrange=True)
794
+
795
+ return fig
796
+
797
+
798
+ # Define task metadata (icons, names, descriptions)
799
+ TASK_METADATA_MULTIPLECHOICE = {
800
+ #"TE": {"icon": "📊", "name": "Textual Entailment", "tooltip": ""},
801
+ #"SA": {"icon": "😃", "name": "Sentiment Analysis", "tooltip": ""},
802
+ #"HS": {"icon": "⚠️", "name": "Hate Speech", "tooltip": ""},
803
+ #"AT": {"icon": "🏥", "name": "Admission Test", "tooltip": ""},
804
+ #"WIC": {"icon": "🔤", "name": "Word in Context", "tooltip": ""},
805
+ #"FAQ": {"icon": "❓", "name": "Frequently Asked Questions", "tooltip": ""}
806
+ }
807
+
808
+ # Define task metadata (icons, names, descriptions)
809
+ TASK_METADATA_GENERATIVE = {
810
+
811
+ "NER": {"icon": "🏷️", "name": "Named Entity Recognition", "tooltip": ""},
812
+ "REL": {"icon": "🔗", "name": "Relation Extraction", "tooltip": ""},
813
+ "RML": {"icon": "😃", "name": "CRF RML", "tooltip": "CRF RML"},
814
+ "DIA": {"icon": "🏥", "name": "CRF Diagnosis", "tooltip": "CRF Diagnosis"},
815
+ "HIS": {"icon": "📝", "name": "CRF History", "tooltip": "CRF History"},
816
+ }
817
+
818
+ def restart_space():
819
+ """Restart the Hugging Face space."""
820
+ API.restart_space(repo_id=REPO_ID)
821
+
822
+
823
+ def init_leaderboard(dataframe, default_selection=None, hidden_columns=None):
824
+ """
825
+ Initialize and return the leaderboard when it is first loaded or when 'benchmark' is selected.
826
+ The table is sorted based on the "Avg. Combined Performance" field.
827
+ """
828
+ if dataframe is None or dataframe.empty:
829
+ raise ValueError("Leaderboard DataFrame is empty or None.")
830
+
831
+ #print("????????????????????????????????", mean_of_max_per_field(dataframe))
832
+
833
+ sorted_dataframe = dataframe.sort_values(by="Avg. Comb. Perf. ⬆️", ascending=False)
834
+
835
+ sorted_dataframe = sorted_dataframe.reset_index(drop=True)
836
+ sorted_dataframe["Rank"] = sorted_dataframe.index + 1
837
+
838
+ # Flag per sapere se la medaglia è già stata assegnata per categoria e tipo
839
+ large_medal_fs_assigned = False
840
+ medium_medal_fs_assigned = False
841
+ small_medal_fs_assigned = False
842
+
843
+ large_medal_0shot_assigned = False
844
+ medium_medal_0shot_assigned = False
845
+ small_medal_0shot_assigned = False
846
+
847
+ # Lista temporanea per salvare i nuovi valori della colonna Model
848
+ new_model_column = []
849
+
850
+ for _, row in sorted_dataframe.iterrows():
851
+ if row['IS_FS']: # 10-Few-Shot
852
+ if row["Size"] == "🔵🔵🔵" and not large_medal_fs_assigned:
853
+ new_model_column.append(f"{row['Model']} 🔵🔵🔵🏆")
854
+ large_medal_fs_assigned = True
855
+ elif row["Size"] == "🔵🔵" and not medium_medal_fs_assigned:
856
+ new_model_column.append(f"{row['Model']} 🔵🔵🏆")
857
+ medium_medal_fs_assigned = True
858
+ elif row["Size"] == "🔵" and not small_medal_fs_assigned:
859
+ new_model_column.append(f"{row['Model']} 🔵🏆")
860
+ small_medal_fs_assigned = True
861
+ else:
862
+ new_model_column.append(row["Model"])
863
+ else: # 0-Shot
864
+ if row["Size"] == "🔵🔵🔵" and not large_medal_0shot_assigned:
865
+ new_model_column.append(f"{row['Model']} 🔵🔵🔵🎖️")
866
+ large_medal_0shot_assigned = True
867
+ elif row["Size"] == "🔵🔵" and not medium_medal_0shot_assigned:
868
+ new_model_column.append(f"{row['Model']} 🔵🔵🎖️")
869
+ medium_medal_0shot_assigned = True
870
+ elif row["Size"] == "🔵" and not small_medal_0shot_assigned:
871
+ new_model_column.append(f"{row['Model']} 🔵🎖️")
872
+ small_medal_0shot_assigned = True
873
+ else:
874
+ new_model_column.append(row["Model"])
875
+
876
+ # Lista delle colonne da aggiornare
877
+ #cols_to_update = ["REL Best Prompt Id", "NER Best Prompt Id", "SU Best Prompt Id", "LS Best Prompt Id"]
878
+ # Applichiamo la trasformazione
879
+ #for col in cols_to_update:
880
+ # dataframe[col] = dataframe[col].replace({1: 7, 2: 8})
881
+
882
+ # Aggiorna la colonna Model
883
+ sorted_dataframe["Model"] = new_model_column
884
+
885
+ field_list = fields(AutoEvalColumn)
886
+
887
+ return Leaderboard(
888
+ value=sorted_dataframe,
889
+ datatype=[c.type for c in field_list],
890
+ search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],
891
+ hide_columns=hidden_columns or [c.name for c in field_list if c.hidden],
892
+ filter_columns=[
893
+ ColumnFilter(AutoEvalColumn.fewshot_symbol.name, type="checkboxgroup", label="N-Shot Learning (FS): "),
894
+ ColumnFilter(AutoEvalColumn.LANG.name, type="checkboxgroup", label="Languges: "),
895
+ ColumnFilter(AutoEvalColumn.params.name, type="slider", min=0, max = 100, default = [0,100], label="Select the number of parameters (B)"),
896
+ ],
897
+ bool_checkboxgroup_label="Evaluation Mode",
898
+ interactive=False,
899
+ )
900
+
901
+ def update_task_leaderboard(dataframe, default_selection=None, hidden_columns=None):
902
+ """
903
+ Update and return the leaderboard when a specific task is selected.
904
+ The table is sorted based on the "Combined Performance" field.
905
+ """
906
+ if dataframe is None or dataframe.empty:
907
+ raise ValueError("Leaderboard DataFrame is empty or None.")
908
+ #sorted_dataframe = dataframe.sort_values(by="Combined Performance", ascending=False)
909
+ clean_df = dataframe.assign( **{"Combined Performance": pd.to_numeric(dataframe["Combined Performance"], errors="coerce")}).loc[lambda df: df["Combined Performance"].notna() & (df["Combined Performance"] != 0)]
910
+
911
+ sorted_dataframe = clean_df.sort_values(by="Combined Performance", ascending=False)
912
+
913
+ # aggiungo la colonna rank in base alla posizione
914
+ sorted_dataframe = sorted_dataframe.reset_index(drop=True)
915
+ sorted_dataframe["Rank"] = sorted_dataframe.index + 1
916
+
917
+ # Flag per sapere se la medaglia è già stata assegnata per categoria e tipo
918
+ large_medal_fs_assigned = False
919
+ medium_medal_fs_assigned = False
920
+ small_medal_fs_assigned = False
921
+
922
+ large_medal_0shot_assigned = False
923
+ medium_medal_0shot_assigned = False
924
+ small_medal_0shot_assigned = False
925
+
926
+ # Lista temporanea per salvare i nuovi valori della colonna Model
927
+ new_model_column = []
928
+
929
+ for _, row in sorted_dataframe.iterrows():
930
+ if row['IS_FS']: # 5-Few-Shot
931
+ if row["Size"] == "🔵🔵🔵" and not large_medal_fs_assigned:
932
+ new_model_column.append(f"{row['Model']} 🔵🔵🔵🏆")
933
+ large_medal_fs_assigned = True
934
+ elif row["Size"] == "🔵🔵" and not medium_medal_fs_assigned:
935
+ new_model_column.append(f"{row['Model']} 🔵🔵🏆")
936
+ medium_medal_fs_assigned = True
937
+ elif row["Size"] == "🔵" and not small_medal_fs_assigned:
938
+ new_model_column.append(f"{row['Model']} 🔵🏆")
939
+ small_medal_fs_assigned = True
940
+ else:
941
+ new_model_column.append(row["Model"])
942
+ else: # 0-Shot
943
+ if row["Size"] == "🔵🔵🔵" and not large_medal_0shot_assigned:
944
+ new_model_column.append(f"{row['Model']} 🔵🔵🔵🎖️")
945
+ large_medal_0shot_assigned = True
946
+ elif row["Size"] == "🔵🔵" and not medium_medal_0shot_assigned:
947
+ new_model_column.append(f"{row['Model']} 🔵🔵🎖️")
948
+ medium_medal_0shot_assigned = True
949
+ elif row["Size"] == "🔵" and not small_medal_0shot_assigned:
950
+ new_model_column.append(f"{row['Model']} 🔵🎖️")
951
+ small_medal_0shot_assigned = True
952
+ else:
953
+ new_model_column.append(row["Model"])
954
+
955
+ # Aggiorna la colonna Model
956
+ sorted_dataframe["Model"] = new_model_column
957
+
958
+ pd.set_option('display.max_colwidth', None)
959
+ #print("========================", dataframe['Model'])
960
+
961
+ #print(sorted_dataframe['Combined Performance'])
962
+
963
+ field_list = fields(AutoEvalColumn)
964
+
965
+ return Leaderboard(
966
+ value=sorted_dataframe,
967
+ #datatype=[c.type for c in field_list],
968
+ datatype=[c.type for c in field_list] + [int],
969
+ #select_columns=SelectColumns(
970
+ # default_selection=default_selection or [c.name for c in field_list if c.displayed_by_default],
971
+ # cant_deselect=[c.name for c in field_list if c.never_hidden],
972
+ # label="Select Columns to Display:",
973
+ #),
974
+ search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],
975
+ hide_columns=hidden_columns or [c.name for c in field_list if c.hidden],
976
+ filter_columns=[
977
+ ColumnFilter(AutoEvalColumn.fewshot_symbol.name, type="checkboxgroup", label="N-Shot Learning (FS): "),
978
+ ColumnFilter(AutoEvalColumn.LANG.name, type="checkboxgroup", label="Languges: "),
979
+
980
+ ColumnFilter(AutoEvalColumn.params.name, type="slider", min=0, max=100, default=[0, 100],
981
+ label="Select the number of parameters (B)"),
982
+ ],
983
+ bool_checkboxgroup_label="Evaluation Mode",
984
+ interactive=False
985
+ )
986
+
987
+
988
+
989
+ def download_snapshot(repo, local_dir):
990
+ """Try to download a snapshot from Hugging Face Hub."""
991
+ try:
992
+ print(f"Downloading from {repo} to {local_dir}...")
993
+ snapshot_download(repo_id=repo, local_dir=local_dir, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN)
994
+ except Exception as e:
995
+ print(f"Error downloading {repo}: {e}")
996
+ restart_space()
997
+
998
+
999
+ # Initialize the app by downloading snapshots
1000
+ download_snapshot(QUEUE_REPO, EVAL_REQUESTS_PATH)
1001
+ download_snapshot(RESULTS_REPO, EVAL_RESULTS_PATH)
1002
+
1003
+ # Load leaderboard data
1004
+ LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
1005
+ finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
1006
+ #print(LEADERBOARD_DF.columns.tolist())
1007
+
1008
+ theoretical_max_combined_perf = mean_of_max_per_field(LEADERBOARD_DF)
1009
+
1010
+ # Prepare the main interface
1011
+ demo = gr.Blocks(css=custom_css)
1012
+ with demo:
1013
+ #gr.HTML(TITLE)
1014
+ gr.HTML(
1015
+ """
1016
+ <div style="display: flex; align-items: center; position: relative; width: 100%; height: 60px; padding: 10px 0;">
1017
+ <h1 style="
1018
+ margin: 0 auto;
1019
+ font-weight: 900;
1020
+ font-size: 5.5em;
1021
+ letter-spacing: 2px;
1022
+ text-transform: uppercase;
1023
+ color: red;
1024
+ background: linear-gradient(90deg, #1f77b4, #00c6ff);
1025
+ -webkit-background-clip: text;
1026
+ -webkit-text-fill-color: transparent;
1027
+ text-shadow: 2px 2px 8px rgba(0.2,0,0,0);
1028
+ ">
1029
+ ECREAM-LLM Leaderboard
1030
+ </h1>
1031
+ </div>
1032
+ """
1033
+ )
1034
+ gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
1035
+
1036
+ # ⬇️ QUI aggiungiamo i grafici subito sotto la barra del titolo e sopra le tabs
1037
+ with gr.Row():
1038
+ gr.Plot(value=line_chart(LEADERBOARD_DF), elem_id="line-chart")
1039
+ gr.Plot(value=boxplot_per_task(LEADERBOARD_DF, BASELINES, REFERENCES), elem_id="boxplot-task")
1040
+
1041
+ # === NEW: second row with the 2 extra plots (NER/REL + p1..p3) ===
1042
+ #with gr.Row():
1043
+ #gr.Plot(value=create_prompt_heatmap(LEADERBOARD_DF), elem_id="prompt-heatmap")
1044
+ #gr.Plot(value=create_best_model_comparison_table(LEADERBOARD_DF), elem_id="best-model-table")
1045
+ # === NEW: gray background wrapper for combos ===
1046
+ with gr.Row(elem_id="filters-wrap"):
1047
+ lang_dd = gr.Dropdown(
1048
+ choices=["All", "EN", "IT", "SL", "SK", "GR", "PL"],
1049
+ value="All", label="Language: ", scale=1
1050
+ )
1051
+ shot_dd = gr.Dropdown(
1052
+ choices=["All", "0", "10"],
1053
+ value="All", label="N-Shot: ", scale=1
1054
+ )
1055
+
1056
+ with gr.Row():
1057
+ heatmap_plot = gr.Plot(value=create_prompt_heatmap(LEADERBOARD_DF, None, None), elem_id="prompt-heatmap")
1058
+ table_plot = gr.Plot(value=create_best_model_comparison_table(LEADERBOARD_DF, None, None), elem_id="best-model-table")
1059
+
1060
+ def _update_both(lang, shot):
1061
+ return (
1062
+ create_prompt_heatmap(LEADERBOARD_DF, None if lang == "All" else lang, None if shot == "All" else shot),
1063
+ create_best_model_comparison_table(LEADERBOARD_DF, None if lang == "All" else lang, None if shot == "All" else shot)
1064
+ )
1065
+
1066
+ lang_dd.change(_update_both, inputs=[lang_dd, shot_dd], outputs=[heatmap_plot, table_plot])
1067
+ shot_dd.change(_update_both, inputs=[lang_dd, shot_dd], outputs=[heatmap_plot, table_plot])
1068
+
1069
+
1070
+
1071
+ with gr.Tabs(elem_classes="tab-buttons") as tabs:
1072
+
1073
+ # Main leaderboard tab
1074
+ with gr.TabItem("🏅 Benchmark"):
1075
+
1076
+ leaderboard = init_leaderboard(
1077
+ LEADERBOARD_DF,
1078
+ default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML", "DIA", "HIS"],
1079
+ hidden_columns=[col for col in LEADERBOARD_DF.columns if col not in ['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML", "DIA", "HIS"]]
1080
+ )
1081
+
1082
+
1083
+ # About tab
1084
+ with gr.TabItem("📝 About"):
1085
+ gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
1086
+
1087
+ # Task-specific leaderboards
1088
+ for task, metadata in TASK_METADATA_MULTIPLECHOICE.items():
1089
+
1090
+ with gr.TabItem(f"{metadata['icon']}{task}"):
1091
+
1092
+ task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
1093
+ gr.Markdown(task_description, elem_classes="markdown-text")
1094
+
1095
+ leaderboard = update_task_leaderboard(
1096
+ LEADERBOARD_DF.rename(columns={f"{task} Prompt Average": "Prompt Average", f"{task} Prompt Std": "Prompt Std", f"{task} Best Prompt": "Best Prompt", f"{task} Best Prompt Id": "Best Prompt Id", task: "Combined Performance"}),
1097
+ default_selection=['Rank', 'Size','LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std', 'Best Prompt', 'Best Prompt Id'],
1098
+ hidden_columns=[col for col in LEADERBOARD_DF.columns if col not in ['Rank', 'Size','LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std', 'Best Prompt', 'Best Prompt Id']]
1099
+ )
1100
+
1101
+ # About tab
1102
+ with gr.TabItem("│", interactive=False):
1103
+ gr.Markdown("", elem_classes="markdown-text")
1104
+
1105
+ # Task-specific leaderboards
1106
+ for task, metadata in TASK_METADATA_GENERATIVE.items():
1107
+ with gr.TabItem(f"{metadata['icon']}{task}"):
1108
+ task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
1109
+ gr.Markdown(task_description, elem_classes="markdown-text1")
1110
+ #print (LEADERBOARD_DF)
1111
+ leaderboard = update_task_leaderboard(
1112
+ LEADERBOARD_DF.rename(columns={f"{task} Prompt Average": "Prompt Average",
1113
+ f"{task} Prompt Std": "Prompt Std",
1114
+ f"{task} Best Prompt": "Best Prompt",
1115
+ f"{task} Best Prompt Id": "Best Prompt Id",
1116
+ task: "Combined Performance"}),
1117
+ default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std', 'Best Prompt',
1118
+ 'Best Prompt Id'],
1119
+ hidden_columns=[col for col in LEADERBOARD_DF.columns if
1120
+ col not in ['Rank', 'Size','LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std',
1121
+ 'Best Prompt', 'Best Prompt Id']]
1122
+ )
1123
+
1124
+ # Citation section
1125
+ with gr.Accordion("📙 Citation", open=False):
1126
+ gr.Textbox(value=CITATION_BUTTON_TEXT, label=CITATION_BUTTON_LABEL, lines=20, elem_id="citation-button", show_copy_button=True)
1127
+
1128
+ with gr.Accordion("📙 Credits", open=False):
1129
+ gr.Markdown(
1130
+ """
1131
+ ***This project has been funded by the European Union under:
1132
+
1133
+ Horizon Europe eCREAM Project (Grant Agreement No.101057726)
1134
+ """
1135
+ )
1136
+
1137
+ # Background job to restart space
1138
+ scheduler = BackgroundScheduler()
1139
+ scheduler.add_job(restart_space, "interval", seconds=1800)
1140
+ scheduler.start()
1141
+
1142
+ # Launch the app with concurrent queueing
1143
+ demo.queue(default_concurrency_limit=40).launch(debug=True, # Enable Gradio debug mode
1144
+ show_error=True)
.ipynb_checkpoints/preprocess_models_output-checkpoint.py ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ EVALITA LLM EVALUATION PROCESSOR
3
+
4
+ Transforms raw model evaluation outputs into structured performance reports for leaderboard integration.
5
+
6
+ DATA PIPELINE OVERVIEW:
7
+
8
+ 1. Inputs:
9
+ - Evaluation Results: Raw .out files from lm-eval-harness
10
+ - Model Metadata: Pre-collected .json files from HuggingFace
11
+
12
+ 2. Output:
13
+ - Comprehensive evaluation reports in JSON format
14
+ - Ready for ingestion into the evaluation leaderboard
15
+
16
+ --------------------------------------------------------------------
17
+ INPUT SPECIFICATION
18
+
19
+ Evaluation Results (.out format):
20
+ hf (pretrained=model-org/model-name), num_fewshot: 5, batch_size: 1
21
+ | Task | Metric | Value | Stderr |
22
+ |---------------|--------|--------|--------|
23
+ | main-task | acc | 0.5605 | 0.0052 |
24
+ | - sub-task | acc | 0.4640 | 0.0088 |
25
+ | - prompt-1 | acc | 0.3720 | 0.0216 |
26
+
27
+ Model Metadata (.json format):
28
+ {
29
+ "model": "model-org/model-name",
30
+ "base_model": "ModelArchitecture",
31
+ "revision": "git_commit_hash",
32
+ "parameters": 8.03,
33
+ "language": "en_it"
34
+ }
35
+
36
+ --------------------------------------------------------------------
37
+ OUTPUT SPECIFICATION
38
+
39
+ Evaluation Report (.json format):
40
+ {
41
+ "summary_metrics": {
42
+ "average_CPS": 41.74,
43
+ "num_tasks": 12
44
+ },
45
+ "model_config": {
46
+ "identifier": "model-org/model-name",
47
+ "architecture": "ModelArchitecture",
48
+ "parameters": 8.03,
49
+ "evaluation_settings": {
50
+ "fewshot": 5,
51
+ "batch_size": 1
52
+ }
53
+ },
54
+ "task_results": {
55
+ "task-name": {
56
+ "average_score": 52.60,
57
+ "best_prompt": {
58
+ "id": "prompt-6",
59
+ "score": 66.57
60
+ },
61
+ "prompt_analysis": [
62
+ {
63
+ "prompt_id": "prompt-1",
64
+ "score": 37.20,
65
+ "stderr": 0.0216
66
+ }
67
+ ]
68
+ }
69
+ }
70
+ }
71
+ """
72
+
73
+ import json
74
+ import os
75
+ import re
76
+ import statistics
77
+
78
+ TASKS ={"NER", "RE", "DIA", "RML", "HIS" }
79
+
80
+ def safe_float(value):
81
+ """Safely converts a value to float, returning None if the conversion fails."""
82
+ try:
83
+ return float(value)
84
+ except ValueError:
85
+ return None
86
+
87
+
88
+ def calculate_task_metrics(task_info):
89
+ """Calculates average accuracy, best prompt accuracy, and CPS for a given task."""
90
+ accuracies = [prompt['value'] for prompt in task_info['prompts'] if prompt['value'] is not None]
91
+
92
+ if not accuracies:
93
+ return None
94
+
95
+ task_info['average_accuracy'] = sum(accuracies) / len(accuracies)
96
+ task_info['std_accuracy'] = statistics.stdev(accuracies) if len(accuracies) > 1 else 0.0
97
+ best_prompt_data = max(task_info['prompts'], key=lambda x: x['value'])
98
+ task_info['best_prompt'] = best_prompt_data['value']
99
+ task_info['prompt_id'] = best_prompt_data['prompt']
100
+
101
+ # Calculate CPS
102
+ avg_acc = task_info['average_accuracy']
103
+ best_acc = task_info['best_prompt']
104
+ task_info['CPS'] = (1 - (best_acc - avg_acc) / 100) * best_acc
105
+
106
+
107
+ def extract_data_from_file(file_path):
108
+ """Extracts task and prompt data from a specified file."""
109
+
110
+
111
+ LANG=""
112
+ if file_path.find ("__en__")!=-1 : LANG="EN"
113
+ if file_path.find ("__sl__")!=-1 : LANG="SL"
114
+ if file_path.find ("__it__")!=-1 : LANG="IT"
115
+ if file_path.find ("__gr__")!=-1 : LANG="GR"
116
+ if file_path.find ("__sk__")!=-1 : LANG="SK"
117
+ if file_path.find ("__pl__")!=-1 : LANG="PL"
118
+ if LANG=="" :
119
+ print ("ERROR: ",file_path)
120
+
121
+ with open(file_path, 'r') as file:
122
+ lines = file.readlines()
123
+
124
+ tasks_data = {}
125
+
126
+ current_task = None
127
+
128
+ for line in lines:
129
+ line = line.strip()
130
+
131
+ # Skips empty lines
132
+ if not line:
133
+ continue
134
+
135
+ # Skips header lines
136
+ if line.startswith("| Tasks") or line.startswith(" | Task"):
137
+ continue
138
+
139
+ # Extracts model configuration details
140
+ if line.startswith("hf (pretrained=") or line.startswith("hf(pretrained="):
141
+ start = line.find("pretrained=") + len("pretrained=")
142
+ end = line.find(" )", start)
143
+ pretrained_model = line[start:end]
144
+
145
+ num_fewshot_match = re.search(r"num_fewshot:\s*([\w\d]+)", line)
146
+ num_fewshot = num_fewshot_match.group(1) if num_fewshot_match else None
147
+
148
+ batch_size_match = re.search(r"batch_size:\s*(\d+)", line)
149
+ batch_size = int(batch_size_match.group(1)) if batch_size_match else None
150
+
151
+ continue
152
+
153
+ columns = line.split('|')
154
+ if len(columns) != 11:
155
+ continue
156
+ print (columns)
157
+ task_name = columns[1]
158
+ metric = columns[5].strip()
159
+ value = safe_float(columns[7])
160
+ stderr = safe_float(columns[9])
161
+ print (value)
162
+ # Skips normalized accuracy metrics
163
+ if metric == "acc_norm":
164
+ continue
165
+
166
+ # Identifies task and prompt sections in the file
167
+ if task_name.startswith(" - "):
168
+ task_name = task_name[3:].strip()
169
+ current_task = task_name
170
+ tasks_data.setdefault(current_task,
171
+ {'prompts': [], 'average_accuracy': 0, 'best_prompt': None, 'prompt_id': None,
172
+ 'CPS': None, 'is_dummy': False })
173
+
174
+ elif task_name.startswith(" - ") and current_task:
175
+ prompt_name = task_name[4:].strip()
176
+ prompt_data = {'prompt': prompt_name, 'metric': metric, 'value': value * 100,
177
+ 'stderr': stderr}
178
+ tasks_data[current_task]['prompts'].append(prompt_data)
179
+
180
+ # Special handling for evalita NER task to calculate weighted prompt averages
181
+ if "evalita NER" in tasks_data:
182
+ task_info = tasks_data["evalita NER"]
183
+ weight_map = {"ADG prompt-1": 521, "ADG prompt-2": 521, "FIC prompt-1": 1517, "FIC prompt-2": 1517,
184
+ "WN prompt-1": 2088, "WN prompt-2": 2088}
185
+
186
+ weighted_values = {"prompt-1": 0, "prompt-2": 0}
187
+ total_weights = sum(weight_map.values())
188
+
189
+ for prompt in task_info['prompts']:
190
+ if prompt['prompt'] in weight_map:
191
+ if "prompt-1" in prompt['prompt']:
192
+ weighted_values["prompt-1"] += weight_map[prompt['prompt']] * prompt['value']
193
+ elif "prompt-2" in prompt['prompt']:
194
+ weighted_values["prompt-2"] += weight_map[prompt['prompt']] * prompt['value']
195
+
196
+ task_info['prompts'] = [
197
+ {"prompt": "prompt-1", "metric": "acc", "value": weighted_values["prompt-1"] / total_weights,
198
+ 'stderr': None},
199
+ {"prompt": "prompt-2", "metric": "acc", "value": weighted_values["prompt-2"] / total_weights,
200
+ 'stderr': None}]
201
+
202
+ # Inject dummy entries for any TASKS not present in the file
203
+ for must_have in TASKS:
204
+ if must_have not in tasks_data:
205
+ tasks_data[must_have] = {
206
+ 'prompts': [
207
+ {'prompt': 'p1', 'metric': 'f1', 'value': 0.0, 'stderr': 0.0}
208
+ ],
209
+ 'average_accuracy': None,
210
+ 'std_accuracy': None,
211
+ 'best_prompt': None,
212
+ 'prompt_id': None,
213
+ 'CPS': None,
214
+ 'is_dummy': True # <--- mark as dummy
215
+ }
216
+
217
+ # Calculates task metrics for each task
218
+ for task_info in tasks_data.values():
219
+ if task_info.get('is_dummy'):
220
+ # leave metrics as None for dummy tasks
221
+ continue
222
+ calculate_task_metrics(task_info)
223
+
224
+ # Calculates the average CPS across all tasks
225
+ tasks_with_cps = [
226
+ t['CPS'] for t in tasks_data.values() if not t.get('is_dummy') and t.get('CPS') is not None ]
227
+ average_CPS = (sum(tasks_with_cps) / len(tasks_with_cps)) if tasks_with_cps else 0
228
+
229
+ #tasks_with_cps = [task['CPS'] for task in tasks_data.values() if task['CPS'] is not None]
230
+ #average_CPS = sum(tasks_with_cps) / len(tasks_with_cps) if tasks_with_cps else 0
231
+
232
+ config = {
233
+ "model_name": pretrained_model,
234
+ "num_fewshot": num_fewshot,
235
+ "batch_size": batch_size,
236
+ "LANG": LANG
237
+ }
238
+
239
+ return {'average_CPS': average_CPS, 'config': config, 'tasks': tasks_data}
240
+
241
+
242
+ """
243
+ MAIN PROCESSING PIPELINE
244
+
245
+ This script executes the complete evaluation data processing workflow:
246
+
247
+ 1. Input Sources:
248
+ - Raw evaluation results (.out files) from: ../evalita_llm_models_output/
249
+ - Model metadata JSON files from: ../evalita_llm_requests/
250
+
251
+ 2. Processing Steps:
252
+ - Parses evaluation metrics from .out files
253
+ - Combines with model metadata
254
+ - Calculates aggregated performance statistics
255
+
256
+ 3. Output:
257
+ - Structured JSON results saved to: ../evalita_llm_results/
258
+ - Organized by model organization/name
259
+ - Contains complete evaluation results with metadata
260
+ """
261
+ directory_in_path = '/home/sfarzi/leaderboard/trail_leaderboard/csv_new/output/'
262
+ directory_in_requests_path = '/home/sfarzi/leaderboard/trail_leaderboard/e3c_llm_requests/'
263
+ directory_out_results_path = '/home/sfarzi/leaderboard/trail_leaderboard/e3c_llm_results/'
264
+
265
+ for filename in os.listdir(directory_in_path):
266
+ if filename.endswith('.txt'):
267
+ file_path = os.path.join(directory_in_path, filename)
268
+ json_output = extract_data_from_file(file_path)
269
+
270
+ model_org_name, model_name = json_output['config']['model_name'].split('/')
271
+
272
+
273
+ config_file_path = os.path.join(directory_in_requests_path, model_org_name, f"{model_name}.json")
274
+
275
+ if os.path.exists(config_file_path):
276
+ with open(config_file_path, 'r', encoding='utf-8') as config_file:
277
+ additional_config = json.load(config_file)
278
+ json_output['config'].update(additional_config)
279
+
280
+
281
+ org_folder_path = os.path.join(directory_out_results_path, model_org_name)
282
+ os.makedirs(org_folder_path, exist_ok=True)
283
+
284
+ file_suffix = f"{json_output['config']['num_fewshot']}" +"_"+ f"{json_output['config']['LANG']}"
285
+ output_file_path = os.path.join(org_folder_path, f"{model_name}_{file_suffix}.json")
286
+
287
+ with open(output_file_path, 'w', newline="\n") as outfile:
288
+ json.dump(json_output, outfile, indent=4)
289
+
290
+ print(f"File {filename} processed and saved to {output_file_path}")
app.py CHANGED
@@ -52,7 +52,7 @@ def create_best_model_comparison_table(dataframe, lang: str | None = None, shot:
52
  - lang in {EN, IT, SL, SK, GR, PL} or None/"All"
53
  - shot in {"0","10"} or None/"All" (mapped to IS_FS False/True)
54
  """
55
- tasks = ["NER", "REL", "RML", "HIS", "DIA"]
56
  df = dataframe.copy()
57
 
58
  if lang and lang != "All" and "LANG" in df.columns:
@@ -141,7 +141,7 @@ def create_best_model_comparison_table_without_lang(dataframe):
141
  Table with the best overall model per task (NER, REL,) and the model that
142
  achieves the best score with its own best prompt.
143
  """
144
- tasks = ["NER", "REL", "RML", "HIS", "DIA"]
145
  table_data = {'Task': [], 'Best Overall Model': [], 'CPS': [], 'Best Prompt Model': [], 'Acc.': []}
146
 
147
  for task in tasks:
@@ -216,7 +216,7 @@ def create_prompt_heatmap(dataframe, lang: str | None = None, shot: str | None =
216
  - lang: None or one of EN/IT/SL/SK/GR/PL (None means All)
217
  - shot: None or "0"/"10" (None means All) mapped to IS_FS False/True
218
  """
219
- tasks = ["NER", "REL", "RML", "HIS", "DIA"]
220
 
221
  df = dataframe.copy()
222
  # Language filter
@@ -236,6 +236,8 @@ def create_prompt_heatmap(dataframe, lang: str | None = None, shot: str | None =
236
  for task in tasks:
237
  col = f"{task} Best Prompt Id"
238
  if col in df.columns:
 
 
239
  all_ids.update(df[col].dropna().unique())
240
  prompt_ids_raw = sorted(list(all_ids), key=lambda x: int(re.sub(r'[^0-9]', '', str(x)) or 0))
241
  prompt_ids_raw = [pid for pid in prompt_ids_raw if label_for(pid) in {"p1", "p2", "p3"}] or [1, 2, 3]
@@ -294,7 +296,7 @@ def create_prompt_heatmap_without_lang(dataframe):
294
  for tasks NER and REL, with exactly 3 prompts (p1, p2, p3). It supports columns storing
295
  ids as integers (1/2/3) or strings ('p1'/'p2'/'p3').
296
  """
297
- tasks = ["NER", "REL", "RML", "HIS", "DIA"]
298
 
299
  # Collect unique prompt ids as they appear (int or 'pX'); restrict to 3 prompts
300
  all_ids = set()
@@ -395,10 +397,11 @@ def mean_of_max_per_field(df):
395
  float: media dei valori massimi dei campi
396
  """
397
  #fields = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
398
- fields = ["NER", "REL", "RML", "DIA", "HIS"]
399
  #print(df.columns)
400
 
401
  # Controlla che tutte le colonne esistano nel DataFrame
 
402
  missing = [f for f in fields if f not in df.columns]
403
  if missing:
404
  raise ValueError(f"Le seguenti colonne mancano nel DataFrame: {missing}")
@@ -414,7 +417,7 @@ def mean_of_max_per_field(df):
414
 
415
  def barplot_mean_few_minus_zero_shot(dataframe, tasks=None):
416
  if tasks is None:
417
- tasks = [ "NER", "REL", "RML", "DIA", "HIS"]
418
 
419
  task_means = {}
420
 
@@ -489,7 +492,7 @@ def boxplot_per_task(dataframe=None, baselines=None, references=None):
489
  #print(dataframe.columns)
490
 
491
  #tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
492
- tasks =["NER", "REL", "RML", "HIS", "DIA"]
493
  if dataframe is None:
494
  np.random.seed(42)
495
  dataframe = pd.DataFrame({
@@ -810,9 +813,11 @@ TASK_METADATA_GENERATIVE = {
810
 
811
  "NER": {"icon": "🏷️", "name": "Named Entity Recognition", "tooltip": ""},
812
  "REL": {"icon": "🔗", "name": "Relation Extraction", "tooltip": ""},
813
- "RML": {"icon": "😃", "name": "CRF RML", "tooltip": "CRF RML"},
814
- "DIA": {"icon": "🏥", "name": "CRF Diagnosis", "tooltip": "CRF Diagnosis"},
815
- "HIS": {"icon": "📝", "name": "CRF History", "tooltip": "CRF History"},
 
 
816
  }
817
 
818
  def restart_space():
@@ -1075,8 +1080,8 @@ with demo:
1075
 
1076
  leaderboard = init_leaderboard(
1077
  LEADERBOARD_DF,
1078
- default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML", "DIA", "HIS"],
1079
- hidden_columns=[col for col in LEADERBOARD_DF.columns if col not in ['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML", "DIA", "HIS"]]
1080
  )
1081
 
1082
 
@@ -1107,7 +1112,7 @@ with demo:
1107
  with gr.TabItem(f"{metadata['icon']}{task}"):
1108
  task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
1109
  gr.Markdown(task_description, elem_classes="markdown-text1")
1110
- #print (LEADERBOARD_DF)
1111
  leaderboard = update_task_leaderboard(
1112
  LEADERBOARD_DF.rename(columns={f"{task} Prompt Average": "Prompt Average",
1113
  f"{task} Prompt Std": "Prompt Std",
 
52
  - lang in {EN, IT, SL, SK, GR, PL} or None/"All"
53
  - shot in {"0","10"} or None/"All" (mapped to IS_FS False/True)
54
  """
55
+ tasks = ["NER", "REL", "RML-CRF", "HIS-CRF", "DIA-CRF", "NER-PHARMAER"]
56
  df = dataframe.copy()
57
 
58
  if lang and lang != "All" and "LANG" in df.columns:
 
141
  Table with the best overall model per task (NER, REL,) and the model that
142
  achieves the best score with its own best prompt.
143
  """
144
+ tasks = ["NER", "REL", "RML-CRF", "HIS-CRF", "DIA-CRF", "NER-PHARMAER"]
145
  table_data = {'Task': [], 'Best Overall Model': [], 'CPS': [], 'Best Prompt Model': [], 'Acc.': []}
146
 
147
  for task in tasks:
 
216
  - lang: None or one of EN/IT/SL/SK/GR/PL (None means All)
217
  - shot: None or "0"/"10" (None means All) mapped to IS_FS False/True
218
  """
219
+ tasks = ["NER", "REL", "RML-CRF", "HIS-CRF", "DIA-CRF", "NER-PHARMAER"]
220
 
221
  df = dataframe.copy()
222
  # Language filter
 
236
  for task in tasks:
237
  col = f"{task} Best Prompt Id"
238
  if col in df.columns:
239
+ #print (col)
240
+ #print(df[col])
241
  all_ids.update(df[col].dropna().unique())
242
  prompt_ids_raw = sorted(list(all_ids), key=lambda x: int(re.sub(r'[^0-9]', '', str(x)) or 0))
243
  prompt_ids_raw = [pid for pid in prompt_ids_raw if label_for(pid) in {"p1", "p2", "p3"}] or [1, 2, 3]
 
296
  for tasks NER and REL, with exactly 3 prompts (p1, p2, p3). It supports columns storing
297
  ids as integers (1/2/3) or strings ('p1'/'p2'/'p3').
298
  """
299
+ tasks = ["NER", "REL", "RML-CRF", "HIS-CRF", "DIA-CRF", "NER-PHARMAER"]
300
 
301
  # Collect unique prompt ids as they appear (int or 'pX'); restrict to 3 prompts
302
  all_ids = set()
 
397
  float: media dei valori massimi dei campi
398
  """
399
  #fields = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
400
+ fields = ["NER", "REL", "RML-CRF", "DIA-CRF", "HIS-CRF", "NER-PHARMAER"]
401
  #print(df.columns)
402
 
403
  # Controlla che tutte le colonne esistano nel DataFrame
404
+ print(df.columns)
405
  missing = [f for f in fields if f not in df.columns]
406
  if missing:
407
  raise ValueError(f"Le seguenti colonne mancano nel DataFrame: {missing}")
 
417
 
418
  def barplot_mean_few_minus_zero_shot(dataframe, tasks=None):
419
  if tasks is None:
420
+ tasks = [ "NER", "REL", "RML-CRF", "DIA-CRF", "HIS-CRF","NER-PHARMAER"]
421
 
422
  task_means = {}
423
 
 
492
  #print(dataframe.columns)
493
 
494
  #tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
495
+ tasks =["NER", "REL", "RML-CRF", "HIS-CRF", "DIA-CRF" , "NER-PHARMAER"]
496
  if dataframe is None:
497
  np.random.seed(42)
498
  dataframe = pd.DataFrame({
 
813
 
814
  "NER": {"icon": "🏷️", "name": "Named Entity Recognition", "tooltip": ""},
815
  "REL": {"icon": "🔗", "name": "Relation Extraction", "tooltip": ""},
816
+ "RML-CRF": {"icon": "😃", "name": "CRF RML", "tooltip": "CRF RML"},
817
+ "DIA-CRF": {"icon": "🏥", "name": "CRF Diagnosis", "tooltip": "CRF Diagnosis"},
818
+ "HIS-CRF": {"icon": "📝", "name": "CRF History", "tooltip": "CRF History"},
819
+ "NER-PHARMAER": {"icon": "🏷️", "name": "Named Entity Recognition over PharmaER.It Datasets", "tooltip": ""},
820
+
821
  }
822
 
823
  def restart_space():
 
1080
 
1081
  leaderboard = init_leaderboard(
1082
  LEADERBOARD_DF,
1083
+ default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML-CRF", "DIA-CRF", "HIS-CRF", "NER-PHARMAER"],
1084
+ hidden_columns=[col for col in LEADERBOARD_DF.columns if col not in ['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL", "RML-CRF", "DIA-CRF", "HIS-CRF", "NER-PHARMAER"]]
1085
  )
1086
 
1087
 
 
1112
  with gr.TabItem(f"{metadata['icon']}{task}"):
1113
  task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
1114
  gr.Markdown(task_description, elem_classes="markdown-text1")
1115
+ print (task)
1116
  leaderboard = update_task_leaderboard(
1117
  LEADERBOARD_DF.rename(columns={f"{task} Prompt Average": "Prompt Average",
1118
  f"{task} Prompt Std": "Prompt Std",
csv_new2/llm_scores_p1_final.xlsx ADDED
Binary file (33.3 kB). View file
 
csv_new2/llm_scores_p2_final.xlsx ADDED
Binary file (28.7 kB). View file
 
csv_new2/llm_scores_p3_final.xlsx ADDED
Binary file (29.7 kB). View file
 
csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__0shot-checkpoint.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=deepseek-ai/DeepSeek-R1-Distill-Qwen-32B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.2877 | |0 |
5
+ | - p1 | | | |f1 | | 0.1963 | | 0 |
6
+ | - p2 | | | |f1 | | 0.3459 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3208 | | 0 |
8
+ | - RE | | | |f1 | | 0.4430 | |0 |
9
+ | - p1 | | | |f1 | | 0.4487 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4492 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4311 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__10shot-checkpoint.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=deepseek-ai/DeepSeek-R1-Distill-Qwen-32B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.5963 | |0 |
5
+ | - p1 | | | |f1 | | 0.6024 | | 0 |
6
+ | - p2 | | | |f1 | | 0.5929 | | 0 |
7
+ | - p3 | | | |f1 | | 0.5935 | | 0 |
8
+ | - RE | | | |f1 | | 0.5221 | |0 |
9
+ | - p1 | | | |f1 | | 0.5191 | | 0 |
10
+ | - p2 | | | |f1 | | 0.5199 | | 0 |
11
+ | - p3 | | | |f1 | | 0.5273 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.1768 | |0 |
13
+ | - p1 | | | |f1 | | 0.1169 | | 0 |
14
+ | - p2 | | | |f1 | | 0.1503 | | 0 |
15
+ | - p3 | | | |f1 | | 0.2633 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.2339 | |0 |
17
+ | - p1 | | | |f1 | | 0.3117 | | 0 |
18
+ | - p2 | | | |f1 | | 0.2416 | | 0 |
19
+ | - p3 | | | |f1 | | 0.1483 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.4828 | |0 |
21
+ | - p1 | | | |f1 | | 0.3922 | | 0 |
22
+ | - p2 | | | |f1 | | 0.5191 | | 0 |
23
+ | - p3 | | | |f1 | | 0.5371 | | 0 |
csv_new2/output/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__it__0shot-checkpoint.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=deepseek-ai/DeepSeek-R1-Distill-Qwen-32B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3220 | |0 |
5
+ | - p1 | | | |f1 | | 0.2678 | | 0 |
6
+ | - p2 | | | |f1 | | 0.3568 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3414 | | 0 |
8
+ | - RE | | | |f1 | | 0.4452 | |0 |
9
+ | - p1 | | | |f1 | | 0.4519 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4611 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4227 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.4608 | |0 |
25
+ | - p1 | | | |f1 | | 0.5012 | | 0 |
26
+ | - p2 | | | |f1 | | 0.4493 | | 0 |
27
+ | - p3 | | | |f1 | | 0.4319 | | 0 |
csv_new2/output/.ipynb_checkpoints/epfl-llm__meditron-7b__en__0shot-checkpoint.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=epfl-llm/meditron-7b ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0612 | |0 |
5
+ | - p1 | | | |f1 | | 0.0578 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0410 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0848 | | 0 |
8
+ | - RE | | | |f1 | | 0.0313 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0442 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0497 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__en__0shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0918 | |0 |
5
+ | - p1 | | | |f1 | | 0.0629 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1041 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1083 | | 0 |
8
+ | - RE | | | |f1 | | 0.2604 | |0 |
9
+ | - p1 | | | |f1 | | 0.1287 | | 0 |
10
+ | - p2 | | | |f1 | | 0.3394 | | 0 |
11
+ | - p3 | | | |f1 | | 0.3131 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__en__10shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.2142 | |0 |
5
+ | - p1 | | | |f1 | | 0.2189 | | 0 |
6
+ | - p2 | | | |f1 | | 0.2243 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1994 | | 0 |
8
+ | - RE | | | |f1 | | 0.1681 | |0 |
9
+ | - p1 | | | |f1 | | 0.1189 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1668 | | 0 |
11
+ | - p3 | | | |f1 | | 0.2185 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.1779 | |0 |
13
+ | - p1 | | | |f1 | | 0.1825 | | 0 |
14
+ | - p2 | | | |f1 | | 0.1612 | | 0 |
15
+ | - p3 | | | |f1 | | 0.1900 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.1500 | |0 |
17
+ | - p1 | | | |f1 | | 0.2415 | | 0 |
18
+ | - p2 | | | |f1 | | 0.1416 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0668 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0147 | |0 |
21
+ | - p1 | | | |f1 | | 0.0178 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0068 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0194 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__gr__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0611 | |0 |
5
+ | - p1 | | | |f1 | | 0.0620 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0592 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0620 | | 0 |
8
+ | - RE | | | |f1 | | 0.0863 | |0 |
9
+ | - p1 | | | |f1 | | 0.1017 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0506 | | 0 |
11
+ | - p3 | | | |f1 | | 0.1065 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__gr__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1474 | |0 |
5
+ | - p1 | | | |f1 | | 0.1667 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1089 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1667 | | 0 |
8
+ | - RE | | | |f1 | | 0.0970 | |0 |
9
+ | - p1 | | | |f1 | | 0.0821 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1053 | | 0 |
11
+ | - p3 | | | |f1 | | 0.1036 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__it__0shot.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0416 | |0 |
5
+ | - p1 | | | |f1 | | 0.0435 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0429 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0384 | | 0 |
8
+ | - RE | | | |f1 | | 0.1413 | |0 |
9
+ | - p1 | | | |f1 | | 0.0672 | | 0 |
10
+ | - p2 | | | |f1 | | 0.2266 | | 0 |
11
+ | - p3 | | | |f1 | | 0.1300 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.1786 | |0 |
25
+ | - p1 | | | |f1 | | 0.1702 | | 0 |
26
+ | - p2 | | | |f1 | | 0.2001 | | 0 |
27
+ | - p3 | | | |f1 | | 0.1657 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__it__10shot.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3753 | |0 |
5
+ | - p1 | | | |f1 | | 0.3299 | | 0 |
6
+ | - p2 | | | |f1 | | 0.4023 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3938 | | 0 |
8
+ | - RE | | | |f1 | | 0.1331 | |0 |
9
+ | - p1 | | | |f1 | | 0.0977 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1226 | | 0 |
11
+ | - p3 | | | |f1 | | 0.1789 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.1044 | |0 |
17
+ | - p1 | | | |f1 | | 0.0821 | | 0 |
18
+ | - p2 | | | |f1 | | 0.1119 | | 0 |
19
+ | - p3 | | | |f1 | | 0.1190 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0007 | |0 |
21
+ | - p1 | | | |f1 | | 0.0010 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0002 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0008 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.3769 | |0 |
25
+ | - p1 | | | |f1 | | 0.3616 | | 0 |
26
+ | - p2 | | | |f1 | | 0.3881 | | 0 |
27
+ | - p3 | | | |f1 | | 0.3812 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__pl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0379 | |0 |
5
+ | - p1 | | | |f1 | | 0.0379 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0378 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0379 | | 0 |
8
+ | - RE | | | |f1 | | 0.0891 | |0 |
9
+ | - p1 | | | |f1 | | 0.0602 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1293 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0778 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__pl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3966 | |0 |
5
+ | - p1 | | | |f1 | | 0.3992 | | 0 |
6
+ | - p2 | | | |f1 | | 0.3916 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3992 | | 0 |
8
+ | - RE | | | |f1 | | 0.1003 | |0 |
9
+ | - p1 | | | |f1 | | 0.0998 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1055 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0956 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__sk__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0385 | |0 |
5
+ | - p1 | | | |f1 | | 0.0387 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0380 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0387 | | 0 |
8
+ | - RE | | | |f1 | | 0.0174 | |0 |
9
+ | - p1 | | | |f1 | | 0.0121 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0280 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0121 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__sk__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3507 | |0 |
5
+ | - p1 | | | |f1 | | 0.3444 | | 0 |
6
+ | - p2 | | | |f1 | | 0.3632 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3444 | | 0 |
8
+ | - RE | | | |f1 | | 0.0884 | |0 |
9
+ | - p1 | | | |f1 | | 0.0734 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1045 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0875 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__sl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0438 | |0 |
5
+ | - p1 | | | |f1 | | 0.0429 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0456 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0429 | | 0 |
8
+ | - RE | | | |f1 | | 0.1278 | |0 |
9
+ | - p1 | | | |f1 | | 0.0967 | | 0 |
10
+ | - p2 | | | |f1 | | 0.1900 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0967 | | 0 |
csv_new2/output/Henrychur__MMed-Llama-3-8B__sl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Henrychur/MMed-Llama-3-8B ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3720 | |0 |
5
+ | - p1 | | | |f1 | | 0.3558 | | 0 |
6
+ | - p2 | | | |f1 | | 0.4045 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3558 | | 0 |
8
+ | - RE | | | |f1 | | 0.0762 | |0 |
9
+ | - p1 | | | |f1 | | 0.0787 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0781 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0719 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__en__0shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0578 | |0 |
5
+ | - p1 | | | |f1 | | 0.0940 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0331 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0464 | | 0 |
8
+ | - RE | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__en__10shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1317 | |0 |
5
+ | - p1 | | | |f1 | | 0.1215 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1415 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1322 | | 0 |
8
+ | - RE | | | |f1 | | 0.0031 | |0 |
9
+ | - p1 | | | |f1 | | 0.0028 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0016 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0049 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__gr__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0769 | |0 |
5
+ | - p1 | | | |f1 | | 0.0859 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0591 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0859 | | 0 |
8
+ | - RE | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__gr__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1448 | |0 |
5
+ | - p1 | | | |f1 | | 0.1455 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1434 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1455 | | 0 |
8
+ | - RE | | | |f1 | | 0.0010 | |0 |
9
+ | - p1 | | | |f1 | | 0.0024 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0007 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__it__0shot.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0812 | |0 |
5
+ | - p1 | | | |f1 | | 0.0770 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0920 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0747 | | 0 |
8
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
12
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - NER-PHARMAER | | | |f1 | | 0.0429 | |0 |
21
+ | - p1 | | | |f1 | | 0.0762 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0270 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0255 | | 0 |
24
+ | - RE | | | |f1 | | 0.0000 | |0 |
25
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
26
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__it__10shot.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1694 | |0 |
5
+ | - p1 | | | |f1 | | 0.1616 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1774 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1690 | | 0 |
8
+ | - RE | | | |f1 | | 0.0048 | |0 |
9
+ | - p1 | | | |f1 | | 0.0035 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0064 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0046 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.1917 | |0 |
25
+ | - p1 | | | |f1 | | 0.1647 | | 0 |
26
+ | - p2 | | | |f1 | | 0.2071 | | 0 |
27
+ | - p3 | | | |f1 | | 0.2032 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__pl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0308 | |0 |
5
+ | - p1 | | | |f1 | | 0.0244 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0436 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0244 | | 0 |
8
+ | - RE | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__pl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1516 | |0 |
5
+ | - p1 | | | |f1 | | 0.1500 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1548 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1500 | | 0 |
8
+ | - RE | | | |f1 | | 0.0032 | |0 |
9
+ | - p1 | | | |f1 | | 0.0040 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0023 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0034 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__sk__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0712 | |0 |
5
+ | - p1 | | | |f1 | | 0.0880 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0375 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0880 | | 0 |
8
+ | - RE | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__sk__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1444 | |0 |
5
+ | - p1 | | | |f1 | | 0.1485 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1360 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1485 | | 0 |
8
+ | - RE | | | |f1 | | 0.0027 | |0 |
9
+ | - p1 | | | |f1 | | 0.0038 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0024 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0020 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__sl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0711 | |0 |
5
+ | - p1 | | | |f1 | | 0.0777 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0579 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0777 | | 0 |
8
+ | - RE | | | |f1 | | 0.0000 | |0 |
9
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/HiTZ__Medical-mT5-large__sl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=HiTZ/Medical-mT5-large ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1422 | |0 |
5
+ | - p1 | | | |f1 | | 0.1470 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1325 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1470 | | 0 |
8
+ | - RE | | | |f1 | | 0.0080 | |0 |
9
+ | - p1 | | | |f1 | | 0.0073 | | 0 |
10
+ | - p2 | | | |f1 | | 0.0074 | | 0 |
11
+ | - p3 | | | |f1 | | 0.0093 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__en__0shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.2500 | |0 |
5
+ | - p1 | | | |f1 | | 0.3425 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1181 | | 0 |
7
+ | - p3 | | | |f1 | | 0.2893 | | 0 |
8
+ | - RE | | | |f1 | | 0.4075 | |0 |
9
+ | - p1 | | | |f1 | | 0.4135 | | 0 |
10
+ | - p2 | | | |f1 | | 0.3917 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4172 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0000 | |0 |
13
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0001 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0002 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__en__10shot.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.5993 | |0 |
5
+ | - p1 | | | |f1 | | 0.6091 | | 0 |
6
+ | - p2 | | | |f1 | | 0.5646 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6243 | | 0 |
8
+ | - RE | | | |f1 | | 0.6164 | |0 |
9
+ | - p1 | | | |f1 | | 0.6332 | | 0 |
10
+ | - p2 | | | |f1 | | 0.6025 | | 0 |
11
+ | - p3 | | | |f1 | | 0.6133 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.2843 | |0 |
13
+ | - p1 | | | |f1 | | 0.2129 | | 0 |
14
+ | - p2 | | | |f1 | | 0.3222 | | 0 |
15
+ | - p3 | | | |f1 | | 0.3178 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.1658 | |0 |
17
+ | - p1 | | | |f1 | | 0.3073 | | 0 |
18
+ | - p2 | | | |f1 | | 0.1137 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0764 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.2370 | |0 |
21
+ | - p1 | | | |f1 | | 0.1244 | | 0 |
22
+ | - p2 | | | |f1 | | 0.4429 | | 0 |
23
+ | - p3 | | | |f1 | | 0.1437 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__gr__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.1290 | |0 |
5
+ | - p1 | | | |f1 | | 0.1339 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1191 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1339 | | 0 |
8
+ | - RE | | | |f1 | | 0.3957 | |0 |
9
+ | - p1 | | | |f1 | | 0.3796 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4266 | | 0 |
11
+ | - p3 | | | |f1 | | 0.3810 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__gr__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.6028 | |0 |
5
+ | - p1 | | | |f1 | | 0.6119 | | 0 |
6
+ | - p2 | | | |f1 | | 0.5847 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6119 | | 0 |
8
+ | - RE | | | |f1 | | 0.6056 | |0 |
9
+ | - p1 | | | |f1 | | 0.5962 | | 0 |
10
+ | - p2 | | | |f1 | | 0.6024 | | 0 |
11
+ | - p3 | | | |f1 | | 0.6183 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__it__0shot.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.2137 | |0 |
5
+ | - p1 | | | |f1 | | 0.2467 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1709 | | 0 |
7
+ | - p3 | | | |f1 | | 0.2234 | | 0 |
8
+ | - RE | | | |f1 | | 0.4016 | |0 |
9
+ | - p1 | | | |f1 | | 0.4173 | | 0 |
10
+ | - p2 | | | |f1 | | 0.3770 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4106 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0002 | |0 |
13
+ | - p1 | | | |f1 | | 0.0007 | | 0 |
14
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.0000 | |0 |
17
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
18
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
21
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
22
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
23
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.1067 | |0 |
25
+ | - p1 | | | |f1 | | 0.0844 | | 0 |
26
+ | - p2 | | | |f1 | | 0.0724 | | 0 |
27
+ | - p3 | | | |f1 | | 0.1635 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__it__10shot.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.6569 | |0 |
5
+ | - p1 | | | |f1 | | 0.6719 | | 0 |
6
+ | - p2 | | | |f1 | | 0.6327 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6661 | | 0 |
8
+ | - RE | | | |f1 | | 0.5952 | |0 |
9
+ | - p1 | | | |f1 | | 0.5767 | | 0 |
10
+ | - p2 | | | |f1 | | 0.5998 | | 0 |
11
+ | - p3 | | | |f1 | | 0.6093 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.1557 | |0 |
13
+ | - p1 | | | |f1 | | 0.1111 | | 0 |
14
+ | - p2 | | | |f1 | | 0.1599 | | 0 |
15
+ | - p3 | | | |f1 | | 0.1960 | | 0 |
16
+ | - DIA-CRF | | | |f1 | | 0.2496 | |0 |
17
+ | - p1 | | | |f1 | | 0.4407 | | 0 |
18
+ | - p2 | | | |f1 | | 0.1328 | | 0 |
19
+ | - p3 | | | |f1 | | 0.1753 | | 0 |
20
+ | - HIS-CRF | | | |f1 | | 0.2339 | |0 |
21
+ | - p1 | | | |f1 | | 0.0817 | | 0 |
22
+ | - p2 | | | |f1 | | 0.5103 | | 0 |
23
+ | - p3 | | | |f1 | | 0.1096 | | 0 |
24
+ | - NER-PHARMAER | | | |f1 | | 0.6282 | |0 |
25
+ | - p1 | | | |f1 | | 0.6312 | | 0 |
26
+ | - p2 | | | |f1 | | 0.6199 | | 0 |
27
+ | - p3 | | | |f1 | | 0.6337 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__pl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0586 | |0 |
5
+ | - p1 | | | |f1 | | 0.0697 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0364 | | 0 |
7
+ | - p3 | | | |f1 | | 0.0697 | | 0 |
8
+ | - RE | | | |f1 | | 0.4022 | |0 |
9
+ | - p1 | | | |f1 | | 0.3803 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4464 | | 0 |
11
+ | - p3 | | | |f1 | | 0.3800 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__pl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.6092 | |0 |
5
+ | - p1 | | | |f1 | | 0.6226 | | 0 |
6
+ | - p2 | | | |f1 | | 0.5824 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6226 | | 0 |
8
+ | - RE | | | |f1 | | 0.5944 | |0 |
9
+ | - p1 | | | |f1 | | 0.5991 | | 0 |
10
+ | - p2 | | | |f1 | | 0.5466 | | 0 |
11
+ | - p3 | | | |f1 | | 0.6375 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sk__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.0955 | |0 |
5
+ | - p1 | | | |f1 | | 0.1220 | | 0 |
6
+ | - p2 | | | |f1 | | 0.0426 | | 0 |
7
+ | - p3 | | | |f1 | | 0.1220 | | 0 |
8
+ | - RE | | | |f1 | | 0.4116 | |0 |
9
+ | - p1 | | | |f1 | | 0.4027 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4294 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4027 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sk__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.6419 | |0 |
5
+ | - p1 | | | |f1 | | 0.6386 | | 0 |
6
+ | - p2 | | | |f1 | | 0.6486 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6386 | | 0 |
8
+ | - RE | | | |f1 | | 0.5899 | |0 |
9
+ | - p1 | | | |f1 | | 0.5894 | | 0 |
10
+ | - p2 | | | |f1 | | 0.5845 | | 0 |
11
+ | - p3 | | | |f1 | | 0.5959 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sl__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3398 | |0 |
5
+ | - p1 | | | |f1 | | 0.3910 | | 0 |
6
+ | - p2 | | | |f1 | | 0.2375 | | 0 |
7
+ | - p3 | | | |f1 | | 0.3910 | | 0 |
8
+ | - RE | | | |f1 | | 0.3777 | |0 |
9
+ | - p1 | | | |f1 | | 0.3775 | | 0 |
10
+ | - p2 | | | |f1 | | 0.3783 | | 0 |
11
+ | - p3 | | | |f1 | | 0.3775 | | 0 |
csv_new2/output/Qwen__Qwen2.5-14B-Instruct-1M__sl__10shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-14B-Instruct-1M ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.6371 | |0 |
5
+ | - p1 | | | |f1 | | 0.6467 | | 0 |
6
+ | - p2 | | | |f1 | | 0.6178 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6467 | | 0 |
8
+ | - RE | | | |f1 | | 0.5837 | |0 |
9
+ | - p1 | | | |f1 | | 0.5949 | | 0 |
10
+ | - p2 | | | |f1 | | 0.5782 | | 0 |
11
+ | - p3 | | | |f1 | | 0.5781 | | 0 |
csv_new2/output/Qwen__Qwen2.5-32B-Instruct__en__0shot.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-32B-Instruct ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.3279 | |0 |
5
+ | - p1 | | | |f1 | | 0.3804 | | 0 |
6
+ | - p2 | | | |f1 | | 0.3068 | | 0 |
7
+ | - p3 | | | |f1 | | 0.2964 | | 0 |
8
+ | - RE | | | |f1 | | 0.4658 | |0 |
9
+ | - p1 | | | |f1 | | 0.4734 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4649 | | 0 |
11
+ | - p3 | | | |f1 | | 0.4591 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0015 | |0 |
13
+ | - p1 | | | |f1 | | 0.0005 | | 0 |
14
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p2 | | | |f1 | | 0.0057 | | 0 |
16
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
17
+ | - DIA-CRF | | | |f1 | | 0.0002 | |0 |
18
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
19
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
20
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
21
+ | - p3 | | | |f1 | | 0.0006 | | 0 |
22
+ | - HIS-CRF | | | |f1 | | 0.0000 | |0 |
23
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
24
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
25
+ | - p3 | | | |f1 | | 0.0000 | | 0 |
csv_new2/output/Qwen__Qwen2.5-32B-Instruct__en__10shot.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-32B-Instruct ), num_fewshot: 10, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.5895 | |0 |
5
+ | - p1 | | | |f1 | | 0.5970 | | 0 |
6
+ | - p2 | | | |f1 | | 0.5602 | | 0 |
7
+ | - p3 | | | |f1 | | 0.6113 | | 0 |
8
+ | - RE | | | |f1 | | 0.6440 | |0 |
9
+ | - p1 | | | |f1 | | 0.6482 | | 0 |
10
+ | - p2 | | | |f1 | | 0.6469 | | 0 |
11
+ | - p3 | | | |f1 | | 0.6370 | | 0 |
12
+ | - RML-CRF | | | |f1 | | 0.0931 | |0 |
13
+ | - p1 | | | |f1 | | 0.1501 | | 0 |
14
+ | - p1 | | | |f1 | | 0.0000 | | 0 |
15
+ | - p2 | | | |f1 | | 0.1383 | | 0 |
16
+ | - p3 | | | |f1 | | 0.0839 | | 0 |
17
+ | - DIA-CRF | | | |f1 | | 0.0286 | |0 |
18
+ | - p1 | | | |f1 | | 0.0311 | | 0 |
19
+ | - p2 | | | |f1 | | 0.0000 | | 0 |
20
+ | - p3 | | | |f1 | | 0.0546 | | 0 |
21
+ | - HIS-CRF | | | |f1 | | 0.0659 | |0 |
22
+ | - p1 | | | |f1 | | 0.0247 | | 0 |
23
+ | - p2 | | | |f1 | | 0.1557 | | 0 |
24
+ | - p3 | | | |f1 | | 0.0174 | | 0 |
csv_new2/output/Qwen__Qwen2.5-32B-Instruct__gr__0shot.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hf (pretrained=Qwen/Qwen2.5-32B-Instruct ), num_fewshot: 0, batch_size: 1
2
+ |Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
3
+ |-------|-------|------|------|------|----|------|---|------|
4
+ | - NER | | | |f1 | | 0.4506 | |0 |
5
+ | - p1 | | | |f1 | | 0.5976 | | 0 |
6
+ | - p2 | | | |f1 | | 0.1568 | | 0 |
7
+ | - p3 | | | |f1 | | 0.5976 | | 0 |
8
+ | - RE | | | |f1 | | 0.4104 | |0 |
9
+ | - p1 | | | |f1 | | 0.4393 | | 0 |
10
+ | - p2 | | | |f1 | | 0.4083 | | 0 |
11
+ | - p3 | | | |f1 | | 0.3834 | | 0 |