meg-huggingface commited on
Commit
5546565
1 Parent(s): c4e990f

Change to npmi display ordering

Browse files
data_measurements/dataset_statistics.py CHANGED
@@ -796,6 +796,8 @@ class nPMIStatisticsCacheClass:
796
  """
797
  # Canonical ordering for subgroup_list
798
  subgroup_pair = sorted(subgroup_pair)
 
 
799
  subgroups_str = "-".join(subgroup_pair)
800
  if not isdir(self.pmi_cache_path):
801
  logs.warning("Creating cache")
@@ -810,6 +812,8 @@ class nPMIStatisticsCacheClass:
810
  # When everything is already computed for the selected subgroups.
811
  logs.info("Loading cached joint npmi")
812
  joint_npmi_df = self.load_joint_npmi_df(joint_npmi_fid)
 
 
813
  # When maybe some things have been computed for the selected subgroups.
814
  else:
815
  if not self.live:
 
796
  """
797
  # Canonical ordering for subgroup_list
798
  subgroup_pair = sorted(subgroup_pair)
799
+ subgroup1 = subgroup_pair[0]
800
+ subgroup2 = subgroup_pair[1]
801
  subgroups_str = "-".join(subgroup_pair)
802
  if not isdir(self.pmi_cache_path):
803
  logs.warning("Creating cache")
 
812
  # When everything is already computed for the selected subgroups.
813
  logs.info("Loading cached joint npmi")
814
  joint_npmi_df = self.load_joint_npmi_df(joint_npmi_fid)
815
+ npmi_display_cols = ['npmi-bias', subgroup1 + '-npmi', subgroup2 + '-npmi', subgroup1 + '-count', subgroup2 + '-count']
816
+ joint_npmi_df = joint_npmi_df[npmi_display_cols]
817
  # When maybe some things have been computed for the selected subgroups.
818
  else:
819
  if not self.live: