ForzaJuve1 commited on
Commit
af404bf
1 Parent(s): 8446df7

Update Integration.py

Browse files
Files changed (1) hide show
  1. Integration.py +3 -15
Integration.py CHANGED
@@ -554,22 +554,10 @@ class Euro2020Dataset(GeneratorBasedBuilder):
554
  with open(filepath, encoding="utf-8") as f:
555
  reader = csv.DictReader(f)
556
  for id, row in enumerate(reader):
557
- match_event_str = row["MatchEvent"]
558
- try:
559
- match_event = ast.literal_eval(match_event_str)
560
- except ValueError:
561
- # Handle cases where match_event_str is not a valid dictionary string
562
- # This could log an error or set match_event to an empty dict
563
- match_event = {}
564
 
565
- # Process each match event to ensure all expected keys exist
566
- match_event_processed = {
567
- "1-First Half": match_event.get("1-First Half"),
568
- "2-Second Half": match_event.get("2-Second Half"),
569
- "3-Extra Time First Half": match_event.get("3-Extra Time First Half", []),
570
- "4-Extra Time Second Half": match_event.get("4-Extra Time Second Half", []),
571
- "5-Penalty Shootout": match_event.get("5-Penalty Shootout", []),
572
- }
573
  team_linup_str = row["TeamLineUps"]
574
  team_linup_replaced = team_linup_str.replace(": nan", ": None")
575
  team_linup = ast.literal_eval(team_linup_replaced)
 
554
  with open(filepath, encoding="utf-8") as f:
555
  reader = csv.DictReader(f)
556
  for id, row in enumerate(reader):
 
 
 
 
 
 
 
557
 
558
+ match_event_str = row["MatchEvent"]
559
+ match_linup = ast.literal_eval(match_event_str)
560
+
 
 
 
 
 
561
  team_linup_str = row["TeamLineUps"]
562
  team_linup_replaced = team_linup_str.replace(": nan", ": None")
563
  team_linup = ast.literal_eval(team_linup_replaced)