Sentence boundary disambiguation tool for Japanese texts
Project description
Bunkai
Bunkai is a sentence boundary (SB) disambiguation tool for Japanese texts.
Bunkaiは日本語文境界判定器です.
Quick Start
Install
$ pip install -U bunkai
Disambiguation without Models
$ echo -e '宿を予約しました♪!まだ2ヶ月も先だけど。早すぎかな(笑)楽しみです★\n2文書目の先頭行です。▁改行はU+2581で表現します。' \
| bunkai
宿を予約しました♪!│まだ2ヶ月も先だけど。│早すぎかな(笑)│楽しみです★
2文書目の先頭行です。▁│改行はU+2581で表現します。
- Feed a document as one line by using
▁
(U+2581) for line breaks.
1行は1つの文書を表します.文書中の改行は▁
(U+2581) で与えてください. - The output shows sentence boundaries with
│
(U+2502).
出力では文境界は│
(U+2502) で表示されます.
Disambiguation for Line Breaks with a Model
If you want to disambiguate sentence boundaries for line breaks, please add a --model
option with the path to the model.
改行記号に対しても文境界判定を行いたい場合は,--model
オプションを与える必要があります.
First time, please setup a model. It will take some time.
はじめにモデルをセットアップする必要があります.セットアップには少々時間がかかります.
$ bunkai --model bunkai-model-directory --setup
Then, please designate the directory.
そしてモデルを指定して動かしてください.
$ echo -e "文の途中で改行を▁入れる文章ってありますよね▁それも対象です。" | bunkai --model bunkai-model-directory
文の途中で改行を▁入れる文章ってありますよね▁│それも対象です。
Python Library
You can also use Bunkai as Python library.
BunkaiはPythonライブラリとしても使えます.
from bunkai import Bunkai
bunkai = Bunkai()
for sentence in bunkai("はい。このようにpythonライブラリとしても使えます!"):
print(sentence)
For more information, see examples.
ほかの例はexamplesをご覧ください.
Documents
References
- Yuta Hayashibe and Kensuke Mitsuzawa. Sentence Boundary Detection on Line Breaks in Japanese. Proceedings of The 6th Workshop on Noisy User-generated Text (W-NUT 2020), pp.71-75. November 2020. [PDF] [bib]
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bunkai-1.2.0.tar.gz
(43.3 kB
view hashes)
Built Distribution
bunkai-1.2.0-py3-none-any.whl
(60.9 kB
view hashes)