File size: 454 Bytes
c5bb903
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from transformers import pipeline

def get_transcribe_transformers(url:str):
    pipe = pipeline("automatic-speech-recognition", model="distil-whisper/distil-large-v3", return_timestamps=True)

    result = pipe(url)

    return result.get("text"), result.get("chunks")

text, chunks = get_transcribe_transformers("https://static.langkingdom.com/user_playlist_practice_videos/0a871d06c1e8e1174da09d5aad6ec550.x-m4a")

print(chunks[0].get("timestamp")[1])