ONNX Model Zoo

syke9p3/bert-multilabel-tagalog-hate-speech-classifier

By syke9p3 · ↓ 15 · ♥ 0 · Updated 2024-07-21

What's in this repo

This page lists the files in syke9p3/bert-multilabel-tagalog-hate-speech-classifier, including model.onnx, model_optimized.onnx, model_quantized.onnx.

  • 3 ONNX models (.onnx files)
  • 23 files, including 10 .json, 3 .onnx, 2 .txt, 2 .pt, 2 .bin, 1 .md
  • Last updated 2024-07-21

ONNX files

File Size Download
onnx/model.onnx — Download
onnx/model_optimized.onnx — Download
onnx/model_quantized.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Multilabel Classification of Tagalog Hate Speech using Bidirectional Encoder Representations from Transformers (BERT)

Multilabel Tagalog Hate Speech Classifier using Bidirectional Encoder Representation From Transformers. Classifies Tagalog Hate Speech with labels Age, Gender, Physical, Race, Religion, and Others.

Hate speech encompasses expressions and behaviors that promote hatred, discrimination, prejudice, or violence against individuals or groups based on specific attributes, with consequences ranging from physical harm to psychological distress, making it a critical issue in today's society.

Bidirectional Encoder Representations from Transformers (BERT) is pre-trained deep learning model used in this study that uses a transformer architecture to generate word embeddings, capturing both left and right context information, and can be fine-tuned for various natural language processing tasks. For this project, we fine-tuned Jiang et. al.'s pre-trained BERT Tagalog Base Uncased model in the task of multilabel hate speech classification.

👥 Proponents

📋 About the Thesis

📄 Abstract

Hate speech promotes hatred, discrimination, prejudice, or violence against individuals or groups based on specific attributes, leading to physical and psychological harm. This study addresses the prevalence of hate speech on social media by proposing a Tagalog hate speech multilabel classification model. Using a fine-tuned Bidirectional Encoder Representations from Transformers (BERT) model, the study classifies hate speech into categories such as Age, Gender, Physical, Race, Religion, and Others. Analyzing 2,116 manually annotated social media posts from Facebook, Reddit, and Twitter, the model achieved varying precision, recall, and f-measure scores across categories, with an overall hamming loss of 3.79%.

🔠 Keywords

Bidirectional Encoder Representations from Transformers; Hate Speech; Multilabel Classification; Social Media; Tagalog; Polytechnic University of the Philippines; Bachelor of Science in Computer Science

💻 Languages and Technologies

Model

Python PyTorch Jupyter Notebook Hugging Face Pandas Numpy Numpy

User Interface

HTML5 CSS3 JavaScript Flask

🎨 Labels

Multilabel Classification refers to the task of assigning one or more relevant labels to each text. Each text can be associated with multiple categories simultaneously, such as Age, Gender, Physical, Race, Religion, or Others.

Age Target of hate speech pertains to one's age bracket or demographic Gender Target of hate speech pertains to gender identity, sex, or sexual orientation Physical Target of hate speech pertains to physical attributes or disability Race Target of hate speech pertains to racial background, ethnicity, or nationality Religion Target of hate speech pertains to affiliation, belief, and faith to any of the existing religious or non-religious groups Others Target of hate speech pertains other topic that is not relevant as Age, Gender, Physical, Race, or Religion

📜 Dataset

2,116 scraped social media posts from Facebook, Reddit, and Twitter manually annotated for determining labels for each data split into three sets:

Dataset Number of Posts Percentage
Training Set 1,267 60%
Validation Set 212 10%
Testing Set 633 30%

🔢 Results

The testing set containing 633 annotated hate speech data used to analyze performance of the model in its ability to classify the hate speech input according to different label in terms of Precision, Recall, F-Measure, and overall hamming loss.

Label Precision Recall F-Measure
Age 97.12% 90.18% 93.52%
Gender 93.23% 94.66% 93.94%
Physical 92.23% 71.43% 80.51%
Race 90.99% 88.60% 89.78%
Religion 99.03% 94.44% 96.68%
Others 83.74% 85.12% 84.43%

Overall Hamming Loss: 3.79%

Model info

text-classification transformers
transformers onnx safetensors bert text-classification nlp language tl en dataset:syke9p3/multilabel-tagalog-hate-speech license:mit text-embeddings-inference
↓ 15 ♥ 0

Created: 2024-07-16

Updated: 2024-07-21

View on Hugging Face

Files (23)

.gitattributes
README.md
config.json
model.safetensors
onnx/config.json
onnx/model.onnx ONNX
onnx/model_optimized.onnx ONNX
onnx/model_quantized.onnx ONNX
onnx/ort_config.json
onnx/special_tokens_map.json
onnx/tokenizer.json
onnx/tokenizer_config.json
onnx/vocab.txt
optimizer.pt
original model/bert-tagalog-hate-speech-classifier.bin
rng_state.pth
scheduler.pt
special_tokens_map.json
tokenizer.json
tokenizer_config.json
trainer_state.json
training_args.bin
vocab.txt

Related models