camel_tools.disambig.common
This sub-module contains common functions and classes used for disambiguation.
Classes
- class camel_tools.disambig.common.ScoredAnalysis(score, analysis, diac, pos_lex_logprob, lex_logprob)
A named tuple containing an analysis and its score.
- analysis
The analysis dictionary. See CAMeL Morphology Features for more information on features and their values.
- Type:
- diac
The diactrized form of the associated analysis. Used for tie-breaking equally scored analyses.
- Type:
- pos_lex_log_prob
The log (base 10) of the probability of the associated pos-lex pair values. Used for tie-breaking equally scored analyses.
- Type:
- class camel_tools.disambig.common.DisambiguatedWord(word, analyses)
A named tuple containing a word and a sorted list (from high to low score) of scored analyses.
- analyses
List of scored analyses sorted from highest to lowest disambiguation score.
- Type:
- class camel_tools.disambig.common.Disambiguator
Abstract base class that all disambiguators should implement.
- abstract all_feats()
Return a set of all features produced by this disambiguator.
- abstract disambiguate(sentence, top=1)
Disambiguate words in a sentence.
- Parameters:
Returns:
listofDisambiguatedWord: List of disambiguted words in sentence.
- abstract disambiguate_word(sentence, word_ndx, top=1)
Disambiguate a word at a given index in a sentence.
- Parameters:
Returns:
DisambiguatedWord: The disambiguated word at index word_ndx in sentence.