ierhon's picture
Update embedding.py
35fcd62
raw
history blame contribute delete
247 Bytes
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli')
def getvec(text: str):
sentences = [text,]
embeddings = model.encode(sentences)
return embeddings[0]