Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type error #5

Open
chesterkuo opened this issue Jun 19, 2018 · 4 comments
Open

type error #5

chesterkuo opened this issue Jun 19, 2018 · 4 comments

Comments

@chesterkuo
Copy link

I'm trying to create uni_bi.sh with Chinese/utf8 word seg file, however always got following error.
any idea ?

==========
Traceback (most recent call last):
File "ngram2vec/pairs2counts.py", line 109, in
main()
File "ngram2vec/pairs2counts.py", line 88, in main
counts_file.write(str(old[0]) + " " + str(w) + " " + str(old[1][w]) + "\n")
TypeError: write() argument 1 must be unicode, not str

@zhezhaoa
Copy link
Owner

I think the error is related with character encoding difference between python2 and 3. Maybe using python2 could fix the problem?

@shubhamnagalwade
Copy link

I am trying to run the word2vecf.py file from simplified file but got following error.
Traceback (most recent call last):
File "corpus2pairs.py", line 4, in
from corpus2vocab import getNgram
File "/home/shubham/Inovanttech/W2V/ngram2vec/ngram2vec/simplified/corpus2vocab.py", line 4, in
from representations.matrix_serializer import save_count_vocabulary
ModuleNotFoundError: No module named 'representations'

@zhezhaoa
Copy link
Owner

zhezhaoa commented Oct 7, 2018

I am sorry that I didn't try the codes in simplified file thoroughly. A simple solution is to add the save_count_vocabulary function in representations.matrix_serializer into corpus2vocab.py file. And then delete the line from representations.matrix_serializer import save_count_vocabulary

@shubhamnagalwade
Copy link

shubhamnagalwade commented Oct 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants