")
title = "Scream: Fine-Tuned Whisper model for automatic gutural speech recognition 🤟🤟🤟"
examples = [["Whitechapel - Prostatic Fluid Asphyxiation.wav",True,True],
["Suicide Silence - Genocide.wav",True,True]
]
#-------------------------------------------------------------------------------------------------------------------------------
#Define classifier for sentiment analysis
classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", top_k=None)
#Functions-----------------------------------------------------------------------------------------------------------------------
def transcribe(file,use_timestamps=True,sentiment_analysis=True):
'''inputs: file, return_timestamps'''
outputs = pipe(file, batch_size=BATCH_SIZE, generate_kwargs={"task": 'transcribe'}, return_timestamps=True)
text = outputs["text"]
timestamps = outputs["chunks"]
#If return timestamps is True, return html text with timestamps format
if use_timestamps==True:
spider_text = [f"{chunk['text']}" for chunk in timestamps] #Text for spider chart without timestamps
timestamps = [f"[{format_timestamp(chunk['timestamp'][0])} -> {format_timestamp(chunk['timestamp'][1])}] {chunk['text']}" for chunk in timestamps]
else:
timestamps = [f"{chunk['text']}" for chunk in timestamps]
spider_text = timestamps
text = " ".join(str(feature) for feature in timestamps)
text = f"