Skip to main content

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


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)

Uploaded Source

Built Distribution

korouge_score-0.1.4-py3-none-any.whl (28.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page