kokex
한국어 문서 집합에서 키워드를 추출하는 라이브러리입니다. 구문분석을 통해 사전 없이도 고유명사, 복합명사, 신조어에 강건한 키워드 추출기를 만들고자 합니다.
간단한 사용예는 아래와 같습니다.
import kokex
keywords = kokex.keywords([
'첫 번째 문서입니다. 여러 문장을 포함할 수 있습니다.',
'두 번째 문서입니다. 여러 문서를 포함할 수 있습니다.'
])
print(keywords) # {'번째': 2, '문서': 3, '문장': 1, '포함': 2}
더 자세한 사용법은 문서 를 참고해주세요.
설치
설치는 pip 를 이용하는 방법과 docker 를 이용하는 방법이 있습니다.
pip
pip install kokex
이 라이브러리는 konlpy 와 Mecab 형태소 분석기에 의존성이 있습니다. konlpy 의 설치 안내 에 따라 Mecab 을 설치해주시기 바랍니다. 예를 들어, Mac 환경에서는 아래의 명령을 입력하시기 바랍니다.
$ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
docker
도커를 사용한다면, 모든 의존성이 설치된 상태로 로컬 API 서버를 구동할 수 있습니다.
export KOKEX_PORT=80
export KOKEX_VERSION=0.0.11
docker pull kokex/server:${KOKEX_VERSION}
docker run -d -p ${KOKEX_PORT}:8081 --name kokex-server --rm kokex/server:${KOKEX_VERSION}
서버를 종료할 때는 docker stop kokex-server 를 입력하세요.
서버를 실행하면 아래와 같이 http 요청을 처리할 수 있습니다.
curl -X POST \
http://localhost/keywords \
-d '{
"docs": [
"첫 번째 문서입니다. 여러 문장을 포함할 수 있습니다.",
"두 번째 문서입니다. 여러 문서를 포함할 수 있습니다."
]
}'
그리고 http://localhost/docs 에 접속하면 API 문서를 확인할 수 있습니다.
참여
모든 논의는 이슈를 통해 이루어지면 좋겠습니다.
API 사용자
kokex api 를 사용하는 분들이라면 새로운 문장에 대한 분석 요청을 하실 수 있습니다. 테스트 문장과 함께 원하는 분석결과를 담아 이슈를 생성하실 수 있도록 템플릿(test_suggest)을 준비해두었으니 참고해주세요.
API 개발자
kokex api 개발에 관심이 있으시다면, 이슈를 생성 후 논의를 진행하고, 수정한 사항을 PR 해주시면 됩니다. 소스 코드를 수정하신다면, isort 와 black 으로 포맷팅을 해주시기 바랍니다. 저장소 복제 후 아래와 같이 입력하시면 이를 자동으로 체크할 수 있습니다.
pip install -r requirements.txt
pre-commit install
그리고 bin/run_test.sh 를 실행하여 기존 테스트 문장의 분석 결과를 해치지 않도록 해야합니다.
테스트 문장은, test 디렉토리의 test_{API_NAME}.py 파일에서 찾아보실 수 있습니다.
Metadata
Release files for kokex 0.0.11
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 |
|---|---|---|---|---|
| kokex-0.0.11.tar.gz | 13.5 kB | Without provenance | Details for kokex-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kokex-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for kokex-0.0.11-py3-none-any.whl |
Total release size: 26.1 kB
Release files / kokex-0.0.11.tar.gz
| Download URL | kokex-0.0.11.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2c7e770bc3486a3f7eb4f54ff2ee80faf2525a2d97b155839f3d605f153a70f
|
|
BLAKE2b-256 checksum How to use checksums |
cf4d34d945c23d6ee780d2b8ddc018b522d559025d3c908412ef61a714f2504b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10
|
Release files / kokex-0.0.11-py3-none-any.whl
| Download URL | kokex-0.0.11-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fca66b0f0a4a53fd741d1a5e0e4a39058cf816896962f25ea2663f3e85177241
|
|
BLAKE2b-256 checksum How to use checksums |
3d4461b2546642c78bc186df433e1e56abb7ced6b1e53cd0cc422278faf8d030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10
|
Security for kokex 0.0.11
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.