Spaces:
Running
Running
File size: 720 Bytes
431dc03 41979e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from asr import MedicalASR
import os
# Test yapılandırması
config = {
"language": "tr",
"model": "whisper-base", # Daha hızlı test için daha küçük model
"domain": "medical"
}
# MedicalASR sınıfını başlat
asr = MedicalASR(config)
# Test ses dosyası (örnek bir wav dosyası yolu verin)
test_file = "test_audio.wav"
# Transkripsiyon yap
result = asr.transcribe(
test_file,
speaker_diarization=True,
enhance_audio=True
)
# Sonuçları yazdır
print("Tam Transkripsiyon:")
print(result["text"])
print("\nKonuşmacı Ayrımı:")
for segment in result.get("diarization", []):
print(f"{segment['speaker']} ({segment['start']:.1f}s - {segment['end']:.1f}s): {segment['text']}") |