Spaces:
Paused
Paused
asis
Browse files
app.py
CHANGED
|
@@ -243,23 +243,26 @@ def load_next_batch(session: SessionState, strategy: str):
|
|
| 243 |
if strategy == "Random" or (session.model_state is None and session.text_embedding is None):
|
| 244 |
selected_indices = random.sample(range(len(pool)), min(BATCH_SIZE, len(pool)))
|
| 245 |
session.current_batch_mode = "neutral"
|
| 246 |
-
title = "
|
|
|
|
| 247 |
elif strategy == "Verify Positives":
|
| 248 |
sort_idx = np.argsort(probs[:, 1])[::-1]
|
| 249 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 250 |
session.current_batch_mode = "verify_pos"
|
| 251 |
-
title = "
|
|
|
|
| 252 |
elif strategy == "Verify Negatives":
|
| 253 |
sort_idx = np.argsort(probs[:, 1])
|
| 254 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 255 |
session.current_batch_mode = "verify_neg"
|
| 256 |
-
title = "
|
|
|
|
| 257 |
elif strategy == "Borderline":
|
| 258 |
scores = np.abs(probs[:, 1] - 0.5)
|
| 259 |
sort_idx = np.argsort(scores)
|
| 260 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 261 |
session.current_batch_mode = "neutral"
|
| 262 |
-
title = "
|
| 263 |
else:
|
| 264 |
selected_indices = []
|
| 265 |
title = "Unknown Strategy"
|
|
|
|
| 243 |
if strategy == "Random" or (session.model_state is None and session.text_embedding is None):
|
| 244 |
selected_indices = random.sample(range(len(pool)), min(BATCH_SIZE, len(pool)))
|
| 245 |
session.current_batch_mode = "neutral"
|
| 246 |
+
title = "### 🟢 Mode: MIXED\n**Action**: Select all **POSITIVE** items. (Unselected will be Negative)"
|
| 247 |
+
|
| 248 |
elif strategy == "Verify Positives":
|
| 249 |
sort_idx = np.argsort(probs[:, 1])[::-1]
|
| 250 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 251 |
session.current_batch_mode = "verify_pos"
|
| 252 |
+
title = "### 🔵 Mode: VERIFY POSITIVES\n**Action**: Select the **ERRORS** (items that are actually **Negative**). (Unselected will stay Positive)"
|
| 253 |
+
|
| 254 |
elif strategy == "Verify Negatives":
|
| 255 |
sort_idx = np.argsort(probs[:, 1])
|
| 256 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 257 |
session.current_batch_mode = "verify_neg"
|
| 258 |
+
title = "### 🔴 Mode: VERIFY NEGATIVES\n**Action**: Select the **ERRORS** (items that are actually **Positive**). (Unselected will stay Negative)"
|
| 259 |
+
|
| 260 |
elif strategy == "Borderline":
|
| 261 |
scores = np.abs(probs[:, 1] - 0.5)
|
| 262 |
sort_idx = np.argsort(scores)
|
| 263 |
selected_indices = sort_idx[:BATCH_SIZE]
|
| 264 |
session.current_batch_mode = "neutral"
|
| 265 |
+
title = "### 🟡 Mode: BORDERLINE\n**Action**: Select all **POSITIVE** items. (Unselected will be Negative)"
|
| 266 |
else:
|
| 267 |
selected_indices = []
|
| 268 |
title = "Unknown Strategy"
|