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

Python3 Preprocessing and UTF-8 decoding of GoogleNews-vectors correction #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gargrohin
Copy link

Updated preprocess.py to Python3. Corrected reading of characters from GoogleNews-vectors-negative300.bin by adding .decode("utf-8"), which was not working before, at least in Python3. Tested on custom datasets.

word = []
while True:
ch = f.read(1)
try:
ch = f.read(1).decode("utf-8")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was not working without .decode("utf-8") for certain lines in GoogleNews-vector-bin. Needed try-exceptbecause of some bad end of line characters in GoogleNews-vector-bin`.

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

Successfully merging this pull request may close these issues.

1 participant