首页 > 解决方案 > RASA X: UnicodeEncodeError: 'charmap' codec can't encode character when run Rasa X

问题描述

I am using Rasa Open Source to build a chatbot application and it works pretty well. I want to use Rasa X to make more use of its features. But I get this problem every time I run the command rasa x:

Traceback (most recent call last):
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 212, in get_story_steps
    return StoryService._reader_read_from_string(reader, story_string)
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 130, in _reader_read_from_string
    f.write(story_string)
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\tempfile.py", line 481, in func_wrapper
    return func(*args, **kwargs)
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u1ee7' in position 25: character maps to <undefined>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasa\cli\x.py", line 500, in run_locally
    domain_path=domain_path,
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\local.py", line 242, in main
    project_path, data_path, session, args.port, config_path, domain_path
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\local.py", line 169, in _initialize_with_local_data
    domain_path=domain_path,
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\asyncio\base_events.py", line 579, in run_until_complete
    return future.result()
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\initialise.py", line 375, in inject_files_from_disk
    username,
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\initialise.py", line 135, in inject_stories
    story_files, team, project_id, username
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 553, in save_stories_from_files
    is_test=is_test,
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 434, in save_stories
    story_string, filename, domain, is_test
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 332, in _extract_stories_markdown
    test_stories=is_test,
  File "c:\users\admin\anaconda3\envs\chatbot3\lib\site-packages\rasax\community\services\story_service.py", line 216, in get_story_steps
    "'{}'\nError: {}".format(story_string, e)
rasa.shared.core.training_data.story_reader.story_reader.StoryParseError

I tried using rasa x and it seems to be perfect for English. But my current language is Vietnamese. Does rasa x have a problem with it?

Someone please help me!

UPDATE

I fixed the charmap bug and start the bot successfully, but something went wrong making the conversation not so smooth.

WARNING:rasax.community.services.event_consumers.event_consumer:Saving event failed due to an 'IntegrityError'.
An error occured when trying to send the telemetry event: HTTPSConnectionPool(host='api.segment.io', port=443): Max retries exceeded with url: /v1/track (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 500 Internal Server Error')))

标签: rasarasa-x

解决方案


这个警告:

An error occured when trying to send the telemetry event: HTTPSConnectionPool(host='api.segment.io', port=443): Max retries exceeded with url: /v1/track (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 500 Internal Server Error')))

不是应该影响机器人的问题;它只是说它试图发送遥测事件但不能。遥测事件不是你的机器人/Rasa X 需要操作的东西。除非它导致机器人出现实际问题,否则您可以忽略它。


推荐阅读