def __init__(self, match_fn=TermMatch, binary=True, dtype=np.bool_,
**cv_params):
"""initializes a Matching object
:match_fn: A matching function of signature `docs, query`
-> indices of matching docs
:binary: Store only binary term occurrences.
:dtype: Data type of internal feature matrix
:cv_params: Parameter for the count vectorizer such as lowercase=True
"""
# RetrievalBase.__init__(self)
self._match_fn = match_fn
self._vect = CountVectorizer(binary=binary, dtype=dtype,
**cv_params)
评论列表
文章目录