Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,7 +167,6 @@ def get_articles(
|
|
| 167 |
def get_monitoring_results(
|
| 168 |
overall_status: Optional[str] = None,
|
| 169 |
requires_human_review: Optional[int] = None,
|
| 170 |
-
relevance_judgment: Optional[str] = None,
|
| 171 |
label_judgment: Optional[str] = None,
|
| 172 |
predicted_label: Optional[str] = None,
|
| 173 |
source: Optional[str] = None,
|
|
@@ -191,9 +190,6 @@ def get_monitoring_results(
|
|
| 191 |
url,
|
| 192 |
published_at,
|
| 193 |
classified_at,
|
| 194 |
-
relevance_judgment,
|
| 195 |
-
relevance_confidence,
|
| 196 |
-
relevance_explanation,
|
| 197 |
label_judgment,
|
| 198 |
label_confidence,
|
| 199 |
label_explanation,
|
|
@@ -215,10 +211,6 @@ def get_monitoring_results(
|
|
| 215 |
query += " AND requires_human_review = ?"
|
| 216 |
params.append(requires_human_review)
|
| 217 |
|
| 218 |
-
if relevance_judgment:
|
| 219 |
-
query += " AND relevance_judgment = ?"
|
| 220 |
-
params.append(relevance_judgment)
|
| 221 |
-
|
| 222 |
if label_judgment:
|
| 223 |
query += " AND label_judgment = ?"
|
| 224 |
params.append(label_judgment)
|
|
@@ -267,16 +259,6 @@ def get_monitoring_summary():
|
|
| 267 |
conn
|
| 268 |
)["n"].iloc[0])
|
| 269 |
|
| 270 |
-
relevance_distribution = pd.read_sql_query(
|
| 271 |
-
"""
|
| 272 |
-
SELECT relevance_judgment, COUNT(*) AS count
|
| 273 |
-
FROM monitoring_results
|
| 274 |
-
GROUP BY relevance_judgment
|
| 275 |
-
ORDER BY count DESC
|
| 276 |
-
""",
|
| 277 |
-
conn
|
| 278 |
-
).to_dict(orient="records")
|
| 279 |
-
|
| 280 |
label_distribution = pd.read_sql_query(
|
| 281 |
"""
|
| 282 |
SELECT label_judgment, COUNT(*) AS count
|
|
@@ -326,7 +308,6 @@ def get_monitoring_summary():
|
|
| 326 |
return {
|
| 327 |
"total_monitored": total_monitored,
|
| 328 |
"needs_review": needs_review,
|
| 329 |
-
"relevance_distribution": relevance_distribution,
|
| 330 |
"label_distribution": label_distribution,
|
| 331 |
"status_distribution": status_distribution,
|
| 332 |
"common_problem_labels": common_problem_labels,
|
|
@@ -348,9 +329,6 @@ def get_review_queue(limit: int = Query(100, ge=1, le=500)):
|
|
| 348 |
source,
|
| 349 |
url,
|
| 350 |
published_at,
|
| 351 |
-
relevance_judgment,
|
| 352 |
-
relevance_confidence,
|
| 353 |
-
relevance_explanation,
|
| 354 |
label_judgment,
|
| 355 |
label_confidence,
|
| 356 |
label_explanation,
|
|
|
|
| 167 |
def get_monitoring_results(
|
| 168 |
overall_status: Optional[str] = None,
|
| 169 |
requires_human_review: Optional[int] = None,
|
|
|
|
| 170 |
label_judgment: Optional[str] = None,
|
| 171 |
predicted_label: Optional[str] = None,
|
| 172 |
source: Optional[str] = None,
|
|
|
|
| 190 |
url,
|
| 191 |
published_at,
|
| 192 |
classified_at,
|
|
|
|
|
|
|
|
|
|
| 193 |
label_judgment,
|
| 194 |
label_confidence,
|
| 195 |
label_explanation,
|
|
|
|
| 211 |
query += " AND requires_human_review = ?"
|
| 212 |
params.append(requires_human_review)
|
| 213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
if label_judgment:
|
| 215 |
query += " AND label_judgment = ?"
|
| 216 |
params.append(label_judgment)
|
|
|
|
| 259 |
conn
|
| 260 |
)["n"].iloc[0])
|
| 261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
label_distribution = pd.read_sql_query(
|
| 263 |
"""
|
| 264 |
SELECT label_judgment, COUNT(*) AS count
|
|
|
|
| 308 |
return {
|
| 309 |
"total_monitored": total_monitored,
|
| 310 |
"needs_review": needs_review,
|
|
|
|
| 311 |
"label_distribution": label_distribution,
|
| 312 |
"status_distribution": status_distribution,
|
| 313 |
"common_problem_labels": common_problem_labels,
|
|
|
|
| 329 |
source,
|
| 330 |
url,
|
| 331 |
published_at,
|
|
|
|
|
|
|
|
|
|
| 332 |
label_judgment,
|
| 333 |
label_confidence,
|
| 334 |
label_explanation,
|