class_docstr: Coreference on Winogender schemas (Rudinger et al. 2018).
class_docstr_tok: ["Coreference","on","Winogender","schemas","(","Rudinger","et","al",".","2018",")","."]
code: def __init__(
      self,
      templates_path: Optional[str] = None,
      occupation_stats_path: Optional[str] = None,
  ):
      templates_path_to_cache = templates_path or os.path.join(
          DATA_ROOT, "templates.tsv"
      )
      cached_templates_path = cache_data(templates_path_to_cache)
  
      occupation_stats_path_to_cache = (
          occupation_stats_path
          or os.path.join(DATA_ROOT, "occupations-stats.tsv")
      )
      cached_occupation_stats_path = cache_data(
          occupation_stats_path_to_cache
      )
  
      # Load templates and make a DataFrame.
      with open(cached_templates_path) as fd:
          self.templates_df = pd.read_csv(
              fd, sep="\t", header=0, names=self.TSV_COLUMN_NAMES
          )
  
      # Load occpuation stats.
      with open(cached_occupation_stats_path) as fd:
          self.occupation_df = pd.read_csv(fd, sep="\t").set_index(
              "occupation"
          )
  
      # Make examples for each {someone} x {gender} x {template}
      self._examples = []
      for _, row in self.templates_df.iterrows():
          for someone in {False, True}:
              for gender in Gender:
                  r = generate_instance(
                      someone=someone, gender=gender, **row
                  )
                  r["pf_bls"] = (
                      self.occupation_df.bls_pct_female[r["occupation"]]
                      / 100.0
                  )
                  self._examples.append(r)
  
file_path: lit/lit_nlp/examples/coref/datasets/winogender.py
imports: import enum
  import os
  from typing import Optional
  from absl import logging
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import types
  from lit_nlp.lib import file_cache
  import pandas
label_desc: Use image node_id 1 to create a new WinogenderDataset object from inherited base classes: lit_dataset with example: obj = WinogenderDataset(templates_path, occupation_stats_path)