Skip to content

Commit

Permalink
Modify sequence labeling tutorial (#69)
Browse files Browse the repository at this point in the history
* add sequence labeling in tutorial

* add tag scheme convert script

* add paper link

* modify sequence labeling tutorial

* modify senquence labeling tutorial
  • Loading branch information
adolphk-yk authored and ljshou committed Jun 22, 2019
1 parent 3f69dac commit 47008bb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
28 changes: 25 additions & 3 deletions Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,20 +578,42 @@ Sequence Labeling is an important NLP task, which includes NER, Slot Tagging, Po
- ***Usages***
1. BiLSTM representation and Softmax output.
1. Softmax output.
```bash
# train model
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json
# test model
cd PROJECT_ROOT
python test.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json
```
2. CRF output.
```bash
# train model
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json
# test model
cd PROJECT_ROOT
python test.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json
```
*Tips: you can try more model in [here](https://github.com/microsoft/NeuronBlocks/tree/master/model_zoo/nlp_tasks/slot_tagging).*
- ***Result***
1. BiLSTM representation and Softmax output.
The result on CoNLL 2003 English NER dataset.
Model | F1-score
-------- | --------
[Ma and Hovy(2016)](https://arxiv.org/pdf/1603.01354.pdf)|87.00
BiLSTM+Softmax(NeuronBlocks)|88.50
[BiLSTM+Softmax](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json) (NeuronBlocks)|88.50
[Lample et al.(2016)](https://arxiv.org/pdf/1603.01360.pdf)| 89.15
[CLSTM+WLSTM+CRF](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_clstm_wlstm_crf.json) (NeuronBlocks)|90.83
[Chiu and Nichols(2016)](https://www.mitpressjournals.org/doi/pdf/10.1162/tacl_a_00104)|90.91
[CCNN+WLSTM+CRF](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json) (NeuronBlocks)|91.38
*Tips: C means Char and W means Word. CCNN means Char-level representation with CNN model and CLSTM means Char-level representation with LSTM model.*
## <span id="advanced-usage">Advanced Usage</span>
Expand Down
28 changes: 25 additions & 3 deletions Tutorial_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,20 +568,42 @@ This task is to train a query-passage regression model to learn from a heavy tea
- ***用法***
1. BiLSTM 词表示和 Softmax 输出
1. Softmax 输出.
```bash
# train model
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json
# test model
cd PROJECT_ROOT
python test.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json
```
2. CRF 输出.
```bash
# train model
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json
# test model
cd PROJECT_ROOT
python test.py --conf_path=model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json
```
*提示 :尝试更多模型可 [点击](https://github.com/microsoft/NeuronBlocks/tree/master/model_zoo/nlp_tasks/slot_tagging)。*
- ***结果***
1. BiLSTM 词表示和 Softmax 输出
实验采用 CoNLL 2003 英文 NER 数据集。
Model | F1-score
-------- | --------
[Ma and Hovy(2016)](https://arxiv.org/pdf/1603.01354.pdf)|87.00
BiLSTM+Softmax(NeuronBlocks)|88.50
[BiLSTM+Softmax](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging.json) (NeuronBlocks)|88.50
[Lample et al.(2016)](https://arxiv.org/pdf/1603.01360.pdf)| 89.15
[CLSTM+WLSTM+CRF](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_clstm_wlstm_crf.json) (NeuronBlocks)|90.83
[Chiu and Nichols(2016)](https://www.mitpressjournals.org/doi/pdf/10.1162/tacl_a_00104)|90.91
[CCNN+WLSTM+CRF](https://github.com/microsoft/NeuronBlocks/blob/master/model_zoo/nlp_tasks/slot_tagging/conf_slot_tagging_ccnn_wlstm_crf.json) (NeuronBlocks)|91.38
*提示 : C 代表字符,W 代表单词。 CCNN 代表使用 CNN 模型的字符级别表示, CLSTM 代表使用 LSTM 模型的字符级别表示。*
## <span id="advanced-usage">高阶用法</span>
Expand Down

0 comments on commit 47008bb

Please sign in to comment.