Vector

class matchup.models.algorithms.vector_space.Vector

Bases: matchup.models.model.IterModel

Methods Summary

generate_scores(doc_repr, float], …) Calculate the similarity between one doc and one query by its representations
run(query, vocabulary) Principal method that represents IR vector space model.

Methods Documentation

classmethod generate_scores(doc_repr: DefaultDict[str, float], query_repr: DefaultDict[str, float]) → float
Calculate the similarity between one doc and one query by its representations
Parameters:
  • doc_repr – doc repr
  • query_repr – query repr
Returns:

similarity

run(query: List[matchup.presentation.text.Term], vocabulary: matchup.structure.vocabulary.Vocabulary) → List[matchup.structure.solution.Result]
Principal method that represents IR vector space model.
Parameters:
  • query – list of all query terms
  • vocabulary – data structure that represents the vocabulary
Returns:

list of solution -> (document, score)