code: def test_filter_out_unigrams_that_only_occur_in_one_bigram(self):
      bigrams = [
          "the cat",
          "the saw",
          "horses are",
          "are pigs",
          "pigs horses",
      ]
      df = (
          TermDocMatrixFromPandas(
              data_frame=pd.DataFrame(
                  {
                      "text": bigrams,
                      "category": ["a", "a", "a", "b", "b"],
                  }
              ),
              category_col="category",
              text_col="text",
              nlp=whitespace_nlp,
          )
          .build()
          .get_term_freq_df()
      )
      new_df = filter_out_unigrams_that_only_occur_in_one_bigram(df)
      self.assertFalse("cat" in new_df.index)
      self.assertFalse("saw" in new_df.index)
      self.assertTrue("the" in new_df.index)
      self.assertTrue("horses" in new_df.index)
      self.assertTrue("pigs" in new_df.index)
      self.assertEqual(set(bigrams) & set(new_df.index), set(bigrams))
  
file_path: scattertext/scattertext/test/test_PMIFiltering.py
imports: from unittest import TestCase
  import pandas
  from scattertext import TermDocMatrixFilter
  from scattertext import TermDocMatrixFromPandas
  from scattertext import whitespace_nlp
  from scattertext.TermDocMatrixFilter import AtLeastOneCategoryHasNoTermsException, filter_bigrams_by_pmis, unigrams_that_only_occur_in_one_bigram, filter_out_unigrams_that_only_occur_in_one_bigram
  from scattertext.test.test_TermDocMat import get_hamlet_term_doc_matrix
label_desc: Use image node_id 5 for calling the TestPMIFiltering obj's underlying member method code with example usage: obj.test_filter_out_unigrams_that_only_occur_in_one_bigram() without return types