From 31eac4a795f90e87bfe5cff2df87eadeceffd688 Mon Sep 17 00:00:00 2001 From: FengZiYjun Date: Sun, 2 Sep 2018 14:33:23 +0800 Subject: [PATCH] fix bug in preprocessor: reported in issue 47 --- fastNLP/core/preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/preprocess.py b/fastNLP/core/preprocess.py index 99bf45ba..1c419ce9 100644 --- a/fastNLP/core/preprocess.py +++ b/fastNLP/core/preprocess.py @@ -268,7 +268,7 @@ class ClassPreprocess(BasePreprocess): for word in sent: if word not in word2index: - word2index[word[0]] = len(word2index) + word2index[word] = len(word2index) return word2index, label2index def to_index(self, data):