Student repo for CBOW and Skip-gram Word2Vec with a GitHub Pages leaderboard.
Main homework: complete the TODOs in skipgram_homework.py.
SkipGramDataset: build(center_word_id, context_word_id)pairs.SkipGramWord2Vec: defineself.embeddingandself.output.forward: turn center ids into vocabulary logits.
CBOW is already implemented in cbow_word2vec.py and can also be submitted.
Skip-gram minimizes cross-entropy for predicting a nearby context word from the center word.
CBOW minimizes cross-entropy for predicting the center word from its surrounding context words.
Leaderboard ranking uses held-out accuracy; lower loss breaks ties.
Skip-gram:
python skipgram_homework.py --epochs 3CBOW:
python cbow_word2vec.py --epochs 3Keep the starter defaults for leaderboard-compatible checkpoints: vocab size 5000, window size 2, max tokens 200000, validation fraction 0.2.
Install dependencies if needed:
pip install -r requirements.txtScore without saving by omitting --name:
python submit.py --model skipgram
python submit.py --model cbow --file cbow_submission.ptYou can also force test-only mode with a name:
python submit.py --name "your-name" --model skipgram --score-only
python submit.py --name "your-name" --model cbow --file cbow_submission.pt --score-onlyPublish by adding a name:
python submit.py --name "your-name" --model skipgram
python submit.py --name "your-name" --model cbow --file cbow_submission.ptLeaderboard page: https://tues-ai.github.io/word2vec/
- skipgram_homework.py — student starter.
- cbow_word2vec.py — simple CBOW implementation.
- submit.py — terminal submission client.
- index.html, server-url/ — GitHub Pages leaderboard and live backend URL broker.
- examples/ — copy-paste command examples.