微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

RASA X: UnicodeEncodeError: 'charmap' 编解码器在运行 Rasa X 时无法编码字符

如何解决RASA X: UnicodeEncodeError: 'charmap' 编解码器在运行 Rasa X 时无法编码字符

我正在使用 Rasa Open Source 构建一个聊天机器人应用程序,它运行良好。我想使用 Rasa X 来更多地利用它的功能。但是每次运行命令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,line 216,in get_story_steps
    "'{}'\nError: {}".format(story_string,e)
rasa.shared.core.training_data.story_reader.story_reader.StoryParseError

我尝试使用 rasa x,它似乎非常适合英语。但我现在的语言是越南语。 rasa x 有问题吗?

有人请帮帮我!

更新

我修复了 charmap 错误并成功启动了机器人,但出了点问题,使对话变得不那么顺畅。

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')))

解决方法

此警告:

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 需要操作的东西。除非它导致机器人出现实际问题,否则您可以忽略它。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。