Skip to content

v2.0

Compare
Choose a tag to compare
@woodthom2 woodthom2 released this 06 Sep 14:30
· 17 commits to main since this release
06c02ce

A number of bugs have been fixed and the way that data is pulled from source APIs has been streamlined and cleaned up.

Molecular structures

drugs = find_drugs("i bought some Mounjaro".split(" "), is_include_structure=True)

this will return the atomic structure of the drug if that data is available.

Fuzzy matching/spelling tolerance

You can get drugs even with spelling mistakes:

drugs = find_drugs("i bought some Monjaro".split(" "), is_include_structure=True, is_fuzzy_match=True)

Add and remove drugs (customise the drugs list)

Now you can modify the drug recogniser's behaviour if there is a particular drug which it isn't finding:

To reset the drugs dictionary

from drug_named_entity_recognition.drugs_finder import find_drugs, add_custom_drug_synonym, reset_drugs_data, \
    add_custom_new_drug, remove_drug_synonym
reset_drugs_data()

To add a synonym

add_custom_drug_synonym("potato", "sertraline")

To add a new drug

add_custom_new_drug("potato", {"name": "solanum tuberosum"})

To remove an existing drug

remove_drug_synonym("sertraline")