juliuslipp
commited on
Commit
•
f955d8f
1
Parent(s):
17a7544
Update README.md
Browse files
README.md
CHANGED
@@ -124,7 +124,32 @@ console.log(results);
|
|
124 |
|
125 |
## Using API
|
126 |
|
127 |
-
You
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
## Evaluation
|
130 |
|
|
|
124 |
|
125 |
## Using API
|
126 |
|
127 |
+
You can use the Model via our API as follows:
|
128 |
+
|
129 |
+
```python
|
130 |
+
from mixedbread_ai.client import MixedbreadAI
|
131 |
+
|
132 |
+
mxbai = MixedbreadAI(api_key="{MIXEDBREAD_API_KEY}")
|
133 |
+
|
134 |
+
res = mxbai.reranking(
|
135 |
+
model="mixedbread-ai/mxbai-rerank-large-v1",
|
136 |
+
query="Who is the author of To Kill a Mockingbird?",
|
137 |
+
input=[
|
138 |
+
"To Kill a Mockingbird is a novel by Harper Lee published in 1960. It was immediately successful, winning the Pulitzer Prize, and has become a classic of modern American literature.",
|
139 |
+
"The novel Moby-Dick was written by Herman Melville and first published in 1851. It is considered a masterpiece of American literature and deals with complex themes of obsession, revenge, and the conflict between good and evil.",
|
140 |
+
"Harper Lee, an American novelist widely known for her novel To Kill a Mockingbird, was born in 1926 in Monroeville, Alabama. She received the Pulitzer Prize for Fiction in 1961.",
|
141 |
+
"Jane Austen was an English novelist known primarily for her six major novels, which interpret, critique and comment upon the British landed gentry at the end of the 18th century.",
|
142 |
+
"The Harry Potter series, which consists of seven fantasy novels written by British author J.K. Rowling, is among the most popular and critically acclaimed books of the modern era.",
|
143 |
+
"The Great Gatsby, a novel written by American author F. Scott Fitzgerald, was published in 1925. The story is set in the Jazz Age and follows the life of millionaire Jay Gatsby and his pursuit of Daisy Buchanan."
|
144 |
+
],
|
145 |
+
top_k=3,
|
146 |
+
return_input=false
|
147 |
+
)
|
148 |
+
|
149 |
+
print(res.data)
|
150 |
+
```
|
151 |
+
|
152 |
+
The API comes with additional features, such as a continous trained reranker! Check out the [docs](https://www.mixedbread.ai/docs) for more information.
|
153 |
|
154 |
## Evaluation
|
155 |
|