From fc8438587b7d3064e8e498aa046b1dccec276f70 Mon Sep 17 00:00:00 2001 From: yh Date: Mon, 19 Aug 2019 23:37:25 +0800 Subject: [PATCH] Conll2003Pipe --- fastNLP/io/pipe/conll.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastNLP/io/pipe/conll.py b/fastNLP/io/pipe/conll.py index 58fab281..d253f3be 100644 --- a/fastNLP/io/pipe/conll.py +++ b/fastNLP/io/pipe/conll.py @@ -158,9 +158,9 @@ class Conll2003Pipe(Pipe): _indexize(data_bundle, input_field_names=Const.INPUT, target_field_names=['pos', 'ner']) # chunk中存在一些tag只在dev中出现,没在train中 tgt_vocab = Vocabulary(unknown=None, padding=None) - tgt_vocab.from_dataset(*data_bundle.datasets.values(), field_name='ner') - tgt_vocab.index_dataset(*data_bundle.datasets.values(), field_name='ner') - data_bundle.set_vocab(tgt_vocab, 'ner') + tgt_vocab.from_dataset(*data_bundle.datasets.values(), field_name='chunk') + tgt_vocab.index_dataset(*data_bundle.datasets.values(), field_name='chunk') + data_bundle.set_vocab(tgt_vocab, 'chunk') input_fields = [Const.INPUT, Const.INPUT_LEN] target_fields = ['pos', 'ner', 'chunk', Const.INPUT_LEN]