A portable document embedding using SWEM.
Project description
SWEM
Implementation of SWEM(Simple Word-Embedding-based Models)
Baseline Needs More Love: On Simple Word-Embedding-Based Models and Associated Pooling Mechanisms (ACL 2018)
Installation
pip install swem
Example
import swem
from gensim.models import Word2Vec
if __name__ == '__main__':
model = Word2Vec.load('wiki_mecab-ipadic-neologd.model')
swem_embed = swem.SWEM(model)
doc = 'すもももももももものうち'
embed = swem_embed.infer_vector(doc, method='average')
print(embed.shape)
Results
(200,)
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
swem-0.1.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
swem-0.1.0-py3-none-any.whl
(3.8 kB
view hashes)