langtest.modelhandler.custom_modelhandler.PretrainedModelForQA#

class PretrainedModelForQA(model: Any)#

Bases: PretrainedCustomModel, ModelAPI

A class for handling a pre-trained model for question answering.

Inherits from PretrainedCustomModel and ModelAPI.

predict(text: str, \*args, \*\*kwargs)#

Predicts the answer to a given question based on the pre-trained model.

Raises:

Exception – If an error occurs during prediction.

__init__(model: Any) None#

Methods

__init__(model)

load_model(path)

Load the model.

predict(text, *args, **kwargs)

Perform predictions on input text.

predict_raw(text, *args, **kwargs)

Attributes

model_registry

classmethod load_model(path: Any) Any#

Load the model.

predict(text: str, *args, **kwargs)#

Perform predictions on input text.