allenai / scispacy

A full spaCy pipeline and models for scientific/biomedical documents.
https://allenai.github.io/scispacy/
Apache License 2.0
1.7k stars 227 forks source link

UserWarning: [W036] The component 'matcher' does not have any patterns defined. #464

Closed hrshdhgd closed 1 year ago

hrshdhgd commented 1 year ago

Hello,

Happy Holidays!

I used the last sentence from the example on your README.md file :

doc = nlp("Spinal and bulbar muscular atrophy (SBMA) is an \
           inherited motor neuron disease caused by the expansion \
           of a polyglutamine tract within the androgen receptor (AR). \
           SBMA can be caused by this easily.")

Here's my code:

import spacy
import scispacy

from scispacy.linking import EntityLinker

nlp = spacy.load("en_ner_craft_md")
nlp.add_pipe("abbreviation_detector")
nlp.add_pipe(
            "scispacy_linker",
            config={"resolve_abbreviations": True, "linker_name":"mesh"},
        )
doc = self.nlp("SBMA can be caused by this easily.") # from the scispacy example

I get the following error:

../site-packages/scispacy/abbreviation.py:230: UserWarning: [W036] The component 'matcher' does not have any patterns defined.
  global_matches = self.global_matcher(doc)

Any guidance would be greatly appreciated!

scispacy                  0.5.1  
spacy                     3.4.4  
dakinggg commented 1 year ago

That warning can be safely ignored. I believe it just occurs because no abbreviations are found in the text provided.