Joshua Lochner
commited on
Commit
•
60499f4
1
Parent(s):
c5d6b08
Update pipeline.py
Browse files- pipeline.py +2 -10
pipeline.py
CHANGED
@@ -1,14 +1,5 @@
|
|
1 |
import json
|
2 |
-
from
|
3 |
-
|
4 |
-
import tensorflow as tf
|
5 |
-
from tensorflow import keras
|
6 |
-
import base64
|
7 |
-
import io
|
8 |
-
import os
|
9 |
-
import numpy as np
|
10 |
-
from PIL import Image
|
11 |
-
|
12 |
import youtube_transcript_api2
|
13 |
import json
|
14 |
import re
|
@@ -184,6 +175,7 @@ WORDS_TO_REMOVE = [
|
|
184 |
]
|
185 |
|
186 |
|
|
|
187 |
def get_words(video_id, transcript_type='auto', fallback='manual', filter_words_to_remove=True, granularity='word'):
|
188 |
"""Get parsed video transcript with caching system
|
189 |
returns None if not processed yet and process is False
|
|
|
1 |
import json
|
2 |
+
from functools import lru_cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import youtube_transcript_api2
|
4 |
import json
|
5 |
import re
|
|
|
175 |
]
|
176 |
|
177 |
|
178 |
+
@lru_cache(maxsize=16)
|
179 |
def get_words(video_id, transcript_type='auto', fallback='manual', filter_words_to_remove=True, granularity='word'):
|
180 |
"""Get parsed video transcript with caching system
|
181 |
returns None if not processed yet and process is False
|