test
|
@ -34,25 +34,13 @@ git clone git@github.com:zjunlp/DeepKE.git
|
|||
- `train.txt`:存放训练数据集
|
||||
- `valid.txt`:存放验证数据集
|
||||
- `test.txt`:存放测试数据集
|
||||
- 开始训练:```python run.py``` (训练所用到参数都在conf文件夹中,修改即可)
|
||||
|
||||
- 先进行训练,训练后的模型参数保存在`out_ner`文件夹中
|
||||
|
||||
```
|
||||
python run.py --data_dir=data/ --bert_model=bert-base-cased --task_name=ner --output_dir=out_ner --max_seq_length=128 --do_train --num_train_epochs 5 --do_eval --warmup_proportion=0.1
|
||||
```
|
||||
|
||||
- 再进行预测
|
||||
|
||||
- 执行以下命令运行示例`python predict.py`
|
||||
|
||||
- 如果需要指定NER的文本,可以利用--text参数指定,如:
|
||||
|
||||
````
|
||||
python predict.py --text="It was one o'clock when we left Lauriston Gardens and Sherlock Holmes led me to Metropolitan Police Service.."
|
||||
````
|
||||
|
||||
- 每次训练的日志保存在 `logs` 文件夹内,模型结果保存在 `checkpoints` 文件夹内。
|
||||
|
||||
- 进行预测 ```python predict.py```
|
||||
|
||||
## 模型内容
|
||||
|
||||
BERT
|
||||
|
||||
|
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 94 KiB |
|
@ -65,7 +65,9 @@
|
|||
"metadata": {},
|
||||
"source": [
|
||||
"## BERT\n",
|
||||
"[**Bidirectional Encoder Representations from Transformers (BERT)**](https://github.com/google-research/bert) is a transformer-based machine learning technique for natural language processing (NLP) pre-training developed by Google."
|
||||
"[**Bidirectional Encoder Representations from Transformers (BERT)**](https://github.com/google-research/bert) is a transformer-based machine learning technique for natural language processing (NLP) pre-training developed by Google.\n",
|
||||
"\n",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -894,7 +896,7 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
@ -909,6 +911,24 @@
|
|||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.11"
|
||||
},
|
||||
"latex_envs": {
|
||||
"LaTeX_envs_menu_present": true,
|
||||
"autoclose": false,
|
||||
"autocomplete": true,
|
||||
"bibliofile": "biblio.bib",
|
||||
"cite_by": "apalike",
|
||||
"current_citInitial": 1,
|
||||
"eqLabelWithNumbers": true,
|
||||
"eqNumInitial": 1,
|
||||
"hotkeys": {
|
||||
"equation": "Ctrl-E",
|
||||
"itemize": "Ctrl-I"
|
||||
},
|
||||
"labels_anchors": false,
|
||||
"latex_user_defs": false,
|
||||
"report_style_numbering": false,
|
||||
"user_envs_cfg": false
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 292 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |