Skip to content
Discussion options

You must be logged in to vote

Using token patterns, each {} pattern matches exactly one token by default, so for this pattern you end up with the matched token "chest":

{"ENT_TYPE": "cc"}

To match one or more tokens, you can use:

{"ENT_TYPE": "cc", "OP": "+"}

Docs on operators: https://spacy.io/usage/rule-based-matching#quantifiers

If you might ever have two adjacent entity spans (e.g. something like "following a week of [intense headaches] [chest pain] for three days") and you only want to match one of the spans, you'd need to also include the ENT_IOB features so you can match only one entity based on the IOB tags:

{"ENT_IOB": "B", "ENT_TYPE": "cc"}, {"ENT_IOB": "I", "ENT_TYPE": "cc", "OP": "?"}

Alternatively, you…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianeboyd
Comment options

You must be logged in to vote
6 replies
@kamlesh0606
Comment options

@adrianeboyd
Comment options

@kamlesh0606
Comment options

@adrianeboyd
Comment options

@kamlesh0606
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / spanruler Feature: Entity and span ruler
2 participants
Converted from issue

This discussion was converted from issue #12976 on September 13, 2023 06:21.