Skip to content

Toxicity Detection model #23

Description

@rlucatoor

What is a Toxicity Detection model

A Toxicity Detection model identifies whether a piece of text is unwelcome and, if so, for which reason.

What needs to be done

Implement a Toxicity Detection model that exposes the following public methods:

.train() method:

.train(output_path: Optional[str] = None, num_samples: int = config.DEFAULT_SYNTHEX_DATAPOINT_NUM, num_epochs: int = 3)`

The method should train the model to assign one of the following labels

  • safe
  • toxic
  • insulting
  • threatening
  • obscene
  • identity-attack
  • other-unsafe

to any piece of text.

.__call__(text: Union[str, list[str])

  • If a str is provided, the model should return any one of the labels listed above.

  • If a list[str] is provided, the model should return a list of labels, one per sentence.

.load(model_path: str)

Loads a pre-trained Toxicity Detection model from the specified path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new modelRequest for a new model implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions