1

I'm using the dependency parser to see if a sentence matches a rule with exceptions. For example, I'm trying to find all sentences whose noun subject does not have a complement word (adjective, compound, etc.).

A positive case is.

The school is built in 1978.

A negative case is.

The Blue Sky Airline is 70 years old.

My current Spacy pattern matches all two cases.

[
    {"RIGHT_ID": "copula", "RIGHT_ATTRS": {"LEMMA": "be"}},
    # subject of the verb
    {
        "LEFT_ID": "copula",
        "REL_OP": ">",
        "RIGHT_ID": "subject",
        "RIGHT_ATTRS": {"DEP": "nsubj"},
    },
]

Is there a negative REL_OP? I want to exclude some relations between tokens.

Song Yang
  • 407
  • 5
  • 14

1 Answers1

0

There is no negative REL_OP.

I haven't seen this come up before... It's a little weird, but your best option might be to match the complements you want to exclude, and keep any sentence with no matches.

polm23
  • 14,456
  • 7
  • 35
  • 59