langtest.modelhandler.transformers_modelhandler.PretrainedModelForStereoSet#

class PretrainedModelForStereoSet(model)#

Bases: ModelAPI

A class representing a pretrained model for StereoSet detection.

Parameters:

model (transformers.pipeline.Pipeline) – Pretrained HuggingFace pipeline for predictions.

__init__(model)#

Constructor method

Parameters:

model (transformers.pipeline.Pipeline) – Pretrained HuggingFace model for predictions.

Methods

__init__(model)

Constructor method

load_model(path)

Load the Translation model into the model attribute.

predict(text, **kwargs)

Perform predictions on the input text.

Attributes

model_registry

classmethod load_model(path: str) Pipeline#

Load the Translation model into the model attribute.

Parameters:

path (str) – path to model or model name

Return type:

‘Pipeline’

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

Perform predictions on the input text.

Parameters:
  • text (str) – Input text to perform mask filling on.

  • kwargs – Additional keyword arguments.

Returns:

Output for wino-bias task

Return type:

Dict