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
  • Default predictor
  • Methods and properties
  • __init__
  • EntityLinkingInput
  • __init__
  • EntityLinkingOutput
  • __init__
  • EntityLinkingPreprocessor
  • execute
  • EntityLinkingPostprocessor
  • __init__
  • execute
  1. Tasks

TransformersEntityLinking

Entity linking task

PreviousTransformersTextEmbeddingNextTransformersTokenClassifier

Last updated 12 months ago

Subclass of .

Module: .tasks

Default predictor

This task uses by default with this configuration:

model = AutoModel.from_pretrained("openai-community/gpt2")
predictor = TransformersGenerativeModel(
    TransformersModelConfig(
        model=model,
        kwargs={
            "max_new_tokens": 512,
            "pad_token_id": self.pad_token_id,
            "return_dict_in_generate": True,
            "output_scores": True, 
        }
    ),
    input_class=TransformersEntityLinkingInput,
    output_class=TransformersEntityLinkingOutput,
)

See:

Methods and properties

Main methods and properties


__init__

Arguments:

  • labels (List[str]): Labels to link.

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




EntityLinkingInput


__init__

Arguments:

  • texts (List[str]): Texts to process.

  • num_beams (int)

  • num_return_sequences (int)




EntityLinkingOutput


__init__

Arguments:

  • classification_output (Any)




EntityLinkingPreprocessor


execute

Arguments:

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

    • "texts" (List[str]): Texts to process;

Returns:

  • Dict[str, Any]: Expected keys:

    • "texts" (Any): Prompts;




EntityLinkingPostprocessor


__init__

Arguments:

  • encoder_decoder (bool): Model configuration parameter.

  • 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:

    • "sequences" (Any): Model output;

    • "sequences_scores" (Optional[Any], optional): Used if num_beams > 1. Defaults to None;

    • "num_beams" (int);

    • "texts" (List[str]): Processed prompts;

Returns:

  • Dict[str, Any]: Expected keys:

    • "classification_output" (Any): Formatted output;



tokenizer (Optional[Union[str, , ]], optional): Tokenizer to use. Defaults to None.

predictor ([Any, Any], optional): Predictor that will be used in task. If equals to None, 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: If default chain is used, will use provided tokenizer or tokenizer from predictor model.

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

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

Subclass of .

Subclass of .

Prepare prompts for model. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

Process model output. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

tokenizer (Union[, ])

PreTrainedTokenizer
PreTrainedTokenizerFast
Action
Action
Action
Action
PreTrainedTokenizer
PreTrainedTokenizerFast
Predictor
default predictor
Component
EntityLinkingPreprocessor
Component
EntityLinkingPostprocessor
EntityLinkingPostprocessor
Task
EntityLinkingInput
EntityLinkingOutput
implementation
TransformersModel
TransformersGenerativeModel
TransformersModelConfig
TransformersEntityLinkingInput
TransformersEntityLinkingOutput
Input
Output
IOModel
IOModel