Skip to content

Commit

Permalink
Fix Mounjaro
Browse files Browse the repository at this point in the history
  • Loading branch information
woodthom2 committed Aug 21, 2024
1 parent 489b93b commit ab18f60
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion harvesting_data_from_source/05_combine_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

from nltk.corpus import words

from inclusions import common_english_words_to_include_in_drugs_dictionary, extra_terms_to_exclude_from_drugs_dictionary
from inclusions import common_english_words_to_include_in_drugs_dictionary, extra_terms_to_exclude_from_drugs_dictionary, extra_mappings

re_num = re.compile(r'^\d+$')
re_three_digits = re.compile(r'\d\d\d')
Expand Down Expand Up @@ -197,6 +197,9 @@ def get_brand_names_nhs(description: str):
for synonym in synonyms:
add_synonym(synonym, canonical)

for surface_form, canonical_form in extra_mappings.items():
add_synonym(surface_form, canonical_form)

# Remove common English words

print("Finding all drugs that are also in the NLTK list of English words.")
Expand Down
2 changes: 2 additions & 0 deletions harvesting_data_from_source/inclusions.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,5 @@
"java tea",
"kidney tea",
}

extra_mappings = {"mounjaro": "tirzepatide"}
Binary file modified src/drug_named_entity_recognition/drug_ner_dictionary.pkl.bz2
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/test_drugs_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ def test_penicillin_streptomycin(self):
drugs = find_drugs("i bought some Penicillin streptomycin".split(" "), is_include_structure=True)

self.assertEqual(2, len(drugs)) # should be 1?

def test_mounjaro(self):
drugs = find_drugs("i bought some Mounjaro".split(" "), is_include_structure=True)

self.assertEqual(1, len(drugs))

0 comments on commit ab18f60

Please sign in to comment.