Custom Skip-Gram and Bag-of-Words implementations trained on a
Training data was drawn from dataset.py for the full list.
skip_gram.py contains a PyTorch implementation of the Skip-Gram model. Training configuration:
- Embedding dimension:
128 - Optimizer:
Adamwith default settings,lr=0.001 - Epochs:
30 - Context window radius:
4 - Negative sampling:
20negative token pairs per batch
TensorBoard was used for experiment tracking and training was run locally on an NVIDIA GeForce GTX 1650.
bag_of_words.py uses a scikit-learn TF-IDF vectorizer. The corpus is split into consecutive, non-overlapping windows of 256 tokens, each treated as a document, yielding word vectors of dimension 11029.
Both models were evaluated on the WordSim-353 human-annotated word-pair similarity benchmark. Cosine similarity scores were rescaled to
| Model | MSE | RMSE |
|---|---|---|
| Bag of Words | 0.05451 | 0.23347 |
| Skip-Gram | 0.04049 | 0.20122 |