Skip to main content

A service to serve bert_multitask_learning models(server)

Project description

bert-multitask-as-service

A serving service for bert-multitask-learning

Install

pip install bert-multitask-server
pip install bert-multitask-client

Getting Started

  1. Train and export model.

    A typical trained checkpoint dir looks like below.

    bert_serving_ckpt/
    ├── *_label_encoder.pkl
    ├── bert_config.json
    ├── export_model
    ├── params.json
    └── vocab.txt
    
  2. Start server using CLI

    bert-multitask-serving-start -model_dir ~/CWS_NER_POS_ckpt/ -num_worker=4 -problem "CWS|NER|POS"
    
  3. Use Client to Get Prediction

    from bert_serving.client import BertClient
    bc = BertClient()
    bc.encode(['我爱北京天安门'])
    

Bert多任务学习服务

一个部署Bert多任务学习的服务

安装

pip install bert-multitask-server
pip install bert-multitask-client

开始使用

  1. 训练模型并导出模型.

    导出后的模型目录应该有以下文件

    bert_serving_ckpt/
    ├── *_label_encoder.pkl
    ├── bert_config.json
    ├── export_model
    ├── params.json
    └── vocab.txt
    
  2. 用CLI启动服务

    bert-multitask-serving-start -model_dir models/ -num_worker=4 -problem "fake_problem"
    
  3. 用客户端获取预测结果

    from bert_serving.client import BertClient
    bc = BertClient()
    bc.encode(['我爱北京天安门'])
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

bert_multitask_server-0.1.1-py3-none-any.whl (21.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page