SilentFlame / Fact-Checker

A python written script to check whether fact you are checking is "True" or "False".
18 stars 9 forks source link

Handle the case with multiple subjects. #3

Open SilentFlame opened 7 years ago

SilentFlame commented 7 years ago

To see this run the script and see that there is a sentence where there are two subjects. Ram and Shyam. When we give a fact concerned with Ram, It says fact is False no matter whether it's true or not. but when we give the same fact with subject as Shyam it works fine.

handle the cases when it considers both the subjects for checking the fact not only the latter subject.

sarthakmadaan commented 7 years ago

I ran both cases with sopex, sopex "Ram and Shyam are good boys." Shyam --[are]--> boys

sopex "Shyam and Ram are good boys." Ram --[are]--> boys

and when the condition triplets[j].subject == target.subject is used, second case is rejected. This is a drawback of sopex that it doesn't recognise multiple subjects and I think it would be better to do away with sopex and use nltk for the same purpose.

SilentFlame commented 7 years ago

Was thinking of something similar.

Please suggest the way you are thinking to move from here.

sarthakmadaan commented 7 years ago

Spacy can be used for the purpose. I ran the following code: https://gist.github.com/sarthak5/46baf7e2e7ce60fbc4a087856b8756f1 If given input : Ram and Shyam are walking and playing football and cricket. it will separate into three lists subjects,verbs,objects as [Ram, Shyam] [walking, playing] [football, cricket] sets of subjects,objects or verbs of sentences can be compared to check for a fact.