code: def scale_font_size(
      scores: np.array, min_size=9, max_size=20
  ) -> np.array:
      bin_boundaries = np.histogram_bin_edges(
          np.log(scores), bins=max_size - min_size
      )
      return (
          pd.Series(scores)
          .apply(np.log)
          .apply(lambda x: bisect_left(bin_boundaries, x) + min_size)
          .values
      )
  
file_path: scattertext/demo_umap_wordcloud.py
imports: import re
  from bisect import bisect_left
  import numpy
  import pandas
  import umap
  import scattertext
  import spacy
label_desc: Use image node_id 2 for calling a global function with example usage: scale_font_size(scores, min_size, max_size) and returns: pd