class_docstr: Individual fairness perturbation for person names.
class_docstr_tok: ["Individual","fairness","perturbation","for","person","names","."]
docstr: Load the name file
docstr_tok: ["Load","the","name","file"]
code: def load_name_file(
      self, file_path
  ) -> Dict[str, Dict[str, List[str]]]:
      """Load the name file"""
      mapping_dict: Dict[str, Dict[str, List[str]]] = defaultdict(
          lambda_defaultdict_list
      )
      delimiter = ","
      with open(file_path, encoding="utf-8") as f:
          for line in f.readlines():
              name, name_type, *categories = line.replace(
                  self.LINE_SEP, ""
              ).split(delimiter)
              for ind in range(len(categories) // 2):
                  category_type, category = (
                      categories[2 * ind],
                      categories[2 * ind + 1],
                  )
                  if self.person_name_type == name_type:
                      mapping_dict[category_type][category].append(
                          name.strip().lower()
                      )
      return mapping_dict
  
imports: import os
  import re
  from collections import defaultdict
  from dataclasses import dataclass, replace
  from functools import reduce
  from pathlib import Path
  from random import Random
  from typing import Dict, List, Optional, Set
  from helm.benchmark.scenarios.scenario import Input, Instance, Reference, Output
  from helm.common.general import ensure_file_downloaded, ensure_directory_exists, match_case
  from .perturbation_description import PerturbationDescription
  from .perturbation import Perturbation
label_desc: Use image node_id 6 for calling the PersonNamePerturbation obj's underlying member method code with example usage: obj.load_name_file(file_path) and returns: mapping_dict