Skip to content
Merged
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
38 changes: 19 additions & 19 deletions fern/pages/text-embeddings/embeddings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,25 +218,7 @@ res = co.embed(
res.embeddings.float
```

## Matryoshka Embeddings
Matryoshka learning creates embeddings with coarse-to-fine representation within a single vector; `embed-v4.0` supports multiple output dimensions in the following values: `[256,512,1024,1536]`. To access this, you specify the parameter `output_dimension` when creating the embeddings.

```python PYTHON
texts = ["hello"]

response = co.embed(
model="embed-v4.0",
texts=texts,
output_dimension=1024,
input_type="classification",
embedding_types=["float"],
).embeddings

# print out the embeddings
response.float # returns a vector that is 1024 dimensions
```

## Support for Fused and Mixed Modalities
## Support for Mixed Content Embeddings
`embed-v4.0` supports text and content-rich images such as figures, slide decks, document screen shots (i.e. screenshots of PDF pages). This eliminates the need for complex text extraction or ETL pipelines. Unlike our previous `embed-v3.0` model family, `embed-v4.0` is capable of processing both images and texts together; the inputs can either be an image that contains both text and visual content, or text and images that youd like to compress into a single vector representation.

Here's a code sample illustrating how `embed-v4.0` could be used to work with fused images and texts like the following:
Expand Down Expand Up @@ -274,6 +256,24 @@ res = co.embed(
res
```

## Matryoshka Embeddings
Matryoshka learning creates embeddings with coarse-to-fine representation within a single vector; `embed-v4.0` supports multiple output dimensions in the following values: `[256,512,1024,1536]`. To access this, you specify the parameter `output_dimension` when creating the embeddings.

```python PYTHON
texts = ["hello"]

response = co.embed(
model="embed-v4.0",
texts=texts,
output_dimension=1024,
input_type="classification",
embedding_types=["float"],
).embeddings

# print out the embeddings
response.float # returns a vector that is 1024 dimensions
```

## Compression Levels

The Cohere embeddings platform supports compression. The Embed API features an `embeddings_types` parameter which allows the user to specify various ways of compressing the output.
Expand Down