File size: 731 Bytes
8ad2ab3
 
 
aef3b1e
8ad2ab3
 
 
 
aef3b1e
8ad2ab3
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import whisper
from .compute_fluency import compute_fluency_score

def main(file_path: str, model_size: str = "base", filler_count = None) -> dict:
    try:

        whisper_model = whisper.load_model(model_size)
        
        results = compute_fluency_score(file_path, whisper_model, filler_count)

        # Structure response
        response = {
            "fluency_score": round(results['fluency_score'], 2)
            # "insight": results["insight"],
            # "SRS": round(results["SRS"], 2),
            # "PAS": round(results["PAS"], 2),
            # "transcript": results["transcript"]
        }
        return response

    except Exception as e:
        raise RuntimeError(f"Error during analysis: {str(e)}")