Instructions to use GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech") model = AutoModelForSequenceClassification.from_pretrained("GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech", device_map="auto") - Notebooks
- Google Colab
- Kaggle
GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech: Multilingual Hate Speech Detection Using Unified Latin Script
Model Details
Model Description
XLM_Latin is a multilingual Transformer-based model fine-tuned for multilingual hate speech detection using text standardized into a unified Latin script representation.
The model was fine-tuned using eight languages:
- Arabic
- Hebrew
- Persian
- Russian
- Spanish
- Bengali
- Chinese
- Korean
Before fine-tuning, the text from these languages was converted from their original writing systems into a unified Latin script through transliteration.
The model was then trained jointly on the eight standardized languages and evaluated individually on each language.
The classification task is binary:
Hate Speech
Non-Hate Speech
Developed by: Ghadeer Albadani
Model type: Multilingual Transformer-based sequence classification model
Task: Multilingual Hate Speech Detection
Languages: Arabic, Hebrew, Persian, Russian, Spanish, Bengali, Chinese, Korean
Writing System: Unified Latin Script
Method: Transliteration-based multilingual learning
Classification: Binary text classification
Framework: PyTorch / Hugging Face Transformers
Fine-tuned from: XLM-RoBERTa
License: Please refer to the license of the underlying pretrained model and datasets
Model Sources
- Repository: https://huggingface.co/GhadeerALbadani/XLM_Latin
- Task: Multilingual Hate Speech Detection
- Approach: Transliteration-based multilingual learning
- Training Scenario: Multilingual fine-tuning using eight languages standardized to Latin script
Uses
Direct Use
XLM_Latin is designed for binary hate speech classification on multilingual text that has been converted into the same unified Latin-script representation used during model training.
The model can be used for:
- Multilingual hate speech detection
- Cross-lingual NLP research
- Transliteration-based text classification
- Multilingual content analysis
- Research on unified writing systems
- Hate speech detection across different writing systems
Downstream Use
The model can be further adapted for:
- Social media hate speech detection
- Multilingual content moderation research
- Cross-lingual text classification
- Low-resource language NLP
- Offensive language detection
- Multilingual NLP applications
For downstream applications, the same preprocessing and transliteration procedure used during training should be applied to the input data.
Out-of-Scope Use
The model should not be used as the sole decision-making mechanism for:
- Legal or criminal decisions
- Automated punishment of individuals
- Permanent social media account suspension
- Political or social profiling
- High-stakes content moderation without human review
The model is primarily intended for research and automated classification assistance.
Bias, Risks, and Limitations
Hate speech detection is a context-sensitive task influenced by language, culture, dialect, topic, and social context.
Although transliteration provides a unified writing representation, it does not eliminate linguistic differences between languages.
The evaluation results demonstrate that model performance varies across languages.
The model achieved the following performance:
- Bengali: Macro F1 = 0.85
- Spanish: Macro F1 = 0.81
- Persian: Macro F1 = 0.80
- Russian: Macro F1 = 0.77
- Chinese: Macro F1 = 0.75
- Arabic: Macro F1 = 0.72
- Hebrew: Macro F1 = 0.72
- Korean: Macro F1 = 0.62
Potential limitations include:
- Transliteration ambiguity.
- Language-specific lexical and semantic differences.
- Difficulty with sarcasm and implicit hate speech.
- Difficulty with slang and informal social media language.
- False positives and false negatives.
- Domain shift between training and real-world data.
- Reduced performance on languages not represented during fine-tuning.
Recommendations
Users should evaluate the model separately for each target language and application domain.
For real-world applications, predictions should be combined with:
- Human review
- Contextual analysis
- Language-specific validation
- Periodic model evaluation
- Bias and fairness assessment
The model should be considered a decision-support system rather than a fully autonomous moderation system.
How to Get Started with the Model
The model can be loaded using the Hugging Face Transformers library.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "your transliterated text here"
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
padding=True
)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
if prediction == 1:
print("Hate Speech")
else:
print("Non-Hate Speech")
- Downloads last month
- 13
Model tree for GhadeerALbadani/xlm_latin-Multilingual_detection_of_hate_speech
Base model
GhadeerALbadani/XLM_Latin