Skip to content
Discussion options

You must be logged in to vote

It looks like the issue is just that none of your phrases match "He is out of work", so I'm not sure what is unexpected here?

I find your code pretty confusing due to the indirection involved. If you're just filtering a list of matches it might be easier to just filter it in the for loop rather than mutating the list. Something like:

matches = matcher(doc)
for match_id, start, end in matches:
    span = doc[start:end]
    for phrase in _phrases:
        if phrase in span.sent.text:
            continue # skip this one
    ... do stuff ...

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@bwang482
Comment options

@bwang482
Comment options

@polm
Comment options

@bwang482
Comment options

@polm
Comment options

Answer selected by polm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / matcher Feature: Token, phrase and dependency matcher
2 participants