What is this?
bareun-apis is the generated python classes of GRPC API for bareun.ai.
The bareun.ai provides several service for deep learning NLP features. This api has all of main features, which provides tokenizing, POS tagging for Korean. It has also customized dictionary service.
How to install
pip3 install bareun-apis
How to use
- You can create your own baikal language service client.
- It is used for
bareunlpy, the official bareun package for python.
from google.protobuf.json_format import MessageToDict
import bareun.language_service_pb2 as pb
import bareun.language_service_pb2_grpc as ls
MAX_MESSAGE_LENGTH = 100*1024*1024
class BareunLanguageServiceClient:
def __init__(self, remote):
channel = grpc.insecure_channel(
remote,
options=[
('grpc.max_send_message_length', MAX_MESSAGE_LENGTH),
('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH),
])
self.stub = ls.LanguageServiceStub(channel)
def analyze_syntax(self, document, auto_split=False):
req = pb.AnalyzeSyntaxRequest()
req.document.content = document
req.document.language = "ko_KR"
req.encoding_type = pb.EncodingType.UTF32
req.auto_split_sentence = auto_split
res = self.stub.AnalyzeSyntax(req)
# print_syntax_as_json(res)
return res
def tokenize(self, document, auto_split=False):
req = pb.TokenizeRequest()
req.document.content = document
req.document.language = "ko_KR"
req.encoding_type = pb.EncodingType.UTF32
req.auto_split_sentence = auto_split
res = self.stub.Tokenize(req)
# print_tokens_as_json(res)
return res
def print_syntax_as_json(res: pb.AnalyzeSyntaxResponse, logf=sys.stdout):
d = MessageToDict(res)
import json
json_str = json.dumps(d, ensure_ascii=False, indent=2)
logf.write(json_str)
logf.write('\n')
def print_tokens_as_json(res: pb.TokenizeResponse, logf=sys.stdout):
d = MessageToDict(res)
import json
json_str = json.dumps(d, ensure_ascii=False, indent=2)
logf.write(json_str)
logf.write('\n')
Metadata
Release files for bareun-apis 0.15.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bareun_apis-0.15.2.tar.gz | 28.3 kB | Without provenance | Details for bareun_apis-0.15.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bareun_apis-0.15.2-py3-none-any.whl | Python 3 | none | any | Details for bareun_apis-0.15.2-py3-none-any.whl |
Total release size: 64.5 kB
Release files / bareun_apis-0.15.2.tar.gz
| Download URL | bareun_apis-0.15.2.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9b2e544734e2f4395fdafd5b83b44803c6921fa3cbc27c2f2d2dfb97c12010f
|
|
BLAKE2b-256 checksum How to use checksums |
22c350d62dce108a5b285b89a24f1e538aa2c2cb942531d202e88e33e4d0b96a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / bareun_apis-0.15.2-py3-none-any.whl
| Download URL | bareun_apis-0.15.2-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad66fd130fe23262605a29e31d41ff68f8874a39e9508df75d22e71640692c4b
|
|
BLAKE2b-256 checksum How to use checksums |
1ac71db08eaf20cfc22564ef570aa6298d56c83228abce905c3a528a65814d17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for bareun-apis 0.15.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.