可読性テスト

Pythonで学ぶNLPの特徴量エンジニアリング

Rounak Banik

Data Scientist

可読性テストの概要

  • 英文の可読性を判定
  • 小学校から大学卒レベルまでの尺度
  • 単語数・音節数・文数を用いる数式
  • フェイクニュースや意見スパム検出に利用
Pythonで学ぶNLPの特徴量エンジニアリング

可読性テストの例

  • Flesch読易度
  • Gunning fog指数
  • SMOG(Simple Measure of Gobbledygook)
  • Dale–Challスコア
Pythonで学ぶNLPの特徴量エンジニアリング

可読性テストの例

  • Flesch読易度
  • Gunning fog指数
  • SMOG(Simple Measure of Gobbledygook)
  • Dale–Challスコア
Pythonで学ぶNLPの特徴量エンジニアリング

Flesch読易度

  • 最も古く広く使われるテストの一つ
  • 平均文長が長いほど読みにくい
    • 「This is a short sentence.」
    • 「This is longer sentence with more words and it is harder to follow than the first sentence.」
  • 単語の平均音節数が多いほど読みにくい
    • 「I live in my home.」
    • 「I reside in my domicile.」
  • スコアが高いほど読みやすい
Pythonで学ぶNLPの特徴量エンジニアリング

Flesch読易度スコアの解釈

読易度スコア 学年レベル
90-100 5
80-90 6
70-80 7
60-70 8-9
50-60 10-12
30-50 大学
0-30 大学卒
Pythonで学ぶNLPの特徴量エンジニアリング

Gunning fog指数

  • 1954年に開発
  • 平均文長にも依存
  • 複雑語の割合が高いほど読みにくい
  • 指数が高いほど可読性は低い
Pythonで学ぶNLPの特徴量エンジニアリング

Gunning fog指数の解釈

Fog指数 学年レベル
17 大学卒
16 大学4年
15 大学3年
14 大学2年
13 大学1年
12 高校3年
11 高校2年
Fog指数 学年レベル
10 高校1年
9 中学3年
8 中学2年
7 中学1年
6 小学6年
Pythonで学ぶNLPの特徴量エンジニアリング

readabilityライブラリ

# Download nltk punkt module
import nltk
nltk.download('punkt_tab')
# Import the Readability class
from readability import Readability

# Create a Readability Object readability_scores = Readability(text)
# Generate scores gf = readability_scores.gunning_fog() print(gf.score())
16.26
Pythonで学ぶNLPの特徴量エンジニアリング

Let's practice!

Pythonで学ぶNLPの特徴量エンジニアリング

Preparing Video For Download...