YAML Metadata
Warning:
The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
ViHateT5: Enhancing Hate Speech Detection in Vietnamese with A Unified Text-to-Text Transformer Model | ACL'2024 (Findings)
Disclaimer: This paper contains examples from actual content on social media platforms that could be considered toxic and offensive.
ViHateT5-HSD is the fine-tuned model of ViHateT5 on multiple Vietnamese hate speech detection benchmark datasets.
The architecture and experimental results of ViHateT5 can be found in the paper:
@inproceedings{thanh-nguyen-2024-vihatet5,
title = "{V}i{H}ate{T}5: Enhancing Hate Speech Detection in {V}ietnamese With a Unified Text-to-Text Transformer Model",
author = "Thanh Nguyen, Luan",
editor = "Ku, Lun-Wei and Martins, Andre and Srikumar, Vivek",
booktitle = "Findings of the Association for Computational Linguistics ACL 2024",
month = aug,
year = "2024",
address = "Bangkok, Thailand and virtual meeting",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2024.findings-acl.355",
pages = "5948--5961"
}
The pre-training dataset named VOZ-HSD is available at HERE.
Kindly CITE our paper if you use ViHateT5-HSD to generate published results or integrate it into other software.
Example usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("tarudesu/ViHateT5-base-HSD")
model = AutoModelForSeq2SeqLM.from_pretrained("tarudesu/ViHateT5-base-HSD")
def generate_output(input_text, prefix):
# Add prefix
prefixed_input_text = prefix + ': ' + input_text
# Tokenize input text
input_ids = tokenizer.encode(prefixed_input_text, return_tensors="pt")
# Generate output
output_ids = model.generate(input_ids, max_length=256)
# Decode the generated output
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
return output_text
sample = 'Tôi ghét bạn vl luôn!'
prefix = 'hate-spans-detection' # Choose 1 from 3 prefixes ['hate-speech-detection', 'toxic-speech-detection', 'hate-spans-detection']
result = generate_output(sample, prefix)
print('Result: ', result)
Please feel free to contact us by email [email protected] if you have any further information!
- Downloads last month
- 12
Model tree for DungSon/ViHateT5-base-HSD-Clone
Base model
tarudesu/ViHateT5-base