wordsim is a small game that scores guesses by semantic similarity, similar to Contexto or Semantle. An online version of the game is currently hosted at cagrislist.org/projects/wordsim using the code in this repository. The core game is a standalone static page with a vanilla TypeScript client, and all embeddings, cosine similarities, and proximity ranks are computed offline for responsiveness. This repository also includes a small Jekyll landing page for local previewing.
The demo contains English and Turkish collections, each with 160 puzzles currently: 20 each for animals, objects, actions, adjectives, foods, places, occupations, and clothing. For the generated puzzles, stable IDs and category assignments live in pipeline/targets/en.json and pipeline/targets/tr.json.
- Node.js 18 or newer
- Ruby 3.3 and Bundler
- Python 3.11 or newer
- A Hugging Face account with the EmbeddingGemma terms accepted when generating English data
npm install
bundle install
python3 -m venv game
source game/bin/activate
pip install -e .
hf auth loginAccess to EmbeddingGemma is gated by Google's terms. Model weights and generated NumPy caches remain local and are ignored by Git; they are not included in Wordsim releases.
source game/bin/activate
python -m pipeline generate --collection embeddinggemma-768-en-v1
python -m pipeline fetch --collection word2vec-skipgram-300-tr-v1
python -m pipeline generate --collection word2vec-skipgram-300-tr-v1
python -m pipeline audit --collection embeddinggemma-768-en-v1 --limit 25
python -m pipeline audit --collection word2vec-skipgram-300-tr-v1 --limit 25Generation performs the following work:
- Selects and normalizes entries from
wordfreq: the 30,000 most frequent valid English surface forms, or the reviewed Zeyrek-preprocessed Turkish vocabulary. See the Turkish vocabulary documentation for the normalization rules and thetr-overrides.jsonlexical-review workflow. - Encodes the vocabulary with the collection's pinned extractor: prompted EmbeddingGemma for English or the static Word2Vec table for Turkish.
- Stores normalized embeddings in
pipeline-cache/<collection-id>/embeddings.npyfor reuse. - Reads the language's 160 stable IDs, words, and categories from
pipeline/targets/and verifies exactly 20 targets per category. - Writes a versioned vocabulary, collection manifest, and 160 minified puzzle tables under
wordsim/data/collections/<collection-id>/, plus the sharedcatalog.json.
Useful generator options include --device cuda, --batch-size N, --targets PATH, and --force. A valid generated vocabulary and embedding cache can be reused without loading the model dependencies.
In this current version, the published Turkish collection uses the 300-dimensional Word2Vec skip-gram vectors released with A Comprehensive Analysis of Static Word Embeddings for Turkish.
source game/bin/activate
python -m pipeline fetch --collection word2vec-skipgram-300-tr-v1
python -m pipeline generate --collection word2vec-skipgram-300-tr-v1
python -m pipeline audit --collection word2vec-skipgram-300-tr-v1 --limit 25npm run build:game
bundle exec jekyll serveAfter these steps, you can access the game by visiting http://localhost:4000/wordsim/.
The repository intentionally is minimal and contains no deployment workflow. npm run build:site bundles the browser code and creates the local _site/ output.
npm test
source game/bin/activate
python -m unittest discover -s tests -p 'test_*.py'
npm run build:siteSee THIRD_PARTY_NOTICES.md for model and vocabulary attribution.
Wordsim's original code and documentation are available under the MIT License. Generated vocabularies and ranking data incorporate outputs or data from third-party sources and remain subject to the attribution and applicable terms described in THIRD_PARTY_NOTICES.md. The MIT License does not relicense those third-party materials.
