sentence-transformers How to use TomatenMarc/WRAPresentations with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("TomatenMarc/WRAPresentations")
sentences = [
"The formula: Not everyone who voted Leave is racist. But everyone who's racist voted Leave. Not everyone who voted Leave is thick. But everyone who's thick voted Leave. The thick racists therefore called the shots, whatever the thoughts of the minority of others. #thick #Brexit",
"Men shouldn’t be making laws about women’s bodies #abortion #Texas",
"Opinion: As the draconian (and then some) abortion law takes effecting #Texas, this is not an idle question for millions of Americans. A slippery slope towards more like-minded Republican state-legislatures to try to follow suit. #abortion #F24 HTTPURL",
"’Bitter truth’: EU chief pours cold water on idea of Brits keeping EU citizenship after #Brexit HTTPURL via @USER",
"@USER Blah blah blah blah blah blah"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [5, 5]