caikit.interfaces.nlp.tasks

This module holds the Task definitions for all common NLP tasks

Classes

TextGenerationTask

The Text Generation Task is responsible for taking input prompting text

TextClassificationTask

The text classification task is responsible for assigning a label or class to text.

TokenClassificationTask

The token classification task is responsible for assigning a label to individual

TokenizationTask

The tokenization task is responsible for splitting a document into tokens.

ClassificationWithTextGenerationTask

The classification with text generation task is responsible for taking

EmbeddingTask

Return a text embedding for the input text string

EmbeddingTasks

Return a text embedding for each text string in the input list

RerankTask

Returns an ordered list ranking the most relevant documents for the query

RerankTasks

Returns an ordered list for each query ranking the most relevant documents for the query

SentenceSimilarityTask

Compare the source_sentence to each of the sentences.

SentenceSimilarityTasks

Compare each of the source_sentences to each of the sentences.

ChunkerTokenizationTask

The Chunk tokenization task is responsible for taking input text

Module Contents

class caikit.interfaces.nlp.tasks.TextGenerationTask[source]

Bases: caikit.core.TaskBase

The Text Generation Task is responsible for taking input prompting text and generating additional text from that prompt.

class caikit.interfaces.nlp.tasks.TextClassificationTask[source]

Bases: caikit.core.TaskBase

The text classification task is responsible for assigning a label or class to text.

class caikit.interfaces.nlp.tasks.TokenClassificationTask[source]

Bases: caikit.core.TaskBase

The token classification task is responsible for assigning a label to individual tokens in a document.

class caikit.interfaces.nlp.tasks.TokenizationTask[source]

Bases: caikit.core.TaskBase

The tokenization task is responsible for splitting a document into tokens.

class caikit.interfaces.nlp.tasks.ClassificationWithTextGenerationTask[source]

Bases: caikit.core.TaskBase

The classification with text generation task is responsible for taking input prompting text, generating additional text from that prompt and classifying the generated text based on detectors.

class caikit.interfaces.nlp.tasks.EmbeddingTask[source]

Bases: caikit.core.TaskBase

Return a text embedding for the input text string

class caikit.interfaces.nlp.tasks.EmbeddingTasks[source]

Bases: caikit.core.TaskBase

Return a text embedding for each text string in the input list

class caikit.interfaces.nlp.tasks.RerankTask[source]

Bases: caikit.core.TaskBase

Returns an ordered list ranking the most relevant documents for the query

Required parameters:

query: The search query documents: JSON documents containing “text” or alternative “_text” to search

Returns:

The top_n documents in order of relevance (most relevant first). For each, a score and document index (position in input) is returned. The original document JSON is returned depending on optional args. The top_n optional parameter limits the results when used.

class caikit.interfaces.nlp.tasks.RerankTasks[source]

Bases: caikit.core.TaskBase

Returns an ordered list for each query ranking the most relevant documents for the query

Required parameters:

queries: The search queries documents: JSON documents containing “text” or alternative “_text” to search

Returns:

Results in order of the queries. In each query result:

The query text is optionally included for visual convenience. The top_n documents in order of relevance (most relevant first). For each, a score and document index (position in input) is returned. The original document JSON is returned depending on optional args. The top_n optional parameter limits the results when used.

class caikit.interfaces.nlp.tasks.SentenceSimilarityTask[source]

Bases: caikit.core.TaskBase

Compare the source_sentence to each of the sentences. Result contains a list of scores in the order of the input sentences.

class caikit.interfaces.nlp.tasks.SentenceSimilarityTasks[source]

Bases: caikit.core.TaskBase

Compare each of the source_sentences to each of the sentences. Returns a list of results in the order of the source_sentences. Each result contains a list of scores in the order of the input sentences.

class caikit.interfaces.nlp.tasks.ChunkerTokenizationTask[source]

Bases: caikit.core.TaskBase

The Chunk tokenization task is responsible for taking input text and giving out chunks of pre-configured type, like sentences.