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