Skip to content

Solution to week5 project of Natural Language Processing by National Research University Higher School of Economics Coursera

Notifications You must be signed in to change notification settings

claw89/stackoverflow_chatbot

Repository files navigation

Chatbot project

This folder contains the starting code for the chatbot project.

Troubleshooting

Bot crashes with the unicode error

If your bot code crashes with the error that ends with UnicodeEncodeError: 'ascii' codec can't encode character, your terminal likely has problems showing unicode symbols. To fix this you can change your terminal local by adding the following lines to you ~/.bashrc file (or any other shell configuration):

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

To verify the effect, you can run the following command end check that it outputs 'utf-8'

> python -c 'import locale; print(locale.getpreferredencoding())'
utf-8

You can find more details in this article.

If this doesn't work, you can explicitly specify the encoding when opening files:

with open(filename, 'r', encoding="utf-8") as file:
  ...

About

Solution to week5 project of Natural Language Processing by National Research University Higher School of Economics Coursera

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published