shirayu / jumanpp-grpc

Juman++ gRPC Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gRPC server for Juman++

This is a project, making Juman++ easy to use from other languages, especially if you already are using gRPC.

Quickstart

You need to have reasonably fresh C++ versions of Protobuf and gRPC installed.

First, build the server binary:

$ git clone --recursive git@github.com:eiennohito/jumanpp-grpc.git
$ cd jumanpp-grpc
$ mkdir build
$ cd build
$ cmake ..
$ make -j

Second, download a Juman++ model. You can find the latest one in a package on Juman++ (V2) Releases page. We will assume that you have Juman++ installed to the default directory.

Now launch the server using

./src/jumanpp-grpc \
    --config=/usr/local/libexec/jumanpp/jumandic.config \
    --port=51231 \
    --threads=2

Python (3) Client

You can use our python example to check if the server is working. We assume that you are still in the build folder.

First, generate gRPC python files with:

$ pip3 install grpcio-tools
$ make python
$ cd python
$ pip3 install -e . 

You can now run the client with:

$ python3 ../python/example/separator.py localhost:51231
Sentece: すもももももももものうち
すもも_名詞 も_助詞 もも_名詞 も_助詞 もも_名詞 の_助詞 うち_名詞
Sentece:  

About

Juman++ gRPC Server

License:Apache License 2.0


Languages

Language:C++ 82.4%Language:CMake 12.9%Language:Python 4.8%