Skip to content

[NLP] A Named Entity Recognition project for the medical records (from ccks2019) using BERT+BiLSTM+CRF

Notifications You must be signed in to change notification settings

chenjunyi1999/Medical-NER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical-NER

简介

一个使用Pytorch 构建的基于 BERT+BiLSTM+CRF 的中文医疗信息命名实体识别程序。

项目结构

data:存放训练数据
config.py: 模型参数,训练超参数,文件路径等配置信息
dataset.py: 定义数据集以及与数据处理相关的函数
main.py:主函数
model.py:模型文件(BERT+BiLSTM+CRF)
preprocess.py:处理原始数据,使用BIO标签
utils.py:一些工具函数(模型训练,验证,测试,推理等)

如何使用

  1. 安装依赖库
pip install -r requirements.txt
  1. 处理原始数据集
python preprocess.py
  1. 训练模型(含测试结果)
python main.py --mode='train'
  1. 模型推理
python main.py --mode='infer' --ckpt_name="best" --txt="xxxxxxxxxx(中文输入)"

参考文献

  1. Pytorch-crf doc

About

[NLP] A Named Entity Recognition project for the medical records (from ccks2019) using BERT+BiLSTM+CRF

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages