I'm trying to find a noun phrase from a set of sentences and output whether the sentence is true or false based on its presence.
For an example, following are four samples
s1 = "he reported red light"
s2 = "he found a red light at the end of the road"
s3 = "he denied to have seen red light"
s4 = "he said that the red light was absent"
The output which I'm looking for is "True" for s1 and s2 (because from the sentence it is clear that the red light is present", whereas "False" for s3 & s4, when the input string is "red light"
I tried using TextBlob which returns "red light" as noun phrase.
print(TextBlob(s1).sentences[0].pos_tags)
print(TextBlob(s1).sentences[0].noun_phrases)
The example above are samples which can be part of a long sentence also. Also, there can be combinations of positive words like "present","found", "spotted","has" etc, same is the case with negative words
Also, if there are multiple noun phrases, but I want to find the presence of a particular noun phrase, how can I do it?