Views
No views yet
pip install -U sentence-transformers1from sentence_transformers import CrossEncoder
2
3# Download from the 🤗 Hub
4model = CrossEncoder("software-si/kitchen-it-nli-deberta")
5# Get scores for pairs of texts
6pairs = [
7 ['How many calories in an egg', 'There are on average between 55 and 80 calories in an egg depending on its size.'],
8 ['How many calories in an egg', 'Egg whites are very low in calories, have no fat, no cholesterol, and are loaded with protein.'],
9 ['How many calories in an egg', 'Most of the calories in an egg come from the yellow yolk in the center.'],
10]
11scores = model.predict(pairs)
12print(scores.shape)
13# (3, 3)