资源算法BERT-NER-CLI

BERT-NER-CLI

2020-02-18 | |  36 |   0 |   0

BERT_NER_CLI Step by Step Guide

Before started, would like to appreciate for Google Research Team and @Kaiyinzhou's previous work at here.

Environment

  • Python 3.5+

  • Tensorflow 1.11+

Folder structure

ItemDesc
NERdatatraining / evaluating dataset
bertbert code download from here
bert_ner.pytraining code
ner_predict.pypredict code
predict_cli.pysimple command line program for testing purpose

Fine-Tune model

alt text

Training with GCP GPU/TPU

I found this pretty detailed instructions of how to deploy code, mount folders and execute .py files with Google Colab and utilizing their FREE TPU/GPU capabilities.

BERT-Base, Uncased or BERT-Large, Uncased need to be unzipped and upload to your Google Drive folder and be mounted.

alt text

I used Colab GPU (K80) fine-tuning the model, took me around 30 mins.

Evaluating

An evaluation script can be found here. A quick evaluation with Uncased 12-layer result in 93.26 f1 score. 24-layer result will be tried and provided here later.

Predicting

A simple command line program was provided here for testing purpose. Simply run

python predict_cli.py

The program will firstly load the model and waiting for inputs.


上一篇:NER-BERT-CRF

下一篇:nested-ner-2019-bert

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...