All Projects → bigboNed3 → Bert_serving

bigboNed3 / Bert_serving

Licence: apache-2.0
export bert model for serving

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bert serving

Fastrtext
R wrapper for fastText
Stars: ✭ 103 (-25.36%)
Mutual labels:  text-classification
Context
ConText v4: Neural networks for text categorization
Stars: ✭ 120 (-13.04%)
Mutual labels:  text-classification
Ml Projects
ML based projects such as Spam Classification, Time Series Analysis, Text Classification using Random Forest, Deep Learning, Bayesian, Xgboost in Python
Stars: ✭ 127 (-7.97%)
Mutual labels:  text-classification
Kadot
Kadot, the unsupervised natural language processing library.
Stars: ✭ 108 (-21.74%)
Mutual labels:  text-classification
Bdci2017 Minglue
BDCI2017-让AI当法官,决赛第四(4/415)https://www.datafountain.cn/competitions/277/details
Stars: ✭ 118 (-14.49%)
Mutual labels:  text-classification
Python Stop Words
Get list of common stop words in various languages in Python
Stars: ✭ 122 (-11.59%)
Mutual labels:  text-classification
Text Classification
An example on how to train supervised classifiers for multi-label text classification using sklearn pipelines
Stars: ✭ 100 (-27.54%)
Mutual labels:  text-classification
Nlp estimator tutorial
Educational material on using the TensorFlow Estimator framework for text classification
Stars: ✭ 131 (-5.07%)
Mutual labels:  text-classification
Classifier multi label textcnn
multi-label,classifier,text classification,多标签文本分类,文本分类,BERT,ALBERT,multi-label-classification
Stars: ✭ 116 (-15.94%)
Mutual labels:  text-classification
Rcnn Text Classification
Tensorflow Implementation of "Recurrent Convolutional Neural Network for Text Classification" (AAAI 2015)
Stars: ✭ 127 (-7.97%)
Mutual labels:  text-classification
Pytorch Rnn Text Classification
Word Embedding + LSTM + FC
Stars: ✭ 112 (-18.84%)
Mutual labels:  text-classification
Text rnn attention
嵌入Word2vec词向量的RNN+ATTENTION中文文本分类
Stars: ✭ 117 (-15.22%)
Mutual labels:  text-classification
Dan Jurafsky Chris Manning Nlp
My solution to the Natural Language Processing course made by Dan Jurafsky, Chris Manning in Winter 2012.
Stars: ✭ 124 (-10.14%)
Mutual labels:  text-classification
Delta
DELTA is a deep learning based natural language and speech processing platform.
Stars: ✭ 1,479 (+971.74%)
Mutual labels:  text-classification
Fasttext.js
FastText for Node.js
Stars: ✭ 127 (-7.97%)
Mutual labels:  text-classification
Texting
[ACL 2020] Tensorflow implementation for "Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks"
Stars: ✭ 103 (-25.36%)
Mutual labels:  text-classification
Nlp Pretrained Model
A collection of Natural language processing pre-trained models.
Stars: ✭ 122 (-11.59%)
Mutual labels:  text-classification
Hierarchical Multi Label Text Classification
The code of CIKM'19 paper《Hierarchical Multi-label Text Classification: An Attention-based Recurrent Network Approach》
Stars: ✭ 133 (-3.62%)
Mutual labels:  text-classification
Textclassify with bert
使用BERT模型做文本分类;面向工业用途
Stars: ✭ 128 (-7.25%)
Mutual labels:  text-classification
Cluedatasetsearch
搜索所有中文NLP数据集,附常用英文NLP数据集
Stars: ✭ 2,112 (+1430.43%)
Mutual labels:  text-classification

export bert model for serving

predicting with estimator is slow, use export_savedmodel instead

create virtual environment

conda env create -f env.yml

train a classifier

bash train.sh

use the classifier

bash predict.sh

export bert model

bash export.sh

check out exported model

saved_model_cli show --all --dir $exported_dir

test exported model

bash test.sh

export it yourself

def serving_input_fn():
    label_ids = tf.placeholder(tf.int32, [None], name='label_ids')
    input_ids = tf.placeholder(tf.int32, [None, FLAGS.max_seq_length], name='input_ids')
    input_mask = tf.placeholder(tf.int32, [None, FLAGS.max_seq_length], name='input_mask')
    segment_ids = tf.placeholder(tf.int32, [None, FLAGS.max_seq_length], name='segment_ids')
    input_fn = tf.estimator.export.build_raw_serving_input_receiver_fn({
        'label_ids': label_ids,
        'input_ids': input_ids,
        'input_mask': input_mask,
        'segment_ids': segment_ids,
    })()
    return input_fn

and

estimator._export_to_tpu = False
estimator.export_savedmodel(FLAGS.export_dir, serving_input_fn)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].