code: def bad_persona(persona, stemmer):
      """
      Check for poor persona selection by apprentice.
      """
      persona_parts = persona.split("\n")
  
      # It is not from the persona selection ones (personas used during the pilot).
      if not (
          len(persona_parts) == 2
          or (
              len(persona_parts) == 3
              and "I live in " in persona_parts[0]
          )
      ):
          logging.warning(f"Old fashioned persona: {persona}")
          return
  
      # Removing the location ('I live in X') part
      if len(persona_parts) == 3:
          persona_parts = persona_parts[1:]
  
      main_pers, ext_pers = [p.lower() for p in persona_parts]
  
      violations = []
  
      # Bad main persona response
      if main_pers.startswith("My favorite "):
          for phrase in ("i like", "my favorite"):
              persona_core = main_pers
              # Remove the original My favorite
              persona_core = main_pers[len("My favorite ") :]
              if phrase in persona_core.lower():
                  violations.append(PERSONA_REPEATS_PROMPT)
                  break
  
      # Extended persona that asks questions
      for phrase in (QUESTION_PHRASE,):
          if phrase in ext_pers:
              violations.append(ASKED_WIZARD_QUESTION)
  
      # Extended persona that mostly repeats the main persona
      main_pers_tokens = tokenize_text(main_pers, stemmer)
      ext_pers_tokens = tokenize_text(ext_pers, stemmer)
      if len(ext_pers_tokens.difference(main_pers_tokens)) < 2:
          violations.append(COPIED_EXTENDED_PERSONA)
  
      # Use of non-generic words in persona.
      common_phrases = (
          "i",
          "it",
          "like",
          "very",
          "much",
          "favorite",
          "is",
          "am",
      )
      tokens = [w.strip() for w in ext_pers.split(" ") if w]
      ext_useful_words = [t for t in tokens if t not in common_phrases]
      if len(tokens) > 4 and len(ext_useful_words) < 2:
          violations.append(GENERIC_EXTENDED_PERSONA)
  
      return violations
  
file_path: ParlAI/parlai/crowdsourcing/projects/wizard_of_internet/acceptability.py
imports: import numpy
  from typing import Iterable, List
  from nltk.stem import PorterStemmer
  from parlai.crowdsourcing.utils.acceptability import AcceptabilityChecker, normalize_answer
  import parlai.utils.logging
label_desc: Use image node_id 4 for calling a global function with example usage: bad_persona(persona, stemmer) and returns: violations