# bi_lstm_crf **Repository Path**: taylorguo/bi_lstm_crf ## Basic Information - **Project Name**: bi_lstm_crf - **Description**: Bi-LSTM-CRF - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-05-30 - **Last Updated**: 2023-07-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # bi_lstm_crf #### 介绍 Bi-LSTM-CRF 训练与测试 #### 安装教程 1. git clone https://github.com/jidasheng/bi-lstm-crf 2. python setup.py install 3. 或 直接添加 PYTHONPATH , 方便 debug #### 使用说明 1. 使用 [bi-lstm-crf](https://github.com/jidasheng/bi-lstm-crf) 库训练[人民日报数据集](http://s3.bmio.net/kashgari/china-people-daily-ner-corpus.tar.gz) 2. 准备数据集, 使用 [vocab.py](https://github.com/Gxzzz/BiLSTM-CRF/blob/master/vocab.py)将[人民日报数据集](http://s3.bmio.net/kashgari/china-people-daily-ner-corpus.tar.gz) 转换成 [word2id+id2word sentance&tag](https://github.com/Gxzzz/BiLSTM-CRF/tree/master/vocab)的 json 格式 3. 再使用 [gen_sents_tag.py](./gen_sents_tag.py) 生成 [vocab.json 和 tags.json](https://github.com/jidasheng/bi-lstm-crf/tree/master/bi_lstm_crf/app/sample_corpus) 4. 再使用 [data_to_json.py](./data_to_json.py) 生成 [dataset.txt](https://github.com/jidasheng/bi-lstm-crf/blob/master/bi_lstm_crf/app/sample_corpus/dataset.txt) 5. 上面的训练所用的数据集准备完成后,进行训练: ``` $ python -m bi_lstm_crf "corpus_dir[数据集目录, 这里是 dataset]" --model_dir "model_xxx[存放模型的目录]" ----num_epoch 690[训练时的 epoch 数量] ``` 6. 测试: 运行 python test.py