Skip to main content

Paralinguistic Event Classification from Diarized Speaker Segments

Project description

PEC-DSS ๐ŸŽต๐Ÿ”Š

License: GPL v3

English | ํ•œ๊ตญ์–ด | ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž

Paralinguistic Event Classification from Diarized Speaker Segments

PEC-DSS is an advanced audio analysis system that identifies paralinguistic vocal events (like laughter, sighs, etc.) and attributes them to specific speakers through sophisticated speaker diarization and neural audio processing.

โœจ Features

  • ๐ŸŽ™๏ธ Advanced speaker identification using neural audio encoders
  • ๐Ÿ˜€ Attribution of paralinguistic events to specific speakers
  • ๐Ÿ” High-accuracy SNAC (Scalable Neural Audio Codec) model integration
  • ๐Ÿ”Š Voice embedding and similarity-based speaker matching
  • ๐Ÿ“Š Comprehensive audio codebook analysis
  • ๐Ÿ”„ Modular architecture for easy customization

๐Ÿš€ Installation

From PyPI

pip install pec-dss

From Source with pip

git clone https://github.com/hwk06023/PEC-DSS.git
cd PEC-DSS
pip install -e .

From Source with requirements.txt

git clone https://github.com/hwk06023/PEC-DSS.git
cd PEC-DSS
pip install -r requirements.txt

For development:

pip install -r requirements-dev.txt

๐Ÿ“– Quick Start

Basic Usage

from snac_model import load_snac_model
from audio_encoder import get_codebook_vectors
from speaker_identification import assign_speakers_to_laughs
import librosa

# Load SNAC model
snac_model = load_snac_model(device="cpu")  # or "cuda" for GPU

# Prepare speaker reference samples
speaker_samples = {
    "speaker1": [audio1, audio2],  # Audio waveforms as numpy arrays
    "speaker2": [audio3, audio4]
}

# Process unidentified audio events
unidentified_events = [event1, event2]  # Audio waveforms as numpy arrays

# Identify speakers for each audio event
results = assign_speakers_to_laughs(speaker_samples, unidentified_events, snac_model)

# Print results
for speaker, events in results.items():
    print(f"Speaker {speaker} has {len(events)} attributed events")

CLI Usage

pec-dss --speakers-dir ./speakers --unidentified-dir ./events --output-dir ./results

๐Ÿ“ Directory Structure

PEC-DSS expects a specific directory structure for processing audio files:

Speaker Reference Structure

speakers_directory/
   โ”œโ”€โ”€ speaker_A/       # Each speaker's name becomes their ID
   โ”‚   โ”œโ”€โ”€ audio1.wav   # Reference voice samples for this speaker
   โ”‚   โ”œโ”€โ”€ audio2.wav
   โ”‚   โ””โ”€โ”€ ...
   โ”œโ”€โ”€ speaker_B/
   โ”‚   โ”œโ”€โ”€ audio1.wav
   โ”‚   โ””โ”€โ”€ ...
   โ””โ”€โ”€ speaker_C/
       โ”œโ”€โ”€ audio1.wav
       โ””โ”€โ”€ ...

Unidentified Audio Structure

unidentified_directory/
   โ”œโ”€โ”€ laugh1.wav      # Non-linguistic vocal events to be classified
   โ”œโ”€โ”€ giggle1.wav
   โ””โ”€โ”€ ...

Output Structure (After Processing)

output_directory/
   โ”œโ”€โ”€ results.json           # JSON file with all results
   โ”œโ”€โ”€ speaker_A/             # Files assigned to each speaker
   โ”‚   โ”œโ”€โ”€ 0_laugh1.wav
   โ”‚   โ””โ”€โ”€ ...
   โ”œโ”€โ”€ speaker_B/
   โ”‚   โ”œโ”€โ”€ 0_giggle1.wav
   โ”‚   โ””โ”€โ”€ ...
   โ””โ”€โ”€ unknown/               # Files below similarity threshold (if any)
       โ””โ”€โ”€ ...

๐Ÿงฉ System Architecture

PEC-DSS consists of the following components:

  • snac_model.py: SNAC model initialization and management
  • audio_encoder.py: Audio encoding and vectorization
  • codebook_analysis.py: Statistical analysis of audio codebooks
  • speaker_identification.py: Speaker identification algorithms
  • main.py: Integration and execution framework

๐Ÿ”Š Audio Event Types

The system can identify various paralinguistic events including:

  • Laughter
  • Sighs
  • Crying
  • Coughing
  • Other non-verbal vocal expressions

Note: PEC-DSS does not automatically classify these event types. It only determines which speaker produced the audio event.

๐Ÿš€ Future Developments

  • ๐Ÿง  Integration with more audio encoder models
  • ๐Ÿ˜ข Expanded paralinguistic event recognition
  • ๐ŸŽต Emotional tone classification
  • โšก Performance optimization for real-time processing

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.

๐Ÿ™ Acknowledgements

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

pec_dss-0.1.1.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

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

pec_dss-0.1.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file pec_dss-0.1.1.tar.gz.

File metadata

  • Download URL: pec_dss-0.1.1.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for pec_dss-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0de60fb9634825146613eed6199a90043369681bd997a38cef53a78fb61c6f08
MD5 de017287c3a9e3c3474d45b25c272e24
BLAKE2b-256 4cb8f4eb1ba2fc894efeebeb7c2f4c2fd6e64df657bfddf43e85c4fa3088ecfc

See more details on using hashes here.

File details

Details for the file pec_dss-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pec_dss-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for pec_dss-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b35cb6c0c6f3d187591602a03e652c052c5983a12e167be3998239e849e7c49
MD5 09b52d2e2c483ca0a2254c6ca5468c17
BLAKE2b-256 cf0979f7fc8bd0b8b49d3903f3b8ea84ad1801eeb540262b36a72ccc70dff403

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