Spaces:
Runtime error
Runtime error
update
Browse files- utils/methods.py +3 -0
utils/methods.py
CHANGED
@@ -51,6 +51,9 @@ def extractive_method(sentJson, sentFeat, model, threshold=0.5, TGB=False):
|
|
51 |
#預測
|
52 |
def predict(x):
|
53 |
true_proba = model.predict_proba(x)[:, 1]
|
|
|
|
|
|
|
54 |
# 如果沒有任何句子的預測機率大於閾值,則選取最大機率的句子為摘要句
|
55 |
if not np.any(true_proba > threshold):
|
56 |
true_proba[true_proba == np.max(true_proba)] = 1
|
|
|
51 |
#預測
|
52 |
def predict(x):
|
53 |
true_proba = model.predict_proba(x)[:, 1]
|
54 |
+
print(threshold)
|
55 |
+
print(type(threshold))
|
56 |
+
print(true_proba)
|
57 |
# 如果沒有任何句子的預測機率大於閾值,則選取最大機率的句子為摘要句
|
58 |
if not np.any(true_proba > threshold):
|
59 |
true_proba[true_proba == np.max(true_proba)] = 1
|