class_docstr: Create a visualization of a semiotic square.  Requires Corpus to have
  at least three categories.
  >>> newsgroups_train = fetch_20newsgroups(subset='train',
  ...   remove=('headers', 'footers', 'quotes'))
  >>> vectorizer = CountVectorizer()
  >>> X = vectorizer.fit_transform(newsgroups_train.data)
  >>> corpus = st.CorpusFromScikit(
  ...         X=X,
  ...         y=newsgroups_train.target,
  ...         feature_vocabulary=vectorizer.vocabulary_,
  ...         category_names=newsgroups_train.target_names,
  ...         raw_texts=newsgroups_train.data
  ...         ).build()
  >>> semseq = SemioticSquare(corpus,
  ...         category_a = 'alt.atheism',
  ...         category_b = 'soc.religion.christian',
  ...         neutral_categories = ['talk.religion.misc']
  ... )
  >>> # A simple HTML table
  >>> html = SemioticSquareViz(semseq).to_html()
  >>> # The table with an interactive scatterplot below it
  >>> html = st.produce_semiotic_square_explorer(semiotic_square,
  ...                                            x_label='More Atheism, Less Xtnity',
  ...                                            y_label='General Religious Talk')
class_docstr_tok: ["Create","a","visualization","of","a","semiotic","square",".","Requires","Corpus","to","have","at","least","three","categories",".",">",">",">","newsgroups_train","=","fetch_20newsgroups","(","subset='train","'",",","...","remove=","(","'headers","'",",","'footers","'",",","'quotes","'",")",")",">",">",">","vectorizer","=","CountVectorizer","(",")",">",">",">","X","=","vectorizer.fit_transform","(","newsgroups_train.data",")",">",">",">","corpus","=","st.CorpusFromScikit","(","...","X=X",",","...","y=newsgroups_train.target",",","...","feature_vocabulary=vectorizer.vocabulary_",",","...","category_names=newsgroups_train.target_names",",","...","raw_texts=newsgroups_train.data","...",")",".build","(",")",">",">",">","semseq","=","SemioticSquare","(","corpus",",","...","category_a","=","'alt.atheism","'",",","...","category_b","=","'soc.religion.christian","'",",","...","neutral_categories","=","[","'talk.religion.misc","'","]","...",")",">",">",">","#","A","simple","HTML","table",">",">",">","html","=","SemioticSquareViz","(","semseq",")",".to_html","(",")",">",">",">","#","The","table","with","an","interactive","scatterplot","below","it",">",">",">","html","=","st.produce_semiotic_square_explorer","(","semiotic_square",",","...","x_label='More","Atheism",",","Less","Xtnity","'",",","...","y_label='General","Religious","Talk","'",")"]
code: def _build_lexicons(self):
      self.lexicons = {}
      ax = self.axes
      x_max = ax["x"].max()
      y_max = ax["y"].max()
      x_min = ax["x"].min()
      y_min = ax["y"].min()
      x_baseline = self._get_x_baseline()
      y_baseline = self._get_y_baseline()
  
      def dist(candidates, x_bound, y_bound):
          return (
              (x_bound - candidates["x"]) ** 2
              + (y_bound - candidates["y"]) ** 2
          ).sort_values()
  
      self.lexicons["a"] = dist(
          ax[(ax["x"] > x_baseline) & (ax["y"] > y_baseline)],
          x_max,
          y_max,
      )
      self.lexicons["not_a"] = dist(
          ax[(ax["x"] < x_baseline) & (ax["y"] < y_baseline)],
          x_min,
          y_min,
      )
  
      self.lexicons["b"] = dist(
          ax[(ax["x"] < x_baseline) & (ax["y"] > y_baseline)],
          x_min,
          y_max,
      )
      self.lexicons["not_b"] = dist(
          ax[(ax["x"] > x_baseline) & (ax["y"] < y_baseline)],
          x_max,
          y_min,
      )
  
      self.lexicons["a_and_b"] = dist(
          ax[(ax["y"] > y_baseline)], x_baseline, y_max
      )
      self.lexicons["not_a_and_not_b"] = dist(
          ax[(ax["y"] < y_baseline)], x_baseline, y_min
      )
  
      self.lexicons["a_and_not_b"] = dist(
          ax[(ax["x"] > x_baseline)], x_max, y_baseline
      )
  
      self.lexicons["b_and_not_a"] = dist(
          ax[(ax["x"] < x_baseline)], x_min, y_baseline
      )
  
      return self.lexicons
  
imports: import numpy
  import pandas
  from scattertext.termranking import AbsoluteFrequencyRanker
  from scattertext.termscoring.RankDifference import RankDifference
label_desc: Use image node_id 13 for calling the SemioticSquare obj's underlying member method code with example usage: obj._build_lexicons() and returns: self, unknown