commit files to HF hub
Browse files- youtube-transcription.py +7 -3
youtube-transcription.py
CHANGED
@@ -21,7 +21,7 @@ TRAIN_URL = "yt-transcriptions.jsonl"
|
|
21 |
|
22 |
|
23 |
class YoutubeTranscription(datasets.GeneratorBasedBuilder):
|
24 |
-
VERSION = datasets.Version("1.
|
25 |
|
26 |
def _info(self):
|
27 |
return datasets.DatasetInfo(
|
@@ -29,12 +29,14 @@ class YoutubeTranscription(datasets.GeneratorBasedBuilder):
|
|
29 |
features=datasets.Features(
|
30 |
{
|
31 |
"video_id": datasets.Value("string"),
|
|
|
32 |
"text": datasets.Value("string"),
|
33 |
"start_timestamp": datasets.Value("string"),
|
34 |
"end_timestamp": datasets.Value("string"),
|
35 |
"start_second": datasets.Value("string"),
|
36 |
"end_second": datasets.Value("string"),
|
37 |
-
"url": datasets.Value("string")
|
|
|
38 |
},
|
39 |
),
|
40 |
|
@@ -63,12 +65,14 @@ class YoutubeTranscription(datasets.GeneratorBasedBuilder):
|
|
63 |
for doc in documents:
|
64 |
data = {
|
65 |
"video_id": doc["video_id"],
|
|
|
66 |
"text": doc["text"],
|
67 |
"start_timestamp": doc["start_timestamp"],
|
68 |
"end_timestamp": doc["end_timestamp"],
|
69 |
"start_second": doc["start_second"],
|
70 |
"end_second": doc["end_second"],
|
71 |
-
"url": doc["url"]
|
|
|
72 |
}
|
73 |
yield id_, data
|
74 |
id_ += 1
|
|
|
21 |
|
22 |
|
23 |
class YoutubeTranscription(datasets.GeneratorBasedBuilder):
|
24 |
+
VERSION = datasets.Version("1.2.0")
|
25 |
|
26 |
def _info(self):
|
27 |
return datasets.DatasetInfo(
|
|
|
29 |
features=datasets.Features(
|
30 |
{
|
31 |
"video_id": datasets.Value("string"),
|
32 |
+
"title": datasets.Value("string"),
|
33 |
"text": datasets.Value("string"),
|
34 |
"start_timestamp": datasets.Value("string"),
|
35 |
"end_timestamp": datasets.Value("string"),
|
36 |
"start_second": datasets.Value("string"),
|
37 |
"end_second": datasets.Value("string"),
|
38 |
+
"url": datasets.Value("string"),
|
39 |
+
"thumbnail": datasets.Value("string"),
|
40 |
},
|
41 |
),
|
42 |
|
|
|
65 |
for doc in documents:
|
66 |
data = {
|
67 |
"video_id": doc["video_id"],
|
68 |
+
"title": doc["title"],
|
69 |
"text": doc["text"],
|
70 |
"start_timestamp": doc["start_timestamp"],
|
71 |
"end_timestamp": doc["end_timestamp"],
|
72 |
"start_second": doc["start_second"],
|
73 |
"end_second": doc["end_second"],
|
74 |
+
"url": doc["url"],
|
75 |
+
"thumbnail": doc["thumbnail"]
|
76 |
}
|
77 |
yield id_, data
|
78 |
id_ += 1
|