zhuohan-7 commited on
Commit
5a03d31
·
verified ·
1 Parent(s): 420ed39

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app/draw_diagram.py +17 -8
  2. app/show_examples.py +1 -0
app/draw_diagram.py CHANGED
@@ -33,15 +33,20 @@ def draw(folder_name, category_name, dataset_name, metrics):
33
 
34
  data_path = f'{folder}/{category_name.lower()}.csv'
35
  chart_data = pd.read_csv(data_path).round(3)
36
-
37
- # if sorted == 'Ascending':
38
- # ascend = True
39
- # else:
40
- # ascend = False
41
-
42
  new_dataset_name = dataset_name.replace('-', '_').lower()
43
  chart_data = chart_data[['Model', new_dataset_name]]
44
 
 
 
 
 
 
 
 
 
 
 
 
45
  chart_data = chart_data.sort_values(by=[new_dataset_name], ascending=True).dropna(axis=0)
46
 
47
  if len(chart_data) == 0:
@@ -63,7 +68,7 @@ def draw(folder_name, category_name, dataset_name, metrics):
63
  "xAxis": [
64
  {
65
  "type": "category",
66
- "boundaryGap": False,
67
  "triggerEvent": True,
68
  "data": chart_data['Model'].tolist(),
69
  }
@@ -71,6 +76,7 @@ def draw(folder_name, category_name, dataset_name, metrics):
71
  "yAxis": [{"type": "value",
72
  "min": min_value,
73
  "max": max_value,
 
74
  # "splitNumber": 10
75
  }],
76
  "series": [{
@@ -111,5 +117,8 @@ def draw(folder_name, category_name, dataset_name, metrics):
111
  '''
112
  show samples
113
  '''
114
- show_examples(category_name, dataset_name, chart_data['Model'].tolist())
 
 
 
115
 
 
33
 
34
  data_path = f'{folder}/{category_name.lower()}.csv'
35
  chart_data = pd.read_csv(data_path).round(3)
 
 
 
 
 
 
36
  new_dataset_name = dataset_name.replace('-', '_').lower()
37
  chart_data = chart_data[['Model', new_dataset_name]]
38
 
39
+ st.markdown("""
40
+ <style>
41
+ .stMultiSelect [data-baseweb=select] span{
42
+ max-width: 800px;
43
+ font-size: 0.9rem;
44
+ }
45
+ </style>
46
+ """, unsafe_allow_html=True)
47
+ models = st.multiselect("Please choose the model", chart_data['Model'].tolist(), default = chart_data['Model'].tolist())
48
+ chart_data = chart_data[chart_data['Model'].isin(models)]
49
+
50
  chart_data = chart_data.sort_values(by=[new_dataset_name], ascending=True).dropna(axis=0)
51
 
52
  if len(chart_data) == 0:
 
68
  "xAxis": [
69
  {
70
  "type": "category",
71
+ "boundaryGap": True,
72
  "triggerEvent": True,
73
  "data": chart_data['Model'].tolist(),
74
  }
 
76
  "yAxis": [{"type": "value",
77
  "min": min_value,
78
  "max": max_value,
79
+ "boundaryGap": True
80
  # "splitNumber": 10
81
  }],
82
  "series": [{
 
117
  '''
118
  show samples
119
  '''
120
+ if dataset_name in ['Earnings21-Test', 'Earnings22-Test', 'Tedlium3-Longform-Test']:
121
+ pass
122
+ else:
123
+ show_examples(category_name, dataset_name, chart_data['Model'].tolist())
124
 
app/show_examples.py CHANGED
@@ -5,6 +5,7 @@ import numpy as np
5
  def show_examples(category_name, dataset_name, model_lists):
6
  st.divider()
7
  sample_folder = f"./examples/{category_name}/{dataset_name}"
 
8
  dataset = datasets.load_from_disk(sample_folder)
9
 
10
  for index in range(len(dataset)):
 
5
  def show_examples(category_name, dataset_name, model_lists):
6
  st.divider()
7
  sample_folder = f"./examples/{category_name}/{dataset_name}"
8
+
9
  dataset = datasets.load_from_disk(sample_folder)
10
 
11
  for index in range(len(dataset)):