@@ -24,8 +24,8 @@ permalink: /documentation/products/ai/edge-ai/models/baai-bge-reranker-v2-m3/
24
24
25
25
| Feature | Details |
26
26
| ---------| --------|
27
- | Azion Long-term Support (LTS) | ✅ / ❌|
28
- | Context Length | 8192 |
27
+ | Azion Long-term Support (LTS) | ❌|
28
+ | Context Length | 8k tokens |
29
29
| Supports LoRA | ❌ |
30
30
| Input data | Text |
31
31
@@ -35,50 +35,31 @@ permalink: /documentation/products/ai/edge-ai/models/baai-bge-reranker-v2-m3/
35
35
36
36
This is an example of a basic rerank request using this model:
37
37
38
- ``` bash
39
- curl -X POST \
40
- http://endpoint-url/rerank \
41
- -H ' Content-Type: application/json' \
42
- -d ' {
43
- "model": "BAAI/bge-reranker-v2-m3",
44
- "query": "What is deep learning?",
45
- "documents": [
46
- "Deep learning is a subset of machine learning that uses neural networks with many layers",
47
- "The weather is nice today",
48
- "Deep learning enables computers to learn from large amounts of data",
49
- "I like pizza"
50
- ]
51
- }'
38
+ ``` ts
39
+ const modelResponse = await Azion .AI .run (" baai-bge-reranker-v2-m3" , {
40
+ " query" : " What is deep learning?" ,
41
+ " documents" : [
42
+ " Deep learning is a subset of machine learning that uses neural networks with many layers" ,
43
+ " The weather is nice today" ,
44
+ " Deep learning enables computers to learn from large amounts of data" ,
45
+ " I like pizza"
46
+ ]
47
+ })
52
48
```
53
49
50
+ | Property | Type | Description |
51
+ | ------------| ------| -------------|
52
+ | ` query ` | string | The search query or prompt to rank the documents against. |
53
+ | ` documents ` | string[ ] | An array of documents to be ranked based on their relevance to the query. |
54
+
54
55
### Score example
55
56
56
57
This is an example of a basic score request using this model:
57
58
58
- ``` bash
59
- curl -X POST \
60
- http://endpoint-url/score \
61
- -H ' Content-Type: application/json' \
62
- -d ' {
63
- "model": "BAAI/bge-reranker-v2-m3",
64
- "text_1": "What is deep learning?",
65
- "text_2": [
66
- "Deep learning is a subset of machine learning that uses neural networks with many layers",
67
- "The weather is nice today",
68
- "Deep learning enables computers to learn from large amounts of data",
69
- "I like pizza"
70
- ]
71
- }'
72
- ```
73
-
74
- ### Running with Edge Functions:
75
-
76
- This is an example of how to run this model using Edge Functions:
77
-
78
59
``` ts
79
60
const modelResponse = await Azion .AI .run (" baai-bge-reranker-v2-m3" , {
80
- " query " : " What is deep learning?" ,
81
- " documents " : [
61
+ " text_1 " : " What is deep learning?" ,
62
+ " text_2 " : [
82
63
" Deep learning is a subset of machine learning that uses neural networks with many layers" ,
83
64
" The weather is nice today" ,
84
65
" Deep learning enables computers to learn from large amounts of data" ,
@@ -87,6 +68,65 @@ const modelResponse = await Azion.AI.run("baai-bge-reranker-v2-m3", {
87
68
})
88
69
```
89
70
71
+ | Property | Type | Description |
72
+ | ------------| ------| -------------|
73
+ | ` text_1 ` | string | The first text input for the model to process. |
74
+ | ` text_2 ` | string[ ] | An array of text inputs for the model to process and give a score. |
75
+
76
+ Response example:
77
+
78
+ ``` json
79
+ {
80
+ "id" : " rerank-356bf11f0e794f3c8f726bec7ba698bb" ,
81
+ "model" : " baai-bge-reranker-v2-m3" ,
82
+ "usage" : {
83
+ "total_tokens" : 78
84
+ },
85
+ "results" : [
86
+ {
87
+ "index" : 0 ,
88
+ "document" : {
89
+ "text" : " Deep learning is a subset of machine learning that uses neural networks with many layers"
90
+ },
91
+ "relevance_score" : 0.99951171875
92
+ },
93
+ {
94
+ "index" : 2 ,
95
+ "document" : {
96
+ "text" : " Deep learning enables computers to learn from large amounts of data"
97
+ },
98
+ "relevance_score" : 0.98291015625
99
+ },
100
+ {
101
+ "index" : 3 ,
102
+ "document" : {
103
+ "text" : " I like pizza"
104
+ },
105
+ "relevance_score" : 0.00001621246337890625
106
+ },
107
+ {
108
+ "index" : 1 ,
109
+ "document" : {
110
+ "text" : " The weather is nice today"
111
+ },
112
+ "relevance_score" : 0.000016033649444580078
113
+ }
114
+ ]
115
+ }
116
+ ```
117
+
118
+ | Property | Type | Description |
119
+ | --------------------------- | ------ | ---------------------------------------------------------- |
120
+ | ` id ` | string | Unique identifier for the rerank request. |
121
+ | ` model ` | string | The name of the model used for reranking. |
122
+ | ` usage.total_tokens ` | number | The total number of tokens used in the request. |
123
+ | ` results[] ` | object[ ] | An array of reranked result objects. |
124
+ | ` results[].index ` | number | The index of the document in the input list. |
125
+ | ` results[].document ` | object | The document object containing the text. |
126
+ | ` results[].document.text ` | string | The textual content of the document. |
127
+ | ` results[].relevance_score ` | number | The relevance score assigned to the document by the model. |
128
+
129
+
90
130
## JSON schema
91
131
92
132
``` json
0 commit comments