Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -600,8 +600,6 @@ def predict_re(request: RERequest):
|
|
| 600 |
return {"error": str(e)}
|
| 601 |
|
| 602 |
|
| 603 |
-
# =========== Event Argument Extraction =============
|
| 604 |
-
|
| 605 |
# ============ Event Argument Extraction ==============
|
| 606 |
from transformers import pipeline
|
| 607 |
|
|
@@ -702,7 +700,7 @@ def event_argument_extractor(sentence):
|
|
| 702 |
)
|
| 703 |
|
| 704 |
predicted_relation = event_pipe(relation_sentence)
|
| 705 |
-
score = get_positive_score(predicted_relation)
|
| 706 |
|
| 707 |
if score > 0.50:
|
| 708 |
output_list.append({
|
|
|
|
| 600 |
return {"error": str(e)}
|
| 601 |
|
| 602 |
|
|
|
|
|
|
|
| 603 |
# ============ Event Argument Extraction ==============
|
| 604 |
from transformers import pipeline
|
| 605 |
|
|
|
|
| 700 |
)
|
| 701 |
|
| 702 |
predicted_relation = event_pipe(relation_sentence)
|
| 703 |
+
score = score = predicted_relation[0][0]["score"] #get_positive_score(predicted_relation)
|
| 704 |
|
| 705 |
if score > 0.50:
|
| 706 |
output_list.append({
|