BeliefNetwork

class matchup.models.algorithms.belief_network.BeliefNetwork

Bases: matchup.models.model.IterModel

Methods Summary

generate_scores(doc_repr, float], …) Calculate similarity between one document and query based in Belief Network IR model.
run(query, vocabulary) Belief Network algorithm.

Methods Documentation

classmethod generate_scores(doc_repr: DefaultDict[str, float], query_repr: DefaultDict[str, float], prob_k: float) → float
Calculate similarity between one document and query based in Belief Network IR model.
Parameters:
  • doc_repr – Document vector space representation
  • query_repr – Query vector space representation
  • prob_k – Probability that a random key ‘k’ is relevant

:return Relevant score of document based in query.

run(query: List[matchup.presentation.text.Term], vocabulary: matchup.structure.vocabulary.Vocabulary) → List[matchup.structure.solution.Result]
Belief Network algorithm.
Parameters:
  • query – list of all query terms
  • vocabulary – data structure that represents the vocabulary
Returns:

list of solution -> (document, score)