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

Change args passed to Word2Vec class #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
changed args passed to Word2Vec class
pedroruas18 committed Jun 17, 2021
commit 46e18afddab58eb949f57e17e6f7d1129932e090
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def parse_args():
parser.add_argument('--window-size', type=int, default=10,
help='Context size for optimization. Default is 10.')

parser.add_argument('--iter', default=1, type=int,
parser.add_argument('--epochs', default=1, type=int,
help='Number of epochs in SGD')

parser.add_argument('--workers', type=int, default=8,
@@ -84,7 +84,7 @@ def learn_embeddings(walks):
Learn embeddings by optimizing the Skipgram objective using SGD.
'''
walks = [map(str, walk) for walk in walks]
model = Word2Vec(walks, size=args.dimensions, window=args.window_size, min_count=0, sg=1, workers=args.workers, iter=args.iter)
model = Word2Vec(walks, vector_size=args.dimensions, window=args.window_size, min_count=0, sg=1, workers=args.workers, epochs=args.epochs)
model.save_word2vec_format(args.output)

return