Skip to main content

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(['我爱北京天安门'])
    

Metadata

Release files for bert-multitask-client 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bert-multitask-client 0.1.1
File Interpreter ABI Platform
bert_multitask_client-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / bert_multitask_client-0.1.1-py3-none-any.whl

Download URL bert_multitask_client-0.1.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcc22717a9c1c406393147eaa96c231781a5f4443954133ea03ce40caeb26831
BLAKE2b-256 checksum
How to use checksums
ee5b3f1fbc12bfd18c32d653694c7894b9293cc4ad74018c024458fd91027483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page