Nasty.Operations.QA.AnswerSelector (Nasty v0.3.0)

View Source

Generic answer candidate extraction for Question Answering.

Extracts answer candidates from sentences based on question type:

  • Entity-based answers (person, location, organization)
  • Temporal answers (dates, years, times)
  • Number/quantity answers
  • Clause-based answers (reason, manner)
  • Noun phrase answers (fallback)

Summary

Types

Language configuration for answer selection.

Functions

Extracts answer candidates from a sentence based on question analysis.

Types

language_config()

@type language_config() :: %{
  temporal_patterns: [Regex.t()],
  temporal_keywords: [String.t()]
}

Language configuration for answer selection.

Required fields:

  • temporal_patterns - List of regex patterns for temporal expressions
  • temporal_keywords - List of temporal keywords (year, month, day, etc.)

Functions

extract_candidates(sentence, sent_idx, question_analysis, base_score, document, config)

Extracts answer candidates from a sentence based on question analysis.

Returns a list of Answer structs with confidence scores.