(vocab_file_path, data, vocab, min_frequency=0)
Process vocab
Process vocab
Process vocab
def process_vocab(vocab_file_path, data, vocab, min_frequency=0):
  """Process vocab"""
  for line in data:
    for word in line.split():
      vocab.add(word)
  if min_frequency > 0:
    vocab.trim(min_frequency)
  save_vocabs(vocab.mapping, vocab_file_path)
def process_vocab ( vocab_file_path , data , vocab , min_frequency = 0 ) : for line in data : for word in line . split ( ) : vocab . add ( word ) if min_frequency > 0 : vocab . trim ( min_frequency ) save_vocabs ( vocab . mapping , vocab_file_path )