class_docstr: Mixin for filtering the document containing the label out from retrieved docs.
  
  As these models are generally used with a CC knowledge dump, and the task on which
  they are evaluated is from the same CC dump, it is useful to filter out the document
  containing the label string from the retrieved documents, for a fair comparison.
class_docstr_tok: ["Mixin","for","filtering","the","document","containing","the","label","out","from","retrieved","docs",".","As","these","models","are","generally","used","with","a","CC","knowledge","dump",",","and","the","task","on","which","they","are","evaluated","is","from","the","same","CC","dump",",","it","is","useful","to","filter","out","the","document","containing","the","label","string","from","the","retrieved","documents",",","for","a","fair","comparison","."]
docstr: Override retrieve and score to filter out docs that contain the label string.
  
  Copy over the whole thing because we need to check before chunking.
docstr_tok: ["Override","retrieve","and","score","to","filter","out","docs","that","contain","the","label","string",".","Copy","over","the","whole","thing","because","we","need","to","check","before","chunking","."]
code: def retrieve_and_score(
      self, query: torch.LongTensor
  ) -> Tuple[List[List[Document]], torch.Tensor]:
      """
      Override retrieve and score to filter out docs that contain the label string.
  
      Copy over the whole thing because we need to check before chunking.
      """
      # step 1
      search_queries = self.generate_search_query(query)  # type: ignore
  
      # step 2
      search_results_batch = self.search_client.retrieve(
          search_queries, self.n_docs
      )  # type: ignore
  
      # step 3
      top_docs = []
      top_doc_scores = []
      max_n_docs: int = self.n_docs  # type: ignore
      for batch_id, (sq, search_results) in enumerate(
          zip(search_queries, search_results_batch)
      ):
          if not search_results:
              search_results = self._empty_docs(self.n_docs)  # type: ignore
          elif len(search_results) < self.n_docs:  # type: ignore
              remain_docs = self.n_docs - len(search_results)  # type: ignore
              search_results.extend(self._empty_docs(remain_docs))  # type: ignore
          docs_i = []
          scors_i = []
          # Change this debug later
          logging.debug(
              f"URLS:\n{self._display_urls(search_results)}"
          )  # type: ignore
          label_text = self.dict.vec2txt(
              self.label_vec[batch_id, :-1]
          )  # type: ignore
          for i, doc in enumerate(search_results):
              url = doc["url"]
              title = doc["title"]
              dcontent = doc["content"]
              assert type(dcontent) in (
                  str,
                  list,
              ), f"Unrecognized retrieved doc: {dcontent}"
              full_text = (
                  dcontent
                  if isinstance(dcontent, str)
                  else "\n".join(doc["content"])
              )
              if label_text in full_text:
                  docs_i.append(BLANK_DOC)
                  scors_i.append(0)
              else:
                  doc_chunks = [
                      dc[0]
                      for dc in self.pick_chunk(
                          sq, title, full_text, url
                      )  # type: ignore
                  ]
                  for splt_id, splt_content in enumerate(doc_chunks):
                      docs_i.append(
                          Document(
                              docid=url,
                              text=splt_content,
                              title=f"{title}_{splt_id}",
                          )
                      )
                      scors_i.append(self.rank_score(i))  # type: ignore
          max_n_docs = max(max_n_docs, len(docs_i))
          top_docs.append(docs_i)
          top_doc_scores.append(scors_i)
      # Pad with empty docs
      for i in range(len(top_docs)):
          n_empty = max_n_docs - len(top_docs[i])
          if n_empty:
              top_docs[i] = top_docs[i] + [BLANK_DOC] * n_empty
              top_doc_scores[i] = top_doc_scores[i] + [0] * n_empty
      self.top_docs = top_docs
      self.search_queries = search_queries
      return top_docs, torch.Tensor(top_doc_scores).to(query.device)
  
imports: from typing import Optional, Type, Tuple, List, Dict, Any
  import torch
  import torch.nn
  from parlai.agents.fid.fid import FidModel, concat_enc_outs
  from parlai.agents.hugging_face.gpt2 import GPT2Decoder, Gpt2Agent
  from parlai.agents.rag.args import RetrieverType
  from parlai.agents.rag.modules import RagModel
  from parlai.agents.rag.retrievers import Document, BLANK_DOC, SearchQuerySearchEngineRetriever, retriever_factory, RagRetriever
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  import parlai.utils.logging
  from projects.seeker.agents.seeker_modules import ComboFidSearchQuerySearchEngineRetriever
  from projects.seeker.agents.seeker_modules import combo_fid_retriever_factory, interleave_fid_combo_outputs, ComboFidModel
label_desc: Use image node_id 2 for calling the FilterDocsForLabelSearchEngineRetrieverMixin obj's underlying member method code with example usage: obj.retrieve_and_score(query) and returns: top_docs,  torch