Initial clone with modifications
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- Gen_llm_eval_output.py +117 -0
- Makefile +13 -0
- app.py +1144 -0
- app_17_10_2025.py +815 -0
- csv_files/llm_scores_p1.xlsx +0 -0
- csv_files/llm_scores_p2.xlsx +0 -0
- csv_files/llm_scores_p3.xlsx +0 -0
- csv_files/outputs/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__0shot-checkpoint.txt +11 -0
- csv_files/outputs/.ipynb_checkpoints/epfl-llm__meditron-7b__it__10shot-checkpoint.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__en__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__en__10shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__gr__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__gr__10shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__it__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__it__10shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__pl__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__pl__10shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__sk__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__sk__10shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__sl__0shot.txt +11 -0
- csv_files/outputs/Henrychur__MMed-Llama-3-8B__sl__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__en__0shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__en__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__gr__0shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__gr__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__it__0shot.txt +10 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__it__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__pl__0shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__pl__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__sk__0shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__sk__10shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__sl__0shot.txt +11 -0
- csv_files/outputs/HiTZ__Medical-mT5-large__sl__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__en__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__en__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__gr__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__gr__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__it__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__it__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__pl__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__pl__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__sk__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__sk__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__sl__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__sl__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__en__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__en__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__gr__0shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__gr__10shot.txt +11 -0
- csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__it__0shot.txt +11 -0
Gen_llm_eval_output.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()
|
Makefile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.PHONY: style format
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
style:
|
| 5 |
+
python -m black --line-length 119 .
|
| 6 |
+
python -m isort .
|
| 7 |
+
ruff check --fix .
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
quality:
|
| 11 |
+
python -m black --check --line-length 119 .
|
| 12 |
+
python -m isort --check-only .
|
| 13 |
+
ruff check .
|
app.py
ADDED
|
@@ -0,0 +1,1144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|
app_17_10_2025.py
ADDED
|
@@ -0,0 +1,815 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
def mean_of_max_per_field(df):
|
| 22 |
+
"""
|
| 23 |
+
Calcola il massimo per ciascun campo e poi la media dei massimi.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
df (pd.DataFrame): DataFrame con colonne TE, SA, HS, AT, WIC, FAQ, LS, SU, NER, REL
|
| 27 |
+
|
| 28 |
+
Returns:
|
| 29 |
+
float: media dei valori massimi dei campi
|
| 30 |
+
"""
|
| 31 |
+
#fields = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
|
| 32 |
+
fields = ["NER", "REL"]
|
| 33 |
+
#print(df.columns)
|
| 34 |
+
|
| 35 |
+
# Controlla che tutte le colonne esistano nel DataFrame
|
| 36 |
+
missing = [f for f in fields if f not in df.columns]
|
| 37 |
+
if missing:
|
| 38 |
+
raise ValueError(f"Le seguenti colonne mancano nel DataFrame: {missing}")
|
| 39 |
+
|
| 40 |
+
# Calcola il massimo per ciascun campo
|
| 41 |
+
max_values = df[fields].max()
|
| 42 |
+
|
| 43 |
+
# Calcola la media dei massimi
|
| 44 |
+
mean_max = max_values.mean()
|
| 45 |
+
|
| 46 |
+
return mean_max
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def barplot_mean_few_minus_zero_shot(dataframe, tasks=None):
|
| 50 |
+
if tasks is None:
|
| 51 |
+
tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
|
| 52 |
+
|
| 53 |
+
task_means = {}
|
| 54 |
+
|
| 55 |
+
for task in tasks:
|
| 56 |
+
if task not in dataframe.columns:
|
| 57 |
+
continue
|
| 58 |
+
|
| 59 |
+
# Separa few-shot e zero-shot
|
| 60 |
+
few_shot = dataframe[dataframe['IS_FS'] == True][["Model", task]]
|
| 61 |
+
zero_shot = dataframe[dataframe['IS_FS'] == False][["Model", task]]
|
| 62 |
+
|
| 63 |
+
# Allinea i modelli
|
| 64 |
+
merged = pd.merge(few_shot, zero_shot, on="Model", suffixes=("_few", "_zero"))
|
| 65 |
+
|
| 66 |
+
# Rimuovi righe con valori mancanti
|
| 67 |
+
merged = merged.dropna(subset=[f"{task}_few", f"{task}_zero"])
|
| 68 |
+
|
| 69 |
+
if merged.empty:
|
| 70 |
+
continue
|
| 71 |
+
|
| 72 |
+
# Calcola differenza few - zero
|
| 73 |
+
diff = merged[f"{task}_few"] - merged[f"{task}_zero"]
|
| 74 |
+
|
| 75 |
+
# Calcola la media
|
| 76 |
+
task_means[task] = diff.mean()
|
| 77 |
+
|
| 78 |
+
# Crea barplot
|
| 79 |
+
fig = go.Figure([go.Bar(
|
| 80 |
+
x=list(task_means.keys()),
|
| 81 |
+
y=list(task_means.values()),
|
| 82 |
+
marker_color="#ff7f0e",
|
| 83 |
+
text=[f"{v:.2f}" for v in task_means.values()],
|
| 84 |
+
textposition="outside",
|
| 85 |
+
hovertemplate="<b>%{x}</b><br>Mean Delta Accuracy: %{y:.2f}%<extra></extra>"
|
| 86 |
+
)])
|
| 87 |
+
|
| 88 |
+
# Linea di riferimento a 0
|
| 89 |
+
'''
|
| 90 |
+
fig.add_shape(
|
| 91 |
+
type="line",
|
| 92 |
+
x0=-0.5, x1=len(task_means) - 0.5,
|
| 93 |
+
y0=0, y1=0,
|
| 94 |
+
line=dict(color="black", width=2, dash="dash"),
|
| 95 |
+
xref="x", yref="y"
|
| 96 |
+
)
|
| 97 |
+
'''
|
| 98 |
+
|
| 99 |
+
fig.update_layout(
|
| 100 |
+
title="Mean Accuracy Difference (Few-shot − Zero-shot) per Task",
|
| 101 |
+
xaxis_title="",
|
| 102 |
+
yaxis_title="Mean Delta Combined Performance",
|
| 103 |
+
template="plotly_white",
|
| 104 |
+
font=dict(family="Arial", size=13),
|
| 105 |
+
#margin=dict(b=100)
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
fig.add_annotation(
|
| 109 |
+
text="10-shot learning generally outperforms zero-shot. <br>"
|
| 110 |
+
"",
|
| 111 |
+
xref="paper", yref="paper",
|
| 112 |
+
x=0, y=-0.2,
|
| 113 |
+
showarrow=False,
|
| 114 |
+
font=dict(size=11, color="gray"),
|
| 115 |
+
align="left"
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
return fig
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
def boxplot_per_task(dataframe=None, baselines=None, references=None):
|
| 122 |
+
|
| 123 |
+
#print(dataframe.columns)
|
| 124 |
+
|
| 125 |
+
#tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
|
| 126 |
+
tasks =["NER", "REL"]
|
| 127 |
+
if dataframe is None:
|
| 128 |
+
np.random.seed(42)
|
| 129 |
+
dataframe = pd.DataFrame({
|
| 130 |
+
task: np.random.uniform(0.4, 0.9, 20) * 100
|
| 131 |
+
for task in tasks
|
| 132 |
+
})
|
| 133 |
+
|
| 134 |
+
if baselines is None:
|
| 135 |
+
baselines = {task: np.random.randint(50, 70) for task in tasks}
|
| 136 |
+
|
| 137 |
+
colors = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
|
| 138 |
+
"#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]
|
| 139 |
+
|
| 140 |
+
fig = go.Figure()
|
| 141 |
+
|
| 142 |
+
for i, task in enumerate(tasks):
|
| 143 |
+
if task in dataframe.columns:
|
| 144 |
+
y_data = dataframe[task].dropna().tolist()
|
| 145 |
+
|
| 146 |
+
# boxplot
|
| 147 |
+
fig.add_trace(go.Box(
|
| 148 |
+
y=y_data,
|
| 149 |
+
name=task,
|
| 150 |
+
marker=dict(color=colors[i]),
|
| 151 |
+
line=dict(color="black", width=2),
|
| 152 |
+
fillcolor=colors[i],
|
| 153 |
+
opacity=0.7,
|
| 154 |
+
hovertemplate="<b>"+task+"</b><br>Accuracy: %{y:.2f}%<extra></extra>",
|
| 155 |
+
width=0.6,
|
| 156 |
+
whiskerwidth=0.2,
|
| 157 |
+
quartilemethod="linear"
|
| 158 |
+
))
|
| 159 |
+
|
| 160 |
+
# baseline
|
| 161 |
+
if task in baselines and baselines[task] is not None:
|
| 162 |
+
fig.add_shape(
|
| 163 |
+
type="line",
|
| 164 |
+
x0=i - 0.3, x1=i + 0.3,
|
| 165 |
+
y0=baselines[task], y1=baselines[task],
|
| 166 |
+
line=dict(color="black", width=2, dash="dot"), # più visibile
|
| 167 |
+
xref="x", yref="y"
|
| 168 |
+
)
|
| 169 |
+
'''
|
| 170 |
+
fig.add_annotation(
|
| 171 |
+
x=i, y=baselines[task],
|
| 172 |
+
text=f"{baselines[task]}%",
|
| 173 |
+
showarrow=False,
|
| 174 |
+
yshift=10,
|
| 175 |
+
font=dict(size=10, color="black")
|
| 176 |
+
)
|
| 177 |
+
'''
|
| 178 |
+
|
| 179 |
+
# reference GPT-4o
|
| 180 |
+
if task in references and references[task] is not None:
|
| 181 |
+
fig.add_shape(
|
| 182 |
+
type="line",
|
| 183 |
+
x0=i - 0.3, x1=i + 0.3,
|
| 184 |
+
y0=references[task], y1=references[task],
|
| 185 |
+
line=dict(color="red", width=2, dash="dashdot"),
|
| 186 |
+
xref="x", yref="y"
|
| 187 |
+
)
|
| 188 |
+
|
| 189 |
+
fig.update_layout(
|
| 190 |
+
title="Distribution of Model Accuracy by Task",
|
| 191 |
+
xaxis_title="Task",
|
| 192 |
+
yaxis_title="Combined Performance",
|
| 193 |
+
template="plotly_white",
|
| 194 |
+
boxmode="group",
|
| 195 |
+
dragmode=False,
|
| 196 |
+
font=dict(family="Arial", size=10),
|
| 197 |
+
margin=dict(b=80),
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
fig.add_annotation(
|
| 201 |
+
text=(""
|
| 202 |
+
#"In tasks like TE and SA, models approach the accuracy of supervised <br>"
|
| 203 |
+
#"models at EVALITA (dashed black line); in NER and REL they remain lower. <br>"
|
| 204 |
+
# "Dashed red lines show GPT-4o reference results for generative tasks."
|
| 205 |
+
),
|
| 206 |
+
xref="paper", yref="paper",
|
| 207 |
+
x=0.5, y=-0.30,
|
| 208 |
+
showarrow=False,
|
| 209 |
+
font=dict(size=11, color="gray"),
|
| 210 |
+
align="left"
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
fig.update_yaxes(range=[0, 100], fixedrange=True)
|
| 214 |
+
|
| 215 |
+
return fig
|
| 216 |
+
|
| 217 |
+
# EVALITA results
|
| 218 |
+
BASELINES = {
|
| 219 |
+
"TE":71.00, "SA": 66.38, "HS": 80.88, "AT": 82.40, "WIC": 85.00,
|
| 220 |
+
"LS": 38.82, "SU": 38.91, "NER":88.00, "REL": 62.99
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
# GPT-4o
|
| 224 |
+
REFERENCES = {
|
| 225 |
+
"NER": 79.11,
|
| 226 |
+
"REL": 63.32,
|
| 227 |
+
"LS": 59.25,
|
| 228 |
+
"SU": 33.04
|
| 229 |
+
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
def boxplot_prompts_per_task(dataframe, tasks=None):
|
| 234 |
+
if tasks is None:
|
| 235 |
+
tasks = ["TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"]
|
| 236 |
+
|
| 237 |
+
# Lista delle colonne da aggiornare
|
| 238 |
+
cols_to_update = ["REL Best Prompt Id", "NER Best Prompt Id", "SU Best Prompt Id", "LS Best Prompt Id"]
|
| 239 |
+
# Applichiamo la trasformazione
|
| 240 |
+
for col in cols_to_update:
|
| 241 |
+
dataframe[col] = dataframe[col].replace({1: 7, 2: 8})
|
| 242 |
+
|
| 243 |
+
fig = go.Figure()
|
| 244 |
+
|
| 245 |
+
# Liste per creare una sola voce in legenda per Average e Best
|
| 246 |
+
avg_x, avg_y = [], []
|
| 247 |
+
best_x, best_y, best_text = [], [], []
|
| 248 |
+
|
| 249 |
+
for task in tasks:
|
| 250 |
+
avg_col = f"{task} Prompt Average"
|
| 251 |
+
best_col = f"{task} Best Prompt"
|
| 252 |
+
best_id_col = f"{task} Best Prompt Id"
|
| 253 |
+
|
| 254 |
+
if all(col in dataframe.columns for col in [avg_col, best_col, best_id_col]):
|
| 255 |
+
avg_value = dataframe[avg_col].mean()
|
| 256 |
+
avg_x.append(task)
|
| 257 |
+
avg_y.append(avg_value)
|
| 258 |
+
|
| 259 |
+
best_value = dataframe[best_col].mean()
|
| 260 |
+
best_x.append(task)
|
| 261 |
+
best_y.append(best_value)
|
| 262 |
+
best_id = dataframe[best_id_col].mode()[0] # Most frequent best prompt id
|
| 263 |
+
best_text.append(f"P:{best_id}")
|
| 264 |
+
|
| 265 |
+
# Barre Average Accuracy (azzurro)
|
| 266 |
+
fig.add_trace(go.Bar(
|
| 267 |
+
x=avg_x,
|
| 268 |
+
y=avg_y,
|
| 269 |
+
name="Avg. Accuracy",
|
| 270 |
+
marker_color="#1f77b4",
|
| 271 |
+
#hovertemplate="%{y:.2f}%<extra></extra>"
|
| 272 |
+
#hovertemplate="<b>" + task + "</b><br>Accuracy: %{y:.2f}%<extra></extra>",
|
| 273 |
+
))
|
| 274 |
+
|
| 275 |
+
# Barre Best Prompt (rosso)
|
| 276 |
+
fig.add_trace(go.Bar(
|
| 277 |
+
x=best_x,
|
| 278 |
+
y=best_y,
|
| 279 |
+
name="Best Prompt",
|
| 280 |
+
marker_color="#d62728",
|
| 281 |
+
#hovertemplate="%{y:.2f}%<extra></extra>"
|
| 282 |
+
#hovertemplate = "<b>" + task + "</b><br>Accuracy: %{y:.2f}%<extra></extra>",
|
| 283 |
+
))
|
| 284 |
+
|
| 285 |
+
# Testo sopra barre Best Prompt con ID
|
| 286 |
+
for x, y, text in zip(best_x, best_y, best_text):
|
| 287 |
+
fig.add_annotation(
|
| 288 |
+
x=x,
|
| 289 |
+
y=y + 3, # leggermente sopra la barra
|
| 290 |
+
text=text,
|
| 291 |
+
showarrow=False,
|
| 292 |
+
font=dict(size=12, color="black")
|
| 293 |
+
)
|
| 294 |
+
|
| 295 |
+
fig.update_layout(
|
| 296 |
+
title= "Prompt Accuracy: Avg vs Best",
|
| 297 |
+
xaxis_title="Task",
|
| 298 |
+
yaxis_title="Combined Performance",
|
| 299 |
+
barmode='group',
|
| 300 |
+
template="plotly_white",
|
| 301 |
+
font=dict(family="Arial", size=10),
|
| 302 |
+
yaxis=dict(range=[0, 100], fixedrange=True)
|
| 303 |
+
)
|
| 304 |
+
|
| 305 |
+
# caption come annotazione separata
|
| 306 |
+
fig.add_annotation(
|
| 307 |
+
text="There is no single prompt that performs best across all tasks.<br>"
|
| 308 |
+
"Different prompts achieve the highest accuracy on different tasks.",
|
| 309 |
+
xref="paper", yref="paper",
|
| 310 |
+
x=0.5, y=-0.3,
|
| 311 |
+
showarrow=False,
|
| 312 |
+
font=dict(size=11, color="gray"),
|
| 313 |
+
align="center",
|
| 314 |
+
xanchor="center"
|
| 315 |
+
)
|
| 316 |
+
|
| 317 |
+
return fig
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
def line_chart(dataframe):
|
| 321 |
+
|
| 322 |
+
# Normalizza le dimensioni per avere marker non troppo piccoli né enormi
|
| 323 |
+
def scale_sizes(values, min_size=8, max_size=30):
|
| 324 |
+
vmin, vmax = min(values), max(values)
|
| 325 |
+
return [
|
| 326 |
+
min_size + (val - vmin) / (vmax - vmin) * (max_size - min_size) if vmax > vmin else (min_size + max_size) / 2
|
| 327 |
+
for val in values
|
| 328 |
+
]
|
| 329 |
+
|
| 330 |
+
# dati in base a IS_FS
|
| 331 |
+
df_true = dataframe[dataframe['IS_FS'] == True]
|
| 332 |
+
df_false = dataframe[dataframe['IS_FS'] == False]
|
| 333 |
+
|
| 334 |
+
# Estrai valori x, y e labels
|
| 335 |
+
x_true = df_true['#Params (B)'].tolist()
|
| 336 |
+
y_true = df_true['Avg. Comb. Perf. ⬆️'].tolist()
|
| 337 |
+
labels_true = [re.search(r'>([^<]+)<', m).group(1) for m in df_true['Model'].tolist()]
|
| 338 |
+
|
| 339 |
+
x_false = df_false['#Params (B)'].tolist()
|
| 340 |
+
y_false = df_false['Avg. Comb. Perf. ⬆️'].tolist()
|
| 341 |
+
labels_false = [re.search(r'>([^<]+)<', m).group(1) for m in df_false['Model'].tolist()]
|
| 342 |
+
|
| 343 |
+
fig = go.Figure()
|
| 344 |
+
|
| 345 |
+
# Punti IS_FS=True
|
| 346 |
+
fig.add_trace(go.Scatter(
|
| 347 |
+
x=x_true,
|
| 348 |
+
y=y_true,
|
| 349 |
+
mode='markers',
|
| 350 |
+
name='10-Shot',
|
| 351 |
+
marker=dict(
|
| 352 |
+
color='blue',
|
| 353 |
+
size=scale_sizes(x_true)
|
| 354 |
+
),
|
| 355 |
+
hovertemplate='<b>%{customdata}</b><br>#Params: %{x}<br>Performance: %{y}<extra></extra>',
|
| 356 |
+
customdata=labels_true
|
| 357 |
+
))
|
| 358 |
+
|
| 359 |
+
# Punti IS_FS=False
|
| 360 |
+
fig.add_trace(go.Scatter(
|
| 361 |
+
x=x_false,
|
| 362 |
+
y=y_false,
|
| 363 |
+
mode='markers',
|
| 364 |
+
name='0-Shot',
|
| 365 |
+
marker=dict(
|
| 366 |
+
color='red',
|
| 367 |
+
size=scale_sizes(x_false)
|
| 368 |
+
),
|
| 369 |
+
hovertemplate='<b>%{customdata}</b><br>#Params: %{x}<br>Performance: %{y}<extra></extra>',
|
| 370 |
+
customdata=labels_false
|
| 371 |
+
))
|
| 372 |
+
|
| 373 |
+
# Trova il massimo tra tutti i modelli
|
| 374 |
+
all_y = y_true + y_false
|
| 375 |
+
all_x = x_true + x_false
|
| 376 |
+
all_labels = labels_true + labels_false
|
| 377 |
+
max_idx = all_y.index(max(all_y))
|
| 378 |
+
max_x = all_x[max_idx]
|
| 379 |
+
max_y = all_y[max_idx]
|
| 380 |
+
max_label = all_labels[max_idx]
|
| 381 |
+
|
| 382 |
+
# Aggiungi annotazione visibile per il modello migliore
|
| 383 |
+
fig.add_annotation(
|
| 384 |
+
x=max_x,
|
| 385 |
+
y=max_y,
|
| 386 |
+
#text=f"Top: {max_label} ({max_y:.1f}%)",
|
| 387 |
+
text=f"{max_label}",
|
| 388 |
+
showarrow=True,
|
| 389 |
+
arrowhead=2,
|
| 390 |
+
arrowsize=1,
|
| 391 |
+
arrowwidth=2,
|
| 392 |
+
arrowcolor="black",
|
| 393 |
+
font=dict(size=11, color="black"),
|
| 394 |
+
xshift=10,
|
| 395 |
+
yshift=10,
|
| 396 |
+
ax = -30, ay = -20, # sposta la label a sinistra e sopra il punto
|
| 397 |
+
xanchor = "right" # allinea la label a destra rispetto al punto
|
| 398 |
+
)
|
| 399 |
+
|
| 400 |
+
fig.update_layout(
|
| 401 |
+
title="Avg. Combined Performance vs #Params",
|
| 402 |
+
xaxis_title="#Params (B)",
|
| 403 |
+
yaxis_title="Avg. Combined Performance",
|
| 404 |
+
template="plotly_white",
|
| 405 |
+
hovermode="closest",
|
| 406 |
+
font=dict(family="Arial", size=10),
|
| 407 |
+
dragmode=False,
|
| 408 |
+
xaxis=dict(
|
| 409 |
+
tickvals=[0, 25, 50, 75, 100, 125],
|
| 410 |
+
ticktext=["0", "25", "50", "75", "100"]
|
| 411 |
+
),
|
| 412 |
+
yaxis=dict(
|
| 413 |
+
tickvals=[0, 20, 40, 60, 80, 100], # 👈 tick fissi
|
| 414 |
+
range=[0, 100] # 👈 range bloccato
|
| 415 |
+
)
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
# Caption
|
| 419 |
+
fig.add_annotation(
|
| 420 |
+
text="Accuracy generally rises with #Params, but smaller models <br>"
|
| 421 |
+
"with 10-shot can outperform larger zero-shot models.",
|
| 422 |
+
xref="paper", yref="paper",
|
| 423 |
+
x=0.5, y=-0.3, # 👈 centrata
|
| 424 |
+
showarrow=False,
|
| 425 |
+
font=dict(size=11, color="gray"),
|
| 426 |
+
align="center",
|
| 427 |
+
xanchor="center" # 👈 ancora centrata rispetto al testo
|
| 428 |
+
)
|
| 429 |
+
|
| 430 |
+
fig.update_xaxes(fixedrange=True, rangeslider_visible=False)
|
| 431 |
+
fig.update_yaxes(fixedrange=True)
|
| 432 |
+
|
| 433 |
+
return fig
|
| 434 |
+
|
| 435 |
+
|
| 436 |
+
# Define task metadata (icons, names, descriptions)
|
| 437 |
+
TASK_METADATA_MULTIPLECHOICE = {
|
| 438 |
+
#"TE": {"icon": "📊", "name": "Textual Entailment", "tooltip": ""},
|
| 439 |
+
#"SA": {"icon": "😃", "name": "Sentiment Analysis", "tooltip": ""},
|
| 440 |
+
#"HS": {"icon": "⚠️", "name": "Hate Speech", "tooltip": ""},
|
| 441 |
+
#"AT": {"icon": "🏥", "name": "Admission Test", "tooltip": ""},
|
| 442 |
+
#"WIC": {"icon": "🔤", "name": "Word in Context", "tooltip": ""},
|
| 443 |
+
#"FAQ": {"icon": "❓", "name": "Frequently Asked Questions", "tooltip": ""}
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
# Define task metadata (icons, names, descriptions)
|
| 447 |
+
TASK_METADATA_GENERATIVE = {
|
| 448 |
+
#"LS": {"icon": "🔄", "name": "Lexical Substitution", "tooltip": ""},
|
| 449 |
+
#"SU": {"icon": "📝", "name": "Summarization", "tooltip": ""},
|
| 450 |
+
"NER": {"icon": "🏷️", "name": "Named Entity Recognition", "tooltip": ""},
|
| 451 |
+
"REL": {"icon": "🔗", "name": "Relation Extraction", "tooltip": ""},
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
def restart_space():
|
| 455 |
+
"""Restart the Hugging Face space."""
|
| 456 |
+
API.restart_space(repo_id=REPO_ID)
|
| 457 |
+
|
| 458 |
+
|
| 459 |
+
def init_leaderboard(dataframe, default_selection=None, hidden_columns=None):
|
| 460 |
+
"""
|
| 461 |
+
Initialize and return the leaderboard when it is first loaded or when 'benchmark' is selected.
|
| 462 |
+
The table is sorted based on the "Avg. Combined Performance" field.
|
| 463 |
+
"""
|
| 464 |
+
if dataframe is None or dataframe.empty:
|
| 465 |
+
raise ValueError("Leaderboard DataFrame is empty or None.")
|
| 466 |
+
|
| 467 |
+
#print("????????????????????????????????", mean_of_max_per_field(dataframe))
|
| 468 |
+
|
| 469 |
+
sorted_dataframe = dataframe.sort_values(by="Avg. Comb. Perf. ⬆️", ascending=False)
|
| 470 |
+
|
| 471 |
+
sorted_dataframe = sorted_dataframe.reset_index(drop=True)
|
| 472 |
+
sorted_dataframe["Rank"] = sorted_dataframe.index + 1
|
| 473 |
+
|
| 474 |
+
# Flag per sapere se la medaglia è già stata assegnata per categoria e tipo
|
| 475 |
+
large_medal_fs_assigned = False
|
| 476 |
+
medium_medal_fs_assigned = False
|
| 477 |
+
small_medal_fs_assigned = False
|
| 478 |
+
|
| 479 |
+
large_medal_0shot_assigned = False
|
| 480 |
+
medium_medal_0shot_assigned = False
|
| 481 |
+
small_medal_0shot_assigned = False
|
| 482 |
+
|
| 483 |
+
# Lista temporanea per salvare i nuovi valori della colonna Model
|
| 484 |
+
new_model_column = []
|
| 485 |
+
|
| 486 |
+
for _, row in sorted_dataframe.iterrows():
|
| 487 |
+
if row['IS_FS']: # 10-Few-Shot
|
| 488 |
+
if row["Size"] == "🔵🔵🔵" and not large_medal_fs_assigned:
|
| 489 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🔵🏆")
|
| 490 |
+
large_medal_fs_assigned = True
|
| 491 |
+
elif row["Size"] == "🔵🔵" and not medium_medal_fs_assigned:
|
| 492 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🏆")
|
| 493 |
+
medium_medal_fs_assigned = True
|
| 494 |
+
elif row["Size"] == "🔵" and not small_medal_fs_assigned:
|
| 495 |
+
new_model_column.append(f"{row['Model']} 🔵🏆")
|
| 496 |
+
small_medal_fs_assigned = True
|
| 497 |
+
else:
|
| 498 |
+
new_model_column.append(row["Model"])
|
| 499 |
+
else: # 0-Shot
|
| 500 |
+
if row["Size"] == "🔵🔵🔵" and not large_medal_0shot_assigned:
|
| 501 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🔵🎖️")
|
| 502 |
+
large_medal_0shot_assigned = True
|
| 503 |
+
elif row["Size"] == "🔵🔵" and not medium_medal_0shot_assigned:
|
| 504 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🎖️")
|
| 505 |
+
medium_medal_0shot_assigned = True
|
| 506 |
+
elif row["Size"] == "🔵" and not small_medal_0shot_assigned:
|
| 507 |
+
new_model_column.append(f"{row['Model']} 🔵🎖️")
|
| 508 |
+
small_medal_0shot_assigned = True
|
| 509 |
+
else:
|
| 510 |
+
new_model_column.append(row["Model"])
|
| 511 |
+
|
| 512 |
+
# Lista delle colonne da aggiornare
|
| 513 |
+
#cols_to_update = ["REL Best Prompt Id", "NER Best Prompt Id", "SU Best Prompt Id", "LS Best Prompt Id"]
|
| 514 |
+
# Applichiamo la trasformazione
|
| 515 |
+
#for col in cols_to_update:
|
| 516 |
+
# dataframe[col] = dataframe[col].replace({1: 7, 2: 8})
|
| 517 |
+
|
| 518 |
+
# Aggiorna la colonna Model
|
| 519 |
+
sorted_dataframe["Model"] = new_model_column
|
| 520 |
+
|
| 521 |
+
field_list = fields(AutoEvalColumn)
|
| 522 |
+
|
| 523 |
+
return Leaderboard(
|
| 524 |
+
value=sorted_dataframe,
|
| 525 |
+
datatype=[c.type for c in field_list],
|
| 526 |
+
#select_columns=SelectColumns(
|
| 527 |
+
# default_selection=default_selection or [c.name for c in field_list if c.displayed_by_default],
|
| 528 |
+
# cant_deselect=[c.name for c in field_list if c.never_hidden],
|
| 529 |
+
# label="Select Columns to Display:",
|
| 530 |
+
#),
|
| 531 |
+
search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],
|
| 532 |
+
hide_columns=hidden_columns or [c.name for c in field_list if c.hidden],
|
| 533 |
+
filter_columns=[
|
| 534 |
+
ColumnFilter(AutoEvalColumn.fewshot_symbol.name, type="checkboxgroup", label="N-Shot Learning (FS)"),
|
| 535 |
+
#ColumnFilter(AutoEvalColumn.fewshot_symbol.name, type="checkboxgroup", label="N-Few-Shot Learning (FS)",
|
| 536 |
+
# default=[["0️⃣", "0️⃣"]]),
|
| 537 |
+
ColumnFilter(AutoEvalColumn.LANG.name, type="checkboxgroup", label="Languges "),
|
| 538 |
+
|
| 539 |
+
ColumnFilter(AutoEvalColumn.params.name, type="slider", min=0, max = 100, default = [0,100], label="Select the number of parameters (B)"),
|
| 540 |
+
],
|
| 541 |
+
#filter_columns=[
|
| 542 |
+
# ColumnFilter("IS_FS", type="checkbox", default=False, label="5-Few-Shot")
|
| 543 |
+
# #ColumnFilter("FS", type="dropdown", label="5-Few-Shot")
|
| 544 |
+
#],
|
| 545 |
+
bool_checkboxgroup_label="Evaluation Mode",
|
| 546 |
+
interactive=False,
|
| 547 |
+
)
|
| 548 |
+
|
| 549 |
+
def update_task_leaderboard(dataframe, default_selection=None, hidden_columns=None):
|
| 550 |
+
"""
|
| 551 |
+
Update and return the leaderboard when a specific task is selected.
|
| 552 |
+
The table is sorted based on the "Combined Performance" field.
|
| 553 |
+
"""
|
| 554 |
+
if dataframe is None or dataframe.empty:
|
| 555 |
+
raise ValueError("Leaderboard DataFrame is empty or None.")
|
| 556 |
+
|
| 557 |
+
sorted_dataframe = dataframe.sort_values(by="Combined Performance", ascending=False)
|
| 558 |
+
|
| 559 |
+
# aggiungo la colonna rank in base alla posizione
|
| 560 |
+
sorted_dataframe = sorted_dataframe.reset_index(drop=True)
|
| 561 |
+
sorted_dataframe["Rank"] = sorted_dataframe.index + 1
|
| 562 |
+
|
| 563 |
+
# Flag per sapere se la medaglia è già stata assegnata per categoria e tipo
|
| 564 |
+
large_medal_fs_assigned = False
|
| 565 |
+
medium_medal_fs_assigned = False
|
| 566 |
+
small_medal_fs_assigned = False
|
| 567 |
+
|
| 568 |
+
large_medal_0shot_assigned = False
|
| 569 |
+
medium_medal_0shot_assigned = False
|
| 570 |
+
small_medal_0shot_assigned = False
|
| 571 |
+
|
| 572 |
+
# Lista temporanea per salvare i nuovi valori della colonna Model
|
| 573 |
+
new_model_column = []
|
| 574 |
+
|
| 575 |
+
for _, row in sorted_dataframe.iterrows():
|
| 576 |
+
if row['IS_FS']: # 5-Few-Shot
|
| 577 |
+
if row["Size"] == "🔵🔵🔵" and not large_medal_fs_assigned:
|
| 578 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🔵🏆")
|
| 579 |
+
large_medal_fs_assigned = True
|
| 580 |
+
elif row["Size"] == "🔵🔵" and not medium_medal_fs_assigned:
|
| 581 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🏆")
|
| 582 |
+
medium_medal_fs_assigned = True
|
| 583 |
+
elif row["Size"] == "🔵" and not small_medal_fs_assigned:
|
| 584 |
+
new_model_column.append(f"{row['Model']} 🔵🏆")
|
| 585 |
+
small_medal_fs_assigned = True
|
| 586 |
+
else:
|
| 587 |
+
new_model_column.append(row["Model"])
|
| 588 |
+
else: # 0-Shot
|
| 589 |
+
if row["Size"] == "🔵🔵🔵" and not large_medal_0shot_assigned:
|
| 590 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🔵🎖️")
|
| 591 |
+
large_medal_0shot_assigned = True
|
| 592 |
+
elif row["Size"] == "🔵🔵" and not medium_medal_0shot_assigned:
|
| 593 |
+
new_model_column.append(f"{row['Model']} 🔵🔵🎖️")
|
| 594 |
+
medium_medal_0shot_assigned = True
|
| 595 |
+
elif row["Size"] == "🔵" and not small_medal_0shot_assigned:
|
| 596 |
+
new_model_column.append(f"{row['Model']} 🔵🎖️")
|
| 597 |
+
small_medal_0shot_assigned = True
|
| 598 |
+
else:
|
| 599 |
+
new_model_column.append(row["Model"])
|
| 600 |
+
|
| 601 |
+
# Aggiorna la colonna Model
|
| 602 |
+
sorted_dataframe["Model"] = new_model_column
|
| 603 |
+
|
| 604 |
+
pd.set_option('display.max_colwidth', None)
|
| 605 |
+
#print("========================", dataframe['Model'])
|
| 606 |
+
|
| 607 |
+
#print(sorted_dataframe['Combined Performance'])
|
| 608 |
+
|
| 609 |
+
field_list = fields(AutoEvalColumn)
|
| 610 |
+
|
| 611 |
+
return Leaderboard(
|
| 612 |
+
value=sorted_dataframe,
|
| 613 |
+
#datatype=[c.type for c in field_list],
|
| 614 |
+
datatype=[c.type for c in field_list] + [int],
|
| 615 |
+
#select_columns=SelectColumns(
|
| 616 |
+
# default_selection=default_selection or [c.name for c in field_list if c.displayed_by_default],
|
| 617 |
+
# cant_deselect=[c.name for c in field_list if c.never_hidden],
|
| 618 |
+
# label="Select Columns to Display:",
|
| 619 |
+
#),
|
| 620 |
+
search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],
|
| 621 |
+
hide_columns=hidden_columns or [c.name for c in field_list if c.hidden],
|
| 622 |
+
filter_columns=[
|
| 623 |
+
ColumnFilter(AutoEvalColumn.fewshot_symbol.name, type="checkboxgroup", label="N-Shot Learning (FS)"),
|
| 624 |
+
ColumnFilter(AutoEvalColumn.LANG.name, type="checkboxgroup", label="Languges "),
|
| 625 |
+
|
| 626 |
+
ColumnFilter(AutoEvalColumn.params.name, type="slider", min=0, max=100, default=[0, 100],
|
| 627 |
+
label="Select the number of parameters (B)"),
|
| 628 |
+
],
|
| 629 |
+
bool_checkboxgroup_label="Evaluation Mode",
|
| 630 |
+
interactive=False
|
| 631 |
+
)
|
| 632 |
+
|
| 633 |
+
'''
|
| 634 |
+
# Helper function for leaderboard initialization
|
| 635 |
+
def init_leaderboard(dataframe, default_selection=None, hidden_columns=None):
|
| 636 |
+
"""Initialize and return a leaderboard."""
|
| 637 |
+
if dataframe is None or dataframe.empty:
|
| 638 |
+
raise ValueError("Leaderboard DataFrame is empty or None.")
|
| 639 |
+
|
| 640 |
+
return Leaderboard(
|
| 641 |
+
value=dataframe,
|
| 642 |
+
datatype=[c.type for c in fields(AutoEvalColumn)],
|
| 643 |
+
select_columns=SelectColumns(
|
| 644 |
+
default_selection=default_selection or [c.name for c in fields(AutoEvalColumn) if c.displayed_by_default],
|
| 645 |
+
cant_deselect=[c.name for c in fields(AutoEvalColumn) if c.never_hidden],
|
| 646 |
+
label="Select Columns to Display:",
|
| 647 |
+
),
|
| 648 |
+
search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],
|
| 649 |
+
hide_columns=hidden_columns or [c.name for c in fields(AutoEvalColumn) if c.hidden],
|
| 650 |
+
filter_columns=[
|
| 651 |
+
ColumnFilter(AutoEvalColumn.fewshot_type.name, type="checkboxgroup", label="N-Few-Shot Learning (FS)"),
|
| 652 |
+
ColumnFilter(AutoEvalColumn.params.name, type="slider", min=0, max=150, label="Select the number of parameters (B)"),
|
| 653 |
+
],
|
| 654 |
+
bool_checkboxgroup_label="Hide models",
|
| 655 |
+
interactive=False,
|
| 656 |
+
)
|
| 657 |
+
'''
|
| 658 |
+
|
| 659 |
+
def download_snapshot(repo, local_dir):
|
| 660 |
+
"""Try to download a snapshot from Hugging Face Hub."""
|
| 661 |
+
try:
|
| 662 |
+
print(f"Downloading from {repo} to {local_dir}...")
|
| 663 |
+
snapshot_download(repo_id=repo, local_dir=local_dir, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN)
|
| 664 |
+
except Exception as e:
|
| 665 |
+
print(f"Error downloading {repo}: {e}")
|
| 666 |
+
restart_space()
|
| 667 |
+
|
| 668 |
+
|
| 669 |
+
# Initialize the app by downloading snapshots
|
| 670 |
+
download_snapshot(QUEUE_REPO, EVAL_REQUESTS_PATH)
|
| 671 |
+
download_snapshot(RESULTS_REPO, EVAL_RESULTS_PATH)
|
| 672 |
+
|
| 673 |
+
# Load leaderboard data
|
| 674 |
+
LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
| 675 |
+
finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
| 676 |
+
#print(LEADERBOARD_DF.columns.tolist())
|
| 677 |
+
|
| 678 |
+
theoretical_max_combined_perf = mean_of_max_per_field(LEADERBOARD_DF)
|
| 679 |
+
|
| 680 |
+
# Prepare the main interface
|
| 681 |
+
demo = gr.Blocks(css=custom_css)
|
| 682 |
+
with demo:
|
| 683 |
+
#gr.HTML(TITLE)
|
| 684 |
+
gr.HTML(
|
| 685 |
+
"""
|
| 686 |
+
<div style="display: flex; align-items: center; position: relative; width: 100%; height: 60px; padding: 10px 0;">
|
| 687 |
+
<h1 style="
|
| 688 |
+
margin: 0 auto;
|
| 689 |
+
font-weight: 900;
|
| 690 |
+
font-size: 5.5em;
|
| 691 |
+
letter-spacing: 2px;
|
| 692 |
+
text-transform: uppercase;
|
| 693 |
+
color: red;
|
| 694 |
+
background: linear-gradient(90deg, #1f77b4, #00c6ff);
|
| 695 |
+
-webkit-background-clip: text;
|
| 696 |
+
-webkit-text-fill-color: transparent;
|
| 697 |
+
text-shadow: 2px 2px 8px rgba(0.2,0,0,0);
|
| 698 |
+
">
|
| 699 |
+
ECREAM-LLM Leaderboard
|
| 700 |
+
</h1>
|
| 701 |
+
</div>
|
| 702 |
+
"""
|
| 703 |
+
)
|
| 704 |
+
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
| 705 |
+
|
| 706 |
+
# ⬇️ QUI aggiungiamo i grafici subito sotto la barra del titolo e sopra le tabs
|
| 707 |
+
with gr.Row():
|
| 708 |
+
gr.Plot(value=line_chart(LEADERBOARD_DF), elem_id="line-chart")
|
| 709 |
+
gr.Plot(value=boxplot_per_task(LEADERBOARD_DF, BASELINES, REFERENCES), elem_id="boxplot-task")
|
| 710 |
+
#gr.Plot(value=boxplot_prompts_per_task(LEADERBOARD_DF), elem_id="boxplot-prompt-task")
|
| 711 |
+
|
| 712 |
+
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
| 713 |
+
|
| 714 |
+
# Main leaderboard tab
|
| 715 |
+
with gr.TabItem("🏅 Benchmark"):
|
| 716 |
+
|
| 717 |
+
leaderboard = init_leaderboard(
|
| 718 |
+
LEADERBOARD_DF,
|
| 719 |
+
default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', "Avg. Comb. Perf. ⬆️", "TE", "SA", "HS", "AT", "WIC", "FAQ", "LS", "SU", "NER", "REL"],
|
| 720 |
+
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"]]
|
| 721 |
+
)
|
| 722 |
+
|
| 723 |
+
# gr.HTML(
|
| 724 |
+
# f"""
|
| 725 |
+
# <div style="
|
| 726 |
+
# border: 2px solid #1f77b4;
|
| 727 |
+
# border-radius: 10px;
|
| 728 |
+
# padding: 10px;
|
| 729 |
+
# background-color: #f0f8ff;
|
| 730 |
+
# font-weight: bold;
|
| 731 |
+
# font-size: 14px;
|
| 732 |
+
# display: inline-block;
|
| 733 |
+
# ">
|
| 734 |
+
# Theoretical performance of a model that scores the highest on every individual task: <span style="color:#d62728; font-size:18px;">{theoretical_max_combined_perf:.2f}</span>
|
| 735 |
+
# </div>
|
| 736 |
+
# $ """
|
| 737 |
+
# )
|
| 738 |
+
|
| 739 |
+
'''
|
| 740 |
+
with gr.TabItem("📈 Charts"):
|
| 741 |
+
#gr.Plot(value=line_chart(LEADERBOARD_DF), label="Andamento di esempio")
|
| 742 |
+
#gr.Plot(value=line_chart_interactive_test(), label="Andamento interattivo")
|
| 743 |
+
gr.Plot(value=line_chart(LEADERBOARD_DF))
|
| 744 |
+
gr.Plot(value=boxplot_per_task(LEADERBOARD_DF, BASELINES))
|
| 745 |
+
gr.Plot(value=boxplot_prompts_per_task(LEADERBOARD_DF))
|
| 746 |
+
gr.Plot(value=barplot_mean_few_minus_zero_shot(LEADERBOARD_DF))
|
| 747 |
+
'''
|
| 748 |
+
|
| 749 |
+
# About tab
|
| 750 |
+
with gr.TabItem("📝 About"):
|
| 751 |
+
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
| 752 |
+
|
| 753 |
+
# About tab
|
| 754 |
+
#with gr.TabItem("║", interactive=False):
|
| 755 |
+
# gr.Markdown("", elem_classes="markdown-text")
|
| 756 |
+
|
| 757 |
+
|
| 758 |
+
# Task-specific leaderboards
|
| 759 |
+
for task, metadata in TASK_METADATA_MULTIPLECHOICE.items():
|
| 760 |
+
|
| 761 |
+
with gr.TabItem(f"{metadata['icon']}{task}"):
|
| 762 |
+
|
| 763 |
+
task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
|
| 764 |
+
gr.Markdown(task_description, elem_classes="markdown-text")
|
| 765 |
+
|
| 766 |
+
leaderboard = update_task_leaderboard(
|
| 767 |
+
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"}),
|
| 768 |
+
default_selection=['Rank', 'Size','LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std', 'Best Prompt', 'Best Prompt Id'],
|
| 769 |
+
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']]
|
| 770 |
+
)
|
| 771 |
+
|
| 772 |
+
# About tab
|
| 773 |
+
with gr.TabItem("│", interactive=False):
|
| 774 |
+
gr.Markdown("", elem_classes="markdown-text")
|
| 775 |
+
|
| 776 |
+
# Task-specific leaderboards
|
| 777 |
+
for task, metadata in TASK_METADATA_GENERATIVE.items():
|
| 778 |
+
with gr.TabItem(f"{metadata['icon']}{task}"):
|
| 779 |
+
task_description = TASK_DESCRIPTIONS.get(task, "Description not available.")
|
| 780 |
+
gr.Markdown(task_description, elem_classes="markdown-text1")
|
| 781 |
+
#print (LEADERBOARD_DF)
|
| 782 |
+
leaderboard = update_task_leaderboard(
|
| 783 |
+
LEADERBOARD_DF.rename(columns={f"{task} Prompt Average": "Prompt Average",
|
| 784 |
+
f"{task} Prompt Std": "Prompt Std",
|
| 785 |
+
f"{task} Best Prompt": "Best Prompt",
|
| 786 |
+
f"{task} Best Prompt Id": "Best Prompt Id",
|
| 787 |
+
task: "Combined Performance"}),
|
| 788 |
+
default_selection=['Rank', 'Size', 'LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std', 'Best Prompt',
|
| 789 |
+
'Best Prompt Id'],
|
| 790 |
+
hidden_columns=[col for col in LEADERBOARD_DF.columns if
|
| 791 |
+
col not in ['Rank', 'Size','LANG', 'FS', 'Model', 'Combined Performance', 'Prompt Average', 'Prompt Std',
|
| 792 |
+
'Best Prompt', 'Best Prompt Id']]
|
| 793 |
+
)
|
| 794 |
+
|
| 795 |
+
# Citation section
|
| 796 |
+
with gr.Accordion("📙 Citation", open=False):
|
| 797 |
+
gr.Textbox(value=CITATION_BUTTON_TEXT, label=CITATION_BUTTON_LABEL, lines=20, elem_id="citation-button", show_copy_button=True)
|
| 798 |
+
|
| 799 |
+
with gr.Accordion("📙 Credits", open=False):
|
| 800 |
+
gr.Markdown(
|
| 801 |
+
"""
|
| 802 |
+
***This project has been funded by the European Union under:
|
| 803 |
+
|
| 804 |
+
Horizon Europe eCREAM Project (Grant Agreement No.101057726)
|
| 805 |
+
"""
|
| 806 |
+
)
|
| 807 |
+
|
| 808 |
+
# Background job to restart space
|
| 809 |
+
scheduler = BackgroundScheduler()
|
| 810 |
+
scheduler.add_job(restart_space, "interval", seconds=1800)
|
| 811 |
+
scheduler.start()
|
| 812 |
+
|
| 813 |
+
# Launch the app with concurrent queueing
|
| 814 |
+
demo.queue(default_concurrency_limit=40).launch(debug=True, # Enable Gradio debug mode
|
| 815 |
+
show_error=True)
|
csv_files/llm_scores_p1.xlsx
ADDED
|
Binary file (28.9 kB). View file
|
|
|
csv_files/llm_scores_p2.xlsx
ADDED
|
Binary file (26.3 kB). View file
|
|
|
csv_files/llm_scores_p3.xlsx
ADDED
|
Binary file (26.6 kB). View file
|
|
|
csv_files/outputs/.ipynb_checkpoints/deepseek-ai__DeepSeek-R1-Distill-Qwen-32B__en__0shot-checkpoint.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
csv_files/outputs/.ipynb_checkpoints/epfl-llm__meditron-7b__it__10shot-checkpoint.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
hf (pretrained=epfl-llm/meditron-7b ), num_fewshot: 10, batch_size: 1
|
| 2 |
+
|Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
|
| 3 |
+
|-------|-------|------|------|------|----|------|---|------|
|
| 4 |
+
| - NER | | | |f1 | | 0.3288 | |0 |
|
| 5 |
+
| - p1 | | | |f1 | | 0.2991 | | 0 |
|
| 6 |
+
| - p2 | | | |f1 | | 0.3563 | | 0 |
|
| 7 |
+
| - p3 | | | |f1 | | 0.3311 | | 0 |
|
| 8 |
+
| - RE | | | |f1 | | 0.0896 | |0 |
|
| 9 |
+
| - p1 | | | |f1 | | 0.0832 | | 0 |
|
| 10 |
+
| - p2 | | | |f1 | | 0.0887 | | 0 |
|
| 11 |
+
| - p3 | | | |f1 | | 0.0968 | | 0 |
|
csv_files/outputs/Henrychur__MMed-Llama-3-8B__en__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.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 |
|
csv_files/outputs/Henrychur__MMed-Llama-3-8B__en__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/Henrychur__MMed-Llama-3-8B__it__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.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 |
|
csv_files/outputs/Henrychur__MMed-Llama-3-8B__it__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/HiTZ__Medical-mT5-large__en__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.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 |
|
csv_files/outputs/HiTZ__Medical-mT5-large__en__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/HiTZ__Medical-mT5-large__it__0shot.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
| - RE | | | |f1 | | 0.0000 | |0 |
|
| 9 |
+
| - p2 | | | |f1 | | 0.0000 | | 0 |
|
| 10 |
+
| - p3 | | | |f1 | | 0.0000 | | 0 |
|
csv_files/outputs/HiTZ__Medical-mT5-large__it__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__en__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.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 |
|
csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__en__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__it__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.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 |
|
csv_files/outputs/Qwen__Qwen2.5-14B-Instruct-1M__it__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.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 |
|
csv_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/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_files/outputs/Qwen__Qwen2.5-32B-Instruct__en__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.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 |
|
csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__en__10shot.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
csv_files/outputs/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 |
|
csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__gr__10shot.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.6175 | |0 |
|
| 5 |
+
| - p1 | | | |f1 | | 0.6196 | | 0 |
|
| 6 |
+
| - p2 | | | |f1 | | 0.6131 | | 0 |
|
| 7 |
+
| - p3 | | | |f1 | | 0.6196 | | 0 |
|
| 8 |
+
| - RE | | | |f1 | | 0.5840 | |0 |
|
| 9 |
+
| - p1 | | | |f1 | | 0.5913 | | 0 |
|
| 10 |
+
| - p2 | | | |f1 | | 0.5896 | | 0 |
|
| 11 |
+
| - p3 | | | |f1 | | 0.5710 | | 0 |
|
csv_files/outputs/Qwen__Qwen2.5-32B-Instruct__it__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.2734 | |0 |
|
| 5 |
+
| - p1 | | | |f1 | | 0.3758 | | 0 |
|
| 6 |
+
| - p2 | | | |f1 | | 0.1647 | | 0 |
|
| 7 |
+
| - p3 | | | |f1 | | 0.2796 | | 0 |
|
| 8 |
+
| - RE | | | |f1 | | 0.4370 | |0 |
|
| 9 |
+
| - p1 | | | |f1 | | 0.4505 | | 0 |
|
| 10 |
+
| - p2 | | | |f1 | | 0.4159 | | 0 |
|
| 11 |
+
| - p3 | | | |f1 | | 0.4447 | | 0 |
|