ForzaJuve1
commited on
Update Euro_2020_Integration.py
Browse files- Euro_2020_Integration.py +1 -12
Euro_2020_Integration.py
CHANGED
@@ -538,12 +538,11 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
538 |
def _split_generators(self, dl_manager):
|
539 |
file_url = "https://drive.google.com/uc?id=1RKoAQwq68LASd4ret_OKYUkF4B4m6hnu"
|
540 |
downloaded_file = dl_manager.download(file_url)
|
541 |
-
#dl_path = dl_manager.download_and_extract({'train_csv': file_url})
|
542 |
|
543 |
return [
|
544 |
SplitGenerator(
|
545 |
name="train",
|
546 |
-
gen_kwargs={"filepath": downloaded_file}
|
547 |
),
|
548 |
]
|
549 |
|
@@ -551,15 +550,11 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
551 |
csv.field_size_limit(sys.maxsize)
|
552 |
|
553 |
def _generate_examples(self, filepath):
|
554 |
-
#fobj = tf.io.gfile.GFile(filepath)
|
555 |
-
#reader = csv.DictReader(fobj)
|
556 |
with open(filepath, encoding="utf-8") as f:
|
557 |
reader = csv.DictReader(f)
|
558 |
for id, row in enumerate(reader):
|
559 |
|
560 |
match_event_str = row["MatchEvent"]
|
561 |
-
#match_event_replaced = match_event_str.replace("'", '"')
|
562 |
-
#match_event_replaced = match_event_str.replace(": nan: ", ": None: ")
|
563 |
match_event = yaml.safe_load(match_event_str)
|
564 |
|
565 |
team_linup_str = row["TeamLineUps"]
|
@@ -567,19 +562,13 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
567 |
team_linup = ast.literal_eval(team_linup_replaced)
|
568 |
|
569 |
team_stats_str = row["TeamStats"]
|
570 |
-
#team_stats_replaced = team_stats_str.replace("'", '"')
|
571 |
-
#team_stats_replaced = team_stats_replaced.replace(": nan", ": null")
|
572 |
team_stats = yaml.safe_load(team_stats_str)
|
573 |
|
574 |
player_stats_str = row["PlayerStats"]
|
575 |
-
#player_stats_replaced = player_stats_str.replace("'", '"')
|
576 |
-
#player_stats_replaced = player_stats_replaced.replace(": nan", ": null")
|
577 |
player_stats_replaced = player_stats_str.replace('"', '\"')
|
578 |
player_stats = yaml.safe_load(player_stats_replaced)
|
579 |
|
580 |
pre_match_str = row["PlayerPreMatchInfo"]
|
581 |
-
#pre_match_replaced = pre_match_str.replace("'", '"')
|
582 |
-
#pre_match_replaced = pre_match_replaced.replace(": nan", ": null")
|
583 |
pre_match_info = yaml.safe_load(pre_match_str)
|
584 |
|
585 |
yield id, {
|
|
|
538 |
def _split_generators(self, dl_manager):
|
539 |
file_url = "https://drive.google.com/uc?id=1RKoAQwq68LASd4ret_OKYUkF4B4m6hnu"
|
540 |
downloaded_file = dl_manager.download(file_url)
|
|
|
541 |
|
542 |
return [
|
543 |
SplitGenerator(
|
544 |
name="train",
|
545 |
+
gen_kwargs={"filepath": downloaded_file},
|
546 |
),
|
547 |
]
|
548 |
|
|
|
550 |
csv.field_size_limit(sys.maxsize)
|
551 |
|
552 |
def _generate_examples(self, filepath):
|
|
|
|
|
553 |
with open(filepath, encoding="utf-8") as f:
|
554 |
reader = csv.DictReader(f)
|
555 |
for id, row in enumerate(reader):
|
556 |
|
557 |
match_event_str = row["MatchEvent"]
|
|
|
|
|
558 |
match_event = yaml.safe_load(match_event_str)
|
559 |
|
560 |
team_linup_str = row["TeamLineUps"]
|
|
|
562 |
team_linup = ast.literal_eval(team_linup_replaced)
|
563 |
|
564 |
team_stats_str = row["TeamStats"]
|
|
|
|
|
565 |
team_stats = yaml.safe_load(team_stats_str)
|
566 |
|
567 |
player_stats_str = row["PlayerStats"]
|
|
|
|
|
568 |
player_stats_replaced = player_stats_str.replace('"', '\"')
|
569 |
player_stats = yaml.safe_load(player_stats_replaced)
|
570 |
|
571 |
pre_match_str = row["PlayerPreMatchInfo"]
|
|
|
|
|
572 |
pre_match_info = yaml.safe_load(pre_match_str)
|
573 |
|
574 |
yield id, {
|