Spaces:
Runtime error
Runtime error
update
Browse files- utils/methods.py +5 -5
utils/methods.py
CHANGED
|
@@ -59,14 +59,14 @@ def extractive_method(sentJson, sentFeat, model, threshold=0.5, TGB=False):
|
|
| 59 |
|
| 60 |
|
| 61 |
grouped = sentFeat.groupby('section')
|
| 62 |
-
pred = []
|
| 63 |
-
true_proba = []
|
| 64 |
|
| 65 |
for group_name, group_data in grouped:
|
| 66 |
-
print(group_name)
|
| 67 |
pred_sec, true_proba_sec = predict(group_data)
|
| 68 |
-
|
| 69 |
-
|
|
|
|
| 70 |
|
| 71 |
body = convert_sentence_df(sentJson, pred, true_proba, TGB)
|
| 72 |
res = body[body['predict'] == True]
|
|
|
|
| 59 |
|
| 60 |
|
| 61 |
grouped = sentFeat.groupby('section')
|
| 62 |
+
pred = np.array([])
|
| 63 |
+
true_proba = np.array([])
|
| 64 |
|
| 65 |
for group_name, group_data in grouped:
|
|
|
|
| 66 |
pred_sec, true_proba_sec = predict(group_data)
|
| 67 |
+
# Append to the NumPy arrays
|
| 68 |
+
pred = np.append(pred, pred_sec)
|
| 69 |
+
true_proba = np.append(true_proba, true_proba_sec)
|
| 70 |
|
| 71 |
body = convert_sentence_df(sentJson, pred, true_proba, TGB)
|
| 72 |
res = body[body['predict'] == True]
|