juancopi81's picture
Duplicate from Whispering-GPT/whisper-youtube-2-hf_dataset
7288748
raw
history blame
651 Bytes
from typing import Dict, List, Optional, Tuple
from pydantic import BaseModel
class YoutubeVideo(BaseModel):
"""This class represent a YouTube video entry
"""
channel_name: str
url: str
title: Optional[str]
description: Optional[str]
transcription: Optional[str]
segments: Optional[List[Dict]] = None
def to_tuple(self) -> Tuple:
"""Convert TranscribedVideo object to a tuple of the type:
(channel_name, url, title, description, transcription, segments).
"""
return (self.channel_name, self.url, self.title,
self.description, self.transcription, self.segments)