def __init__(self,
analyzer=None, matching=None,
name=None,
verbose=0,
n_epochs=10,
alpha=0.25,
min_alpha=0.05,
n_jobs=4,
**kwargs):
# self.model = model
self.alpha = alpha
self.min_alpha = min_alpha
self.verbose = verbose
self.name = "paragraph-vectors" if name is None else name
if matching is True:
self._matching = Matching()
elif matching is False or matching is None:
self._matching = None
else:
self._matching = Matching(**dict(matching))
self.analyzer = analyzer
self.model = Doc2Vec(alpha=alpha,
min_alpha=alpha,
size=500,
window=8,
min_count=1,
sample=1e-5,
workers=n_jobs,
negative=20,
dm=0, dbow_words=1, # words only with dm!=0?
dm_mean=0, # unused when in concat mode
dm_concat=1,
dm_tag_count=1
)
self.n_epochs = n_epochs
self._neighbors = NearestNeighbors(**kwargs)
评论列表
文章目录