From 693981be27c988de07d12b1add8950a3d63a31f1 Mon Sep 17 00:00:00 2001 From: ChenXin Date: Fri, 27 Mar 2020 21:29:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=9A=84=E5=85=B6=E5=AE=83bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/batch.py | 2 +- fastNLP/io/loader/classification.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fastNLP/core/batch.py b/fastNLP/core/batch.py index 432777b3..1cebd4bd 100644 --- a/fastNLP/core/batch.py +++ b/fastNLP/core/batch.py @@ -321,7 +321,7 @@ class TorchLoaderIter(BatchIter): data.append(x + [y]) with open(tmp_file_path, 'w') as f: for d in data: - f.write(' '.join(map(str, d)) + '\\n') + f.write(' '.join(map(str, d)) + '\n') class FileDataSet: def __init__(self, tmp_file): diff --git a/fastNLP/io/loader/classification.py b/fastNLP/io/loader/classification.py index 9fa0d6c3..23af5d8f 100644 --- a/fastNLP/io/loader/classification.py +++ b/fastNLP/io/loader/classification.py @@ -424,7 +424,7 @@ class ChnSentiCorpLoader(Loader): class THUCNewsLoader(Loader): r""" 数据集简介:document-level分类任务,新闻10分类 - 原始数据内容为:每行一个sample,第一个'\t'之前为target,第一个'\t'之后为raw_words + 原始数据内容为:每行一个sample,第一个 "\\t" 之前为target,第一个 "\\t" 之后为raw_words Example::