首页 > 解决方案 > 使用“\t”进行文件解析和标记化

问题描述

我目前正在使用以下 git repo - https://github.com/threelittlemonkeys/rnn-encoder-decoder-pytorch

我在设置输入文件时遇到问题。根据github,我们需要以下格式的文件:

source_sequence \t target_sequence

source_sequence \t target_sequence

查看代码,它正在解析每一行并将其拆分为“\t”分隔符。但是,当我运行 prepare.py 时,我收到以下错误“没有足够的值来解包(预期 2,得到 1)”

这似乎在执行 line.split("\t") 时发生。我的每一行输入都是一个序列,后跟 \t,然后是另一个序列。谁能告诉我发生了什么?

标签: pythonparsingtexttokenize

解决方案


推荐阅读