Skip to main content

Vietnamese Audio-based Toxic Spans Detection Pipeline

Project description

ViToSA: Audio-Based Toxic Spans Detection on Vietnamese Speech Utterances | INTERSPEECH'2025


Overview

ViToSA-Pipeline provides an end-to-end Python interface for:

  • Transcribing Vietnamese audio into text using ViToSA PhoWhisper ASR.
  • Detecting and masking toxic words with ViToSA PhoBERT TSD.
  • Optionally processing full directories of .wav files.

It is built on top of the ViToSA 1.0 dataset, the first Vietnamese dataset for audio-based toxic spans detection, developed by researchers from the University of Information Technology (VNU-HCM).


About the ViToSA Dataset

Title: ViToSA: Audio-Based Toxic Spans Detection on Vietnamese Speech Utterances
Version: 1.0 (August 2025)
Authors: Huy Ba Do, Vy Le-Phuong Huynh, and Luan Thanh Nguyen
Institution: University of Information Technology, VNU-HCM
Published: Interspeech 2025

If you use this dataset or models derived from it, please cite:

@inproceedings{do25b_interspeech,
  title     = {{ViToSA: Audio-Based Toxic Spans Detection on Vietnamese Speech Utterances}},
  author    = {Huy Ba Do and Vy Le-Phuong Huynh and Luan Thanh Nguyen},
  year      = {2025},
  booktitle = {Interspeech 2025},
  pages     = {4013--4017},
  doi       = {10.21437/Interspeech.2025-1958},
  issn      = {2958-1796}
}

Abstract

Toxic speech in online platforms is a growing concern for user safety. While textual toxicity detection is well-studied, audio-based toxicity detection—especially for low-resource languages like Vietnamese—remains underexplored.

The ViToSA dataset introduces ~11,000 speech samples (≈25 hours) with human-annotated toxic spans, enabling ASR + Toxic Speech Detection (TSD) pipelines for Vietnamese. Experiments show that fine-tuning ASR models on ViToSA improves WER, and that text-based toxic span detection (TSD) models outperform baseline toxicity classifiers.

Dataset Summary

Split # Examples Notes
Train 8,641 toxic only
Validation 2,161 toxic only
Test 2,000 balanced 50/50 toxic / non-toxic

Each entry includes:

  • file_name: audio file name
  • audio: waveform (float32)
  • transcript: human transcription
  • toxicity: binary annotation

For the test set, we also include its annotated toxic spans.

Modalities: Audio + Text
Language: Vietnamese
License: CC-BY-NC-ND 4.0 (non-commercial, no derivatives)


ViToSA Pipeline Features

✅ Automatic GPU / CPU selection
✅ Robust Hugging Face model handling
✅ Toxic word masking with "***"


Installation

pip install vitosa

Usage

1. Full Pipeline (ASR + TSD)

Transcribe and censor toxic words in an audio file:

from vitosa_pipeline import ViToSA

vitosa = ViToSA()
print(vitosa.pipeline("example.wav"))

2. Individual Components

2.1. ASR Only - Transcribe Audio

Transcribe an utterance with ViToSA-PhoWhisper:

from vitosa_pipeline import ViToSA

vitosa = ViToSA()
print(vitosa.asr("path_to_audio.wav"))

2.2. TSD Only - Detect Toxic Spans

Detect and mask toxic words with ViToSA-PhoBERT:

from vitosa_pipeline import ViToSA

vitosa = ViToSA()
transcript = "your_text_here"

# Return censored text with *** masking toxic words
print(vitosa.tsd(transcript))

# Return binary labels (0 = non-toxic, 1 = toxic word)
print(vitosa.tsd(transcript, return_labels=True))

Terms of Use

  • Research and educational use only (non-commercial).
  • Redistribution of raw data is prohibited.
  • Cite the ViToSA paper if used in research.
  • The dataset and models may contain explicit language. Use responsibly.

Contact

For more information: luannt@uit.edu.vn


MIT License © 2025 Luan Thanh Nguyen

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vitosa-1.0.0.post79.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vitosa-1.0.0.post79-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file vitosa-1.0.0.post79.tar.gz.

File metadata

  • Download URL: vitosa-1.0.0.post79.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vitosa-1.0.0.post79.tar.gz
Algorithm Hash digest
SHA256 b13efbf6fc8884dd62fb21cc4be592b831c1fe581d18ca54a4f7727b07c2b448
MD5 b656e3029ec2d4a545f56f9d42e5758a
BLAKE2b-256 e069004b6b435bd319fd2eb7b79cf75f40e2c508b76185b4776541bec308f114

See more details on using hashes here.

File details

Details for the file vitosa-1.0.0.post79-py3-none-any.whl.

File metadata

  • Download URL: vitosa-1.0.0.post79-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vitosa-1.0.0.post79-py3-none-any.whl
Algorithm Hash digest
SHA256 e45d4f9272a71103e3d0a32c413428644d32498d4e44e2a26c8b10aba3fc3a64
MD5 7ac43bb1f9ba659ac5adc3bc693cc03f
BLAKE2b-256 64fe918893252fb2110c68a6f66740f570f9b594c3fd1d4a113d9ad15cb31c8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page