Git Product home page Git Product logo

albert-vi-as-service's Introduction

Install

Install the server and client via pip. They can be installed separately or even on different machines:

# server
git clone https://github.com/duongkstn/albert-vi-as-service.git
cd albert-vi-as-service/server
pip install albert-vi-serving-server  
python setup.py install

#client
pip install bert-serving-client==1.10.0  # client, independent of `albert-vi-as-service`

Getting Started

1. Download a Pre-trained ALBERT_VI Model

Download a model of albert_vi, remember to download sentence piece model

2. Start the ALBERT_VI service

After installing the server, you should be able to use albert-vi-serving-start CLI as follows:

albert-vi-serving-start -model_dir albert_vi_model/ -spm_model_file albertvi_30k-clean.model -config_name albert_config.json -ckpt_name model.ckpt-1015000

At client side, your code should be similar to original bert-as-service repos

It is noted that you can still use bert-serving-start command independently

albert-vi-as-service's People

Contributors

abhishekraok avatar astariul avatar cbockman avatar dmitrykey avatar drndos avatar dslim23 avatar duongkstn avatar dveselov avatar eric-haibin-lin avatar gabrielbianconi avatar georgefeng avatar hanxiao avatar jacobdevlin-google avatar jhangsy avatar jtiger0431 avatar kraglik avatar liam-thunder avatar likejazz avatar lu161513 avatar paperplanet avatar parsaghaffari avatar peterisp avatar razzaghnoori avatar rodgzilla avatar sakuranew avatar shushanxingzhe avatar stefan-it avatar vsoch avatar xhj-fs avatar yangyaofei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

albert-vi-as-service's Issues

Only one vector was return

Dear author,

Only one vector was return if I use encode instead of multiple vector like other BERT.

For examples.

'''
from bert_serving.client import BertClient

bert_client = BertClient(port=5555, port_out=5556)

text = ["vô cùng đẹp trai", "đẹp trai thi mới có nhiều người yêu"]
x = bert_client.encode(text, show_tokens=False)

print(x.shape)
print(x)

'''

will return

'''
(2, 768)
[[ 0.2791622 0.38170967 -0.4323979 ... 0.5590598 -0.30385852
-0.21244307]
[ 0.2540159 0.1214181 -0.31108022 ... -0.07018693 -0.02891144
0.41919646]]

'''

instead of something like "23768" matrix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.