title: What is UNK Token in Vector Representation of Words
body: <pre><code># Step 2: Build the dictionary and replace rare words with UNK token.
  vocabulary_size = 50000
  
  
  def build_dataset(words, n_words):
    """Process raw inputs into a dataset."""
    count = [['UNK', -1]]
    count.extend(collections.Counter(words).most_common(n_words - 1))
    dictionary = dict()
    for word, _ in count:
      dictionary[word] = len(dictionary)
    data = list()
    unk_count = 0
    for word in words:
      if word in dictionary:
        index = dictionary[word]
      else:
        index = 0  # dictionary['UNK']
        unk_count += 1
      data.append(index)
    count[0][1] = unk_count
    reversed_dictionary = dict(zip(dictionary.values(), dictionary.keys()))
    return data, count, dictionary, reversed_dictionary
  
  data, count, dictionary, reverse_dictionary = build_dataset(vocabulary,
                                                              vocabulary_size)
  </code></pre>
  
  <p>I am learning the elementary example of Vector Representation of Words using Tensorflow.</p>
  
  <p>This Step 2 is titled as "Build the dictionary and replace rare words with UNK token", however, there's no prior defining process of what "UNK" refers to.</p>
  
  <p>To specify the question:</p>
  
  <p>0) What does UNK generally refer to in NLP?</p>
  
  <p>1) What does count = [['UNK', -1]] mean? I know the bracket [] refer to list in python, however, why do we collocating it with -1?</p>