All Projects → treeform → word2vec

treeform / word2vec

Licence: MIT license
Word2vec implemented in nim.

Programming Languages

nim
578 projects

word2vec - for Nim

Word2vec Logo

nimble install word2vec

Github Actions

API reference

This library has no dependencies other than the Nim standard libarary.

About

Word2vec can be used to turn text into vectors that encode the meaning. You can use these vectors to compare similarities between texts.

Exmaple

import word2vec

load(300) # load huge binary file
let
    aVec = text2vec("Cat set on a red wall")
    bVec = text2vec("Dog set on a red fence")
# how different are they?
echo dist(aVec, bVec)

Getting started

This library uses alreayd created GloVe vectors. There is no need to train your own vectors.

Beforey you start you need to download and convert:

mkdir glovebin
cd glovebin
wget http://nlp.stanford.edu/data/glove.6B.zip
unzip glove.6B.zip
cd ..
nim c -r tools/word2vecloader.nim
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].