code: def generate_freq_df(
      value: pd.Series,
      n_gram: int = 1,
      top_n: int = 50,
      stopwords: list = [],
      verbose: bool = True,
  ) -> pd.DataFrame:
      """Generate a data frame of frequent word
  
      Args:
          value (pd.Series): Separated by space values.
          n_gram (int, optional): N number of N grams. Dafaults to 1.
          top_n (int, optional): N to get TOP N. Dafaults to 50.
          stopwords (list of str, optional): A list of words to specify for the stopword.
          verbose (bool, optional): Whether or not to output the log by tqdm.
  
      Returns:
          pd.DataFrame: frequent word DataFrame
      """
  
      def generate_ngrams(text: str, n_gram: int = 1) -> list:
          """Generate ngram
  
          Args:
              text (str): Target text
              n_gram (int, optional): N number of N grams. Defaults to 1.
  
          Returns:
              list of str: ngram list
          """
          token = [
              token
              for token in text.lower().split(" ")
              if token != ""
              if token not in stopwords
          ]
          ngrams = zip(*[token[i:] for i in range(n_gram)])
          return [" ".join(ngram) for ngram in ngrams]
  
      freq_dict = defaultdict(int)
      if verbose:
          for sent in tqdm(value):
              for word in generate_ngrams(str(sent), n_gram):
                  freq_dict[word] += 1
      else:
          for sent in value:
              for word in generate_ngrams(str(sent), n_gram):
                  freq_dict[word] += 1
  
      # frequent word DataFrame
      output_df = pd.DataFrame(
          sorted(freq_dict.items(), key=lambda x: x[1])[::-1]
      )
      output_df.columns = ["word", "word_count"]
      return output_df.head(top_n)
  
imports: import os
  import gc
  import itertools
  from io import BytesIO
  from PIL import Image
  from collections import defaultdict, Counter
  import datetime
  import pandas
  import numpy
  from tqdm import tqdm
  from sklearn import preprocessing
  import seaborn
  import plotly
  import plotly.graph_objs
  import plotly.express
  from wordcloud import WordCloud
  import networkx
  from networkx.algorithms import community
label_desc: Use image node_id 2 for calling a global function with example usage: generate_freq_df(value, n_gram, top_n, stopwords, verbose) and returns: output_df, unknown