Existing pre-trained NLP models to detect if a text input is a question
There are multiple threads on Stack Overflow talking about this. Couple of examples can be found below:


Determine if a sentence is an inquiry
NLTK. Detecting whether a sentence is Interogative or Not?


You can also take a look at Natty. It's a bot on Stack Overflow, which reviews answers to old questions. You can see how effective it is in terms of detecting questions (every bot needs training, and Natty has been trained for quite a while). However it is written in Java, it may give you some ideas. Like detecting keywords alongside checking for presence of question mark.