langtest.modelhandler.transformers_modelhandler.PretrainedModelForWinoBias#

class PretrainedModelForWinoBias(model, *args, **kwargs)#

Bases: ModelAPI

A class representing a pretrained model for wino-bias detection.

Parameters:

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

__init__(model, *args, **kwargs)#

Constructor method

Parameters:

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

Methods

__init__(model, *args, **kwargs)

Constructor method

load_model(path, *args, **kwargs)

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, *args, **kwargs) 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