king17pvp commited on
Commit
b8dd3b4
1 Parent(s): 995aaf9

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. utils.py +4 -3
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 = [1, 2, 9, 13]
 
173
  return ['\n'.join(nltk.sent_tokenize(data[i]['transcript'])) for i in random_idx]
174
 
175
  if __name__ == "__main__":
176
- '''data = []
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']))