AMR-KELEG commited on
Commit
5a485e4
·
1 Parent(s): 013e3f5

Only show the results if they exist

Browse files
Files changed (1) hide show
  1. app.py +21 -20
app.py CHANGED
@@ -86,26 +86,27 @@ with tab1:
86
  "F1 score": macro_avg_f1,
87
  }
88
  )
89
- results_df = pd.DataFrame(evaluation_metrics).sort_values(
90
- "F1 score", ascending=False
91
- )
92
- results_df["Rank"] = range(1, len(results_df) + 1)
93
- results_df["URL"] = [
94
- f"https://huggingface.co/{row['model_name']}"
95
- for row in model_predictions_rows
96
- ]
97
-
98
- results_df = results_df[
99
- ["Rank", "Model Name", "Accuracy", "Recall", "Precision", "F1 score", "URL"]
100
- ]
101
- st.data_editor(
102
- results_df,
103
- column_config={
104
- "URL": st.column_config.LinkColumn("URL", display_text="URL"),
105
- },
106
- hide_index=True,
107
- )
108
- st.write("Note: The metrics are macro-averaged across all dialects.")
 
109
 
110
  with st.expander("Click for more information."):
111
  with open("leaderboard_info.md", "r") as f:
 
86
  "F1 score": macro_avg_f1,
87
  }
88
  )
89
+ if evaluation_metrics:
90
+ results_df = pd.DataFrame(evaluation_metrics).sort_values(
91
+ "F1 score", ascending=False
92
+ )
93
+ results_df["Rank"] = range(1, len(results_df) + 1)
94
+ results_df["URL"] = [
95
+ f"https://huggingface.co/{row['model_name']}"
96
+ for row in model_predictions_rows
97
+ ]
98
+
99
+ results_df = results_df[
100
+ ["Rank", "Model Name", "Accuracy", "Recall", "Precision", "F1 score", "URL"]
101
+ ]
102
+ st.data_editor(
103
+ results_df,
104
+ column_config={
105
+ "URL": st.column_config.LinkColumn("URL"),
106
+ },
107
+ hide_index=True,
108
+ )
109
+ st.write("Note: The metrics are macro-averaged across all dialects.")
110
 
111
  with st.expander("Click for more information."):
112
  with open("leaderboard_info.md", "r") as f: