GLiNERQandA
Q&A task
Last updated
Q&A task
Last updated
This task uses GliNERPredictor by default.
For more details, see:
GLiNERPredictorBy default, the predictor uses the knowledgator/gliner-multitask-large-v0.5 model. Learn more about the model here:
Subclass of NERTask.
Main methods and properties
predictor (Predictor[Any, Any], optional): Predictor that will be used in task. If equals to None, default predictor will be used. Defaults to None.
preprocess (Optional[Component], optional): Component executed before predictor.
If equals to None, default component will be used. Defaults to None. Default component: GLiNERQandAPreprocessor
postprocess (Optional[Component], optional): Component executed after predictor.
If equals to None, default component will be used. Defaults to None. Default component: GLiNERQandAPostprocessor
input_class (Type[Input], optional): Class for input validation. Defaults to GLiNERQandAInput.
output_class (Type[Output], optional): Class for output validation. Defaults to GLiNERQandAOutput.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
Subclass of IOModel.
text (str): Text to use.
question (str): Question to answer.
Subclass of NEROutput. Type of NEROutput[Entity].
text (str): Input text.
question (str): Answered question.
output (List[Entity]): Answers.
Preprocess inputs. Subclass of Action. Type of Action[Dict[str, Any], Dict[str, Any]].
sents_batch (int): Chunks size in sentences. Defaults to 10.
threshold (float): Minimial score to put entities into the output (used by predictor). Defaults to 0.5.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
input_data (Dict[str, Any]): Expected keys:
"text" (str): Text to process;
"question" (str): Question to answer;
Dict[str, Any]: Expected keys:
"texts" (List[str]): Model inputs;
"labels" (List[str]): Labels model inputs;
"chunks_starts" (List[int]): Chunks start positions. Used by postprocessor;
"threshold" (float): Minimal score for an entity to put into output;
Format output. Subclass of Action. Type of Action[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"output" (List[List[Dict[str, Any]]]): Model output;
"chunks_starts" (List[int]): Chunks starts;
"text" (str): Processed text;
"question" (str): Answered question.
Dict[str, Any]: Expected keys:
"text" (str): Processed text;
"question" (str): Answered question.
"output" (List[Entity]): Answers;