ClinEmbed-1
ClinEmbed-1 is Fourier’s embedding model for clinical text. It maps a clinical note, a lab result, a problem-list entry, or a search query to a 1024-dimensional vector. Text with similar clinical meaning lands close together. You call it through POST /v1/embeddings.
At a glance
Section titled “At a glance”ClinEmbed-1 has the following properties:
| Property | Value |
|---|---|
| Model ID | ClinEmbed-1 |
| Output | 1024-dimensional vector of unit length |
| Maximum input | 512 tokens per string |
| Batch size | 1 to 1,000 strings per request |
| Input types | query, document |
| Encoding formats | float (default), base64 |
| Usage metered | usage.total_tokens of each response |
Input types
Section titled “Input types”ClinEmbed-1 embeds search queries differently from documents, so that a query’s vector is close to the vectors of the documents that answer it. The input_type field tells the model which one a text is:
query: a search string. The model prepends its retrieval instruction before embedding.document: text that you index for retrieval. Same result as omittinginput_type.
Embed your corpus with document and each search string with query, and then rank by dot product. Vectors are unit length, so the dot product is the cosine similarity. For tasks where all texts play the same role, such as clustering or near-duplicate detection, embed them all with document.
Intended use
Section titled “Intended use”Use ClinEmbed-1 for the following tasks:
- Retrieval and semantic search over clinical notes, reports, and results.
- Clustering and grouping clinical text by topic.
- Similarity between clinical texts, such as finding notes that describe the same finding.
Limits and behavior
Section titled “Limits and behavior”- 512 tokens per input. The model rejects a longer input with
400 invalid_requestunless you settruncate_prompt_tokensto-1, which keeps the first 512 tokens. The count includes the instruction thatqueryadds. - Fixed 1024 dimensions. The model isn’t trained for Matryoshka truncation, so it can’t return shorter vectors: a request that sets
dimensionsfails with400 invalid_request. Use the full vector. - Text only.
inputtakes a string or an array of strings. The model doesn’t accept token arrays.
Example
Section titled “Example”The following examples embed one document. The SDK examples set the base URL with a /v1 suffix and pass input_type outside the SDK’s typed parameters.
curl https://gateway.fourierhealth.com/v1/embeddings \ -H "Authorization: Bearer $FOURIER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ClinEmbed-1", "input": "Hemoglobin A1c 7.9% (ref 4.0-5.6) collected 03/14/2024.", "input_type": "document" }'import os
from openai import OpenAI
client = OpenAI( api_key=os.environ["FOURIER_API_KEY"], base_url="https://gateway.fourierhealth.com/v1",)response = client.embeddings.create( model="ClinEmbed-1", input="Hemoglobin A1c 7.9% (ref 4.0-5.6) collected 03/14/2024.", extra_body={"input_type": "document"},)vector = response.data[0].embeddingprint(len(vector), response.usage.total_tokens)import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.FOURIER_API_KEY, baseURL: "https://gateway.fourierhealth.com/v1",});const params: OpenAI.EmbeddingCreateParams & { input_type?: "query" | "document" } = { model: "ClinEmbed-1", input: "Hemoglobin A1c 7.9% (ref 4.0-5.6) collected 03/14/2024.", input_type: "document",};const response = await client.embeddings.create(params);const vector = response.data[0]?.embedding ?? [];console.log(vector.length, response.usage.total_tokens);For every request field, the response shape, and the errors the endpoint returns, see Embeddings.