Skip to main content

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)

Details are available here(Japanese).

Example

from gensim.models.word2vec import Word2Vec

from swem import SWEM

if __name__ == '__main__':
    model = Word2Vec.load('wiki_mecab-ipadic-neologd.model')

    swem = SWEM(model)

    doc = '僕の名前はバナナです。'


    for method in ['max', 'average', 'concat']:
        print(swem.infer_vector(doc, method=method).shape)

Results

(200,)
(200,)
(400,)

Project details


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.0.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

swem-0.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page