How can I detect if a search query is in the form of a question?
For example, a customer might search for \"how do I track my order\" (notice no question mark).
Finding out if a sentence is a question is not an easiest task, because there is many ways how people asks questions, many of them do not follows grammar rules. Therefore it is hard to find a good rule set for the detection. In such situations, I would go for machine learning and train an algorithm using annotated text corpus (creating a corpus and selecting a feature set can take some time). The machine learning based recognition should provide you better recall than the rule based approach. Here is a step by step instruction:
Create a vector for each of sentences of features (you need both, positive and negative examples) based on the extracted informaiton, e.g.,
| Has ? | A verb on second position | Has 5W1H | Is 5W1H on 1st position in sentence | ... | length of sentence | Is a question |
Use the vectors to train a machine learning algorithm, e.g., MaximumEntropy, SVM (you can use Wekka or Knime)
Use the trained algorithm for the question recognition.
If needed (new question examples), repeat steps.