File size: 510 Bytes
48d1b47 e1efc31 48d1b47 e1efc31 48d1b47 e1efc31 48d1b47 e1efc31 48d1b47 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from sentence_transformers import SentenceTransformer
import numpy as np
def get_sentence_embeddings(positive_text, unlabelled_text):
# Initialize SentenceTransformer model
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
# Generate embeddings for positive text
positive_embeddings = model.encode(positive_text)
# Generate embeddings for unlabelled text
unlabelled_embeddings = model.encode(unlabelled_text)
return positive_embeddings, unlabelled_embeddings |