ashishu007 commited on
Commit
6a840c0
1 Parent(s): 7d4d670

updated linearized input

Browse files
Files changed (1) hide show
  1. sportsett_basketball.py +5 -3
sportsett_basketball.py CHANGED
@@ -590,6 +590,8 @@ class SportsettBasketball(datasets.GeneratorBasedBuilder):
590
  <FT> %d %d %d <REB> %d <AST> %d <STL> %s <BLK> %d <DREB> %d <OREB> %d <TO> %d"
591
  """
592
  pos = f'STARTER YES' if player_stats['starter'] == True else f'STARTER NO'
 
 
593
  player_line = f"<PLAYER> {self.tokenize_initials(player_stats['name'])} <TEAM> {team_name} <POS> {pos} <RANK> {rank}"
594
  player_line = f"{player_line} <MIN> {player_stats['MIN']} <PTS> {player_stats['PTS']} <FG> {player_stats['FGM']} {player_stats['FGA']} {player_stats['FG_PCT']}"
595
  player_line = f"{player_line} <FG3> {player_stats['FG3M']} {player_stats['FG3A']} {player_stats['FG3_PCT']}"
@@ -598,7 +600,7 @@ class SportsettBasketball(datasets.GeneratorBasedBuilder):
598
  player_line = f"{player_line} <BLK> {player_stats['BLK']} <DREB> {player_stats['DREB']} <OREB> {player_stats['OREB']} <TO> {player_stats['TOV']}"
599
  return player_line
600
 
601
- def get_box_score(self, entry, type='HOME', winner='HOME'):
602
  bs = entry['teams'][type.lower()]['box_score']
603
  team_name = f"{entry['teams'][type.lower()]['place']} {entry['teams'][type.lower()]['name']}"
604
  sorted_idx = self.sort_players_by_pts(entry, type)
@@ -633,8 +635,8 @@ class SportsettBasketball(datasets.GeneratorBasedBuilder):
633
  home_team_line = self.get_team_line(entry, type='HOME', winner=winner)
634
  vis_team_line = self.get_team_line(entry, type='VIS', winner=winner)
635
 
636
- home_box_score = self.get_box_score(entry, type='HOME', winner=winner)
637
- vis_box_score = self.get_box_score(entry, type='VIS', winner=winner)
638
 
639
  return home_team_line, vis_team_line, home_box_score, vis_box_score
640
 
 
590
  <FT> %d %d %d <REB> %d <AST> %d <STL> %s <BLK> %d <DREB> %d <OREB> %d <TO> %d"
591
  """
592
  pos = f'STARTER YES' if player_stats['starter'] == True else f'STARTER NO'
593
+ player_min = int(player_stats['MIN'])
594
+ rank = rank if player_min > 0 else f"{rank.split('-')[0]}-DIDNTPLAY"
595
  player_line = f"<PLAYER> {self.tokenize_initials(player_stats['name'])} <TEAM> {team_name} <POS> {pos} <RANK> {rank}"
596
  player_line = f"{player_line} <MIN> {player_stats['MIN']} <PTS> {player_stats['PTS']} <FG> {player_stats['FGM']} {player_stats['FGA']} {player_stats['FG_PCT']}"
597
  player_line = f"{player_line} <FG3> {player_stats['FG3M']} {player_stats['FG3A']} {player_stats['FG3_PCT']}"
 
600
  player_line = f"{player_line} <BLK> {player_stats['BLK']} <DREB> {player_stats['DREB']} <OREB> {player_stats['OREB']} <TO> {player_stats['TOV']}"
601
  return player_line
602
 
603
+ def get_box_score(self, entry, type='HOME'):
604
  bs = entry['teams'][type.lower()]['box_score']
605
  team_name = f"{entry['teams'][type.lower()]['place']} {entry['teams'][type.lower()]['name']}"
606
  sorted_idx = self.sort_players_by_pts(entry, type)
 
635
  home_team_line = self.get_team_line(entry, type='HOME', winner=winner)
636
  vis_team_line = self.get_team_line(entry, type='VIS', winner=winner)
637
 
638
+ home_box_score = self.get_box_score(entry, type='HOME')
639
+ vis_box_score = self.get_box_score(entry, type='VIS')
640
 
641
  return home_team_line, vis_team_line, home_box_score, vis_box_score
642