'Convert a compacted array back into a loose array.
Arguments
word_compact : int array
Input compacted word array to be converted into a loose array.
Examples
>>> corpus = Corpus()
>>> word_indices = np.random.randint(100, size=1000)
>>> corpus.update_word_count(word_indices)
>>> corpus.finalize()
>>> word_compact = corpus.to_compact(word_indices)
>>> word_loose = corpus.to_loose(word_compact)
>>> np.all(word_loose == word_indices)
True'

def to_loose(self, word_compact):

    self._check_finalized()
    uniques = np.unique(word_compact)
    oov = np.setdiff1d(uniques, self.keys_compact, assume_unique=True)
    msg = 'Found    keys    in    `word_compact`    not    present    in    the'
    msg += 'training    corpus.    Is    this    actually    a    compacted    array?'
    assert np.all((oov < 0)), msg
    loose = fast_replace(word_compact, self.keys_compact, self.keys_loose)
    return loose
