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: Given the chunk index, load examples from that chunk.
  
  Return a list of tuples. The function `_create_message` will take these tuples
  to form the Message object that is returned by the teacher.
docstr_tok: ["Given","the","chunk","index",",","load","examples","from","that","chunk",".","Return","a","list","of","tuples",".","The","function","`","_create_message","`","will","take","these","tuples","to","form","the","Message","object","that","is","returned","by","the","teacher","."]
code: def load_from_chunk(self, chunk_idx: int) -> List[ChunkOutput]:
      """
      Given the chunk index, load examples from that chunk.
  
      Return a list of tuples. The function `_create_message` will take these tuples
      to form the Message object that is returned by the teacher.
      """
      convs = Conversations(_path(self.opt, self.data_files[chunk_idx]))
      chunk = []
      for conv in convs:
          turns = [t for t in conv.turns if t.get("id") != "context"]
          ep = self._get_ep_from_turns(turns[::2], turns[1::2])
          if not ep:
              continue
          chunk += ep
      return chunk
  
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 8 for calling the AbstractLMChunkTeacher obj's underlying member method code with example usage: obj.load_from_chunk(chunk_idx) and returns: chunk