Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated description for 'worker_loop' function used in 'score' function #1206

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def __init__(
raise TypeError("You can't pass a generator as the sentences argument. Try an iterator.")
self.build_vocab(sentences, trim_rule=trim_rule)
self.train(sentences)

else :
if trim_rule is not None :
logger.warning("The rule, if given, is only used prune vocabulary during build_vocab() and is not stored as part of the model. ")
Expand Down Expand Up @@ -995,7 +995,7 @@ def score(self, sentences, total_sentences=int(1e6), chunksize=100, queue_factor
run word2vec with hs=1 and negative=0 for this to work.")

def worker_loop():
"""Train the model, lifting lists of sentences from the jobs queue."""
"""Compute log probability for each sentence, lifting lists of sentences from the jobs queue."""
work = zeros(1, dtype=REAL) # for sg hs, we actually only need one memory loc (running sum)
neu1 = matutils.zeros_aligned(self.layer1_size, dtype=REAL)
while True:
Expand Down