NLPatVCU / medaCy

:hospital: Medical Text Mining and Information Extraction with spaCy
GNU General Public License v3.0
432 stars 91 forks source link

Only drug and duration extracted #183

Closed HarsheetKakar closed 4 years ago

HarsheetKakar commented 4 years ago

Description

The example provided showed that Drug, Dosage, Form, and Duration are extracted from the given clinical text. After installing the library (Developer branch) only Drug and Duration was extracted from the given text.

Steps/Code to Reproduce

>>> pip install git+https://github.com/NLPatVCU/medaCy.git@development
>>> pip install git+https://github.com/NLPatVCU/medaCy_model_clinical_notes.git

from medacy.model.model import Model

model = Model.load_external('medacy_model_clinical_notes')
annotation = model.predict("The patient was prescribed 1 capsule of Advil for 5 days.")
print(annotation)

Expected Results

[
    ('Drug', 40, 45, 'Advil'),
    ('Dosage', 27, 28, '1'), 
    ('Form', 29, 36, 'capsule'),
    ('Duration', 46, 56, 'for 5 days')
]

Actual Results

[('Drug', 40, 45, 'Advil'), ('Duration', 46, 56, 'for 5 days')]

Versions

HarsheetKakar commented 4 years ago

import sys; print("Python", sys.version) Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] import numpy; print("NumPy", numpy.version) NumPy 1.18.1 import scipy; print("SciPy", scipy.version) SciPy 1.4.1 import medacy; print("medacy", medacy.version) medacy 1.0.0

prabhatM commented 4 years ago

I got the similar result.

sherwin7 commented 4 years ago

@HarsheetKakar ya i got what's your problem is, since medacy is a spacy based model it scans from left to right of the sentence if it gets the name of the drugs from there it will extract all the information even by mistake you leave a extra space between the words it wont able to extract the information

i have modified you sentence a little bit except dosage everything came here is the code

from medacy.model.model import Model

model = Model.load_external('medacy_model_clinical_notes') annotation = model.predict("The patient was prescribed Advil 1 capsule for 5 days.") print(annotation)

and the result is ('Drug', 27, 32, 'Advil') ('Strength', 33, 34, '1') ('Form', 35, 42, 'capsule') ('Duration', 43, 53, 'for 5 days')

prabhatM commented 4 years ago

Thank you.

On Fri, 6 Mar 2020, 10:09 Sherwin P, notifications@github.com wrote:

@HarsheetKakar https://github.com/HarsheetKakar ya i got what's your problem is, since medacy is a spacy based model it scans from left to right of the sentence if it gets the name of the drugs from there it will extract all the information even by mistake you leave a extra space between the words it wont able to extract the information

i have modified you sentence a little bit except dosage everything came here is the code

from medacy.model.model import Model

model = Model.load_external('medacy_model_clinical_notes') annotation = model.predict("The patient was prescribed Advil 1 capsule for 5 days.") print(annotation)

and the result is ('Drug', 27, 32, 'Advil') ('Strength', 33, 34, '1') ('Form', 35, 42, 'capsule') ('Duration', 43, 53, 'for 5 days')

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NLPatVCU/medaCy/issues/183?email_source=notifications&email_token=ABXKGXBZGRFQ5E4DTJE3NODRGB5BVA5CNFSM4K4VSP22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOABLCA#issuecomment-595596680, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXKGXHMKF2T7FYR73SVBT3RGB5BVANCNFSM4K4VSP2Q .