NLP JP Gears
Overview
日本語の自然言語処理で頻出の前処理をまとめたものです。pipelineをしいて、複数の処理をまとめることができます。
API
- pipelineの作成: composer.Composer
- 全角英数字記号を半角に変換: zenhan.ZenToHanConverter
- 半角英数字記号を全角に変換: zenhan.HanToZenConverter
- 括弧とその間のテキストを削除: remover.TextBtwBracketsRemover
Requirements
Python 3.6+
Installation
pip install nlp-jp-gears
Example
from nlp_jp_gears import Composer
from nlp_jp_gears import (
ZenToHanConverter,
TextBtwBracketsRemover
)
txt_btw_brackets_remover = TextBtwBracketsRemover()
zenhan_converter = ZenToHanConverter()
composer = Composer(txt_btw_brackets_remover, zenhan_converter)
text = "Python(パイソン)で自然言語処理?"
out = composer(text)
print(out)
Then, input text is preprocessed.
Pythonで自然言語処理?
And you can check what is removed and converted, as follows,
print(txt_btw_brackets_remover.removes)
print(zenhan_converter.converts)
<{[(「『([〈《〔{«‹
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Metadata
Release files for nlp-jp-gears 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nlp-jp-gears-0.1.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nlp_jp_gears-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / nlp-jp-gears-0.1.1.tar.gz
| Download URL | nlp-jp-gears-0.1.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
097584b2d5d5f0e8d1fc7feaf77161ed7bde24ec6ea028cec2a4102fbfb03ed5
|
|
BLAKE2b-256 checksum How to use checksums |
4afa8b625135dda7287afd3c4963c5bc97e8cd51e892ab99acdcb7dc5ff41ed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.3 CPython/3.6.8 Darwin/18.7.0
|
Release files / nlp_jp_gears-0.1.1-py3-none-any.whl
| Download URL | nlp_jp_gears-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be4dcb260c68c1a56d571192423183583a8ce64755fe132a4af4522ff5dabd28
|
|
BLAKE2b-256 checksum How to use checksums |
7010f01b7982852a2f6338cecdf79c61bb45dba94d016351d69ed3eef7eb11ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.3 CPython/3.6.8 Darwin/18.7.0
|