SushantGautam commited on
Commit
693ca0a
1 Parent(s): d43508a

Update SoccerNet-Echoes.py

Browse files
Files changed (1) hide show
  1. SoccerNet-Echoes.py +6 -1
SoccerNet-Echoes.py CHANGED
@@ -46,6 +46,7 @@ _URLS = {
46
  }
47
 
48
 
 
49
  class FootballASRDataset(datasets.GeneratorBasedBuilder):
50
  """ASR Dataset for various football leagues and seasons"""
51
 
@@ -82,6 +83,7 @@ class FootballASRDataset(datasets.GeneratorBasedBuilder):
82
  urls = _URLS[self.config.name]
83
  data_dir = dl_manager.download_and_extract("https://codeload.github.com/SoccerNet/sn-echoes/zip/refs/heads/main") +"/sn-echoes-main/Dataset/"
84
  print("data_dir", { "data_dir": os.path.join(data_dir+ urls),})
 
85
  return [
86
  datasets.SplitGenerator(
87
  name=datasets.Split.TRAIN,
@@ -97,9 +99,12 @@ class FootballASRDataset(datasets.GeneratorBasedBuilder):
97
  with open(os.path.join(root, file), encoding="utf-8") as f:
98
  data = json.load(f)
99
  for segment_index, segment_data in data["segments"].items():
 
100
  yield f"{file}_{segment_index}", {
101
- "segment_index": segment_index,
102
  "start_time": segment_data[0],
103
  "end_time": segment_data[1],
104
  "transcribed_text": segment_data[2],
 
 
105
  }
 
46
  }
47
 
48
 
49
+
50
  class FootballASRDataset(datasets.GeneratorBasedBuilder):
51
  """ASR Dataset for various football leagues and seasons"""
52
 
 
83
  urls = _URLS[self.config.name]
84
  data_dir = dl_manager.download_and_extract("https://codeload.github.com/SoccerNet/sn-echoes/zip/refs/heads/main") +"/sn-echoes-main/Dataset/"
85
  print("data_dir", { "data_dir": os.path.join(data_dir+ urls),})
86
+ version_name = urls.replace("/", "").replace("_", ".")
87
  return [
88
  datasets.SplitGenerator(
89
  name=datasets.Split.TRAIN,
 
99
  with open(os.path.join(root, file), encoding="utf-8") as f:
100
  data = json.load(f)
101
  for segment_index, segment_data in data["segments"].items():
102
+ breakpoint()
103
  yield f"{file}_{segment_index}", {
104
+ "segment_index": str(segment_index),
105
  "start_time": segment_data[0],
106
  "end_time": segment_data[1],
107
  "transcribed_text": segment_data[2],
108
+ "game": file,
109
+
110
  }