docstr: Initialize safety modules.
docstr_tok: ["Initialize","safety","modules","."]
code: def _init_safety(self, opt):
      """
      Initialize safety modules.
      """
      if opt["safety"] == "string_matcher" or opt["safety"] == "all":
          self.offensive_string_matcher = OffensiveStringMatcher()
      if opt["safety"] == "classifier" or opt["safety"] == "all":
          self.offensive_classifier = OffensiveLanguageClassifier()
  
      self.self_offensive = False
  
file_path: ParlAI/parlai/agents/safe_local_human/safe_local_human.py
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.utils.misc import display_messages
  from parlai.utils.strings import colorize
  from parlai.agents.local_human.local_human import LocalHumanAgent
  from parlai.utils.safety import OffensiveStringMatcher, OffensiveLanguageClassifier
label_desc: Use image node_id 3 for calling the SafeLocalHumanAgent obj's underlying member method code with example usage: obj._init_safety(opt) without return types