Instructions to use fse/paranmt-300 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fse
How to use fse/paranmt-300 with fse:
pip install "fse<2"
from fse import SIF, IndexedList, Vectors vectors = Vectors.from_pretrained("paranmt-300") model = SIF(vectors) sentences = IndexedList([["hello", "world"], ["fast", "sentence", "embeddings"]]) model.train(sentences) vector = model.sv[0] - Notebooks
- Google Colab
- Kaggle
ParaNMT (300 dimensions)
300-dimensional word embeddings for 77,224 English words, from "Pushing the Limits of Paraphrastic Sentence Embeddings with Millions of Machine Translations".
This is a gensim model, packaged for fse (Fast Sentence Embeddings), which turns word vectors into sentence vectors with CBOW averaging, SIF and uSIF.
Usage
This repository uses the fse 1.x API and requires fse<2.
For fse 2.0, use fse/paranmt-300-raw for a finished mean encoder.
See the migration guide before upgrading.
pip install "fse<2"
from fse import SIF, IndexedList, Vectors
vectors = Vectors.from_pretrained("paranmt-300")
model = SIF(vectors)
sentences = IndexedList([["hello", "world"], ["fast", "sentence", "embeddings"]])
model.train(sentences)
model.sv[0] # the vector of the first sentence
Vectors.from_pretrained("paranmt-300", mmap="r") memory-maps the vectors instead of loading them into RAM.
Files
| File | Content |
|---|---|
paranmt-300.model |
gensim KeyedVectors (vocabulary and metadata) |
paranmt-300.model.vectors.npy |
77,224 ร 300 float32 vectors (93 MB) |
Source and license
The vectors were published by John Wieting on his page at Carnegie Mellon University. The page states no license, so none is given here. This repository redistributes them in the gensim format.
- Wieting and Gimpel (2018), ParaNMT-50M: Pushing the Limits of Paraphrastic Sentence Embeddings with Millions of Machine Translations
About fse
fse is maintained by Dr. Oliver Borchers. Source code, documentation and the STS benchmark of all vector sets in this organization: github.com/oborchers/Fast_Sentence_Embeddings.
- Downloads last month
- 21