Calculate readability by using variable replacement model
Project description
概要
変数置き換えモデルを用いた英日両文に適用可能なリーダビリティ判定ツールです。
字種分割にはdivide-char-typeを, 音節数計算にはcount-syllableを使用しています。
戻り値は全体、段落ごと、センテンスごとのリーダビリティ値が取得できるようにしています。
変数置き換えモデルの指標
jFRE = 206.835-(1.015ASL)-(84.6ASW)
jFKG = (0.39ASL)+(11.8ASW)-15.59
jARI = (4.71ACW)+(0.5ASL)-21.43
jCLI = (5.88ACW)-(29.6/ASL)-15.8
jSMOG = 1.031√(30PS)+3.1291
*ASL = 字種分割語数/センテンス数
*ASW = 音節数・漢字の連なり数/字種分割語数
*ACW = シャノン情報量に基づく重み/字種分割語数
*PS = 英語3音節・漢字3字以上の字種分割語数/センテンス数
シャノン情報量に基づく重みは、英数字(36種類)を1として、ひらがな(88種類)をlog(1/88)/log(1/36)で,カタカナ(141種類)をlog(1/141)/log(1/36)で、漢字(20898種類)をlog(1/20898)/log(1/36)でそれぞれ重み付けする.
セットアップ
pip install calculate-readability
アンインストール
pip uninstall calculate-readability divide-char-type count-syllable nltk
使用方法
from calculate_readability import calculate_readability
data = calculate_readability("今日の天気は晴れです。明日は曇りです。")
print(data["jfre"])
論文
赤木信也ら:変数置き換えモデルを用いた医療関連文書の可読性分析,
バイオメディカル・ファジィ・システム学会誌 19 (1), 19-27, 2017
https://cir.nii.ac.jp/crid/1391975276374773248
別途、論文化、または、学会発表を予定してます。
ライセンス
- calculate-readability
- Python Software Foundation License
- Copyright (C) 2023-2024 Shinya Akagi
- divide-char-type
- Python Software Foundation License
- Copyright (C) 2023-2024 Shinya Akagi
- count-syllable
- Python Software Foundation License
- Copyright (C) 2023-2024 Shinya Akagi
- nltk
- Apache License 2.0
- Copyright (C) 2001-2023 NLTK Project
- cmudict
- BSD License
- Copyright (C) 1998 Carnegie Mellon University
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
Built Distribution
Hashes for calculate-readability-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b27b424156627fa8ecdf41809afcf9ae4294c5496bc72674e6752fff4e8a62f |
|
MD5 | 805ebfc693447b5ad9b1d4eab75f5cb0 |
|
BLAKE2b-256 | f1e34c7806cd1a684b02f7d1cbc67e573aac0cf195e38d609b97bb5ea56f42ee |
Hashes for calculate_readability-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66414e5afbf9fa2b630cbe966cfb46bf2434d96ae74fcf26949a8758b2b672ca |
|
MD5 | 256c3235c58bb277c2bb1959d3597b90 |
|
BLAKE2b-256 | 8596e1baf93c8662280a0c738849aa64a3185d32b60d0b82cbc7596f9f9823e3 |