def score(self,
            claim,
            candidates,
            text_key = 'text'):
    """Return the score for each candidate, order does not change.

    Args:
      claim: The claim to match
      candidates: The candidates to rank
      text_key: Key in the candidate json that contains the text to score

    Returns:
      The score for each candidate
    """
    if self._tfidf is None:
      raise ValueError('You must train or load a model before predicting')
    if not candidates:
      return []
    # make candidates indexable via numpy style indices
    candidates = np.array(candidates, dtype=object)
    # (1, vocab_size)
    claim_repr = self._tfidf.transform([claim])
    # (n_candidates, vocab_size)
    candidates_repr = self._tfidf.transform([c[text_key] for c in candidates])
    # (1, n_candidates)
    product = candidates_repr.dot(claim_repr.T).T.toarray()
    return product.reshape(-1).tolist()
Return the score for each candidate, order does not change.

    Args:
      claim: The claim to match
      candidates: The candidates to rank
      text_key: Key in the candidate json that contains the text to score

    Returns:
      The score for each candidate
    
language/serene/text_matcher.py