Audio Classification
Transformers
Safetensors
English
whisper
speech-assessment
gept
endpoint-detection
silero-vad
Instructions to use ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, BasicClassifier processor = AutoProcessor.from_pretrained("ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint") model = BasicClassifier.from_pretrained("ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint", device_map="auto") - Notebooks
- Google Colab
- Kaggle
HS Answering Questions β Whisper Medium Basic Classifier + Endpoint VAD
Installation
pip install torch transformers==4.52.4 librosa soundfile silero-vad huggingface_hub
Endpoint VAD
This model was trained with endpoint VAD preprocessing. Apply the same preprocessing during inference.
| Parameter | Value |
|---|---|
| Silero threshold | 0.60 |
| Minimum valid speech | 250 ms |
| Minimum trailing audio before trimming | 3.0 s |
| Padding after the final endpoint | 0.5 s |
The endpoint detector only removes a long trailing section after the last valid speech segment. It does not concatenate speech segments or remove internal pauses. If no valid speech is detected, or the trailing section is shorter than 3 seconds, the original audio is retained.
import sys
from pathlib import Path
import librosa
import soundfile as sf
from huggingface_hub import snapshot_download
repo_dir = Path(
snapshot_download(
"ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint"
)
)
sys.path.insert(0, str(repo_dir))
from endpoint_vad import SileroEndpointTrimmer
trimmer = SileroEndpointTrimmer(
threshold=0.60,
min_speech_duration_ms=250,
min_trailing_silence_sec=3.0,
speech_pad_sec=0.5,
)
audio, sample_rate = librosa.load("input.wav", sr=16000, mono=True)
trimmed_audio = trimmer(audio, sample_rate)
sf.write("input_endpoint.wav", trimmed_audio, sample_rate, subtype="PCM_16")
For a response consisting of multiple WAV files, apply the endpoint trimmer independently to each file before passing the files to the grading pipeline.
- Downloads last month
- 25
Model tree for ntnu-smil/HS-answering-questions-whisper-medium-basic-classifier-endpoint
Base model
openai/whisper-medium