||Bag of Words (or bag of trigrams when datamode=trigram) extractor. Used with the DSSM reranker.|
BagOfWords(config=None, provide=None, share_dependency_objects=False, build=True)[source]¶
Bag of Words (or bag of trigrams when datamode=trigram) extractor. Used with the DSSM reranker.
id2vec(self, q_id, posdoc_id, negdoc_id=None, **kwargs)[source]¶
Creates a feature from the (qid, docid) pair. If negdocid is supplied, that’s also included in the feature (needed for training with pairwise hinge loss) Label is a vector of shape [num_classes], and is supplied only when using pointwise training (i.e cross entropy) When using pointwise samples, negdocid is None, and label is either [0, 1] or [1, 0] depending on whether the document represented by posdocid is relevant or irrelevant respectively.