Interface RelevanceRanker

All Known Implementing Classes:
BM25, TFIDF

public interface RelevanceRanker
An interface to provide relevance ranking algorithm.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    rank(Corpus corpus, TextTerms doc, String[] terms, int[] tf, int n)
    Returns the relevance score between a set of terms and a document based on a corpus.
    double
    rank(Corpus corpus, TextTerms doc, String term, int tf, int n)
    Returns the relevance score between a term and a document based on a corpus.
  • Method Details

    • rank

      double rank(Corpus corpus, TextTerms doc, String term, int tf, int n)
      Returns the relevance score between a term and a document based on a corpus.
      Parameters:
      corpus - the corpus.
      doc - the document to rank.
      term - the searching term.
      tf - the term frequency in the document.
      n - the number of documents containing the given term in the corpus;
      Returns:
      the relevance score.
    • rank

      double rank(Corpus corpus, TextTerms doc, String[] terms, int[] tf, int n)
      Returns the relevance score between a set of terms and a document based on a corpus.
      Parameters:
      corpus - the corpus.
      doc - the document to rank.
      terms - the searching terms.
      tf - the term frequencies in the document.
      n - the number of documents containing the given term in the corpus;
      Returns:
      the relevance score.