AMR-KELEG commited on
Commit
182b227
·
1 Parent(s): b85cb01

Add model's URL to leaderboard

Browse files
Files changed (1) hide show
  1. app.py +22 -4
app.py CHANGED
@@ -57,7 +57,10 @@ with tab1:
57
 
58
  evaluation_metrics.append(
59
  {
60
- "Model Name": row["model_name"] + " (" + row["inference_function"] + ")",
 
 
 
61
  "Accuracy": macro_avg_accuracy,
62
  "Recall": macro_avg_recall,
63
  "Precision": macro_avg_precision,
@@ -68,8 +71,20 @@ with tab1:
68
  "F1 score", ascending=False
69
  )
70
  results_df["Rank"] = range(1, len(results_df) + 1)
71
- results_df = results_df[["Rank", "Model Name", "Accuracy", "Recall", "Precision", "F1 score"]]
72
- st.dataframe(results_df, hide_index=True)
 
 
 
 
 
 
 
 
 
 
 
 
73
  st.write("Note: The metrics are macro-averaged across all dialects.")
74
 
75
  with tab2:
@@ -109,7 +124,10 @@ with tab2:
109
 
110
  # Store the predictions in a private dataset
111
  utils.upload_predictions(
112
- os.environ["PREDICTIONS_DATASET_NAME"], predictions, model_name, inference_function
 
 
 
113
  )
114
 
115
  st.toast(f"Inference completed!")
 
57
 
58
  evaluation_metrics.append(
59
  {
60
+ "Model Name": row["model_name"]
61
+ + "\n("
62
+ + row["inference_function"]
63
+ + ")",
64
  "Accuracy": macro_avg_accuracy,
65
  "Recall": macro_avg_recall,
66
  "Precision": macro_avg_precision,
 
71
  "F1 score", ascending=False
72
  )
73
  results_df["Rank"] = range(1, len(results_df) + 1)
74
+ results_df["URL"] = [
75
+ f"https://huggingface.co/{row['model_name']}" for row in model_predictions_rows
76
+ ]
77
+
78
+ results_df = results_df[
79
+ ["Rank", "Model Name", "URL", "Accuracy", "Recall", "Precision", "F1 score"]
80
+ ]
81
+ st.data_editor(
82
+ results_df,
83
+ column_config={
84
+ "URL": st.column_config.LinkColumn("URL", display_text="URL"),
85
+ },
86
+ hide_index=True,
87
+ )
88
  st.write("Note: The metrics are macro-averaged across all dialects.")
89
 
90
  with tab2:
 
124
 
125
  # Store the predictions in a private dataset
126
  utils.upload_predictions(
127
+ os.environ["PREDICTIONS_DATASET_NAME"],
128
+ predictions,
129
+ model_name,
130
+ inference_function,
131
  )
132
 
133
  st.toast(f"Inference completed!")