class_docstr: LM Chunk Teacher, base.
  
  Provides functionality for subclassed teachers for extracting data from world log
  files, generated via `generate_lm_data.py`
class_docstr_tok: ["LM","Chunk","Teacher",",","base",".","Provides","functionality","for","subclassed","teachers","for","extracting","data","from","world","log","files",",","generated","via","`","generate_lm_data.py","`"]
docstr: Subject example to various filters.
  
  Return whether the example passes all filters.
  
  :param xturn:
      context turn
  :param yturn:
      target/knowledge turn
  
  :return passes_filters:
      return whether the example passes the filters.
docstr_tok: ["Subject","example","to","various","filters",".","Return","whether","the","example","passes","all","filters",".",":","param","xturn",":","context","turn",":","param","yturn",":","target\/knowledge","turn",":","return","passes_filters",":","return","whether","the","example","passes","the","filters","."]
code: def passes_filters(
      self, xturn: Dict[str, Any], yturn: Dict[str, Any]
  ) -> bool:
      """
      Subject example to various filters.
  
      Return whether the example passes all filters.
  
      :param xturn:
          context turn
      :param yturn:
          target/knowledge turn
  
      :return passes_filters:
          return whether the example passes the filters.
      """
      passes = True
      # Example filters
      knowledge = (
          yturn["knowledge"]
          .replace(TOKEN_KNOWLEDGE, "")
          .replace(TOKEN_END_KNOWLEDGE, "")
          .strip()
      )
      if passes and self.opt["skip_empty_context"]:
          doc_context_sentences = [
              s
              for s in xturn["text"]
              .split(TOKEN_KNOWLEDGE)[0]
              .split("\n")
              if s
          ]
          passes &= (
              len(doc_context_sentences)
          ) > 1  # All docs have <doc> token as their first line
      if passes and self.opt["min_knowledge_length"] > 0:
          passes &= (
              len(knowledge.split(" "))
              >= self.opt["min_knowledge_length"]
          )
      if passes and self.opt["min_knowledge_overlap"] > 0:
          assert 0 < self.opt["min_knowledge_overlap"] <= 1
          f1 = F1Metric.compute(yturn["text"].strip(), [knowledge])
          passes &= f1.value() >= self.opt["min_knowledge_overlap"]
      if passes and self.opt["shared_knowledge_entity"]:
          knol_ent = extract_entities(knowledge)
          if len(knol_ent) == 0:
              passes &= False
          label_ent = extract_entities(yturn.get("text"))
          ents = set(knol_ent).intersection(label_ent)
          if len(ents) == 0:
              passes &= False
      return passes
  
imports: from abc import ABC, abstractmethod
  import os
  from typing import Tuple, List, Optional, Any, Dict
  import random
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric, BleuMetric, RougeMetric, AverageMetric, ExactMatchMetric, normalize_answer
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import ChunkTeacher, ChunkOutput
  import parlai.tasks.wizard_of_internet.constants
  from parlai.utils.conversations import Conversations
  from parlai.utils.data import DatatypeHelper
  import parlai.utils.logging
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
  from projects.seeker.utils import extract_entities, remove_possible_title_from_text
label_desc: Use image node_id 4 for calling the AbstractLMChunkTeacher obj's underlying member method code with example usage: obj.passes_filters(xturn, yturn) and returns: passes