Fast_api / ves /ves.py
mulasagg's picture
Add application file
8ad2ab3
raw
history blame contribute delete
554 Bytes
# voice engagement score = 0.4 * valence + 0.3 * arousal + 0.3 * SDS
from tone_modulation.sds import calc_sds
def get_valence_and_arousal(file_path):
valence = 4.5 #we get this from model
arousal = 3.2 #we get this from model
return valence, arousal
def calc_voice_engagement_score(file_path):
valence, arousal = get_valence_and_arousal(file_path)
# Calculate SDS
sds = calc_sds(file_path)
ves = 0.4 * valence + 0.3 * arousal + 0.3 * sds
return {
# "sds": sds,
"ves": ves
}