-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When requesting https://kclwqt.sites.er.kcl.ac.uk/api/items/getCompResult? the api breaks. The reason for it is that the function comprehensive_results tries to access the key results that is not there.
The reason for this is because the query
entailment_results = list(mongo_handler.entailment_collection.find({
'task_id': task_id,
'reference_id': temp_ref_id
}))returns an empty list, which the implementation never expected. However, the result is correct since there are no entries for the task ID in the entailment_results collection. I assume it is due to some issues with DOI URLs.
Examples:
- Q192309
- Q1756133
- Q29642076
- Q3136081
For the following URLs:
- https://doi.org/10.1016/S0168-5597(98)00033-1
- https://doi.org/10.1016/j.tins.2019.03.006
- https://doi.org/10.1016/j.bjorl.2015.12.006
- https://doi.org/10.1016/j.mcna.2021.05.003
We should change the following code:
if entailment_results:
# Group by result type and get highest score
supports = [r for r in entailment_results if r['result'] == 'SUPPORTS']
nei = [r for r in entailment_results if r['result'] == 'NOT ENOUGH INFO']
refutes = [r for r in entailment_results if r['result'] == 'REFUTES']
selected_result = None
if supports:
selected_result = max(supports, key=lambda x: x['text_entailment_score'])
elif nei:
selected_result = max(nei, key=lambda x: x['text_entailment_score'])
elif refutes:
selected_result = max(refutes, key=lambda x: x['text_entailment_score'])
if selected_result:
item['result'] = selected_result['result']
item['result_sentence'] = f"Source language: ({temp_lang}) / {selected_result['result_sentence']}"
result_items.append(item)To consider that an empty list is an unknown issue with ProVe.
Metadata
Metadata
Assignees
Labels
No labels