Nasty.Operations.QA.CandidateScorer (Nasty v0.3.0)
View SourceGeneric sentence scoring for Question Answering.
Scores sentences for relevance to a question using:
- Keyword matching (lemma overlap)
- Entity type matching (expected answer type)
- Position bias (earlier sentences preferred)
Summary
Functions
Scores a sentence for relevance to a question.
Functions
@spec score_sentence( Nasty.AST.Sentence.t(), Nasty.Operations.QA.QuestionClassifier.t(), [{Nasty.AST.Sentence.t(), integer()}], map() ) :: float()
Scores a sentence for relevance to a question.
Returns a score between 0.0 and 1.0+, where higher scores indicate more relevant sentences.
Scoring Components
- Base score: 0.1 (allows fallback even with no keyword matches)
- Keyword match: 0.6 weight
- Entity type: 0.2 weight
- Position: 0.2 weight