← all repositories
3Top/word2vec-api

Word2Vec as a REST API: because pip install gensim was too easy

A thin Flask wrapper that turns pretrained word embedding models into HTTP endpoints for similarity queries and vector lookups.

word2vec-api
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does

This is a minimal Python web service that exposes Gensim’s Word2Vec methods over HTTP. You point it at a pretrained model file—Google News vectors, GloVe weights, whatever—and it serves up similarity, most_similar, n_similarity, and raw vector lookups via GET requests. Python 3 compatible, launched from the command line with --model and optional --host/--port.

The interesting bit

The real utility here isn’t the code—it’s the curation. The README maintains a substantial table of downloadable pretrained models (Google News, GloVe variants, Twitter embeddings, even German Wikipedia) with dimensions, corpus sizes, and architecture details. For anyone who needs vectors now without training on their own data, this is a decent starting index.

Key highlights

  • Supports both Word2Vec text and binary formats via Gensim
  • Endpoints: similarity, n_similarity, most_similar (with positive/negative word arithmetic), model (base64-encoded vector), model_word_set (base64-encoded vocabulary pickle)
  • Command-line launch with configurable host, port, and URL path prefix
  • Includes working curl examples for immediate testing
  • Curated list of ~15 pretrained models with metadata (dimensions, corpus, vocabulary size, architecture)

Caveats

  • No authentication, rate limiting, or batching visible in the README—this is a single-process research tool, not a production service
  • Base64 encoding for vectors and vocabulary pickles adds overhead; no native JSON array option shown
  • Last substantial update appears to be the Python 3 port; no mention of async, streaming, or modern serving frameworks

Verdict

Useful if you have a one-off need to query word vectors from a language that isn’t Python, or if you’re prototyping something that needs embedding lookups without the Gensim dependency. Skip it if you need scale, real-time performance, or anything resembling an SLA.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.