sentence-transformers How to use tasksource/ModernBERT-base-embed with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("tasksource/ModernBERT-base-embed")
sentences = [
"Daniel went to the kitchen. Sandra went back to the kitchen. Daniel moved to the garden. Sandra grabbed the apple. Sandra went back to the office. Sandra dropped the apple. Sandra went to the garden. Sandra went back to the bedroom. Sandra went back to the office. Mary went back to the office. Daniel moved to the bathroom. Sandra grabbed the apple. Sandra travelled to the garden. Sandra put down the apple there. Mary went back to the bathroom. Daniel travelled to the garden. Mary took the milk. Sandra grabbed the apple. Mary left the milk there. Sandra journeyed to the bedroom. John travelled to the office. John went back to the garden. Sandra journeyed to the garden. Mary grabbed the milk. Mary left the milk. Mary grabbed the milk. Mary went to the hallway. John moved to the hallway. Mary picked up the football. Sandra journeyed to the kitchen. Sandra left the apple. Mary discarded the milk. John journeyed to the garden. Mary dropped the football. Daniel moved to the bathroom. Daniel journeyed to the kitchen. Mary travelled to the bathroom. Daniel went to the bedroom. Mary went to the hallway. Sandra got the apple. Sandra went back to the hallway. Mary moved to the kitchen. Sandra dropped the apple there. Sandra grabbed the milk. Sandra journeyed to the bathroom. John went back to the kitchen. Sandra went to the kitchen. Sandra travelled to the bathroom. Daniel went to the garden. Daniel moved to the kitchen. Sandra dropped the milk. Sandra got the milk. Sandra put down the milk. John journeyed to the garden. Sandra went back to the hallway. Sandra picked up the apple. Sandra got the football. Sandra moved to the garden. Daniel moved to the bathroom. Daniel travelled to the garden. Sandra went back to the bathroom. Sandra discarded the football.",
"In the adulthood stage, it can jump, walk, run",
"The chocolate is bigger than the container.",
"The football before the bathroom was in the garden."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]