Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,11 +25,11 @@ def call(sentence, detection_threshold):
|
|
25 |
outputs = pipeline([sentence], nominalization_detection_threshold=detection_threshold)[0]
|
26 |
def pretty_qadisc_qas(qa_infos) -> List[str]:
|
27 |
if not qa_infos: return []
|
28 |
-
return [f"{qa['question']} --- {qa['answer']}"
|
29 |
for qa in qa_infos if qa is not None]
|
30 |
def pretty_qasrl_qas(pred_info) -> List[str]:
|
31 |
if not pred_info or not pred_info['QAs']: return []
|
32 |
-
return [f"{qa['question']} --- {';'.join(qa['answers'])}"
|
33 |
for qa in pred_info['QAs'] if qa is not None]
|
34 |
qasrl_qas = [qa for pred_info in outputs['qasrl'] for qa in pretty_qasrl_qas(pred_info)]
|
35 |
qanom_qas = [qa for pred_info in outputs['qanom'] for qa in pretty_qasrl_qas(pred_info)]
|
|
|
25 |
outputs = pipeline([sentence], nominalization_detection_threshold=detection_threshold)[0]
|
26 |
def pretty_qadisc_qas(qa_infos) -> List[str]:
|
27 |
if not qa_infos: return []
|
28 |
+
return [f"{qa['question']} --- {qa['answer']}".lstrip()
|
29 |
for qa in qa_infos if qa is not None]
|
30 |
def pretty_qasrl_qas(pred_info) -> List[str]:
|
31 |
if not pred_info or not pred_info['QAs']: return []
|
32 |
+
return [f"{qa['question']} --- {';'.join(qa['answers'])}".lstrip()
|
33 |
for qa in pred_info['QAs'] if qa is not None]
|
34 |
qasrl_qas = [qa for pred_info in outputs['qasrl'] for qa in pretty_qasrl_qas(pred_info)]
|
35 |
qanom_qas = [qa for pred_info in outputs['qanom'] for qa in pretty_qasrl_qas(pred_info)]
|