GrepBoard/매뉴얼
605 편 ·

AI 영문 초안의 가독성 점수를 textstat 으로 재기

·시험 환경 Claude Sonnet(sonnet 별칭) · Claude Code 2.1.302 · Python 3.12 · textstat 0.7.13 · Ubuntu 24.04 · 2026-10·시험 범위 ↓·7 단계

같은 공지문의 AI 초안 둘을 textstat 으로 비교해 평균 문장 길이·Flesch 점수·학년 지수를 재고, 한국어에는 점수가 맞지 않는 모습도 직접 확인합니다.

AI 에게 「쉽게 써 달라」고 시킨 초안이 정말 쉬워졌는지는 눈으로 판단이 갈립니다. 평균 문장 길이와 Flesch 점수로 재면 숫자로 비교됩니다. 길이와 중복을 세는 비슷한 검사는 메타 설명 검사 에 있습니다.

[1] 프로젝트 안에 가상환경을 만들고 textstat 을 설치합니다.

console
$ python3 -m venv .venv$ .venv/bin/pip install textstat$ .venv/bin/pip list | grep -i -E 'textstat|pyphen'pyphen      0.18.1textstat    0.7.13

[2] 같은 공지문을 두 번 만듭니다. 첫 초안은 조건만 주고, 둘째는 첫 초안을 「8학년 독자가 쉽게 읽도록, 문장은 평균 15단어 미만, 사실은 그대로」로 고쳐 쓰게 합니다. 앱 이름과 기능은 지어낸 것입니다.

p1.txt
Write a product update announcement for customers of a small file-sync app called "SyncNest". The update (version 3.2) adds offline folders, faster uploads of large files, and fixes a bug where shared links expired early. About 180 words, plain prose, no headings, no bullet lists. Output only the text.
console
$ claude -p --model sonnet --max-turns 1 < p1.txt > en.1.txt$ { echo 'Rewrite the announcement below so an average 8th-grade reader finds it easy: sentences under 15 words on average, everyday words, same facts, no new claims. Plain prose, no headings or lists. Output only the text.'; echo; cat en.1.txt; } > p2.txt$ claude -p --model sonnet --max-turns 1 < p2.txt > en.2.txt

[3] 점수를 찍는 스크립트를 만듭니다. 문장 수·단어 수·평균 문장 길이(words_per_sentence)에 Flesch Reading Ease, Flesch-Kincaid 학년, Gunning Fog, ARI 를 붙였습니다.

score.py
#!/usr/bin/env python3"""usage: score.py FILE... — textstat scores per file"""import sys, textstatprint(f"{'file':<10}{'sent':>5}{'words':>6}{'w/sent':>8}{'FRE':>7}{'FKGL':>6}{'fog':>6}{'ARI':>6}")for p in sys.argv[1:]:    t = open(p, encoding="utf-8").read()    print(f"{p:<10}{textstat.sentence_count(t):>5}{textstat.lexicon_count(t):>6}"          f"{textstat.words_per_sentence(t):>8.1f}"          f"{textstat.flesch_reading_ease(t):>7.1f}{textstat.flesch_kincaid_grade(t):>6.1f}"          f"{textstat.gunning_fog(t):>6.1f}{textstat.automated_readability_index(t):>6.1f}")

[4] 영문 두 초안을 비교합니다.

console
$ .venv/bin/python -I score.py en.1.txt en.2.txtfile      sent words  w/sent    FRE  FKGL   fog   ARIen.1.txt    12   203    16.9   65.5   8.3  10.1   9.5en.2.txt    20   196     9.8   86.8   3.6   4.7   4.0

평균 문장 길이가 16.9단어에서 9.8단어로 줄었고, Flesch Reading Ease 는 65.5 에서 86.8 로 올랐습니다. 점수가 높을수록 쉽고, textstat README 의 구간으로는 60~69 가 Standard, 80~89 가 Easy 입니다. FKGL 은 미국 학년에 해당하는 값입니다. 「8학년 독자」로 시켰는데 둘째 초안은 3.6 으로 훨씬 쉬운 쪽에 닿았습니다.

[5] 한국어 두 초안(같은 요청의 한국어판, 약 300자)에도 같은 스크립트를 돌려 봅니다.

console
$ .venv/bin/python -I score.py ko.1.txt ko.2.txtfile      sent words  w/sent    FRE  FKGL   fog   ARIko.1.txt     7    81    11.6  110.5   0.7   4.6  -1.3ko.2.txt    11    78     7.1  115.0  -1.0   2.8  -3.6

Flesch 가 110 을 넘고 학년 지수가 0 이하입니다. 한국어 공지문이 그만큼 쉽다는 뜻이 아닙니다. 영어 식은 음절 수로 어려움을 재는데, 음절이 이렇게 세어집니다.

console
$ .venv/bin/python -I -c "import textstat; print(textstat.syllable_count('싱크네스트'), textstat.syllable_count('synchronization'))"1 5

싱크네스트 는 5음절인데 1 로 셉니다. 첫 초안의 음절 수(81)가 단어 수(81)와 같게 나온 것도 이 때문으로 보입니다. 음절이 적게 잡히니 점수는 쉬운 쪽으로 쏠립니다.

[6] set_lang 으로 한국어를 지정해 봅니다.

console
$ .venv/bin/python -I -c "import textstat; textstat.set_lang('ko'); print(textstat.syllable_count('안녕 하세요'))"…KeyError: None

0.7.13 은 ko 를 받아들이지 않고 KeyError: None 으로 멈춥니다. README 의 언어 표에도 한국어는 없습니다(Flesch Reading Ease 는 en·de·es·fr·it·nl·pl·ru). 한국어는 점수 대신 문장 수와 글자 수로 평균 문장 길이만 비교합니다. 위 표의 문장 수는 한국어 두 초안에서 직접 센 값(7·11)과 같았습니다.

[7] 영문에서도 문장 수가 어긋나는 입력이 있습니다. 두 번째 문장에 버전 번호를 넣으면 한 문장으로 세었습니다.

console
$ .venv/bin/python -I -c "import textstatfor s in ['Version three is out. See the notes.','It is out. See v3.2.1 notes.']: print(textstat.sentence_count(s), s)"2 Version three is out. See the notes.1 It is out. See v3.2.1 notes.

버전 번호가 많은 릴리스 노트는 평균 문장 길이가 실제보다 길게 나올 수 있으니, 문장 수를 직접 세어 한 번 맞춰 보세요. 왜 합쳐지는지는 원인을 찾지 않았습니다.

#textstat#readability#python#claude