READ ME
a logic-guided fine-grained address recognition method (Log-FGAER), where we formulate the address hierarchy relationship as the logic rule and softly apply it in a probabilistic manner to improve the accuracy of FGAER
- 安装
- [NER任务](#soft logic模型及其他基线模型)
本项目依赖PaddlePaddle 1.7.0+, 请参考这里安装 PaddlePaddle。
pip install paddle-ernie
或者
git clone https://github.com/PaddlePaddle/ERNIE.git --depth 1
cd ERNIE
pip install -r requirements.txt
pip install -e .
propeller
是辅助模型训练的高级框架,包含NLP常用的前、后处理流程。你可以通过将本repo根目录放入PYTHONPATH
的方式导入propeller
:
export PYTHONPATH=$PWD:$PYTHONPATH
数据目录整理成以下格式,方便后续使用(通过--data_dir
参数将数据路径传入训练脚本);
the --data_dir
option in the following section assumes a directory tree like this:
soft_logic/data/dialogue
├── dev
│ └── 1
├── test
│ └── 1
└── train
└── 1
构建数据集Dialogue-AER存放在./soft_logic/data/dialogue中,真实下游数据集存放在./soft_logic/data/cucc中
需要配置环境在requirements.txt中 pip install -r requirements.txt进行安装
运行: python3 dialogue_crf_sl.py
--from_pretrained ernie-1.0
--data_dir ./data/dialogue
--max_steps #set this to EPOCH * NUM_SAMPLES / BATCH_SIZE
--save_dir ./save
运行日志保存在./log中
@article{sun2019ernie,
title={Ernie: Enhanced representation through knowledge integration},
author={Sun, Yu and Wang, Shuohuan and Li, Yukun and Feng, Shikun and Chen, Xuyi and Zhang, Han and Tian, Xin and Zhu, Danxiang and Tian, Hao and Wu, Hua},
journal={arXiv preprint arXiv:1904.09223},
year={2019}
}