Connect your moderator Slack workspace to receive post notifications:
Sign in with Slack

ValueError in cooc.py

Hello, I am having trouble running the comand for project 2 text classification. I tried to follow the command in the readme file but I get this error that I don't understand.
ml_.jpg

Do you have an idea where can this error come from ?

Top comment

Hello,

I just went through these steps:

build_vocab.sh
cut_vocab.sh
python3 pickle_vocab.py
python3 cooc.py

I did have to change the paths in cooc.py to

for fn in ['twitter-datasets/train_pos.txt', 'twitter-datasets/train_neg.txt']:

but after that, it worked well. I did not manage to reproduce your error.

From your output, it seems that your data is read correctly. The 200k records reported match what I see here. Maybe the issue could be in scipy? Could you check your version? Mine is

In [1]: import scipy

In [2]: scipy.__version__
Out[2]: '1.4.1'

Edit: maybe this stackoverflow post is helpful?

Hello, the scipy version or the pathway directory does not seem to be the problem. It is the coo_matrix function that doesn't work. When I print the data, row, column and tokens argument there are empty.
I don't understand why is that the case.

Are the inputs you pass into coo_matrix non-empty?

Page 1 of 1

Add comment

Post as Anonymous Dont send out notification