Classes
| Class | Description |
|---|---|
| FilesetResolver | Resolves the files required for the MediaPipe Task APIs.The returned filesets require that the Wasm files are published without renaming. If this is not possible, you can invoke the MediaPipe Tasks APIs using a manually created WasmFileset. |
| LanguageDetector | Predicts the language of an input text. |
| TextClassifier | Performs Natural Language classification. |
| TextEmbedder | Performs embedding extraction on text. |
| TextProofreader | MediaPipe Task that performs text proofreading. |
| TextSummarizer | MediaPipe Task that performs text summarization. |
Interfaces
| Interface | Description |
|---|---|
| Category | A classification category. |
| Classifications | Classification results for a given classifier head. |
| Correction | A single correction. |
| Embedding | List of embeddings with an optional timestamp.One and only one of the two 'floatEmbedding' and 'quantizedEmbedding' will contain data, based on whether or not the embedder was configured to perform scalar quantization. |
| LanguageDetectorOptions | Options to configure the MediaPipe Language Detector Task |
| LanguageDetectorPrediction | A language code and its probability. |
| LanguageDetectorResult | The result of language detection. |
| TextClassifierOptions | Options to configure the MediaPipe Text Classifier Task |
| TextClassifierResult | Classification results of a model. |
| TextEmbedderOptions | Options to configure the MediaPipe Text Embedder Task |
| TextEmbedderResult | Embedding results for a given embedder model. |
| TextFormatOptions | Options for formatting a text embedding request. |
| TextProofreaderOptions | Options to configure the MediaPipe Text Proofreader Task. |
| TextProofreaderResult | The result of text proofreading. |
| TextSummarizerOptions | Options to configure the MediaPipe Text Summarizer Task. |
Type Aliases
| Type Alias | Description |
|---|---|
| CorrectionType | The type of a correction: - 'SAME': The text is the same in the original and proofread text. - 'INSERTION': The text was inserted in the proofread text. - 'DELETION': The text was deleted from the original text. |
| ProofreaderProgressListener | A listener that receives each newly generated part of the proofread text during a streaming proofread. |
| SummarizationMode | The summarization mode for the text summarizer. |
| SummarizerProgressListener | A listener that receives the newly generated part of the summary and an indication whether the summarization is complete. |
| TextEmbeddingType | The type of embedding to generate. This can be used to specify different embedding tasks for models that support it (e.g. Gecko).Supported embedding types are: - 'RETRIEVAL_QUERY': Embeds a query for document retrieval. The input text will be formatted as "task: search result | query: ${text}". - 'RETRIEVAL_DOCUMENT': Embeds a document for semantic retrieval. The input text will be formatted as "title: none | text: ${text}". - 'SEMANTIC_SIMILARITY': Embeds text for semantic similarity. The input text will be formatted as "task: sentence similarity | query: ${text}". - 'CLASSIFICATION': Embeds text for classification. The input text will be formatted as "task: classification | query: ${text}". - 'QUESTION_ANSWERING': Embeds text for question answering. The input text will be formatted as "task: question answering | query: ${text}". - 'CLUSTERING': Embeds text for clustering. The input text will be formatted as "task: clustering | query: ${text}". - 'FACT_CHECKING': Embeds text for fact checking. The input text will be formatted as "task: fact checking | query: ${text}". - 'CODE_RETRIEVAL': Embeds text for code retrieval. The input text will be formatted as "task: code retrieval | query: ${text}". |
| TextRole | The role of the text to be embedded.Supported roles are: - 'QUERY': The text is a query. - 'DOCUMENT': The text is a document. |
| TextSummarizerResult | The result of text summarization. |
CorrectionType
The type of a correction: - 'SAME': The text is the same in the original and proofread text. - 'INSERTION': The text was inserted in the proofread text. - 'DELETION': The text was deleted from the original text.
Signature:
export declare type CorrectionType = "SAME" | "INSERTION" | "DELETION";
ProofreaderProgressListener
A listener that receives each newly generated part of the proofread text during a streaming proofread.
Signature:
export declare type ProofreaderProgressListener = (partialResult: string, done: boolean) => void;
SummarizationMode
The summarization mode for the text summarizer.
Signature:
export declare type SummarizationMode = "TLDR" | "KEYPOINTS";
SummarizerProgressListener
A listener that receives the newly generated part of the summary and an indication whether the summarization is complete.
Signature:
export declare type SummarizerProgressListener = (partialResult: string, done: boolean) => void;
TextEmbeddingType
The type of embedding to generate. This can be used to specify different embedding tasks for models that support it (e.g. Gecko).
Supported embedding types are: - 'RETRIEVAL_QUERY': Embeds a query for document retrieval. The input text will be formatted as "task: search result | query: ${text}". - 'RETRIEVAL_DOCUMENT': Embeds a document for semantic retrieval. The input text will be formatted as "title: none | text: ${text}". - 'SEMANTIC_SIMILARITY': Embeds text for semantic similarity. The input text will be formatted as "task: sentence similarity | query: ${text}". - 'CLASSIFICATION': Embeds text for classification. The input text will be formatted as "task: classification | query: ${text}". - 'QUESTION_ANSWERING': Embeds text for question answering. The input text will be formatted as "task: question answering | query: ${text}". - 'CLUSTERING': Embeds text for clustering. The input text will be formatted as "task: clustering | query: ${text}". - 'FACT_CHECKING': Embeds text for fact checking. The input text will be formatted as "task: fact checking | query: ${text}". - 'CODE_RETRIEVAL': Embeds text for code retrieval. The input text will be formatted as "task: code retrieval | query: ${text}".
Signature:
export declare type TextEmbeddingType = "RETRIEVAL_QUERY" | "RETRIEVAL_DOCUMENT" | "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "QUESTION_ANSWERING" | "CLUSTERING" | "FACT_CHECKING" | "CODE_RETRIEVAL";
TextRole
The role of the text to be embedded.
Supported roles are: - 'QUERY': The text is a query. - 'DOCUMENT': The text is a document.
Signature:
export declare type TextRole = "QUERY" | "DOCUMENT";
TextSummarizerResult
The result of text summarization.
Signature:
export declare type TextSummarizerResult = string;