Pure python implementation of ROUGE-1.5.5. for korean
Project description
Rouge Implementation for Korean
original source code from https://github.com/google-research/google-research/tree/master/rouge
기존 rouge_scorer는 알파벳과 숫자를 제외하고는 제거했기 때문에 한국어로는 계산하려면 별도로 처리가 필요했습니다. tokenize.py 에서 해당 부분을 주석처리한 뒤 pypi로 새롭게 배포했습니다. 따라서 불용어나 특수문자 제거, stemmer처리 등은 별도로 진행해야 합니다.
pip install korouge_score
from korouge_score import rouge_scorer
scorer = rouge_scorer.RougeScorer(["rouge1", "rouge2", "rougeL", "rougeLsum"])
ref = "안녕하세요 반가워요 오늘 뭐 먹을래요?"
pred = "안녕 ㅋ 반가워 오늘 뭐 할래?"
print(scorer.score(ref, pred))
>>> {'rouge1': Score(precision=0.3333333333333333, recall=0.4, fmeasure=0.3636363636363636), 'rouge2': Score(precision=0.2, recall=0.25, fmeasure=0.22222222222222224), 'rougeL': Score(precision=0.3333333333333333, recall=0.4, fmeasure=0.3636363636363636), 'rougeLsum': Score(precision=0.3333333333333333, recall=0.4, fmeasure=0.3636363636363636)}
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
korouge_score-0.1.4.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for korouge_score-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27139c62e097a35d3148c8398a81014084d7d952876340e087431c5f69512884 |
|
MD5 | 423b696b2393adc8e8d7c298477844cf |
|
BLAKE2b-256 | 85685f5dc6e96a232f1167e3d6ff241b9d93944125bf57975ead76b07a65bc44 |