match pattern work in spacy but does not work in prodigy


Any one has the same issue when using match patterns for data annotation? The patterns works in spacy. But when using prodigy, I got below errors. I tried several patterns and got same errors. Could any one help? thank you.

TypeError: list indices must be integers or slices, not str

here are the spacy code which can extract word groups:

import spacy
from spacy.pipeline import EntityRuler

nlp = spacy.load("en_core_web_sm", disable=['ner'])

Entity for np

np_pattern = [{'TAG': {'IN': ['NN', 'NNP', 'NNSS', 'NNPS', 'NNS', 'JJ']}, "OP": "+"}]
patterns_np = [{"label":"NounPhrase", "pattern":np_pattern}]

ruler_np = EntityRuler(nlp, overwrite_ents=True)
ruler_np.add_patterns(patterns_np) = 'ruler_np'


text2 = "Overview of Treatment-Emergent Hepatic Disorder Events"

Entity Ruler

doc = nlp(text2)
for ent in doc.ents:

Hi! How does your patterns.jsonl look? There's likely something wrong with the way the patterns are formatted, so Prodigy gets confused when reading them in.

See here for an example of how the file should look:

Thank you. I will post patterns.jsonl this evening when I am at home.