Knowledgator UTCA
KnowledgatorGitHubDiscord
  • Welcome to UTCA documentation!
  • Quickstart
  • Concepts
    • Components
    • Types of components
    • ExecutionSchema
    • Context
    • Scopes
  • Development and Contribution
    • Contribution
    • Future relises
  • Framework structure
  • Core
    • Component
    • BaseExecutor
    • Action
    • Executable
    • Evaluator
    • Memory management
    • Schemas
    • Exceptions
  • Structural components
    • ExecutionSchema
    • Switch
    • ForEach
    • Filter
    • While
    • Condition
    • BREAK
    • Log
  • Base Actions
    • Flush
    • AddData
    • RenameAttribute
    • RenameAttributeQuery
    • SetValue
    • UnpackValue
    • NestToKey
    • ExecuteFunction
  • Predictors
    • Predictor
    • Transformers predictors
    • Transformers schemas
    • TokenSearcherPredictor
    • ComprehendItPredictor
    • GLiNERPredictor
    • OpenAIChatGPTPredictor
    • OpenAIWhisperPredictor
  • Tasks
    • Task
    • ComprehendIt
    • TokenSearcherTextCleaner
    • TokenSearcherNER
    • TokenSearcherQandA
    • TokenSearcherRelationExtraction
    • GLiNER
    • GLiNERRelationExtraction
    • GLiNERQandA
    • OpenAIChat
    • WhisperSpeechToText
    • TransformersTextToSpeech
    • TransformersChartsAndPlotsAnalysis
    • TransformersDocumentQandA
    • TransformersImageClassification
    • TransformersVisualQandA
    • TransformersObjectDetection
    • TransformersTextEmbedding
    • TransformersEntityLinking
    • TransformersTokenClassifier
    • TransformersTextSummarization
    • TransformersTextualQandA
    • TransformersTextClassification
    • TransformersChat
    • Objects
    • Chat tasks utilities
    • Relation extraction tasks utilities
  • Executable Schemas
    • SemanticSearchSchema
    • Web2Meaning
    • RequestsHTML
  • Datasources
    • Audio
    • DB
      • SQL
      • Neo4j
      • Chroma
      • Qdrant
    • Google Documents
    • Google Sheets
    • Image
    • Index
    • JSON
    • PDF
    • Plain text
    • Video
  • Conditions
    • RePattern
    • SemanticCondition
  • APIs
    • GoogleCloudClient
  • Integrations
    • Google Cloud
  • Examples
    • Basic image classification
    • Text to speech
    • PDF document processing
Powered by GitBook
On this page
  • Module: implementation.tasks
  • Methods and properties
  • __init__
  • TokenSearcherQandAInput
  • __init__
  • TokenSearcherQandAOutput
  • __init__
  • TokenSearcherQandAPreprocessor
  • execute
  • TokenSearcherQandAPostprocessor
  • __init__
  • execute
  1. Tasks

TokenSearcherQandA

Textual Q&A task

PreviousTokenSearcherNERNextTokenSearcherRelationExtraction

Last updated 1 year ago

This task usesby default. For more details, see:

Subclass of .

Module: .tasks

Methods and properties

Main methods and properties


__init__

Arguments:

  • predictor ([Any, Any], optional): Predictor that will be used in task. If equals to None, default will be used. Defaults to None.

  • preprocess (Optional[], optional): Component executed before predictor. If equals to None, default component will be used. Defaults to None. Default component:

  • postprocess (Optional[], optional): Component executed after predictor. If equals to None, default component will be used. Defaults to None. Default component:

  • input_class (Type[], optional): Class for input validation. Defaults to .

  • output_class (Type[], optional): Class for output validation. Defaults to .

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.




TokenSearcherQandAInput


__init__

Arguments:

  • text (str): Input text.

  • question (str): Question to answer.




TokenSearcherQandAOutput


__init__

Arguments:

  • text (str): Input text.

  • question (List[str]): Answered question.




TokenSearcherQandAPreprocessor


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "text" (str): Text to process;

    • "question" (str): Question to answer.

Returns:

  • Dict[str, Any]: Expected keys:

    • "inputs" (List[str]): Model inputs;




TokenSearcherQandAPostprocessor


__init__

Arguments:

  • threshold (float): Answers threshold score. Defaults to 0.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "output" (List[List[Dict[str, Any]]]): Model output;

    • "inputs" (List[str]): Model inputs;

    • "text" (str): Processed text;

    • "question" (str): Answered question.

Returns:

  • Dict[str, Any]: Expected keys:

    • "text" (str): Processed text;

    • "question" (str): Answered question.



Subclass of .

Subclass of . Type of [].

output (List[]): Answers.

Create prompt with providied text and question. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

Format output. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

"output" (List[]): Answers;

Action
Action
Action
Action
TokenSearcherPredictor
TokenSearcherPredictor
Predictor
TokenSearcherPredictor
Component
Component
TokenSearcherQandAPreprocessor
TokenSearcherQandAPostprocessor
TokenSearcherQandAInput
TokenSearcherQandAOutput
Entity
Entity
Entity
IOModel
implementation
Input
NERTask
NEROutputType
NEROutput
NEROutput