No description
Find a file
2021-09-30 16:56:31 -07:00
docs Update readme and add logo. 2019-12-14 10:40:00 -08:00
src initial commit 2019-12-11 22:22:53 +00:00
test Add tests. 2019-12-26 22:54:17 +00:00
tools update loader 2019-12-11 22:59:14 +00:00
.gitignore initial commit 2019-12-11 22:22:53 +00:00
LICENSE Add license 2021-09-30 12:02:03 -07:00
README.md Update readme. 2021-09-30 16:56:31 -07:00
word2vec.nimble Update readme. 2021-09-30 16:56:31 -07:00

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