I am trying to detect whether the sentence I have is a question or no.
I started by thinking about writing keywords, then look-up everytime for those keywords. But I don't think that's enough.
qWords= ["what","when","where","how"]
def isQuestion(w):
return any(item for item in w.split(" ") if item.lower() in qWords)
Is there any way to get insight from a question, like extracting places, times ... etc
sentence= "What is the weather in London today".
- It's a question
- Asking about weather
- Place: London
- Time: today
If I train words by simply looking in senetence for key words. I would face problem like:
"The rainy weather, is what I love most about London"
Is there any recommended approach! or Should I try to train all the words like I did in this simple example for both places, times, .. If it's the case, where can I find data set of these words.