langtest.modelhandler.transformers_modelhandler.PretrainedModelForCrowsPairs#

class PretrainedModelForCrowsPairs(model)#

Bases: ModelAPI

A class representing a pretrained model for Crows-Pairs detection.

Parameters:

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

__init__(model)#

Constructor method

Parameters:

model (transformers.pipeline.Pipeline) – Pretrained HuggingFace NER pipeline 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