title: while i am compiling i am getting key error
body: <pre><code>def words_to_indices(inverse_vocabulary, words):
      return [inverse_vocabulary[word] for word in words]
  
  if __name__ == "__main__":
      vocabulary = open("G:\clickbait-detector-master\data/vocabulary.txt").read().split("\n")
      inverse_vocabulary = dict((word, i) for i, word in enumerate(vocabulary))
  
      clickbait = open("G:\clickbait-detector-master\data/clickbait.preprocessed.txt").read().split("\n")
      clickbait = sequence.pad_sequences([words_to_indices(inverse_vocabulary, sentence.split()) for sentence in clickbait], maxlen=SEQUENCE_LENGTH)
  
      genuine = open("G:\clickbait-detector-master\data/genuine.preprocessed.txt").read().split("\n")
      genuine = sequence.pad_sequences([words_to_indices(inverse_vocabulary, sentence.split()) for sentence in genuine], maxlen=SEQUENCE_LENGTH)
  </code></pre>
  
  <p>my error is:</p>
  
  <pre><code>KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-6-692b7e251048&gt; in &lt;module&gt;()
       25 
       26     clickbait = open("G:\clickbait-detector-master\data/clickbait.preprocessed.txt").read().split("\n")
  ---&gt; 27     clickbait = sequence.pad_sequences([words_to_indices(inverse_vocabulary, sentence.split()) for sentence in clickbait], maxlen=SEQUENCE_LENGTH)
       28 
       29     genuine = open("G:\clickbait-detector-master\data/genuine.preprocessed.txt").read().split("\n")
  
  &lt;ipython-input-6-692b7e251048&gt; in &lt;listcomp&gt;(.0)
       25 
       26     clickbait = open("G:\clickbait-detector-master\data/clickbait.preprocessed.txt").read().split("\n")
  ---&gt; 27     clickbait = sequence.pad_sequences([words_to_indices(inverse_vocabulary, sentence.split()) for sentence in clickbait], maxlen=SEQUENCE_LENGTH)
       28 
       29     genuine = open("G:\clickbait-detector-master\data/genuine.preprocessed.txt").read().split("\n")
  
  &lt;ipython-input-6-692b7e251048&gt; in words_to_indices(inverse_vocabulary, words)
       16 
       17 def words_to_indices(inverse_vocabulary, words):
  ---&gt; 18     return [inverse_vocabulary[word] for word in words]
       19 
       20 if __name__ == "__main__":
  
  &lt;ipython-input-6-692b7e251048&gt; in &lt;listcomp&gt;(.0)
       16 
       17 def words_to_indices(inverse_vocabulary, words):
  ---&gt; 18     return [inverse_vocabulary[word] for word in words]
       19 
       20 if __name__ == "__main__":
  
  KeyError: 'C'
  </code></pre>