You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
entity --- The psynlp module for matching entities in text
The entity submodule contains some very basic funcationality for extracting entities from text.
A matcher is implemented in BasicEntityMatcher, which simply finds literal phrases using the Spacy matcher. Note that the context element of an Entity is not used by default.
Usage
frompsynlp.entityimportBasicEntityMatcherentity_phrases= {}
entity_phrases['symptoms'] = ['boos', 'somber', 'slaapt slecht'] # also accepts phrasesentity_phrases['diagnoses'] = ['depressie', 'psychose']
bem=BasicEntityMatcher(entity_phrases, spacy_model="spacy_model_name")
bem.extract_entities("Deze patient is somber, heeft wellicht een depressie.")
>>> [(token_span=(3, 4), rule=symptoms, text=somber), (token_span=(8, 9), rule=diagnoses, text=depressie)]