glove Python bindings
Project description
glove-py is an implementation of the GloVe algorithm for learning word vectors from a corpus.
##Installation
using pip: pip install glove-py
.
install with github code :
git clone git@github.com:f20500909/glove_py.git
python3 setup.py install
from glove import *
model = Glove(epoch=2)
model.train("small_text")
model.to_txt()
words = model.most_similary("one", 10)
print(words)
using in shell
Skipgram model
Train & load skipgram model
from glove import *
model = Glove(params)
model.train(input_file)
model.to_txt()
words = model.most_similary("one", 10)
print(words)
List of available params
and their default value:
help info......
-input_file input_file [small_text]
-log_dir a dirctory to save temp file [log/]
-cofile max length of word ngram [cooccur.bin]
-vocab_file output vocabulary [vocab.txt]
-temp_file temporary file of common occurrence chunk [temp.bin_]
-embd_file embedded file[wordvec.txt]
-vocab_size vocabulary size to train [0]
-max_size maximum size to keep in courpus [10000000]
-min_count minimum times [1]
-window the window size to get common occurrence [10]
-embed_size embedded size [80]
-epoch train epoch [1]
-threads max length of char ngram [40]
-memory_limit max length of char ngram [1]
-lr max length of char ngram [0.05]
-keep_case max length of char ngram [0]
-symmetric max length of char ngram [1]
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
glove_py-0.1.8.tar.gz
(20.6 kB
view hashes)