ความสามารถในการอ่าน 'The Myth of Sisyphus'
ในแบบฝึกหัดนี้ เราจะคำนวณคะแนน Flesch reading ease สำหรับบทความที่มีชื่อเสียงของ Albert Camus เรื่อง The Myth of Sisyphus จากนั้นจะนำค่าคะแนนที่ได้มาแปลความหมายตามที่อธิบายไว้ในวิดีโอ เพื่อประเมินระดับความยากในการอ่านของบทความ
บทความทั้งหมดอยู่ในรูปแบบ string และถูกเก็บไว้ในตัวแปร sisyphus_essay
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Feature Engineering for NLP in Python
คำแนะนำการฝึกหัด
- Import คลาส
Readabilityจากreadability - คำนวณออบเจกต์
readability_scoresสำหรับsisyphus_essayโดยใช้Readability - แสดงคะแนน Flesch reading ease โดยใช้เมธอด
flesch
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Import Readability
from readability import ____
# Compute the readability scores object
readability_scores = ____(____)
# Print the flesch reading ease score
flesch = readability_scores.____
print("The Flesch Reading Ease is %.2f" % (flesch.____))