Views
No views yet
1from sentence_transformers import CrossEncoder
2
3
4model = CrossEncoder('abbasgolestani/ag-nli-DeTS-sentence-similarity-v2')
5
6# Two lists of sentences
7sentences1 = ['I am honored to be given the opportunity to help make our company better',
8 'I love my job and what I do here',
9 'I am excited about our company’s vision']
10
11sentences2 = ['I am hopeful about the future of our company',
12 'My work is aligning with my passion',
13 'Definitely our company vision will be the next breakthrough to change the world and I’m so happy and proud to work here']
14
15pairs = zip(sentences1,sentences2)
16list_pairs=list(pairs)
17
18scores1 = model.predict(list_pairs, show_progress_bar=False)
19print(scores1)
20
21for i in range(len(sentences1)):
22 print("{} \t\t {} \t\t Score: {:.4f}".format(sentences1[i], sentences2[i], scores1[i]))
231from sentence_transformers import CrossEncoder
2model = CrossEncoder('abbasgolestani/ag-nli-DeTS-sentence-similarity-v2')
3scores = model.predict([('Sentence 1', 'Sentence 2'), ('Sentence 3', 'Sentence 4')])('Sentence 1', 'Sentence 2') and ('Sentence 3', 'Sentence 4').AutoModel class