Probabilistic

class matchup.models.algorithms.probabilistic.Probabilistic

Bases: matchup.models.model.IterModel

Attributes Summary

RANGE

Methods Summary

calculate(doc, term_scores) Sum the scores of the mapped representation.
iter_rank(vocabulary) One iteration of Probabilistic model execute.
number_docs_with_key(occurrences) Return the vi_value : number of documents with key
probabilistic_iterative_perform(vocabulary) Perform the algorithm iterations.
process_terms(vocabulary) Generate scores for all mapped terms.
run(query, vocabulary) Principal method that represents IR probabilistic model.
score(key, vocabulary) Apply probabilistic concepts to calculate the score of one keyword in vocabulary.

Attributes Documentation

RANGE = 5

Methods Documentation

calculate(doc: str, term_scores) → float
Sum the scores of the mapped representation.
Parameters:
  • doc
  • term_scores
Returns:

iter_rank(vocabulary) → List[matchup.structure.solution.Result]
One iteration of Probabilistic model execute.
Returns:ranked list of documents, scores
number_docs_with_key(occurrences) → int
Return the vi_value : number of documents with key
Parameters:occurrences – Occurrences
Returns:
probabilistic_iterative_perform(vocabulary) → List[matchup.structure.solution.Result]
Perform the algorithm iterations.
Parameters:vocabulary
Returns:
process_terms(vocabulary)
Generate scores for all mapped terms.
Parameters:vocabulary
Returns:
run(query: List[matchup.presentation.text.Term], vocabulary: matchup.structure.vocabulary.Vocabulary)
Principal method that represents IR probabilistic model.
Parameters:
  • query – list of all query terms
  • vocabulary – data structure that represents the vocabulary
Returns:

score(key: str, vocabulary: matchup.structure.vocabulary.Vocabulary) → float
Apply probabilistic concepts to calculate the score of one keyword in vocabulary.
Parameters:
  • key – keyword to generate score
  • vocabulary – base collection
Returns:

float score