code: def test_alternative_text_field(self):
      DocsAndLabelsFromCorpus(self.corpus)
      DocsAndLabelsFromCorpus(self.parsed_corpus)
      with self.assertRaises(CorpusShouldBeParsedCorpusException):
          DocsAndLabelsFromCorpus(
              self.corpus, alternative_text_field="orig"
          )
      d = DocsAndLabelsFromCorpus(
          self.parsed_corpus, alternative_text_field="orig"
      )
      self.assertEqual(
          d.get_labels_and_texts()["texts"][0],
          d.get_labels_and_texts()["texts"][0].upper(),
      )
      d = DocsAndLabelsFromCorpus(self.parsed_corpus)
      self.assertNotEqual(
          d.get_labels_and_texts()["texts"][0],
          d.get_labels_and_texts()["texts"][0].upper(),
      )
      d = DocsAndLabelsFromCorpusSample(
          self.parsed_corpus, 2, alternative_text_field="orig", seed=0
      )
      texts = d.get_labels_and_texts()["texts"]
      self.assertEqual(texts[0], texts[0].upper())
      d = DocsAndLabelsFromCorpusSample(self.parsed_corpus, 2)
      self.assertNotEqual(
          d.get_labels_and_texts()["texts"][0],
          d.get_labels_and_texts()["texts"][0].upper(),
      )
  
file_path: scattertext/scattertext/test/test_docsAndLabelsFromCorpus.py
imports: import json
  from unittest import TestCase
  import numpy
  import pandas
  from scattertext import CorpusFromParsedDocuments
  from scattertext import whitespace_nlp
  from scattertext.CorpusFromPandas import CorpusFromPandas
  from scattertext.DocsAndLabelsFromCorpus import DocsAndLabelsFromCorpus, DocsAndLabelsFromCorpusSample, CorpusShouldBeParsedCorpusException
  from scattertext.test.test_corpusFromPandas import get_docs_categories
  from scattertext.test.test_termDocMatrixFactory import build_hamlet_jz_corpus_with_meta
label_desc: Use image node_id 5 for calling the TestDocsAndLabelsFromCorpus obj's underlying member method code with example usage: obj.test_alternative_text_field() without return types