class_docstr: TFIDF-based retriever agent.
  
  If given a task to specify, will first store entries of that task into
  a SQLite database and then build a sparse tfidf matrix of those entries.
  If not, will build it on-the-fly whenever it sees observations with labels.
  
  This agent generates responses by building a sparse entry of the incoming
  text observation, and then returning the highest-scoring documents
  (calculated via sparse matrix multiplication) from the tfidf matrix.
  
  By default, this will return the "value" (the response) of the closest
  entries. For example, saying "What is your favorite movie?" will not return
  the text "Which movie is your favorite?" (high match) but rather the reply
  to that (e.g. "Jurassic Park"). To use this agent for retrieving texts
  (e.g. Wikipedia Entries), you can store label-less examples with the
  '--retriever-task' argument and switch '--retriever-mode' to 'keys'.
class_docstr_tok: ["TFIDF-based","retriever","agent",".","If","given","a","task","to","specify",",","will","first","store","entries","of","that","task","into","a","SQLite","database","and","then","build","a","sparse","tfidf","matrix","of","those","entries",".","If","not",",","will","build","it","on-the-fly","whenever","it","sees","observations","with","labels",".","This","agent","generates","responses","by","building","a","sparse","entry","of","the","incoming","text","observation",",","and","then","returning","the","highest-scoring","documents","(","calculated","via","sparse","matrix","multiplication",")","from","the","tfidf","matrix",".","By","default",",","this","will","return","the","``","value","''","(","the","response",")","of","the","closest","entries",".","For","example",",","saying","``","What","is","your","favorite","movie","?","''","will","not","return","the","text","``","Which","movie","is","your","favorite","?","''","(","high","match",")","but","rather","the","reply","to","that","(","e.g",".","``","Jurassic","Park","''",")",".","To","use","this","agent","for","retrieving","texts","(","e.g",".","Wikipedia","Entries",")",",","you","can","store","label-less","examples","with","the","'","--","retriever-task","'","argument","and","switch","'","--","retriever-mode","'","to","'keys","'","."]
code: def reset(self):
      super().reset()
      self.episode_done = False
      self.current = []
      self.context = deque(maxlen=self.context_length)
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import regex
  import scipy
  import sklearn
  import unicodedata
  from parlai.core.agents import Agent
  from parlai.utils.io import PathManager
  from parlai.utils.misc import AttrDict
  from .doc_db import DocDB
  from .tfidf_doc_ranker import TfidfDocRanker
  from .build_tfidf import run
  from collections import deque
  import math
  import random
  import os
  import json
  import sqlite3
label_desc: Use image node_id 4 for calling the TfidfRetrieverAgent obj's underlying member method code with example usage: obj.reset() without return types