Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,11 +64,16 @@ def get_user_annotations_dictionary(
|
|
| 64 |
|
| 65 |
|
| 66 |
def donut_chart() -> alt.Chart:
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 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 |
|