ForzaJuve1 commited on
Commit
abc1bf3
1 Parent(s): 19c0cad

Update Integration.py

Browse files
Files changed (1) hide show
  1. Integration.py +7 -1
Integration.py CHANGED
@@ -552,7 +552,13 @@ class Euro2020Dataset(GeneratorBasedBuilder):
552
  with open(filepath, encoding="utf-8") as f:
553
  reader = csv.DictReader(f)
554
  for id, row in enumerate(reader):
555
- match_event = row["MatchEvent"]
 
 
 
 
 
 
556
 
557
  # Process each match event to ensure all expected keys exist
558
  match_event_processed = {
 
552
  with open(filepath, encoding="utf-8") as f:
553
  reader = csv.DictReader(f)
554
  for id, row in enumerate(reader):
555
+ match_event_str = row["MatchEvent"]
556
+ try:
557
+ match_event = ast.literal_eval(match_event_str)
558
+ except ValueError:
559
+ # Handle cases where match_event_str is not a valid dictionary string
560
+ # This could log an error or set match_event to an empty dict
561
+ match_event = {}
562
 
563
  # Process each match event to ensure all expected keys exist
564
  match_event_processed = {