code: def create_lyrics_corpus(dataset, field):
      # Remove all other punctuation
      dataset[field] = dataset[field].str.replace(
          "[{}]".format(string.punctuation), ""
      )
      # Make it lowercase
      dataset[field] = dataset[field].str.lower()
      # Make it one long string to split by line
      lyrics = dataset[field].str.cat()
      corpus = lyrics.split("\n")
      # Remove any trailing whitespace
      for l in range(len(corpus)):
          corpus[l] = corpus[l].rstrip()
      # Remove any empty lines
      corpus = [l for l in corpus if l != ""]
  
      return corpus
  
file_path: analytics-zoo/docs/docs/ClusterServingGuide/OtherFrameworkUsers/l10c03_nlp_constructing_text_generation_model.py
imports: import tensorflow
  from tensorflow.keras.preprocessing.text import Tokenizer
  from tensorflow.keras.preprocessing.sequence import pad_sequences
  import string
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: create_lyrics_corpus(dataset, field) and returns: corpus