SISTER (SImple SenTence EmbeddeR)
Project description
sister
SISTER (SImple SenTence EmbeddeR)
Installation
pip install sister
Basic Usage
import sister
sentence_embedding = sister.MeanEmbedding(lang="en")
sentence = "I am a dog."
vector = sentence_embedding(sentence)
Supported languages.
- English
- Japanese
- French
In order to support a new language, please implement Tokenizer
(inheriting sister.tokenizers.Tokenizer
) and add fastText
pre-trained url to word_embedders.get_fasttext()
(List of model urls).
Bert models are supported for en, fr, ja (2020-06-29).
Actually Albert for English, CamemBERT for French and BERT for Japanese.
To use BERT, you need to install sister by pip install 'sister[bert]'
.
import sister
bert_embedding = sister.BertEmbedding(lang="en")
sentence = "I am a dog."
vector = bert_embedding(sentence)
You can also give multiple sentences to it (more efficient).
import sister
bert_embedding = sister.BertEmbedding(lang="en")
sentences = ["I am a dog.", "I want be a cat."]
vectors = bert_embedding(sentences)
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
sister-0.2.2.tar.gz
(4.7 kB
view hashes)
Built Distribution
sister-0.2.2-py3-none-any.whl
(5.3 kB
view hashes)