Skip to main content

Vietnamese speaker profiling (gender/dialect) with PhoWhisper/WavLM-family encoders.

Project description

Vietnamese Speaker Profiling

Finetune

python finetune.py --config configs/finetune.yaml

Eval:

python eval.py --checkpoint output/best_model --config configs/eval.yaml --test_name clean_test

Infer:

python infer.py --config configs/infer.yaml --audio path/to/audio.wav

Infer (PhoWhisper checkpoint matching HF Space v2)

python infer.py --config configs/infer_pho_hf.yaml --audio path/to/audio.wav

Install from PyPI (inference)

pip install vn-speaker-profiling
vn-speaker-profiling-infer --audio path/to/audio.wav
vn-speaker-profiling-infer --audio_dir path/to/folder --batch_size 8

Publish to PyPI (maintainers)

python -m pip install -U build twine
python -m build
python -m twine upload dist/*

Datasets:

Pretrained Models:

In Kaggle:

Architecture:

    Audio -> Encoder (WavLM/HuBERT/Wav2Vec2/Whisper) -> Last Hidden [B,T,H]
                          |
                 Attentive Pooling [B,H]
                          |
                 Layer Normalization
                          |
                     Dropout(0.1)
                          |
          +---------------+---------------+
          |                               |
    Gender Head (2 layers)     Dialect Head (3 layers)
          |                               |
        [B,2]                           [B,3]

Supported encoders:
    - WavLM: microsoft/wavlm-base-plus, microsoft/wavlm-large
    - HuBERT: facebook/hubert-base-ls960, facebook/hubert-large-ls960-ft
    - Wav2Vec2: facebook/wav2vec2-base, facebook/wav2vec2-large-960h
    - Whisper: openai/whisper-base, openai/whisper-small, openai/whisper-medium

Result:

Mô hình Kích thước tham số Nhiệm vụ phân loại Acc. ViSpeech (Clean) Acc. ViSpeech (Noisy) Acc. ViMD (Baseline)
wavlm-base-plus ~94 triệu Gender 96.53% 97.35% 98.66%
Dialect 88.33% 84.41% 88.49%
wav2vec2-base ~95 triệu Gender 93.13% 95.59% 98.52%
Dialect 87.13% 83.63% 88.65%
hubert-base-ls960 ~96 triệu Gender 96.93% 96.67% 98.62%
Dialect 87.40% 82.55% 87.52%
spkrec-ecapa-voxceleb ~22 triệu Gender 96.80% 98.43% N/A
Dialect 65.33% 65.10% N/A
PhoWhisper-base ~73 triệu Gender 95.53% N/A 98.57%
Dialect 93.28% N/A 90.67%
wav2vec2-base-vi-vlsp2020 ~95 triệu Gender N/A N/A 98.72%
Dialect N/A N/A 90.61%

Model

https://drive.google.com/drive/folders/1UCOVh9ut8jHmCFfMKgwM2_Mi_3rGhd94?usp=sharing

Citation:

https://github.com/TranNguyenNB/ViSpeech

https://huggingface.co/datasets/nguyendv02/ViMD_Dataset

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

vn_speaker_profiling-0.1.5.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

vn_speaker_profiling-0.1.5-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file vn_speaker_profiling-0.1.5.tar.gz.

File metadata

  • Download URL: vn_speaker_profiling-0.1.5.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for vn_speaker_profiling-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e99ca048e91f5def4912be9c25e7bd1ceec80088a9bd33861c1f510054dcc69d
MD5 4ee387994de2fb5b90d854907f705d67
BLAKE2b-256 6800b23f2bb5017c5e82b8a76939734f3da6f422db23cc2e99cfaec8dbb39ceb

See more details on using hashes here.

File details

Details for the file vn_speaker_profiling-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for vn_speaker_profiling-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 176223ddd4f490a60a045f75012f5a4fcef6fc9d373c53e8dc083f38260a3328
MD5 8d487982fde44b28b6f866e9c4ae1b3d
BLAKE2b-256 e6b43686bc459d5643ab3cc932901f58a3777b714fe26d5b93a8a3e3d7f88d9f

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