dvilasuero HF staff commited on
Commit
b7a2ed4
1 Parent(s): b62d049

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -113,14 +113,14 @@ def kpi_chart() -> alt.Chart:
113
  total_annotators = len(user_ids_annotations)
114
 
115
  # Assuming you have a DataFrame with user data, create a sample DataFrame
116
- data = pd.DataFrame({"Category": ["Total Annotators"], "Value": [total_annotators]})
117
 
118
  # Create Altair chart
119
  chart = (
120
  alt.Chart(data)
121
  .mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
122
  .encode(text="Value:N")
123
- .properties(title="Number of Annotators", width=250, height=200)
124
  )
125
 
126
  return chart
@@ -138,9 +138,9 @@ def obtain_top_5_users(user_ids_annotations: Dict[str, int]) -> pd.DataFrame:
138
  """
139
 
140
  dataframe = pd.DataFrame(
141
- user_ids_annotations.items(), columns=["Name", "Submitted Records"]
142
  )
143
- dataframe = dataframe.sort_values(by="Submitted Records", ascending=False)
144
  return dataframe.head(10)
145
 
146
 
 
113
  total_annotators = len(user_ids_annotations)
114
 
115
  # Assuming you have a DataFrame with user data, create a sample DataFrame
116
+ data = pd.DataFrame({"Category": ["Total Contributors"], "Value": [total_annotators]})
117
 
118
  # Create Altair chart
119
  chart = (
120
  alt.Chart(data)
121
  .mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
122
  .encode(text="Value:N")
123
+ .properties(title="Number of Contributors", width=250, height=200)
124
  )
125
 
126
  return chart
 
138
  """
139
 
140
  dataframe = pd.DataFrame(
141
+ user_ids_annotations.items(), columns=["Name", "Submitted Responses"]
142
  )
143
+ dataframe = dataframe.sort_values(by="Submitted Responses", ascending=False)
144
  return dataframe.head(10)
145
 
146