cemoody / lda2vec

MIT License
3.15k stars 628 forks source link

Axis Error lda2vec #70

Open Aravinviju opened 6 years ago

Aravinviju commented 6 years ago

I am getting the following error when I tried to run the default preprocess.py in the lda2vec (original github), can someone help me out in this?


AxisError Traceback (most recent call last)

in () 2 # Make a ranked list of rare vs frequent words 3 corpus.update_word_count(tokens) ----> 4 corpus.finalize() ~/Arav/LDA2VEC_TopicModel/lda2vec-master/lda2vec/corpus.py in finalize(self) 153 # Return the loose keys and counts in descending count order 154 # so that the counts arrays is already in compact order --> 155 self.keys_loose, self.keys_counts, n_keys = self._loose_keys_ordered() 156 self.keys_compact = np.arange(n_keys).astype('int32') 157 self.loose_to_compact = {l: c for l, c in ~/Arav/LDA2VEC_TopicModel/lda2vec-master/lda2vec/corpus.py in _loose_keys_ordered(self) 102 keys, counts = keys[order], counts[order] 103 # Add in the specials as a prefix to the other keys --> 104 specials = np.sort(self.specials.values()) 105 keys = np.concatenate((specials, keys)) 106 empty = np.zeros(len(specials), dtype='int32') ~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in sort(a, axis, kind, order) 845 else: 846 a = asanyarray(a).copy(order="K") --> 847 a.sort(axis=axis, kind=kind, order=order) 848 return a 849 AxisError: axis -1 is out of bounds for array of dimension 0
syrin1 commented 5 years ago

I got the same issue, any solution plz?