Home

Awesome

How to use

Prediction

This project, I improve model which was trained, so you can download it, and use it to prediction!

Parameter

nametypedetail
gpu_nointwhich gpu will be use to init bert ner graph
log_dirstrlog dir
verboseboolwhether show tensorflow log
bert_sim_modelstrbert sim model path

Train

Code

In this project, I just use bert pre model to fine tuning, so I just use their original code. I try to create new one, but the new one just same as the original code, so I given up.

Dataset

Because of my domain work, my work is based on judicial examination education, so I didn't use common dataset, my dataset were labeled by manual work, it include 80000+, 50000+ are similar, 30000+ are dissimilar, because of the privacy, I can't open source of this dataset

Suggest:

In original code, they just got the model pool output, I think there may be other ways to increase the accuracy, I tried some ways to increase the accuracy, but I found one, just concat the [CLS] embedding of the fourth from bottom to tailender in encoder output list, if you want to use my way, just do like this。

output_layer = model.get_pooled_output()
output_layer = tf.concat([tf.squeeze(model.all_encoder_layers[i][:, 0:1, :], axis=1) for i in range(-4, 0, 1)], axis=-1)