feat: sentiment engine

This commit is contained in:
superobk
2024-03-20 09:42:08 +08:00
parent f2d6b9e526
commit f14c36d77a
4 changed files with 64 additions and 4 deletions

View File

@ -1,3 +1,4 @@
from .sentiment import Sentiment
from .tts import TTS
from ..asr.asr import ASR
from .audio_to_text import AudioToText
@ -11,6 +12,7 @@ class BlackboxFactory:
def __init__(self) -> None:
self.tts = TTS()
self.asr = ASR("./.env.yaml")
self.sentiment = Sentiment()
def create_blackbox(self, blackbox_name: str, blackbox_config: dict) -> Blackbox:
if blackbox_name == "audio_to_text":
@ -23,4 +25,6 @@ class BlackboxFactory:
return self.asr
if blackbox_name == "tts":
return self.tts
if blackbox_name == "sentiment_engine":
return self.sentiment
raise ValueError("Invalid blockbox type")