Update src/agent.py
Browse files- src/agent.py +18 -28
src/agent.py
CHANGED
@@ -1,28 +1,18 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
self.
|
9 |
-
|
10 |
-
|
11 |
-
self.accent =
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
self.accent = predict_accent(self.audio_path)
|
20 |
-
|
21 |
-
print("[Agent] Transcribing audio...")
|
22 |
-
self.transcription = transcribe_audio(self.audio_path)
|
23 |
-
|
24 |
-
return {
|
25 |
-
"audio_path": self.audio_path,
|
26 |
-
"accent": self.accent,
|
27 |
-
"transcription": self.transcription
|
28 |
-
}
|
|
|
1 |
+
from audio_utils import transcribe_audio
|
2 |
+
from deep_model import predict_accent
|
3 |
+
|
4 |
+
class AccentAgent:
|
5 |
+
def __init__(self, audio_path):
|
6 |
+
self.audio_path = audio_path
|
7 |
+
self.transcription = ""
|
8 |
+
self.accent = ""
|
9 |
+
|
10 |
+
def run(self):
|
11 |
+
self.accent = predict_accent(self.audio_path)
|
12 |
+
self.transcription = transcribe_audio(self.audio_path)
|
13 |
+
|
14 |
+
return {
|
15 |
+
"audio_path": self.audio_path,
|
16 |
+
"accent": self.accent,
|
17 |
+
"transcription": self.transcription
|
18 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|