MCPcopy Index your code
hub / github.com/3Top/word2vec-api

github.com/3Top/word2vec-api @v0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1 ↗ · + Follow
13 symbols 53 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

word2vec-api

Simple web service providing a word embedding API. The methods are based on Gensim Word2Vec implementation. Models are passed as parameters and must be in the Word2Vec text or binary format.

  • Launching the service
python word2vec-api --model path/to/the/model [--host host --port 1234]
  • Example calls
curl http://127.0.0.1:5000/word2vec/n_similarity?ws1=Sushi&ws1=Shop&ws2=Japanese&ws2=Restaurant
curl http://127.0.0.1:5000/word2vec/similarity?w1=Sushi&w2=Japanese
curl http://127.0.0.1:5000/word2vec/most_similar?positive=indian&positive=food[&negative=][&topn=]
curl http://127.0.0.1:5000/word2vec/model?word=restaurant

Note: The "model" method returns a base64 encoding of the Word2Vec vector.

Where to get a pretrained model

In case you do not have domain specific data to train, it can be convenient to use a pretrained model. Please feel free to submit additions to this list through a pull request.

Model file Number of dimensions Corpus (size) Vocabulary size Author Architecture Training Algorithm Context window - size Web page
Google News 300 Google News (100B) 3M Google word2vec negative sampling BoW - ~5 link
Freebase IDs 1000 Gooogle News (100B) 1.4M Google word2vec, skip-gram ? BoW - ~10 link
Freebase names 1000 Gooogle News (100B) 1.4M Google word2vec, skip-gram ? BoW - ~10 link
Wikipedia+Gigaword 5 50 Wikipedia+Gigaword 5 (6B) 400,000 GloVe GloVe AdaGrad 10+10 link
Wikipedia+Gigaword 5 100 Wikipedia+Gigaword 5 (6B) 400,000 GloVe GloVe AdaGrad 10+10 link
Wikipedia+Gigaword 5 200 Wikipedia+Gigaword 5 (6B) 400,000 GloVe GloVe AdaGrad 10+10 link
Wikipedia+Gigaword 5 300 Wikipedia+Gigaword 5 (6B) 400,000 GloVe GloVe AdaGrad 10+10 link
Common Crawl 42B 300 Common Crawl (42B) 1.9M GloVe GloVe GloVe AdaGrad link
Common Crawl 840B 300 Common Crawl (840B) 2.2M GloVe GloVe GloVe AdaGrad link
Twitter (2B Tweets) 25 Twitter (27B) ? GloVe GloVe GloVe AdaGrad link
Twitter (2B Tweets) 50 Twitter (27B) ? GloVe GloVe GloVe AdaGrad link
Twitter (2B Tweets) 100 Twitter (27B) ? GloVe GloVe GloVe AdaGrad link
Twitter (2B Tweets) 200 Twitter (27B) ? GloVe GloVe GloVe AdaGrad link
Wikipedia dependency 300 Wikipedia (?) 174,015 Levy \& Goldberg word2vec modified word2vec syntactic dependencies link
DBPedia vectors 1000 Wikipedia (?) ? wiki2vec word2vec word2vec, skip-gram BoW, 10 link

Core symbols most depended-on inside this repo

filter_words
called by 4
word2vec-api.py
get
called by 3
word2vec-api.py
codepoint_length
called by 1
clean-word2vec-text-format.py
read_utf8_char_and_decode
called by 1
clean-word2vec-text-format.py
get
called by 0
word2vec-api.py
get
called by 0
word2vec-api.py
get
called by 0
word2vec-api.py
pageNotFound
called by 0
word2vec-api.py

Shape

Function 5
Class 4
Method 4

Languages

Python100%

Modules by API surface

word2vec-api.py11 symbols
clean-word2vec-text-format.py2 symbols

For agents

$ claude mcp add word2vec-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact