Spot why this vocabulary produces non-contiguous, oversized word indices.
corpus = ["nlp is fun", "nlp is hard"] words = [] for sentence in corpus: words += sentence.split() vocab = {word: i for i, word in enumerate(words)} print(vocab)
What is the bug in this vocabulary-building code?