Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerank 3.5 #267

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions fern/pages/models/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,24 @@ In this table, we provide some important context for using Cohere Embed models o

The Rerank model can improve created models by re-organizing their results based on certain parameters. This can be used to improve search algorithms.

| Model Name | Description | Modalities | Context Length | Endpoints |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ---------------|---------------------------- |
| `rerank-english-v3.0` | A model that allows for re-ranking English Language documents and semi-structured data (JSON). This model has a context length of 4096 tokens. | Text | 4k | [Rerank](/reference/rerank) |
| `rerank-multilingual-v3.0` | A model for documents and semi-structure data (JSON) that are not in English. Supports the same languages as embed-multilingual-v3.0. This model has a context length of 4096 tokens. | Text | 4k | [Rerank](/reference/rerank) |
| | | | | |
| `rerank-english-v2.0` | A model that allows for re-ranking English language documents. | Text | 512 | [Rerank](/reference/rerank) |
| `rerank-multilingual-v2.0` | A model for documents that are not in English. Supports the same languages as `embed-multilingual-v3.0`. | Text | 512 | [Rerank](/reference/rerank) |
| Latest Model | Description | Modality | Max Tokens | Endpoints |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------|-------------------|
| `rerank-v3.5` | A model for documents and semi-structured data (JSON). State-of-the-art performance in English and non-English languages; supports the same languages as embed-multilingual-v3.0. This model has a context length of 4096 tokens | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-english-v3.0` | A model that allows for re-ranking English Language documents and semi-structured data (JSON). This model has a context length of 4096 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v3.0` | A model for documents and semi-structure data (JSON) that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 4096 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-english-v2.0` | A model that allows for re-ranking English language documents. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v2.0` | A model for documents that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |


### Using Rerank Models on Different Platforms

In this table, we provide some important context for using Cohere Rerank models on Amazon Bedrock, SageMaker, and more.

| Model Name | Amazon Bedrock Model ID | Amazon SageMaker | Azure AI Studio Model ID | Oracle OCI Generative AI Service |
| :------------------------- | :---------------------- | :-------------------- | :----------------------- | :------------------------------- |
| `rerank-english-v3.0` | Not yet available | Unique per deployment | Not yet available | N/A |
| `rerank-multilingual-v3.0` | Not yet available | Unique per deployment | Not yet available | N/A |
| `rerank-english-v2.0` | N/A | N/A | N/A | N/A |
| `rerank-multilingual-v2.0` | N/A | N/A | N/A | N/A |
| `rerank-v3.5` | Not yet available | Unique per deployment | Coming soon | N/A |
| `rerank-english-v3.0` | Not available | Unique per deployment | Not yet available | N/A |
| `rerank-multilingual-v3.0` | Not available | Unique per deployment | Not yet available | N/A |

<br />

Expand Down
13 changes: 7 additions & 6 deletions fern/pages/models/rerank-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ updatedAt: "Mon Apr 08 2024 17:42:11 GMT+0000 (Coordinated Universal Time)"
---
Rerank models sort text inputs by semantic relevance to a specified query. They are often used to sort search results returned from an existing search solution. Learn more about using Rerank in the [best practices guide](/docs/reranking-best-practices).

| Latest Model | Description | Modality | Max Tokens | Endpoints |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------|------------|-------------------|
| `rerank-english-v3.0` | A model that allows for re-ranking English Language documents and semi-structured data (JSON). This model has a context length of 4096 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v3.0` | A model for documents and semi-structure data (JSON) that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 4096 tokens.| Text | N/A | [Rerank](/reference/rerank) |
| `rerank-english-v2.0` | A model that allows for re-ranking English language documents. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v2.0` | A model for documents that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| Latest Model | Description | Modality | Max Tokens | Endpoints |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------|-------------------|
| `rerank-english-v3.5` | A model for documents and semi-structured data (JSON). State-of-the-art performance in English and non-English languages; supports the same languages as embed-multilingual-v3.0. This model has a context length of 4096 tokens | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-english-v3.0` | A model that allows for re-ranking English Language documents and semi-structured data (JSON). This model has a context length of 4096 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v3.0` | A model for documents and semi-structure data (JSON) that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 4096 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-english-v2.0` | A model that allows for re-ranking English language documents. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |
| `rerank-multilingual-v2.0` | A model for documents that are not in English. Supports the same languages as `embed-multilingual-v3.0`. This model has a context length of 512 tokens. | Text | N/A | [Rerank](/reference/rerank) |

<Note>
For each document included in a request, Rerank combines the tokens from the query with the tokens from the document and the combined total counts toward the context limit for a single document. If the combined number of tokens from the query and a given document exceeds the model’s context length for a single document, the document will automatically get chunked and processed in multiple inferences. See our [best practice guide](/docs/reranking-best-practices) for more info about formatting documents for the Rerank endpoint.
Expand Down
8 changes: 4 additions & 4 deletions fern/pages/text-embeddings/reranking/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: "docs/overview"

hidden: false

description: "This page describes how Cohere's ReRank models work."
description: "This page describes how Cohere's Rerank models work."
image: "../../../assets/images/f1cc130-cohere_meta_image.jpg"
keywords: "Cohere, reranking models, large language models"

Expand Down Expand Up @@ -36,7 +36,7 @@ docs = [
"Charlotte Amalie is the capital and largest city of the United States Virgin Islands. It has about 20,000 people. The city is on the island of Saint Thomas.",
"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district. The President of the USA and many major national government offices are in the territory. This makes it the political center of the United States of America.",
"Capital punishment (the death penalty) has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states. The federal government (including the United States military) also uses capital punishment."]
results = co.rerank(model="rerank-english-v3.0", query=query, documents=docs, top_n=5, return_documents=True)
results = co.rerank(model="rerank-v3.5", query=query, documents=docs, top_n=5, return_documents=True)
```

**Response**
Expand Down Expand Up @@ -107,7 +107,7 @@ docs = [
{"Title":"The Capital of United States Virgin Islands","Content":"Charlotte Amalie is the capital and largest city of the United States Virgin Islands. It has about 20,000 people. The city is on the island of Saint Thomas."},
{"Title":"Washington D.C.","Content":"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district. The President of the USA and many major national government offices are in the territory. This makes it the political center of the United States of America."},
{"Title":"Capital Punishment in the US","Content":"Capital punishment (the death penalty) has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states. The federal government (including the United States military) also uses capital punishment."}]
results = co.rerank(model="rerank-english-v3.0", query=query, documents=docs, rank_fields=['Title','Content'],top_n=5, return_documents=True)
results = co.rerank(model="rerank-v3.5", query=query, documents=docs, rank_fields=['Title','Content'],top_n=5, return_documents=True)

```

Expand Down Expand Up @@ -172,7 +172,7 @@ In the `docs` parameter, we are passing in a list of objects which have the key

## Multilingual Reranking

Cohere offers a multilingual model, `rerank-multilingual-v3.0`. Please note that performance may vary across languages. The model is trained on the following languages:
Cohere's `rerank-v3.5` and `rerank-multilingual-v3.0` models have been trained for performance across a variety of languages. Please note that performance may vary across languages. The model is trained on the following languages:

| ISO Code | Language Name |
| -------- | -------------- |
Expand Down
Loading
Loading