Using Gladia's Whisper API for transcribing YouTube videos
Project description
WhisperYT is a Python client for interacting with Gladia's API designed specifically for transcribing YouTube videos. Powered by an optimized variant of OpenAI's Whisper model, Gladia's backend performs Automatic Speech Recognition (ASR), converting spoken words into written text with remarkable precision. Best of all, you can enjoy up to 10 hours of free API usage each month.
In addition to providing access to Gladia's API, this versatile library equips you with postprocessing features to effortlessly manipulate and refine your transcribed data, making it a valuable tool for post-transcription tasks.
Install
pip install whisperyt
Quick Start
The initial step involves initializing the YouTubeTranscriber class before proceeding with your API request. To get started, simply create a free account on Gladia's website and provide your API token. Afterwards, pass the YouTube video URL of your choice:
from whisperyt import YouTubeTranscriber, pretty_json
Gladia = YouTubeTranscriber("YOUR-API-KEY")
response = Gladia.transcribe("https://www.youtube.com/watch?v=BrcKRhQ7K00")
print(pretty_json(response))
Chunk of output:
Save Transcription in JSON File
from whisperyt import YouTubeTranscriber, DataProcessor
Gladia = YouTubeTranscriber("YOUR-API-KEY")
response = Gladia.transcribe("https://www.youtube.com/watch?v=BrcKRhQ7K00")
DataProcessor.save_json_file(response.json(), "output.json")
View Transcription in Pandas Dataframe
After your transcription, has been saved in a JSON file, you can load it in a Pandas Dataframe:
df = DataProcessor.get_table("output.json")
print(df)
Output:
View Transcript by Speaker Turn:
df = DataProcessor.get_table("output.json")
DataProcessor.get_transcription_by_turn(df)
Output:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for whisperyt-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa111d5f4d1c55c376198fe386433ab918b95fedeb36fd0f460c7ae88680f7a |
|
MD5 | fc16ef8a71b1e59e9971bb9eaf85f5a7 |
|
BLAKE2b-256 | 03bb6970f4b7016e0b39a78acce2906a4e2a77f8de9e1ee2dfd70de492362774 |