Spaces:
Running
Running
Update asr.py
Browse files
asr.py
CHANGED
@@ -2,10 +2,11 @@ import torch
|
|
2 |
import whisper
|
3 |
from typing import Dict, Any, Optional
|
4 |
import os
|
5 |
-
from
|
6 |
-
from
|
7 |
-
from
|
8 |
-
from
|
|
|
9 |
|
10 |
class MedicalASR:
|
11 |
def __init__(self, config: Dict[str, Any]):
|
@@ -114,7 +115,6 @@ class MedicalASR:
|
|
114 |
# Basit dosya transkripsiyon fonksiyonu
|
115 |
def transcribe_file(file_path: str) -> str:
|
116 |
# Bu fonksiyon eski API için burada bırakıldı
|
117 |
-
from config import settings
|
118 |
_model = whisper.load_model(settings.ASR_MODEL)
|
119 |
result = _model.transcribe(file_path)
|
120 |
return result.get('text', '').strip()
|
|
|
2 |
import whisper
|
3 |
from typing import Dict, Any, Optional
|
4 |
import os
|
5 |
+
from preprocessing import clean_audio
|
6 |
+
from diarization import diarize_segments
|
7 |
+
from medical_terms import load_turkish_medical_terms
|
8 |
+
from advanced_term_correction import MedicalTermCorrector
|
9 |
+
from config import settings
|
10 |
|
11 |
class MedicalASR:
|
12 |
def __init__(self, config: Dict[str, Any]):
|
|
|
115 |
# Basit dosya transkripsiyon fonksiyonu
|
116 |
def transcribe_file(file_path: str) -> str:
|
117 |
# Bu fonksiyon eski API için burada bırakıldı
|
|
|
118 |
_model = whisper.load_model(settings.ASR_MODEL)
|
119 |
result = _model.transcribe(file_path)
|
120 |
return result.get('text', '').strip()
|