class_docstr: Load model trained to detect offensive language in the context of single- turn
  dialogue utterances.
  
  This model was trained to be robust to adversarial examples created by humans. See
  <http://parl.ai/projects/dialogue_safety/> for more information.
class_docstr_tok: ["Load","model","trained","to","detect","offensive","language","in","the","context","of","single-","turn","dialogue","utterances",".","This","model","was","trained","to","be","robust","to","adversarial","examples","created","by","humans",".","See","<","http",":","\/\/parl.ai\/projects\/dialogue_safety\/",">","for","more","information","."]
docstr: Returns the probability that a message is safe according to the classifier.
docstr_tok: ["Returns","the","probability","that","a","message","is","safe","according","to","the","classifier","."]
code: def contains_offensive_language(self, text):
      """
      Returns the probability that a message is safe according to the classifier.
      """
      if not text:
          return False, 1.0
      act = {"text": text, "episode_done": True}
      self.model.observe(act)
      response = self.model.act()["text"]
      pred_class, prob = [
          x.split(": ")[-1] for x in response.split("\n")
      ]
      pred_not_ok = self.classes[
          pred_class
      ]  # check whether classified as NOT OK
      prob = float(prob)  # cast string to float
  
      return pred_not_ok, prob
  
imports: from parlai.agents.transformer.transformer import TransformerClassifierAgent
  from parlai.core.agents import create_agent, create_agent_from_shared
  from parlai.tasks.dialogue_safety.agents import OK_CLASS, NOT_OK_CLASS
  from parlai.utils.typing import TShared
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  import os
label_desc: Use image node_id 4 for calling the OffensiveLanguageClassifier obj's underlying member method code with example usage: obj.contains_offensive_language(text) and returns: pred_not_ok,  prob, False,  int