shannonai / mrc-for-flat-nested-ner Goto Github PK
View Code? Open in Web Editor NEWCode for ACL 2020 paper `A Unified MRC Framework for Named Entity Recognition`
Code for ACL 2020 paper `A Unified MRC Framework for Named Entity Recognition`
您好,请问这个代码库支持multi gpu么。以及比如跑conll2003的实验,一个gpu大致需要多长时间呢?我现在在aws ec2的p324dn上跑conlll2003的实验,发现时间非常长。十分感谢,期待回复!
Bug in bmes_decode function, infinite loop encountered when predictions presented certain patterns (Exp: O-O-O-M-E).
On prediction output and in the first iterations of training such sequences are not impossible to get which leads to an infinite evaluation time.
Quick fix: add an idx+=1
in line
您好,
感谢您的工作和开源代码,有几个问题想要请教一下。
在测试集上应该如何构建QA中的问题呢?
测试集如果是没有标签的话,是不是要把所有可能的实体标签对应的问句都构建一遍?
如果测试集在构建问句的时候使用了对应的实体类别便签会不会导致数据泄漏从而使性能有较大提升呢?
the log looks like this:
/home/mist/.local/lib/python3.6/site-packages/pytorch_lightning/utilities/distributed.py:37: UserWarning: The dataloader, val dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the num_workers
argument(try 96 which is the number of cpus on this machine) in the
DataLoaderinit to improve performance. warnings.warn(*args, **kwargs) bert/vocab.txt /home/mist/.local/lib/python3.6/site-packages/pytorch_lightning/utilities/distributed.py:37: UserWarning: The dataloader, train dataloader, does not have many workers which may be a bottleneck. Consider increasing the value of the
num_workers argument
(try 96 which is the number of cpus on this machine) in the DataLoader
init to improve performance.
warnings.warn(*args, **kwargs)
bert/vocab.txt
Epoch 0: 0%| | 1/2239 [00:00<17:25, 2.14it/s, loss=0.795, v_num=1]/usr/local/lib/python3.6/dist-packages/torch/optim/lr_scheduler.py:123: UserWarning: Detected call of lr_scheduler.step()
before optimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
Epoch 0: 100%|████████▉| 2231/2239 [19:17<00:04, 1.93it/s, loss=0.025, v_num=1]
look forward to your reply
thanks in advance
您好!请问有生成预测文件部分的代码吗?多谢了!
The address "https://github.com/ShannonAI/dice_loss_for_NLP" in your paper《Dice Loss for Data-imbalanced NLP Tasks》can't be find! I would like to konw how can I get the code for dice_loss? Will you public it? Thanks.
多谢多谢多谢!
My pytorch-lightning version is 0.10.0
and I think the version has been updated thus cannot import TensorMetric in metrics.query_span_f1.py
So, may I ask for the environment details of your experiment?
torch
pytorch-lightning
tokenizers
transformers
您好,请问这几个包的版本是什么
I wonder, to extract all types of eneities, does the model asks several questions to extract different types of entities or just ask one question a time and do this for [entity_types] times?
Hi Xiaoya,
Sorry to bother you again. I have some questions when reproduce the nested NER task using your model. (#10)
Env: Windows server 2016, 512G RAM, 8 P100
torch version: 1.1.0
other pip packages also the same as requirments.txt.
And using the BERT_base_uncased version.
We use the same data set file from you which almost the same as our data set.
We use the same hyperparameters with the log file in log fold and also train in 2 p100.
And run in two different machines.
To avoid inadequate training, we expand the epoch to 40.
ACE05
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"type_vocab_size": 2,
"vocab_size": 30522
},
"config_path": "./config/en_bert_base_uncased.json",
"data_dir": "./data_preprocess/en_ace05",
"bert_model": "./uncased_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 150,
"train_batch_size": 32,
"dev_batch_size": 32,
"test_batch_size": 32,
"checkpoint": 600,
"learning_rate": 4e-05,
"num_train_epochs": 40,
"warmup_proportion": -1.0,
"local_rank": -1,
"gradient_accumulation_steps": 1,
"seed": 2333,
"export_model": false,
"output_dir": "./result-05",
"data_sign": "ace2005",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "nested",
"n_gpu": 2,
"dropout": 0.2,
"entity_threshold": 0.5,
"data_cache": false
}
we only get 81.60% in ACE04 and 79.53% in ACE05.
There are big gaps in your public performance.
Thx!
I'm trying to reproduce the performance of your model on zh_ontonotes4 and zh_msra.
We use the dataset from you(https://drive.google.com/file/d/1KHRSTL_jn5PxQqz4prQ1No2E2wWcuxOd/view?usp=sharing).
We use the same hyperparameters as you except n_gpu and export_model.
But the result we got is significantly lower than your result.
Is there anything wrong?
Here is our result:
Dataset | f1 |
---|---|
zh_msra | 0.8968 |
zh_ontonotes4 | 0.7234 |
Here is our log:
zh_msra
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Please notice that merge the args_dict and json_config ... ...
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"directionality": "bidi",
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pooler_fc_size": 768,
"pooler_num_attention_heads": 12,
"pooler_num_fc_layers": 3,
"pooler_size_per_head": 128,
"pooler_type": "first_token_transform",
"type_vocab_size": 2,
"vocab_size": 21128
},
"config_path": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/config/zh_bert.json",
"data_dir": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_mrc_data/zh_msra_new",
"bert_model": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_checkpoints/chinese_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 100,
"train_batch_size": 28,
"dev_batch_size": 32,
"test_batch_size": 32,
"checkpoint": 300,
"learning_rate": 1e-05,
"num_train_epochs": 10,
"warmup_proportion": -1.0,
"local_rank": -1,
"gradient_accumulation_steps": 1,
"seed": 2333,
"export_model": true,
"output_dir": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new",
"data_sign": "zh_msra",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "flat",
"n_gpu": 2,
"dropout": 0.5,
"entity_threshold": 0.5,
"data_cache": false
}
-*--*--*--*--*--*--*--*--*--*-
current data_sign: zh_msra
=*==*==*==*==*==*==*==*==*==*=
loading train data ... ...
125184
125184 train data loaded
=*==*==*==*==*==*==*==*==*==*=
loading dev data ... ...
13908
13908 dev data loaded
=*==*==*==*==*==*==*==*==*==*=
loading test data ... ...
13095
13095 test data loaded
######################################################################
EPOCH: 0
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.003709064330905676
............................................................
DEV: loss, acc, precision, recall, f1
0.0093 0.8065 0.3027 0.3457 0.3228
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0121 0.7021 0.3227 0.3498 0.3357
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.017259005457162857
............................................................
DEV: loss, acc, precision, recall, f1
0.0057 0.8323 0.3274 0.3557 0.341
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0078 0.7381 0.3487 0.3592 0.3539
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.008477499708533287
............................................................
DEV: loss, acc, precision, recall, f1
0.005 0.8335 0.3295 0.3484 0.3387
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00913945771753788
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.8559 0.3639 0.3278 0.3449
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_1200.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0049 0.7759 0.4154 0.3747 0.394
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.009499709121882915
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.852 0.3597 0.3604 0.36
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_1500.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.004 0.7733 0.4011 0.3875 0.3942
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0031920350156724453
............................................................
DEV: loss, acc, precision, recall, f1
0.0029 0.8607 0.3918 0.3739 0.3826
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_1800.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0036 0.7785 0.4282 0.403 0.4152
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0036160091403871775
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.8728 0.4586 0.4279 0.4427
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_2100.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0036 0.7945 0.4993 0.4805 0.4897
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.4987242543138564e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.8748 0.4482 0.4158 0.4314
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.018135201185941696
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.8643 0.4061 0.3935 0.3997
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0006583106005564332
............................................................
DEV: loss, acc, precision, recall, f1
0.0025 0.8799 0.4774 0.4217 0.4478
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_3000.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0029 0.806 0.5064 0.4535 0.4785
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0013783248141407967
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.9158 0.6883 0.6256 0.6554
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_0_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0029 0.8576 0.6877 0.6292 0.6571
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.477923307102174e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.8626 0.3895 0.3248 0.3542
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001600581599632278
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.8871 0.5343 0.5201 0.5271
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.006113825365900993
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.8901 0.5318 0.5047 0.5179
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 1
current learning rate 9.5e-06
current learning rate 9.5e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00010193065099883825
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.9056 0.6209 0.604 0.6124
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0031829369254410267
............................................................
DEV: loss, acc, precision, recall, f1
0.0022 0.9065 0.6214 0.6084 0.6149
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002457249443978071
............................................................
DEV: loss, acc, precision, recall, f1
0.0023 0.9127 0.6468 0.5984 0.6216
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0036396891809999943
............................................................
DEV: loss, acc, precision, recall, f1
0.0025 0.9118 0.6393 0.6053 0.6218
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.001102091046050191
............................................................
DEV: loss, acc, precision, recall, f1
0.0022 0.899 0.5569 0.552 0.5545
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002639753744006157
............................................................
DEV: loss, acc, precision, recall, f1
0.0021 0.8977 0.5695 0.5385 0.5536
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00040013709804043174
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.9202 0.7055 0.6882 0.6967
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_1_2100.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.003 0.8719 0.6716 0.6403 0.6556
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.1349966270208824e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.9288 0.7213 0.7066 0.7138
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_1_2400.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0027 0.8769 0.6836 0.6471 0.6649
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.003793400712311268
............................................................
DEV: loss, acc, precision, recall, f1
0.0022 0.9263 0.7162 0.7046 0.7104
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.844341649208218e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0026 0.9273 0.749 0.6757 0.7104
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0006897203857079148
............................................................
DEV: loss, acc, precision, recall, f1
0.0025 0.9239 0.6936 0.6416 0.6666
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.337423575227149e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0022 0.9206 0.6974 0.6558 0.6759
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.904028173768893e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0024 0.9325 0.7243 0.6769 0.6998
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0017087730811908841
............................................................
DEV: loss, acc, precision, recall, f1
0.0026 0.923 0.6829 0.6641 0.6734
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 2
current learning rate 9.025e-06
current learning rate 9.025e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.572391142370179e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0026 0.936 0.7424 0.7424 0.7424
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_2_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.003 0.9 0.7143 0.6891 0.7015
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0002671282854862511
............................................................
DEV: loss, acc, precision, recall, f1
0.0025 0.9392 0.7642 0.7404 0.7521
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_2_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0029 0.8993 0.7349 0.6938 0.7138
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00020011379092466086
............................................................
DEV: loss, acc, precision, recall, f1
0.0026 0.9349 0.7454 0.708 0.7262
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0007080938667058945
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.9443 0.7854 0.7463 0.7654
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_2_1200.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0036 0.9039 0.7389 0.6862 0.7116
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0004826923832297325
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.943 0.7894 0.8084 0.7988
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_2_1500.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.003 0.911 0.773 0.7501 0.7614
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0013181626563891768
............................................................
DEV: loss, acc, precision, recall, f1
0.0025 0.945 0.7911 0.7731 0.782
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.680655107833445e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9313 0.7098 0.6936 0.7016
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.5900772016029805e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0027 0.9413 0.7615 0.7316 0.7462
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0007286354666575789
............................................................
DEV: loss, acc, precision, recall, f1
0.0027 0.9415 0.7589 0.7559 0.7574
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.554381303023547e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.9425 0.7897 0.7169 0.7515
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0014772666618227959
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.9367 0.7375 0.7306 0.734
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.3654104047163855e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0026 0.9413 0.7677 0.7306 0.7487
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0011215854901820421
............................................................
DEV: loss, acc, precision, recall, f1
0.0027 0.9457 0.7887 0.7544 0.7712
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005052422638982534
............................................................
DEV: loss, acc, precision, recall, f1
0.003 0.9385 0.7716 0.7385 0.7547
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 3
current learning rate 8.57375e-06
current learning rate 8.57375e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.786872209981084e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0028 0.9412 0.751 0.7505 0.7508
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.6883044231217355e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.945 0.7651 0.7368 0.7507
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00026876796619035304
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9435 0.751 0.7392 0.7451
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005867047584615648
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.9401 0.7598 0.7529 0.7564
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0003530888934619725
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9418 0.7649 0.7679 0.7664
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
9.64657447184436e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0029 0.9499 0.807 0.7794 0.793
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
9.678406058810651e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9438 0.7812 0.7245 0.7518
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.638787239244266e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9453 0.7639 0.7392 0.7514
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0008462652331218123
............................................................
DEV: loss, acc, precision, recall, f1
0.0029 0.9469 0.7832 0.7532 0.7679
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.003733318066224456
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9471 0.793 0.7311 0.7608
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0004604206478688866
............................................................
DEV: loss, acc, precision, recall, f1
0.0029 0.9454 0.759 0.7363 0.7474
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.81521693320974e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9461 0.7833 0.7804 0.7819
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.128935077256756e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0029 0.9459 0.7783 0.7657 0.772
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00015788532618898898
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9435 0.7687 0.7299 0.7488
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 4
current learning rate 8.1450625e-06
current learning rate 8.1450625e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.4038858100539073e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.941 0.7442 0.7618 0.7529
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.912970275152475e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9467 0.7873 0.7684 0.7778
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.056797479279339e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9432 0.7629 0.7525 0.7577
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00013186527939978987
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9445 0.7672 0.7642 0.7657
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.000299242848996073
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.9439 0.7744 0.7647 0.7695
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001854709116742015
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9481 0.7842 0.7674 0.7757
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.7972604079404846e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9421 0.7568 0.7556 0.7562
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.1530944448168157e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9494 0.7817 0.7696 0.7756
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002238978398963809
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9435 0.7507 0.7556 0.7531
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.25590730831027e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9463 0.7766 0.7618 0.7691
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.0732316594803706e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9457 0.7819 0.7731 0.7774
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.1368946363509167e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9447 0.7948 0.7812 0.7879
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.3121558595230454e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9482 0.7924 0.7829 0.7876
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001302013552049175
............................................................
DEV: loss, acc, precision, recall, f1
0.0033 0.9415 0.7497 0.7429 0.7463
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 5
current learning rate 7.737809375e-06
current learning rate 7.737809375e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.1721472876379266e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.9409 0.7519 0.7709 0.7612
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00020708562806248665
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9476 0.7939 0.7581 0.7756
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00012495477858465165
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9435 0.7592 0.7451 0.7521
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.76084600854665e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9444 0.7636 0.7765 0.77
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0002898084931075573
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9452 0.764 0.776 0.77
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.778118116315454e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9525 0.8089 0.7851 0.7968
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.654498479794711e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.9528 0.8098 0.7814 0.7954
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.1837482816190459e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9467 0.7632 0.7794 0.7712
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.003885742276906967
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.948 0.7909 0.7951 0.793
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.392687681800453e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9509 0.8067 0.7927 0.7997
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_5_3000.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0039 0.9201 0.7929 0.7723 0.7825
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.9305941502097994e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9474 0.7881 0.7593 0.7735
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.2214766229590168e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.9501 0.8106 0.7834 0.7968
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.3114838566252729e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0031 0.9539 0.8211 0.7964 0.8086
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_5_3900.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0037 0.921 0.8058 0.771 0.788
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00011340352648403496
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9488 0.7774 0.7755 0.7765
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 6
current learning rate 7.35091890625e-06
current learning rate 7.35091890625e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
9.088798833545297e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9516 0.8116 0.7873 0.7993
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.373324478976429e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0032 0.9519 0.8269 0.7912 0.8087
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0036 0.9184 0.8179 0.7759 0.7963
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.692039899760857e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9462 0.7844 0.7866 0.7855
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.542749957181513e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9497 0.8105 0.7964 0.8034
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00022528451518155634
............................................................
DEV: loss, acc, precision, recall, f1
0.0043 0.9473 0.8003 0.8221 0.8111
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_1500.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.005 0.9209 0.7957 0.7945 0.7951
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005641370080411434
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9532 0.833 0.8209 0.8269
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_1800.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0042 0.9299 0.8247 0.8184 0.8216
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0004577793297357857
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.9515 0.8185 0.8054 0.8119
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.467610316780338e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9545 0.8385 0.8278 0.8331
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_2400.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0037 0.9336 0.8392 0.823 0.831
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00014384184032678604
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.955 0.8396 0.8501 0.8448
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_2700.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.004 0.937 0.8398 0.8375 0.8387
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.342401032568887e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9541 0.8442 0.8204 0.8322
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00020298067829571664
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9506 0.8208 0.8393 0.8299
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.076973262570391e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9542 0.8447 0.8597 0.8521
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_6_3600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.004 0.9388 0.8515 0.8517 0.8516
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.1249686445517e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9516 0.8301 0.8486 0.8393
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.345501555595547e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9539 0.8299 0.8297 0.8298
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 7
current learning rate 6.9833729609374995e-06
current learning rate 6.9833729609374995e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.043228727823589e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.954 0.8378 0.8224 0.83
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00039202457992359996
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.9514 0.8262 0.842 0.834
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.632404695963487e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9501 0.8067 0.8234 0.815
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.399443059810437e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9562 0.8615 0.8364 0.8487
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00017888784350361675
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9554 0.8433 0.8555 0.8493
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.9343957319506444e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9539 0.8619 0.8376 0.8496
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.579341500881128e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9583 0.8678 0.868 0.8679
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_7_2100.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0043 0.9432 0.8813 0.8766 0.8789
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.265644631435862e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9534 0.8374 0.853 0.8452
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00029382319189608097
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.9517 0.8333 0.8538 0.8434
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.263807932147756e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9578 0.8628 0.8513 0.857
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.8777241823263466e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9588 0.8728 0.8656 0.8692
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_7_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0044 0.9447 0.8758 0.8706 0.8732
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.0047420902265e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9598 0.8677 0.853 0.8603
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.263941602606792e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9563 0.8476 0.8472 0.8474
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.551185262855142e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9597 0.8822 0.8761 0.8791
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_7_4200.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0042 0.9517 0.887 0.8846 0.8858
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 8
current learning rate 6.634204312890624e-06
current learning rate 6.634204312890624e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.8492053135996684e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0036 0.9584 0.8651 0.8513 0.8582
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
9.777913874131627e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0034 0.962 0.8931 0.8651 0.8789
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.2939608243177645e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.9564 0.8517 0.8523 0.852
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.324803037685342e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9584 0.8691 0.8604 0.8648
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00017886720888782293
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9598 0.8904 0.8606 0.8752
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0007464283262379467
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9564 0.8563 0.8584 0.8574
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.9155448171659373e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9619 0.8881 0.8817 0.8849
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_8_2100.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0043 0.9472 0.8923 0.8927 0.8925
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.873957095696824e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9586 0.8614 0.8614 0.8614
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0025372281670570374
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9582 0.878 0.8813 0.8796
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.61212267105293e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0045 0.9615 0.8956 0.8714 0.8834
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.7969865186605603e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.96 0.8856 0.8773 0.8814
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.077626378304558e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9602 0.8864 0.8729 0.8796
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.5381450566565036e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0035 0.9602 0.8845 0.8759 0.8802
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.49105422780849e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9599 0.8847 0.8943 0.8895
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_8_4200.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0044 0.9526 0.8983 0.9005 0.8994
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 9
current learning rate 6.302494097246093e-06
current learning rate 6.302494097246093e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.3866313060570974e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9582 0.8695 0.8697 0.8696
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.368812021013582e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0041 0.9636 0.9024 0.8844 0.8933
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export_zh_msra_new/bert_finetune_model_9_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0044 0.9527 0.9038 0.89 0.8968
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.5595760487485677e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0042 0.9618 0.8887 0.8795 0.8841
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.529859870672226e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.005 0.9593 0.9009 0.8388 0.8688
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00022552689188160002
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9618 0.8883 0.8862 0.8873
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.776603832899127e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0038 0.9616 0.8993 0.8871 0.8932
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.422881268808851e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9583 0.8739 0.8908 0.8823
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.909374749535345e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.004 0.9613 0.8847 0.8844 0.8846
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00016942492220550776
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9582 0.8738 0.8815 0.8776
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.059729690197855e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9619 0.9062 0.868 0.8867
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.639337799337227e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0037 0.9603 0.8854 0.8849 0.8852
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.462526809831616e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0043 0.9584 0.8609 0.8913 0.8758
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.65903519600397e-07
............................................................
DEV: loss, acc, precision, recall, f1
0.0039 0.9618 0.8902 0.883 0.8866
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.575884617632255e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0042 0.9586 0.8749 0.8854 0.8801
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
=&==&==&==&==&==&==&==&==&==&==&==&==&==&==&=
Best DEV : overall best loss, acc, precision, recall, f1
0.0041 0.9636 0.9024 0.8844 0.8933
scores on TEST when Best DEV:loss, acc, precision, recall, f1
0.0044 0.9527 0.9038 0.89 0.8968
=&==&==&==&==&==&==&==&==&==&==&==&==&==&==&=
Finish to execute command, exited with: 0
zh_ontonotes4
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Please notice that merge the args_dict and json_config ... ...
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"directionality": "bidi",
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pooler_fc_size": 768,
"pooler_num_attention_heads": 12,
"pooler_num_fc_layers": 3,
"pooler_size_per_head": 128,
"pooler_type": "first_token_transform",
"type_vocab_size": 2,
"vocab_size": 21128
},
"config_path": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/config/zh_bert.json",
"data_dir": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_mrc_data/zh_ontonotes4",
"bert_model": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_checkpoints/chinese_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 100,
"train_batch_size": 16,
"dev_batch_size": 32,
"test_batch_size": 32,
"checkpoint": 300,
"learning_rate": 8e-06,
"num_train_epochs": 6,
"warmup_proportion": -1.0,
"local_rank": -1,
"gradient_accumulation_steps": 1,
"seed": 2333,
"export_model": true,
"output_dir": "/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export",
"data_sign": "zh_onto",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "flat",
"n_gpu": 2,
"dropout": 0.2,
"entity_threshold": 0.5,
"data_cache": false
}
-*--*--*--*--*--*--*--*--*--*-
current data_sign: zh_onto
=*==*==*==*==*==*==*==*==*==*=
loading train data ... ...
62896
62896 train data loaded
=*==*==*==*==*==*==*==*==*==*=
loading dev data ... ...
17204
17204 dev data loaded
=*==*==*==*==*==*==*==*==*==*=
loading test data ... ...
17384
17384 test data loaded
######################################################################
EPOCH: 0
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.015635447576642036
............................................................
DEV: loss, acc, precision, recall, f1
0.0139 0.7215 0.3345 0.3251 0.3297
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_0_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.014 0.7203 0.348 0.3313 0.3394
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.007844654843211174
............................................................
DEV: loss, acc, precision, recall, f1
0.0127 0.7288 0.3737 0.3722 0.3729
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_0_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0125 0.7235 0.3866 0.3692 0.3777
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005729345139116049
............................................................
DEV: loss, acc, precision, recall, f1
0.0138 0.7407 0.4195 0.2787 0.3349
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002610839204862714
............................................................
DEV: loss, acc, precision, recall, f1
0.0181 0.701 0.1474 0.0357 0.0575
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00010268688492942601
............................................................
DEV: loss, acc, precision, recall, f1
0.0145 0.711 0.2596 0.1811 0.2134
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0021138559095561504
............................................................
DEV: loss, acc, precision, recall, f1
0.0133 0.7255 0.3243 0.2181 0.2608
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.213035471271724e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0097 0.7517 0.3611 0.3479 0.3544
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.004232677631080151
............................................................
DEV: loss, acc, precision, recall, f1
0.0094 0.7557 0.3796 0.3389 0.3581
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.005775002297013998
............................................................
DEV: loss, acc, precision, recall, f1
0.0097 0.7405 0.3535 0.2601 0.2997
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.670418325578794e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0096 0.7586 0.3992 0.3248 0.3582
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00026009808061644435
............................................................
DEV: loss, acc, precision, recall, f1
0.0098 0.7589 0.4331 0.4117 0.4221
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_0_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0098 0.7515 0.4467 0.4163 0.431
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.004629841540008783
............................................................
DEV: loss, acc, precision, recall, f1
0.0143 0.709 0.2389 0.0955 0.1364
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.9041992345592007e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0098 0.7601 0.4985 0.3722 0.4262
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_0_3900.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0099 0.7544 0.5063 0.3828 0.436
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 1
current learning rate 7.599999999999999e-06
current learning rate 7.599999999999999e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00890625361353159
............................................................
DEV: loss, acc, precision, recall, f1
0.0099 0.7716 0.4363 0.434 0.4351
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_1_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0099 0.7656 0.4357 0.4337 0.4347
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002970438916236162
............................................................
DEV: loss, acc, precision, recall, f1
0.0103 0.7981 0.5401 0.5912 0.5645
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_1_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0102 0.7905 0.5467 0.5949 0.5698
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.585673377732746e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0104 0.7812 0.5076 0.4711 0.4887
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.001252874732017517
............................................................
DEV: loss, acc, precision, recall, f1
0.0141 0.7187 0.3635 0.2176 0.2722
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.7688555089989677e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.014 0.7443 0.4731 0.3203 0.382
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.000615155790001154
............................................................
DEV: loss, acc, precision, recall, f1
0.0113 0.769 0.4995 0.4256 0.4596
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.140300628321711e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0101 0.8015 0.5079 0.5131 0.5105
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002192702842876315
............................................................
DEV: loss, acc, precision, recall, f1
0.0095 0.7762 0.4196 0.3985 0.4087
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00275650923140347
............................................................
DEV: loss, acc, precision, recall, f1
0.0104 0.7752 0.5051 0.4369 0.4685
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.547100151190534e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0111 0.7897 0.5184 0.4606 0.4878
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.813005115371197e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0117 0.8265 0.6658 0.652 0.6588
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_1_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0112 0.8245 0.6983 0.6696 0.6836
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.004789315164089203
............................................................
DEV: loss, acc, precision, recall, f1
0.0149 0.7135 0.2583 0.1273 0.1705
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.040058335405774e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0112 0.8004 0.6621 0.5128 0.578
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 2
current learning rate 7.219999999999999e-06
current learning rate 7.219999999999999e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.004940534010529518
............................................................
DEV: loss, acc, precision, recall, f1
0.0117 0.76 0.3856 0.3745 0.38
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002199856797233224
............................................................
DEV: loss, acc, precision, recall, f1
0.0117 0.8255 0.6533 0.6932 0.6727
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_2_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0115 0.8296 0.6795 0.7163 0.6974
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.4394217689405195e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0126 0.8136 0.6736 0.5756 0.6208
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005138662527315319
............................................................
DEV: loss, acc, precision, recall, f1
0.0159 0.7475 0.5579 0.3065 0.3956
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.171192919486202e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0154 0.7685 0.5678 0.4331 0.4914
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0008888521115295589
............................................................
DEV: loss, acc, precision, recall, f1
0.0133 0.8053 0.6792 0.558 0.6127
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.557718850468518e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0127 0.8029 0.5219 0.5499 0.5355
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005677390727214515
............................................................
DEV: loss, acc, precision, recall, f1
0.0119 0.7954 0.5096 0.4373 0.4707
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0006335428915917873
............................................................
DEV: loss, acc, precision, recall, f1
0.0139 0.7797 0.5437 0.4136 0.4698
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.084355962026166e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0147 0.8009 0.6843 0.5113 0.5853
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.823778676334769e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0133 0.8366 0.6872 0.6863 0.6867
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_2_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0129 0.834 0.7046 0.696 0.7003
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.006227924022823572
............................................................
DEV: loss, acc, precision, recall, f1
0.0165 0.7439 0.4169 0.2652 0.3242
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.544123268919066e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0151 0.7955 0.6788 0.4761 0.5596
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 3
current learning rate 6.858999999999998e-06
current learning rate 6.858999999999998e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.002185183810070157
............................................................
DEV: loss, acc, precision, recall, f1
0.0138 0.7991 0.5125 0.5017 0.5071
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0016793797258287668
............................................................
DEV: loss, acc, precision, recall, f1
0.014 0.7925 0.611 0.6167 0.6138
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.0567140381899662e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.014 0.824 0.698 0.6065 0.6491
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
9.243372915079817e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0189 0.7558 0.5822 0.3763 0.4571
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.0184657993668225e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0175 0.7644 0.5536 0.4222 0.4791
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.5033217752934434e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0158 0.7993 0.645 0.5573 0.5979
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.953578016080428e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.013 0.8283 0.5891 0.6137 0.6011
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0005898976814933121
............................................................
DEV: loss, acc, precision, recall, f1
0.014 0.7876 0.4804 0.3908 0.431
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00040149822598323226
............................................................
DEV: loss, acc, precision, recall, f1
0.0157 0.7979 0.6009 0.4885 0.5389
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.3822657314885873e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0145 0.8476 0.7095 0.6506 0.6788
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
5.995051469653845e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0145 0.8507 0.7152 0.6913 0.703
SAVED model path is :
/data/ceph/NLP/yichenzhao/mrc-for-flat-nested-ner/bert_export/bert_finetune_model_3_3300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0139 0.8524 0.7395 0.708 0.7234
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0014947339659556746
............................................................
DEV: loss, acc, precision, recall, f1
0.0148 0.7761 0.5482 0.4073 0.4674
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.9173493203416e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0163 0.8136 0.689 0.5582 0.6167
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 4
current learning rate 6.516049999999998e-06
current learning rate 6.516049999999998e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0002748646365944296
............................................................
DEV: loss, acc, precision, recall, f1
0.0152 0.8202 0.5604 0.5664 0.5634
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001686277100816369
............................................................
DEV: loss, acc, precision, recall, f1
0.0169 0.7881 0.6005 0.5829 0.5916
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
8.56941824167734e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.017 0.8233 0.6964 0.6386 0.6662
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.912009121151641e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0222 0.7561 0.597 0.3758 0.4613
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.676116648421157e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0184 0.7635 0.6237 0.496 0.5526
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
1.3288115951581858e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0169 0.7934 0.661 0.558 0.6051
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.7886032967217034e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0146 0.8246 0.6091 0.588 0.5984
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0012897758278995752
............................................................
DEV: loss, acc, precision, recall, f1
0.0163 0.8145 0.5931 0.5286 0.559
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0004314161487855017
............................................................
DEV: loss, acc, precision, recall, f1
0.0168 0.8122 0.6643 0.5352 0.5928
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.5963781808968633e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0175 0.8206 0.6967 0.5852 0.6361
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.498541991575621e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.017 0.8382 0.7153 0.6529 0.6827
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0009119447786360979
............................................................
DEV: loss, acc, precision, recall, f1
0.0192 0.778 0.5853 0.4144 0.4852
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
3.2854179607966216e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0176 0.8144 0.6987 0.557 0.6198
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
######################################################################
EPOCH: 5
current learning rate 6.190247499999998e-06
current learning rate 6.190247499999998e-06
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0004023508809041232
............................................................
DEV: loss, acc, precision, recall, f1
0.0185 0.8239 0.5906 0.5993 0.5949
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001371507823932916
............................................................
DEV: loss, acc, precision, recall, f1
0.0178 0.7743 0.6098 0.5625 0.5852
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.89199192088563e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0176 0.8038 0.7 0.5973 0.6446
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
7.853328133933246e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0285 0.7492 0.5185 0.2837 0.3667
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.2777915091864998e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0264 0.7694 0.661 0.3848 0.4864
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
6.30022168479627e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0204 0.7944 0.6469 0.4908 0.5581
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.568814124970231e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0151 0.8354 0.621 0.6415 0.6311
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0001149507297668606
............................................................
DEV: loss, acc, precision, recall, f1
0.0177 0.8253 0.621 0.5553 0.5863
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.00038258195854723454
............................................................
DEV: loss, acc, precision, recall, f1
0.0195 0.806 0.6516 0.5158 0.5758
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.0197035155433696e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0185 0.8312 0.7268 0.6077 0.6619
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
2.8620584998861887e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0176 0.844 0.7221 0.6339 0.6751
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
0.0017854978796094656
............................................................
DEV: loss, acc, precision, recall, f1
0.0167 0.8096 0.6804 0.544 0.6046
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
current training loss is :
4.354286375019001e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0169 0.8353 0.7247 0.6206 0.6686
-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-
=&==&==&==&==&==&==&==&==&==&==&==&==&==&==&=
Best DEV : overall best loss, acc, precision, recall, f1
0.0145 0.8507 0.7152 0.6913 0.703
scores on TEST when Best DEV:loss, acc, precision, recall, f1
0.0139 0.8524 0.7395 0.708 0.7234
=&==&==&==&==&==&==&==&==&==&==&==&==&==&==&=
Finish to execute command, exited with: 0
I try to use zh_msra.sh ,but it occurs the error:
trainer.py: error: unrecognized arguments: --hard_span_only
how to deal with it?
请问使用MRC做NER,是否加剧了数据的不平衡?我借用了您模型部分的代码,开始的epoch一直是预测为0,统计得到0和1的比例在100:1左右...
Many thanks for your repo, this is very useful. I am just wondering if there is any plan to migrate to huggingface transformers? (like this: https://github.com/huggingface/transformers/tree/master/examples/question-answering)
您好,您在paper中有提到用bert-large在conll03上的performance。请问下可以方便说一下bert-base的performance是多少吗?谢谢!
thanks
Hello, excuse me, is this program runnable? I tried several times. It was stopping at the end of the first epoch and not continuing every time. I wonder if there's something wrong. Thank you.
While I am trying to train the on En_Ontonotes5 datasets. At the feature extraction stage i have face the following problem .
RuntimeError: [enforce fail at CPUAllocator.cpp:56] posix_memalign(&data, gAlignment, nbytes) == 0. 12 vs 0Type a message"
NB. I am using Geforce GTX 1080 Ti , 8 GPU server with 12 GB GPU memory for per GPU and 512 GB CPU Memory .
Would you please help me to figure out the problem ?
Thank you.
Paper has these as example queries
and the repo has these as the queries
"FAC": "facility entities are limited to buildings and other permanent man-made structures such as buildings, airports, highways, bridges.",
"LOC": "location entities are limited to geographical entities such as geographical areas and landmasses, mountains, bodies of water, and geological formations.",
"ORG": "organization entities are limited to companies, corporations, agencies, institutions and other groups of people."
What are the annotator guidelines used to report the results? Did you compare different kinds of annotator guidelines as queries?
Seems like the prefix Find locations in the text
might be useful since it encodes some information but the queries on the repo doesn't seem to have those prefixes. Did you find those prefixes to be not helpful?
您好:
感谢分享! 对于每个样本(假设长度为n),该样本中每个位置和其他位置构建一个矩阵(n,n),该样本中出现的实体利用其位置在矩阵填充为1,其余都是填充为0。请问我对于这个负例的构建理解正确吗?
第二个问题,如果是这样的,那么负例是不是太多?
您好,在zh_msra数据上,好像跑不出来论文的结果,我看了https://github.com/ShannonAI/mrc-for-flat-nested-ner/issues/10和https://github.com/ShannonAI/mrc-for-flat-nested-ner/issues/9这两个的issues,但没发现啥问题。下面是我的日志:
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Please notice that merge the args_dict and json_config ... ...
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"directionality": "bidi",
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pooler_fc_size": 768,
"pooler_num_attention_heads": 12,
"pooler_num_fc_layers": 3,
"pooler_size_per_head": 128,
"pooler_type": "first_token_transform",
"type_vocab_size": 2,
"vocab_size": 21128
},
"config_path": "/opt/ldw/code/ner/mrc-for-flat-nested-ner/config/zh_bert.json",
"data_dir": "/opt/ldw/code/ner/mrc-for-flat-nested-ner/data/zh_msra",
"bert_model": "/opt/ldw/model/bert_model/chinese_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 128,
"train_batch_size": 32,
"dev_batch_size": 16,
"test_batch_size": 16,
"checkpoint": 300,
"learning_rate": 1e-05,
"num_train_epochs": 12,
"warmup_proportion": -1.0,
"max_grad_norm": 1.0,
"gradient_accumulation_steps": 1,
"seed": 2333,
"output_dir": "/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3",
"data_sign": "zh_msra",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "flat",
"n_gpu": 1,
"dropout": 0.3,
"entity_threshold": 0.5,
"num_data_processor": 1,
"data_cache": true,
"export_model": true,
"do_lower_case": false,
"fp16": false,
"amp_level": "O2",
"local_rank": -1
}
--------------------
current data_sign: zh_msra
label_list: ['NS', 'NR', 'NT', 'O']
====================
loading train data ... ...
125184
125184 train data loaded
====================
loading dev data ... ...
13908
13908 dev data loaded
====================
loading test data ... ...
13095
13095 test data loaded
######################################################################
EPOCH: 0
------------------------------
current training loss is :
0.01635975018143654
............................................................
DEV: loss, acc, precision, recall, f1
0.0178 0.4048 0.164 0.3038 0.213
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_0_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0302 0.3752 0.1964 0.3022 0.238
------------------------------
------------------------------
current training loss is :
0.013055425137281418
............................................................
DEV: loss, acc, precision, recall, f1
0.0117 0.7726 0.2742 0.3764 0.3173
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_0_600.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0186 0.6432 0.28 0.3907 0.3262
------------------------------
------------------------------
current training loss is :
0.006994003430008888
............................................................
DEV: loss, acc, precision, recall, f1
0.01 0.5888 0.2829 0.6389 0.3921
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_0_900.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0146 0.567 0.3262 0.606 0.4241
------------------------------
------------------------------
current training loss is :
0.008853244595229626
............................................................
DEV: loss, acc, precision, recall, f1
0.0076 0.5823 0.2714 0.5139 0.3552
------------------------------
------------------------------
current training loss is :
0.019887499511241913
............................................................
DEV: loss, acc, precision, recall, f1
0.0067 0.5843 0.2714 0.5985 0.3735
------------------------------
------------------------------
current training loss is :
0.046563927084207535
............................................................
DEV: loss, acc, precision, recall, f1
0.0066 0.6084 0.3426 0.7808 0.4762
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_0_1800.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0093 0.5949 0.3865 0.7403 0.5079
------------------------------
------------------------------
current training loss is :
4.87403231090866e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.301 0.2011 0.7299 0.3153
------------------------------
------------------------------
current training loss is :
0.010479566641151905
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.3032 0.2072 0.7416 0.3239
------------------------------
------------------------------
current training loss is :
0.0015295092016458511
............................................................
DEV: loss, acc, precision, recall, f1
0.0067 0.8078 0.4964 0.782 0.6073
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_0_2700.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0085 0.7304 0.4809 0.7499 0.586
------------------------------
------------------------------
current training loss is :
0.006260382942855358
............................................................
DEV: loss, acc, precision, recall, f1
0.0061 0.6053 0.3119 0.6876 0.4291
------------------------------
------------------------------
current training loss is :
0.005210643634200096
............................................................
DEV: loss, acc, precision, recall, f1
0.0056 0.305 0.2231 0.7118 0.3397
------------------------------
------------------------------
current training loss is :
0.011097898706793785
............................................................
DEV: loss, acc, precision, recall, f1
0.0053 0.3051 0.2115 0.6809 0.3228
------------------------------
------------------------------
current training loss is :
0.00706856045871973
............................................................
DEV: loss, acc, precision, recall, f1
0.0051 0.8888 0.5676 0.635 0.5994
------------------------------
######################################################################
EPOCH: 1
current learning rate 9.5e-06
current learning rate 9.5e-06
------------------------------
current training loss is :
0.0021997329313308
............................................................
DEV: loss, acc, precision, recall, f1
0.0053 0.9174 0.7173 0.7799 0.7473
SAVED model path is :
/opt/ldw/code/ner/mrc-for-flat-nested-ner/output_mrc_ner/zh_msra_128_1e-5_32_0.3/bert_finetune_model_1_300.bin
............................................................
TEST: loss, acc, precision, recall, f1
0.0075 0.8788 0.6943 0.7269 0.7102
------------------------------
------------------------------
current training loss is :
0.004434032365679741
............................................................
DEV: loss, acc, precision, recall, f1
0.0052 0.8964 0.6686 0.7161 0.6915
------------------------------
------------------------------
current training loss is :
0.000860140600707382
............................................................
DEV: loss, acc, precision, recall, f1
0.0049 0.9205 0.6924 0.7299 0.7106
------------------------------
------------------------------
current training loss is :
0.002716178074479103
............................................................
DEV: loss, acc, precision, recall, f1
0.0055 0.8643 0.5168 0.7208 0.602
------------------------------
------------------------------
current training loss is :
0.009529965929687023
............................................................
DEV: loss, acc, precision, recall, f1
0.0049 0.6399 0.358 0.7643 0.4876
------------------------------
------------------------------
current training loss is :
0.037755656987428665
............................................................
DEV: loss, acc, precision, recall, f1
0.0054 0.3162 0.2194 0.7333 0.3378
------------------------------
------------------------------
current training loss is :
1.558396252221428e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0055 0.2986 0.143 0.6843 0.2365
------------------------------
------------------------------
current training loss is :
0.00695763947442174
............................................................
DEV: loss, acc, precision, recall, f1
0.0056 0.3024 0.1639 0.7354 0.2681
------------------------------
------------------------------
current training loss is :
0.0003703889960888773
............................................................
DEV: loss, acc, precision, recall, f1
0.0056 0.5392 0.3889 0.8396 0.5316
------------------------------
------------------------------
current training loss is :
0.0027276326436549425
............................................................
DEV: loss, acc, precision, recall, f1
0.0053 0.9269 0.7145 0.7249 0.7197
------------------------------
------------------------------
current training loss is :
0.0023270882666110992
............................................................
DEV: loss, acc, precision, recall, f1
0.0053 0.6187 0.3639 0.7835 0.497
------------------------------
------------------------------
current training loss is :
0.008502095006406307
............................................................
DEV: loss, acc, precision, recall, f1
0.0053 0.6089 0.3219 0.7505 0.4505
------------------------------
------------------------------
current training loss is :
0.005848872475326061
............................................................
DEV: loss, acc, precision, recall, f1
0.0045 0.9179 0.6696 0.7161 0.6921
------------------------------
######################################################################
EPOCH: 2
current learning rate 9.025e-06
current learning rate 9.025e-06
------------------------------
current training loss is :
0.001259281998500228
............................................................
DEV: loss, acc, precision, recall, f1
0.0052 0.9184 0.6877 0.7725 0.7276
------------------------------
------------------------------
current training loss is :
0.002061256906017661
............................................................
DEV: loss, acc, precision, recall, f1
0.0054 0.8392 0.5804 0.7727 0.6629
------------------------------
------------------------------
current training loss is :
6.292638863669708e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0059 0.5464 0.2237 0.756 0.3453
------------------------------
------------------------------
current training loss is :
0.0013445813674479723
............................................................
DEV: loss, acc, precision, recall, f1
0.0052 0.2943 0.1882 0.7505 0.301
------------------------------
------------------------------
current training loss is :
0.0027943423483520746
............................................................
DEV: loss, acc, precision, recall, f1
0.0058 0.5569 0.2563 0.7471 0.3817
------------------------------
------------------------------
current training loss is :
0.00506820622831583
............................................................
DEV: loss, acc, precision, recall, f1
0.0058 0.6108 0.3441 0.7569 0.4731
------------------------------
------------------------------
current training loss is :
1.0660241059667896e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0054 0.3354 0.1637 0.7519 0.2688
------------------------------
------------------------------
current training loss is :
0.007756161503493786
............................................................
DEV: loss, acc, precision, recall, f1
0.0061 0.3036 0.1493 0.7576 0.2494
------------------------------
------------------------------
current training loss is :
0.00031303646392188966
............................................................
DEV: loss, acc, precision, recall, f1
0.0066 0.3008 0.1977 0.7581 0.3136
------------------------------
------------------------------
current training loss is :
0.0014186813496053219
............................................................
DEV: loss, acc, precision, recall, f1
0.0058 0.6454 0.3462 0.7146 0.4665
------------------------------
------------------------------
current training loss is :
0.0007883103098720312
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.3254 0.2393 0.7677 0.3649
------------------------------
------------------------------
current training loss is :
0.005411483347415924
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.2989 0.1608 0.7586 0.2653
------------------------------
------------------------------
current training loss is :
0.005193878896534443
............................................................
DEV: loss, acc, precision, recall, f1
0.0056 0.8268 0.4942 0.7335 0.5905
------------------------------
######################################################################
EPOCH: 3
current learning rate 8.57375e-06
current learning rate 8.57375e-06
------------------------------
current training loss is :
0.000553997466340661
............................................................
DEV: loss, acc, precision, recall, f1
0.0068 0.911 0.6529 0.7732 0.708
------------------------------
------------------------------
current training loss is :
0.001516917021945119
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.5209 0.2837 0.7715 0.4149
------------------------------
------------------------------
current training loss is :
0.00020100202527828515
............................................................
DEV: loss, acc, precision, recall, f1
0.0065 0.9019 0.5997 0.7622 0.6712
------------------------------
------------------------------
current training loss is :
0.0011648930376395583
............................................................
DEV: loss, acc, precision, recall, f1
0.0064 0.3306 0.2075 0.7545 0.3255
------------------------------
------------------------------
current training loss is :
0.001798806944862008
............................................................
DEV: loss, acc, precision, recall, f1
0.0058 0.9034 0.5807 0.7588 0.6579
------------------------------
------------------------------
current training loss is :
0.005710647441446781
............................................................
DEV: loss, acc, precision, recall, f1
0.0067 0.8909 0.6289 0.7689 0.6919
------------------------------
------------------------------
current training loss is :
5.536737262445968e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0065 0.3039 0.1685 0.7729 0.2766
------------------------------
------------------------------
current training loss is :
0.0022274518851190805
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.2974 0.0616 0.7545 0.1139
------------------------------
------------------------------
current training loss is :
0.00029264131444506347
............................................................
DEV: loss, acc, precision, recall, f1
0.0072 0.5927 0.3197 0.7505 0.4484
------------------------------
------------------------------
current training loss is :
0.0015814974904060364
............................................................
DEV: loss, acc, precision, recall, f1
0.0061 0.6329 0.3492 0.7309 0.4726
------------------------------
------------------------------
current training loss is :
0.00047273910604417324
............................................................
DEV: loss, acc, precision, recall, f1
0.0069 0.2947 0.2014 0.7605 0.3184
------------------------------
------------------------------
current training loss is :
0.0003899783769156784
............................................................
DEV: loss, acc, precision, recall, f1
0.0066 0.2966 0.1504 0.7211 0.2489
------------------------------
------------------------------
current training loss is :
0.0013236759696155787
............................................................
DEV: loss, acc, precision, recall, f1
0.0067 0.301 0.2294 0.7519 0.3516
------------------------------
######################################################################
EPOCH: 4
current learning rate 8.1450625e-06
current learning rate 8.1450625e-06
------------------------------
current training loss is :
0.0018008921761065722
............................................................
DEV: loss, acc, precision, recall, f1
0.0069 0.299 0.1153 0.7593 0.2002
------------------------------
------------------------------
current training loss is :
0.0001561229582875967
............................................................
DEV: loss, acc, precision, recall, f1
0.0063 0.3044 0.157 0.7744 0.2611
------------------------------
------------------------------
current training loss is :
8.328224794240668e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0065 0.304 0.1429 0.7522 0.2402
------------------------------
------------------------------
current training loss is :
0.0010962827363982797
............................................................
DEV: loss, acc, precision, recall, f1
0.0083 0.2781 0.0618 0.7655 0.1143
------------------------------
------------------------------
current training loss is :
0.0009025464532896876
............................................................
DEV: loss, acc, precision, recall, f1
0.0067 0.3799 0.1656 0.7627 0.2721
------------------------------
------------------------------
current training loss is :
0.0004875045269727707
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.6288 0.3303 0.7859 0.4651
------------------------------
------------------------------
current training loss is :
4.330176125222351e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0073 0.6018 0.2063 0.7761 0.326
------------------------------
------------------------------
current training loss is :
0.0028885039500892162
............................................................
DEV: loss, acc, precision, recall, f1
0.0071 0.327 0.1232 0.7887 0.213
------------------------------
------------------------------
current training loss is :
0.0003202503430657089
............................................................
DEV: loss, acc, precision, recall, f1
0.0072 0.5797 0.2949 0.7749 0.4272
------------------------------
------------------------------
current training loss is :
0.0023023374378681183
............................................................
DEV: loss, acc, precision, recall, f1
0.0064 0.3974 0.1704 0.7689 0.279
------------------------------
------------------------------
current training loss is :
0.0012561487965285778
............................................................
DEV: loss, acc, precision, recall, f1
0.0064 0.3025 0.1853 0.7725 0.2989
------------------------------
------------------------------
current training loss is :
5.9736816183431074e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0069 0.2973 0.0942 0.7715 0.1679
------------------------------
------------------------------
current training loss is :
0.0010490657296031713
............................................................
DEV: loss, acc, precision, recall, f1
0.0077 0.2972 0.1339 0.7677 0.2281
------------------------------
######################################################################
EPOCH: 5
current learning rate 7.737809375e-06
current learning rate 7.737809375e-06
------------------------------
current training loss is :
0.0007653237553313375
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.3029 0.1407 0.7827 0.2385
------------------------------
------------------------------
current training loss is :
0.005620667710900307
............................................................
DEV: loss, acc, precision, recall, f1
0.0072 0.3056 0.1523 0.7983 0.2559
------------------------------
------------------------------
current training loss is :
6.944198048586259e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0082 0.5923 0.2119 0.7772 0.333
------------------------------
------------------------------
current training loss is :
0.001078870496712625
............................................................
DEV: loss, acc, precision, recall, f1
0.0069 0.5109 0.1174 0.8313 0.2057
------------------------------
------------------------------
current training loss is :
0.0005673955893144011
............................................................
DEV: loss, acc, precision, recall, f1
0.0077 0.3115 0.2161 0.8172 0.3419
------------------------------
------------------------------
current training loss is :
0.0051736971363425255
............................................................
DEV: loss, acc, precision, recall, f1
0.0073 0.7691 0.4691 0.8136 0.5951
------------------------------
------------------------------
current training loss is :
3.1025990665511927e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0083 0.2989 0.1682 0.8021 0.2781
------------------------------
------------------------------
current training loss is :
0.0005125850439071655
............................................................
DEV: loss, acc, precision, recall, f1
0.0083 0.3001 0.1163 0.8315 0.2041
------------------------------
------------------------------
current training loss is :
0.00023488891019951552
............................................................
DEV: loss, acc, precision, recall, f1
0.0069 0.2962 0.1543 0.8368 0.2606
------------------------------
------------------------------
current training loss is :
0.0006917217979207635
............................................................
DEV: loss, acc, precision, recall, f1
0.0073 0.4335 0.1804 0.826 0.2962
------------------------------
------------------------------
current training loss is :
0.00034669646993279457
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.293 0.1014 0.8327 0.1808
------------------------------
------------------------------
current training loss is :
0.0002028668241109699
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.298 0.0643 0.8243 0.1194
------------------------------
------------------------------
current training loss is :
0.0009247356210835278
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.2994 0.1389 0.8305 0.2379
------------------------------
######################################################################
EPOCH: 6
current learning rate 7.35091890625e-06
current learning rate 7.35091890625e-06
------------------------------
current training loss is :
0.00019250727200414985
............................................................
DEV: loss, acc, precision, recall, f1
0.009 0.3032 0.1612 0.8363 0.2703
------------------------------
------------------------------
current training loss is :
5.059465183876455e-05
............................................................
DEV: loss, acc, precision, recall, f1
0.0077 0.2978 0.1544 0.8473 0.2612
------------------------------
------------------------------
current training loss is :
5.413561666500755e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0079 0.296 0.1279 0.8518 0.2225
------------------------------
------------------------------
current training loss is :
0.0004280754073988646
............................................................
DEV: loss, acc, precision, recall, f1
0.0078 0.2963 0.0968 0.869 0.1742
------------------------------
------------------------------
current training loss is :
0.0005110411439090967
............................................................
DEV: loss, acc, precision, recall, f1
0.0086 0.2959 0.1405 0.8707 0.2419
------------------------------
------------------------------
current training loss is :
0.00028553747688420117
............................................................
DEV: loss, acc, precision, recall, f1
0.0079 0.298 0.1965 0.8683 0.3205
------------------------------
------------------------------
current training loss is :
2.552310661485535e-06
............................................................
DEV: loss, acc, precision, recall, f1
0.0084 0.2953 0.0978 0.8877 0.1761
------------------------------
-----------------------------*-
current training loss is :
0.0005301011842675507
越跑,f1越低,是哪里出问题了吗,数据是从提供的链接下载的。
您好,关于模型中对于BERT的input和output的处理,有两个问题想请教:
(1) 关于output部分,在/model/bert_mrc.py中,在https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/model/bert_mrc.py#L50这一行代码中,sequence_output即BERT编码层的完整序列输出,即包括了query部分的token,后续的计算中似乎也没有舍弃掉query部分的token,这与您在论文中表述“we simply drop the query representations”似乎有所不符,请问可以解释一下吗?
(2) 关于input部分,在/data_loader/mrc_utils.py中,在https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/data_loader/mrc_utils.py#L200这一行代码中,input_mask = [1] * len(input_tokens),即对整个完整序列的mask都置为1,也就是包括query、context和分隔符,这里全部都是没有mask掉的,可以这样理解吗?那这样处理对于BERT在这个任务上的表现会有影响吗?
期待您的回复!
您好,我在其他的qa任务中借鉴了span loss,但是发现加了以后收敛不了,这样正常吗?lr用的是3e-5。
Hi,
I was trying to run the code for ace2005 and I am not able to reproduce the results with the preprocessed data that have been added to the data-preprocess section
if nb_tr_steps % config.checkpoint == 0:
idx +=1
in line 152 in the else condition?If I do these changes then I code is getting evaluated but the results are not reproduced. Can you please verify the code one and also comment if there is any issue in the command I am running
FOLDER_PATH=<mypath>/mrc-for-flat-nested-ner CONFIG_PATH=<mypath>/mrc-for-flat-nested-ner/config/en_bert_base_cased.json DATA_PATH=<mypath>/release/en_ace05/ EXPORT_DIR=<mypath>/release/en_ace05/output data_sign=ace2005 entity_sign=flat
export PYTHONPATH=${FOLDER_PATH}
python ${FOLDER_PATH}/run/train_bert_mrc.py
--config_path ${CONFIG_PATH}
--data_dir ${DATA_PATH}
--bert_model bert-base-cased
--output_dir ${EXPORT_DIR}
--entity_sign ${entity_sign}
--data_sign ${data_sign}
--export_model True
--dropout 0.3
--checkpoint 1000
--max_seq_length 128
--train_batch_size 16
--dev_batch_size 16
--test_batch_size 16
--learning_rate 5e-5
--weight_start 1.0
--weight_end 1.0
--weight_span 1.0
--num_train_epochs 2
--seed 42
--n_gpu 1
--warmup_proportion -1
--gradient_accumulation_steps 1`
I got the following results
-*--*--*--*--*--*--*--*--*--*- current data_sign: ace2005 =*==*==*==*==*==*==*==*==*==*= loading train data ... ... 50995 50995 train data loaded =*==*==*==*==*==*==*==*==*==*= loading dev data ... ... 6776 6776 dev data loaded =*==*==*==*==*==*==*==*==*==*= loading test data ... ... 7406 7406 test data loaded ###################################################################### EPOCH: 0 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 2.0820212364196777 ............................................................ DEV: loss, acc, precision, recall, f1 1.5432 0.0782 0.0006 0.0007 0.0006 ............................................................ TEST: loss, acc, precision, recall, f1 1.5449 0.0757 0.0011 0.0018 0.0014 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 1.5602871179580688 ............................................................ DEV: loss, acc, precision, recall, f1 1.0879 0.7018 0.0 0.0 0.0 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 1.0668576955795288 ............................................................ DEV: loss, acc, precision, recall, f1 0.7798 0.7634 0.0 0.0 0.0 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 0.7793314456939697 ............................................................ DEV: loss, acc, precision, recall, f1 0.5376 0.7644 0.0 0.0 0.0 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 0.6774319410324097 ............................................................ DEV: loss, acc, precision, recall, f1 0.3504 0.7644 0.0 0.0 0.0 -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- -*--*--*--*--*--*--*--*--*--*--*--*--*--*--*- current training loss is : 0.3500059247016907
I also ran with entity_sign=nested. Even that does not work.
Can you please see if I am missing anything
Hi, I found a bug in your pre-processing code.
span_labels.append((start, len(sentence_tags) -1 , sentence_tags[-1].split("-")[-1]))
This bug will cause the number of entities decreases. In conll2003, each split has the following number of entities
train: 23499
dev: 5942
test: 5648
Because of this bug, it will decrease to
train: 22781
dev: 5796
test: 5465
I am not sure whether this will have an effect on the performance. I tried to run the corrected version by the configuration given in https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/log/en_conll03.txt , but in Telsa V100 (16G memory) it goes OOM. Therefore I have to use 'batch_size=16, gradient_accumulation_steps=2' to simulate, but the performance is far behind the reported one. Is there any trick to restrict the memory used or I need even bigger memory?
你好,这个模型是否支持,在同一个question下面,出现多个答案的情况,如果出现了多个答案,是否可以能够全部的提取出来,谢谢🙏
Would you please upload the Eng-OntoNotes5.0 preprocessed datasets for direct training ?
thank you.
您好!非常感谢您提供了MRC for NER思路,请问您所用的suquentialsampler对最后的结果影响有多大?在ontonotes数据集上您设置的最大句子长度为100,但在这个数据集的train, test, dev中句子长度超过90的非常多,请问您是怎么处理这种情况的呢?对比模型设置的最大句子长度也是100吗?期待您的回复!
您好,请教下,这行代码的意思是什么?max_tokens_for_doc这个变量已经减去过 len(query_tokens)了
https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/data_loader/mrc_utils.py#L146
另外,https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/data_loader/mrc_utils.py#L187 这行代码中的input_mask.append(1) 作用是什么? 后面直接有语句input_mask = [1] * len(input_tokens),好像input_mask.append(1) 没起作用?
您好,我的数据集上存在precision明显大于recall的情况,如果想以precision换recall,您可否给点建议?谢谢
我发现doc_span_pos很容易导致内存溢出,这部分主要是用来计算sapn_loss的,这部分损失对于整体效果收益大吗?
您好,请问下您 Eng-OntoNotes5.0 这个数据集对应的query哪里可以看到吗?谢谢!
I try to reproduce the high performance of your model in the ACE05 nested set.
The data set from you.
We use the same version pip package.
The config is the same as the log, include the same seed, except the batch_size and n_gpu which we only use one P100.
But I don't think it's a matter.
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"type_vocab_size": 2,
"vocab_size": 30522
},
"config_path": "./config/en_bert_base_uncased.json",
"data_dir": "./data_preprocess/en_ace05",
"bert_model": "./uncased_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 160,
"train_batch_size": 15,
"dev_batch_size": 16,
"test_batch_size": 16,
"checkpoint": 1200,
"learning_rate": 4e-05,
"num_train_epochs": 20,
"warmup_proportion": -1.0,
"local_rank": -1,
"gradient_accumulation_steps": 1,
"seed": 2333,
"export_model": false,
"output_dir": "result",
"data_sign": "ace2005",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "nested",
"n_gpu": 1,
"dropout": 0.2,
"entity_threshold": 0.5,
"data_cache": false
}
After running 20 epoch, I only get 79.53% f1 score in the test set.
It has a big gap near 7% with your result 86.88%.
I don't think it causes by the multi-GPU.
Could you rerun your code in another machine or another seed?
Thx!
和序列标注做法一次送入句子出结果相比,MRC的方式需要对每一类实体都做一遍句子+某类实体问句的轮询,尽管MRC的方式能够带来在指标上的显著提升,但是这样一类一类的轮询效率上感觉就比较差。落地工程的话,不知道你们是否有这样的应用场景,验证过MRC这样轮询对响应性能这些指标的影响?
@YuxianMeng @littlesulley需要得到预测的结果,是改写trainer里面的test函数嘛?
之后报个错
result = trainer.test(model=model, test_dataloaders=model.test_dataloader())
print(result)
ValueError: Dataloader
returned 0 length. Please make sure that your Dataloader at least returns 1 batch
Thank you for publishing the source code immediately, I have some concerns about the pre-processing. Based on
, the code will truncate sentence after themax_tokens_for_doc
, whether this truncation is also conducted in the test set?there are various labels (e.g., "ORG", "LOC", "MISC" etc.).
Is there any way to evaluate separately?
evaluate.py
always shows overall results I think.
Where can i find the queries for the Conll2003 dataset ?
Hi, I am looking into the data (for example conll2003). Although for different entity, we can generate different context, query pair. For each context, we have to generate the (context, question, answer) for all entities. I am wondering if I have partially annotated training data, can I only generate (context, question, answer) when we have the entity in the context?
Thank you!
如题,2020.08.08更新,按照和更新之前一样的处理方式,训练过程出现RuntimeError: expected backend CUDA and dtype Float but got backend CUDA and dtype Long。
日志如下:
(mrcner) zhaoxf4@nyu:/data1/zhaoxf4/mrc-for-flat-nested-ner$ sh script/train_zh_msra.sh
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Please notice that merge the args_dict and json_config ... ...
{
"bert_frozen": "false",
"hidden_size": 768,
"hidden_dropout_prob": 0.2,
"classifier_sign": "multi_nonlinear",
"clip_grad": 1,
"bert_config": {
"attention_probs_dropout_prob": 0.1,
"directionality": "bidi",
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"max_position_embeddings": 512,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pooler_fc_size": 768,
"pooler_num_attention_heads": 12,
"pooler_num_fc_layers": 3,
"pooler_size_per_head": 128,
"pooler_type": "first_token_transform",
"type_vocab_size": 2,
"vocab_size": 21128
},
"config_path": "/data1/zhaoxf4/mrc-for-flat-nested-ner/config/zh_bert.json",
"data_dir": "/data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra",
"bert_model": "/data1/zhaoxf4/pretrained/chinese_L-12_H-768_A-12",
"task_name": null,
"max_seq_length": 100,
"train_batch_size": 8,
"dev_batch_size": 16,
"test_batch_size": 16,
"checkpoint": 10,
"learning_rate": 1e-05,
"num_train_epochs": 15,
"warmup_proportion": -1.0,
"max_grad_norm": 1.0,
"gradient_accumulation_steps": 1,
"seed": 2333,
"output_dir": "/data1/zhaoxf4/mrc-for-flat-nested-ner/model_save/zh_msra_100_1e-5_8_0.3_15_10",
"data_sign": "zh_msra",
"weight_start": 1.0,
"weight_end": 1.0,
"weight_span": 1.0,
"entity_sign": "flat",
"n_gpu": 1,
"dropout": 0.3,
"entity_threshold": 0.5,
"num_data_processor": 10,
"data_cache": true,
"export_model": true,
"do_lower_case": false,
"fp16": false,
"amp_level": "O2",
"local_rank": -1
}
-*--*--*--*--*--*--*--*--*--*-
current data_sign: zh_msra
=*==*==*==*==*==*==*==*==*==*=
loading train data ... ...
125184
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-0
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-1
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-2
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-3
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-4
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-5
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-6
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-7
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-8
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-9
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-8 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-0 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-5 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-9 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-6 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-4 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-7 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-3 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-2 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.train.cache.100.10-1 <<< <<< <<<
check number of examples before and after data processing :
125184 125184
125184 train data loaded
=*==*==*==*==*==*==*==*==*==*=
loading dev data ... ...
13908
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-0
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-1
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-2
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-3
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-4
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-5
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-6
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-7
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-8
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-9
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-8 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-1 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-5 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-3 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-9 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-4 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-2 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-0 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-6 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.dev.cache.100.10-7 <<< <<< <<<
check number of examples before and after data processing :
13908 13908
13908 dev data loaded
=*==*==*==*==*==*==*==*==*==*=
loading test data ... ...
13095
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-0
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-1
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-2
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-3
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-4
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-5
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-6
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-7
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-8
>>> >>> >>> export sliced features to : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-9
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-6 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-4 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-7 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-5 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-3 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-9 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-2 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-8 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-1 <<< <<< <<<
load sliced features from : /data1/zhaoxf4/mrc-for-flat-nested-ner/data/zh_msra/mrc-ner.test.cache.100.10-0 <<< <<< <<<
check number of examples before and after data processing :
13095 13095
13095 test data loaded
######################################################################
EPOCH: 0
Traceback (most recent call last):
File "/data1/zhaoxf4/mrc-for-flat-nested-ner/run/train_bert_mrc.py", line 339, in <module>
main()
File "/data1/zhaoxf4/mrc-for-flat-nested-ner/run/train_bert_mrc.py", line 335, in main
train(model, optimizer, sheduler, train_loader, dev_loader, test_loader, config, device, n_gpu, label_list)
File "/data1/zhaoxf4/mrc-for-flat-nested-ner/run/train_bert_mrc.py", line 185, in train
start_positions=start_pos, end_positions=end_pos, span_positions=span_pos, span_label_mask=span_label_mask)
File "/data0/zhaoxf4/.conda/envs/mrcner/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/data1/zhaoxf4/mrc-for-flat-nested-ner/model/bert_mrc.py", line 72, in forward
start_loss = torch.sum(start_loss * token_type_ids.view(-1))
RuntimeError: expected backend CUDA and dtype Float but got backend CUDA and dtype Long
会将代码改为,分批次加入内存的形式吗?因为内存小无法加载太大的数据
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.