question_num module

features.question_num.calculate_num_question_naive(text, question_words)

Get the number of sentences that either end with a question mark or start with a question word (e.g., “who,” “what,” “when,” “where,” “why”). This is a naive measure of the number of questions asked.

Note that this function requires the data to retain punctuation as input.

Parameters:
  • text (str) – The message (utterance) being analyzed.

  • question_words (list) – The list of question words.

Returns:

The number of questions (Sentences ending with question marks or starting with question words) in the text.

Return type:

int