1

I am using the rule-based matcher in Spacy to look for some patterns in a text. Here is a example of my pattern

text = "GDP in developing countries such as Vietnam will continue growing at a high rate." 
pattern = [{'DEP':'amod', 'OP':"?"},
           {'POS':'NOUN'},
           {'LOWER': 'such'},
           {'LOWER': 'as'},
           {'POS': 'PROPN'}]

And it extracts Output: countries such as Vietnam. But I want to serve the results on a webpage and highlight the extracted portions in this case ' countries such as Vietnam'. I couldn't find the options in Displacy. Any help/ redirection to documentation would be great.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
ary
  • 159
  • 1
  • 8

1 Answers1

1

You can use the EntityRuler to make your matches entities and then give those to displaCy, which will highlight them.

polm23
  • 14,456
  • 7
  • 35
  • 59