Reputation: 99
I'm currently working on a project in which I need to manipulate English conditional statements. I downloaded the NLTK library and it seems a very good NLP module. The question is: Is there a built-in mechanism in NLTK (or other libraries) to identify conditional statements? or maybe a paper explaining how to detect conditional statements?
I've read that there are different types of conditional statements, most of them rely on the word IF. But also there are other situations in which a condition can be present without IF (like using unless for example).
Can anyone guide me?
Upvotes: 2
Views: 1433
Reputation: 1281
Sounds like what you want to do relies on discourse parsing. It basically detects relations between sentences (or phrases) and classifies them according to sense, and one of these senses can be condition (others are, for example, comparison, contrast, expansion, etc.). There are a few discourse parsers around (try googling English discourse parser in combination with PDTB or RST), but this is a quite challenging sub-field of NLP with typically not too high f-scores (due to low inter-annotator agreement and only limited training data available, among other things). As far as I know, anything in this direction is not included in NLTK (or corenlp of opennlp for that matter). A good start might be this one (https://wing.comp.nus.edu.sg/~linzihen/parser/), but it's not in python (but in Java or Ruby).
Upvotes: 2