From fbe7b7175baece5e31bdf28298da78db119d15f6 Mon Sep 17 00:00:00 2001 From: ChenXin Date: Wed, 8 May 2019 14:38:44 +0800 Subject: [PATCH] fix a little bug --- fastNLP/core/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/dataset.py b/fastNLP/core/dataset.py index 013f7602..aa3d2d82 100644 --- a/fastNLP/core/dataset.py +++ b/fastNLP/core/dataset.py @@ -97,7 +97,7 @@ # 将句子分成单词形式, 详见DataSet.apply()方法 dataset.apply(lambda ins: ins['sentence'].split(), new_field_name='words') # 或使用DataSet.apply_field() - dataset.apply(lambda sent:sent.split(), field_name='sentence', new_field_name='words') + dataset.apply_field(lambda sent:sent.split(), field_name='sentence', new_field_name='words') # 除了匿名函数,也可以定义函数传递进去 def get_words(instance): sentence = instance['sentence']