It is the implemation of the paper Chinese NER Using Lattice LSTM with pyTorch 1.8.1.
- python 3.8.1
- pytorch==1.8.1
It is ResumeNER data, if you want to use your own dataset, the data need to be CoNLL format (prefer BIOES tag scheme), with each character its label for one line. Sentences are splited with a null line.
美 B-LOC
国 E-LOC
的 O
华 B-PER
莱 I-PER
士 E-PER
我 O
跟 O
他 O
谈 O
笑 O
风 O
生 O
- Clone this code repository to your local machine:
$ git clone https://github.com/hualaobisi/LatticeLSTM.git
-
Install the required dependencies
-
Download the pretrained character and word embeddings and put them into the models directory(It is already done).
-
Run the training program:
$ bash run_train.sh
- Run the predicting program:
$ bash run_predict.sh