Skip to main content

Embeddings for software modeling

Project description

WordE4MDE

WordE4MDE is a Python library that provides word embeddings for the MDE domain.

Installation 🛠

Using pip:

pip install worde4mde

Usage

First of all, you need to load the embeddings (currently supported: 'sgram-mde' and 'glove-mde').

from worde4mde import load_embeddings
sgram_mde = load_embeddings('sgram-mde')

The load_embeddings function returns a KeyedVectors object from the gensim library. If you want to retrieve the most similar words to a given word, you can use the most_similar function:

word = 'ecore'
sgram_mde.most_similar(positive=[word])
>>> [('emf', 0.6336350440979004), ('metamodels', 0.5963817834854126), 
     ('ecorebased', 0.5922590494155884), ... 

Furthermore, if you want to get the embedding of a given word, just write the following:

sgram_mde[word]
>>> [ 0.14674647  0.42704162  0.17717203  0.05179158  0.38020504 -0.00091264 ...

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

worde4mde-1.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

worde4mde-1.0-py3-none-any.whl (3.6 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