class_docstr: Class to read RuBQ datasets
class_docstr_tok: ["Class","to","read","RuBQ","datasets"]
code: def preprocess(self, sample):
      question = sample.get("question_text", "")
      answers = sample.get("answers", [])
      answer_ids = [
          elem.get("value", "").split("/")[-1] for elem in answers
      ]
      answer_labels = [
          elem.get("label", "").split("/")[-1] for elem in answers
      ]
      query = sample.get("query", "")
      if query is None:
          query = ""
      else:
          query = query.replace("\n", " ").replace("  ", " ")
      return [question, [answer_ids, answer_labels, query]]
  
file_path: DeepPavlov/deeppavlov/dataset_readers/sq_reader.py
imports: import json
  import pickle
  from typing import List
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.dataset_reader import DatasetReader
  from deeppavlov.core.common.file import load_pickle
  from deeppavlov.core.common.file import read_json
label_desc: Use image node_id 2 for calling the RuBQReader obj's underlying member method code with example usage: obj.preprocess(sample) and returns: list