3

I am wondering if it's possible to determine if a sentence is a Question or a Statement using Apache OpenNLP or any other library?

If so, I'm looking for some pointers on how to achieve this.

shareef
  • 9,255
  • 13
  • 58
  • 89

1 Answers1

1

Using a rule based engine you can look for the following information in the sentence to decide whether the sentence is a question or not:

  • Start with 'Why', 'What', 'Who', 'When' or 'How'
  • Verb comes before the subject
  • There is a question mark at the end of the sentence.
amirouche
  • 7,682
  • 6
  • 40
  • 94