Yohannes Tigistu Worku
updated the index order
328cca4
Raw
History Blame Contribute Delete
581 Bytes
from sentence_transformers import CrossEncoder
model = CrossEncoder("cross-encoder/nli-deberta-v3-small")
pairs = [
# 1. Clear entailment
["A man is playing soccer.", "A man is playing a sport."],
# 2. Clear contradiction
["A man is playing soccer.", "A man is sleeping."],
# 3. Clear neutral
["A man is playing soccer.", "A man is wearing a red shirt."]
]
scores = model.predict(pairs, apply_softmax=True)
for pair, score in zip(pairs, scores):
print(f"Pair: {pair}")
print(f"Scores: [0]={score[0]:.4f}, [1]={score[1]:.4f}, [2]={score[2]:.4f}")