Skip to content

Commit 5655d62

Browse files
committed
refine similariy
1 parent 274f4c0 commit 5655d62

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

Tutorials/2_Similarity/similarity.ipynb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"name": "stdout",
188188
"output_type": "stream",
189189
"text": [
190-
"tensor([[3., 2., 3., 6.]]) tensor([[2., 4., 4., 1.]])\n"
190+
"tensor([[5., 2., 2., 6.]]) tensor([[4., 6., 6., 4.]])\n"
191191
]
192192
}
193193
],
@@ -239,7 +239,7 @@
239239
{
240240
"data": {
241241
"text/plain": [
242-
"5.5677642822265625"
242+
"6.082762718200684"
243243
]
244244
},
245245
"execution_count": 6,
@@ -273,7 +273,7 @@
273273
{
274274
"data": {
275275
"text/plain": [
276-
"5.5677642822265625"
276+
"6.082762718200684"
277277
]
278278
},
279279
"execution_count": 7,
@@ -382,7 +382,7 @@
382382
"name": "stdout",
383383
"output_type": "stream",
384384
"text": [
385-
"0.6907725930213928\n"
385+
"0.802726686000824\n"
386386
]
387387
}
388388
],
@@ -439,7 +439,7 @@
439439
"name": "stdout",
440440
"output_type": "stream",
441441
"text": [
442-
"0.6907725930213928\n"
442+
"0.802726686000824\n"
443443
]
444444
}
445445
],
@@ -487,7 +487,7 @@
487487
{
488488
"data": {
489489
"text/plain": [
490-
"0.6907725930213928"
490+
"0.802726686000824"
491491
]
492492
},
493493
"execution_count": 11,
@@ -530,7 +530,7 @@
530530
{
531531
"data": {
532532
"text/plain": [
533-
"32.0"
533+
"68.0"
534534
]
535535
},
536536
"execution_count": 12,
@@ -563,31 +563,31 @@
563563
},
564564
{
565565
"cell_type": "code",
566-
"execution_count": 20,
566+
"execution_count": 14,
567567
"id": "e0f40534",
568568
"metadata": {},
569569
"outputs": [],
570570
"source": [
571571
"from FlagEmbedding import FlagModel\n",
572572
"\n",
573-
"model = FlagModel('BAAI/bge-base-en-v1.5',\n",
573+
"model = FlagModel('BAAI/bge-large-en-v1.5',\n",
574574
" query_instruction_for_retrieval=\"Represent this sentence for searching relevant passages:\",\n",
575575
" use_fp16=True)"
576576
]
577577
},
578578
{
579579
"cell_type": "code",
580-
"execution_count": 21,
580+
"execution_count": 15,
581581
"id": "78445a86",
582582
"metadata": {},
583583
"outputs": [
584584
{
585585
"data": {
586586
"text/plain": [
587-
"0.9999999403953552"
587+
"1.0"
588588
]
589589
},
590-
"execution_count": 21,
590+
"execution_count": 15,
591591
"metadata": {},
592592
"output_type": "execute_result"
593593
}
@@ -616,7 +616,7 @@
616616
},
617617
{
618618
"cell_type": "code",
619-
"execution_count": 22,
619+
"execution_count": 16,
620620
"id": "73012cbb",
621621
"metadata": {},
622622
"outputs": [],
@@ -648,7 +648,7 @@
648648
},
649649
{
650650
"cell_type": "code",
651-
"execution_count": 23,
651+
"execution_count": 17,
652652
"id": "98bfcc6d",
653653
"metadata": {},
654654
"outputs": [
@@ -684,15 +684,15 @@
684684
},
685685
{
686686
"cell_type": "code",
687-
"execution_count": 24,
687+
"execution_count": 18,
688688
"id": "426c0b42",
689689
"metadata": {},
690690
"outputs": [
691691
{
692692
"name": "stdout",
693693
"output_type": "stream",
694694
"text": [
695-
"torch.Size([1, 768])\n"
695+
"torch.Size([1, 1024])\n"
696696
]
697697
}
698698
],
@@ -715,16 +715,16 @@
715715
},
716716
{
717717
"cell_type": "code",
718-
"execution_count": 25,
718+
"execution_count": 19,
719719
"id": "d9bb35cf",
720720
"metadata": {},
721721
"outputs": [
722722
{
723723
"name": "stdout",
724724
"output_type": "stream",
725725
"text": [
726-
"0.49946388602256775\n",
727-
"0.6032702922821045\n"
726+
"0.714613139629364\n",
727+
"0.5931472182273865\n"
728728
]
729729
}
730730
],
@@ -745,16 +745,16 @@
745745
},
746746
{
747747
"cell_type": "code",
748-
"execution_count": 26,
748+
"execution_count": 20,
749749
"id": "29e70bbc",
750750
"metadata": {},
751751
"outputs": [
752752
{
753753
"name": "stdout",
754754
"output_type": "stream",
755755
"text": [
756-
"0.8752679824829102\n",
757-
"0.8180326223373413\n"
756+
"0.7446640729904175\n",
757+
"0.8240882158279419\n"
758758
]
759759
}
760760
],

0 commit comments

Comments
 (0)