Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
utils.py
CHANGED
@@ -169,14 +169,15 @@ def get_example()->list[str]:
|
|
169 |
data.append(json.loads(line))
|
170 |
|
171 |
#random_idx = random.sample(list(range(len(data))), 6)
|
172 |
-
random_idx = [
|
|
|
173 |
return ['\n'.join(nltk.sent_tokenize(data[i]['transcript'])) for i in random_idx]
|
174 |
|
175 |
if __name__ == "__main__":
|
176 |
-
|
177 |
with open(filepath + "data/test.json", "r") as f:
|
178 |
for line in f:
|
179 |
data.append(json.loads(line))
|
180 |
tmp = data[:100]
|
181 |
for j, i in enumerate(tmp):
|
182 |
-
print(j, len(i['transcript']))
|
|
|
169 |
data.append(json.loads(line))
|
170 |
|
171 |
#random_idx = random.sample(list(range(len(data))), 6)
|
172 |
+
random_idx = [2, 89, 94, 97]
|
173 |
+
#random_idx = [1, 2, 9, 13]
|
174 |
return ['\n'.join(nltk.sent_tokenize(data[i]['transcript'])) for i in random_idx]
|
175 |
|
176 |
if __name__ == "__main__":
|
177 |
+
data = []
|
178 |
with open(filepath + "data/test.json", "r") as f:
|
179 |
for line in f:
|
180 |
data.append(json.loads(line))
|
181 |
tmp = data[:100]
|
182 |
for j, i in enumerate(tmp):
|
183 |
+
print(j, len(i['transcript']))
|