Spaces:
Runtime error
Runtime error
Commit
·
7090155
1
Parent(s):
0c49c14
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,5 +71,16 @@ def find_samples_to_label():
|
|
| 71 |
top_pred_confs = 1 - np.max(preds, axis=1)
|
| 72 |
idx_to_label = np.argpartition(top_pred_confs, -5)[-5:]
|
| 73 |
|
|
|
|
| 74 |
to_label_data = unlabeled_data.select(idx_to_label)
|
| 75 |
-
to_label_data.push_to_hub("active-learning/to_label_samples")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
top_pred_confs = 1 - np.max(preds, axis=1)
|
| 72 |
idx_to_label = np.argpartition(top_pred_confs, -5)[-5:]
|
| 73 |
|
| 74 |
+
# Upload samples to the dataset to label
|
| 75 |
to_label_data = unlabeled_data.select(idx_to_label)
|
| 76 |
+
to_label_data.push_to_hub("active-learning/to_label_samples")
|
| 77 |
+
|
| 78 |
+
# Remove from the pool of samples
|
| 79 |
+
unlabeled_data = unlabeled_data.select(
|
| 80 |
+
(
|
| 81 |
+
i for i in range(len(unlabeled_data))
|
| 82 |
+
if i not in set(idx_to_label)
|
| 83 |
+
)
|
| 84 |
+
)
|
| 85 |
+
unlabeled_data.push_to_hub("active-learning/unlabeled_samples")
|
| 86 |
+
|