https://github.com/lguyogiro/pyglove
Python interface for building, loading, and using GloVe vectors.
https://github.com/lguyogiro/pyglove
glove glove-vectors nlp python word-vectors
Last synced: 2 months ago
JSON representation
Python interface for building, loading, and using GloVe vectors.
- Host: GitHub
- URL: https://github.com/lguyogiro/pyglove
- Owner: Lguyogiro
- Created: 2018-01-08T21:46:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T21:47:31.000Z (over 7 years ago)
- Last Synced: 2025-04-05T23:51:09.508Z (6 months ago)
- Topics: glove, glove-vectors, nlp, python, word-vectors
- Language: Python
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A small Python module that allows you to train and use GloVe vectors in your Python appplications. For more about GloVe, see https://nlp.stanford.edu/pubs/glove.pdf
eg
```Python
>>> from pyglove import GloVe
>>> from sklearn.datasets import fetch_20newsgroups>>> sentences = [sentence.split() for sentence in fetch_20newsgroups()['data']]
>>> glove_pth = "/path/to/glove/install"
>>> vector_file_name = "20newsgroup_words.txt" # file where vectors will be stored>>> model = GloVe(sentences, vector_file_name, glove_installation_dir=glove_pth,
vocab_min_count=5, vector_size=50, window_size=15)
>>> model.most_similar("Camry", n=1)
[('Toyota', 0.69786818922200133)]```