code: def test_qa(self):
      from sklearn.datasets import fetch_20newsgroups
  
      remove = ("headers", "footers", "quotes")
      newsgroups_train = fetch_20newsgroups(
          subset="train", remove=remove
      )
      newsgroups_test = fetch_20newsgroups(subset="test", remove=remove)
      docs = newsgroups_train.data + newsgroups_test.data
  
      # tmp_folder = '/tmp/qa_test'
      import shutil
      import tempfile
  
      tmp_folder = tempfile.mkdtemp()
      shutil.rmtree(tmp_folder)
      text.SimpleQA.initialize_index(tmp_folder)
      text.SimpleQA.index_from_list(
          docs, tmp_folder, commit_every=len(docs), multisegment=True
      )
      qa = text.SimpleQA(tmp_folder, framework="tf")
  
      answers = qa.ask("When did Cassini launch?")
      top_answer = answers[0]["answer"]
      self.assertEqual(top_answer, "in october of 1997")
  
file_path: ktrain/tests/test_qa.py
imports: from unittest import TestCase, main, skip
  import IPython
  import numpy
  import testenv
  import ktrain
  from ktrain import text
  from ktrain.imports import ACC_NAME, VAL_ACC_NAME
label_desc: Use image node_id 1 for calling the TestQA obj's underlying member method code with example usage: obj.test_qa() without return types