Skip to content

mircorudolph/embeddings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embeddings Demo

Modular word-embedding demo built on pretrained GloVe vectors, with both a CLI and a Streamlit frontend.

Install

With uv

uv sync

With pip

python -m venv .venv
.\.venv\Scripts\activate.bat
pip install -e .

Run

Streamlit frontend

python -m streamlit run app/scripts/streamlit_app.py

Notes:

  • The app shows a dropdown with all downloadable gensim models.
  • Models are not all loaded at startup. Only the model you select is loaded.
  • First load downloads the model; later runs use the local cache (.cache/gensim-data by default).

CLI

Show a word vector:

python -m app.scripts.word_vectors_cli vector --word king

Cosine similarity:

python -m app.scripts.word_vectors_cli similarity --word1 king --word2 queen

Word math:

python -m app.scripts.word_vectors_cli math --expression "king - man + woman" --topn 5

Preload model(s) into cache:

python -m app.scripts.preload_models --model-names glove-wiki-gigaword-300

List available models:

python -m app.scripts.preload_models --list

Docker

Build:

docker build -t embeddings-app .

Run:

docker run -it --rm -p 8501:8501 embeddings-app

Common workflows

Run tests:

pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors