Skip to content

Commit

Permalink
making error catching more broad for all bagel methods
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Nov 7, 2024
1 parent a85c940 commit cade63b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions parsers/LitCoin/src/bagel/bagel.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ def get_orion_bagel_results(text, term, abstract_id):
update_by_id(terms, nr_results, "NameRes")
update_by_id(terms, sb_results, "SAPBert")
augment_results(terms, nameres, taxon_id_to_name)
# make the call to the LLM asking it to classify the synonyms
gpt_class_desc_response = ask_classes_and_descriptions(text, term, terms, abstract_id, session)
# gpt_label_response = ask_labels(abstract, term, terms)
# gpt_class_response = ask_classes(abstract, term, terms)
return gpt_class_desc_response


Expand Down
4 changes: 2 additions & 2 deletions parsers/LitCoin/src/loadLitCoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ def bagelize_entity(self, entity_name, abstract_id, abstract_text):
entity=entity_name,
abstract_id=abstract_id)
self.bagel_results_lookup[abstract_id]["terms"][entity_name] = bagel_results
except requests.exceptions.HTTPError as e:
except Exception as e:
error_message = f'Failed Bagelization: {type(e)}:{e}'
self.logger.error(error_message)
if e.response.status_code == 429:
if isinstance(e, requests.exceptions.HTTPError) and e.response.status_code == 429:
raise e
self.parsing_metadata['bagelization_errors'] += 1
bagel_results = {'error': error_message}
Expand Down

0 comments on commit cade63b

Please sign in to comment.