Nasty.Language.English.QuestionAnalyzer (Nasty v0.3.0)
View SourceEnglish question analysis for Question Answering.
Thin wrapper around generic question classifier with English-specific configuration. Classifies questions by interrogative word and determines expected answer type.
Summary
Functions
Analyzes a question to extract type, expected answer type, and keywords.
Returns a human-readable description of the question analysis.
Checks if a question expects a specific entity type.
Types
@type answer_type() ::
:person
| :location
| :time
| :thing
| :reason
| :manner
| :quantity
| :boolean
Expected answer type for the question.
@type question_type() ::
:who | :what | :when | :where | :why | :how | :which | :yes_no
Question type based on interrogative word.
@type t() :: %Nasty.Language.English.QuestionAnalyzer{ answer_type: answer_type(), aux_verb: Nasty.AST.Token.t() | nil, focus: Nasty.AST.Token.t() | nil, keywords: [Nasty.AST.Token.t()], type: question_type() }
Functions
@spec analyze([Nasty.AST.Token.t()]) :: {:ok, t()} | {:error, term()}
Analyzes a question to extract type, expected answer type, and keywords.
Delegates to generic question classifier with English configuration.
Returns a human-readable description of the question analysis.
Checks if a question expects a specific entity type.
Delegates to QA config.