dvilasuero HF staff commited on
Commit
aa75803
β€’
1 Parent(s): fa06f76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -64,11 +64,16 @@ def get_user_annotations_dictionary(
64
 
65
 
66
  def donut_chart() -> alt.Chart:
67
- # Load your data
68
- source_dataset, results = obtain_source_target_datasets()
69
- pending_records = len(source_dataset)
70
- annotated_records = len(results)
71
-
 
 
 
 
 
72
  source = pd.DataFrame(
73
  {
74
  "values": [annotated_records, pending_records],
@@ -90,6 +95,7 @@ def donut_chart() -> alt.Chart:
90
 
91
  chart = c1 + c2
92
 
 
93
 
94
 
95
 
 
64
 
65
 
66
  def donut_chart() -> alt.Chart:
67
+ """
68
+ This function returns a donut chart with the number of annotated and pending records.
69
+ Returns:
70
+ An altair chart with the donut chart.
71
+ """
72
+
73
+ source_dataset, _ = obtain_source_target_datasets()
74
+ annotated_records = len(source_dataset)
75
+ pending_records = int(os.getenv("TARGET_RECORDS")) - annotated_records
76
+
77
  source = pd.DataFrame(
78
  {
79
  "values": [annotated_records, pending_records],
 
95
 
96
  chart = c1 + c2
97
 
98
+ return chart
99
 
100
 
101