CoolFace
Modelpublic

annieske/bert-base-finnish-cased-toxicity

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes6downloads
Model Card

Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->

This is a toxicity identification model which classifies a text as either "toxic" or "non-toxic".

Model Details

Model Description

<!-- Provide a longer summary of what this model is. -->

This is a toxicity identification model which classifies a text as either "toxic" or "non-toxic".

  • —Developed by: Anni Eskelinen
  • —Model type: Text classification
  • —Language(s) (NLP): Finnish
  • —Finetuned from model: TurkuNLP/bert-base-finnish-cased-v1

Use

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

This model is intended to be used to as a helpful tool for content moderation.

Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

The model is sometimes very sensitive to toxicity and might classify non-toxic texts as toxic.

How to Get Started with the Model

Use the code below to get started with the model.

>>> model = transformers.AutoModelForSequenceClassification.from_pretrained("annieske/bert-base-finnish-cased-toxicity")
>>> tokenizer = transformers.AutoTokenizer.from_pretrained("TurkuNLP/bert-base-finnish-cased-v1")
>>> pipe = transformers.pipeline(task="text-classification", model=model, tokenizer=tokenizer)
>>> pipe("This text is neutral!")
>>> pipe("You suck!")

Training Details

Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

Training data included ten different toxicity and related task datasets that were machine translated to Finnish and the labels were unified.

The datasets can be found in GitHub.

Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

Preprocessing

No preprocessing was done on the training data.

Training Hyperparameters
  • —learning rate 1e-05
  • —batch size 8
  • —sequence length 512
  • —5 epochs with early stopping
  • —evaluation every 25,000 steps

Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

Testing Data

<!-- This should link to a Dataset Card if possible. -->

A manually annotated Finnish dataset consisting of 600 examples which is a sample of the "TurkuNLP/Suomi24-toxicity-annotated" dataset. Includes 299 non-toxic examples and 301 toxic examples.

The dataset can be foung in GitHub.

Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

  • —Accuracy (corresponds to micro F1)
  • —Precision (macro)
  • —Recall (macro)
  • —F1 (macro)

Results

  • —Accuracy: 0.71
  • —Precision: 0.73
  • —Recall: 0.71
  • —F1: 0.71

Citation

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

BibTeX:

Citation information coming later.