VerbalSentimentAnalysis / sentiment_analysis.py
Vlad Bastina
gemini changed and fool proffing
068665b
raw
history blame contribute delete
658 Bytes
from translation import get_transcription_from_sound
from gemini_call import ask_gemini
from dotenv import load_dotenv
load_dotenv()
def get_analysis(file_path)->str:
"""Makes the pipeline to perform the sentiment analysis on a .wav file"""
transcript = get_transcription_from_sound(file_path)
if len(transcript) > 0:
analysis = ask_gemini(transcript)
else :
analysis = "Did not provide any message in order to be analysed"
return transcript , analysis
if __name__ == "__main__":
file_path = "recorded_audio.wav"
transcript , analysis = get_analysis(file_path)
print(f'Analysis result {analysis}')