Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -171,12 +171,13 @@ def on_select(instruction1, instruction2, instruction3, evt: gr.SelectData):
|
|
171 |
|
172 |
#----------------#
|
173 |
# Grammar metrics
|
174 |
-
import textstat
|
|
|
175 |
|
176 |
def calculate_metrics(text):
|
177 |
-
flesch_kincaid_grade = textstat.flesch_kincaid_grade(text)
|
178 |
-
flesch_reading_ease = textstat.flesch_reading_ease(text)
|
179 |
-
gunning_fog = textstat.gunning_fog(text)
|
180 |
|
181 |
return flesch_kincaid_grade, flesch_reading_ease, gunning_fog
|
182 |
|
|
|
171 |
|
172 |
#----------------#
|
173 |
# Grammar metrics
|
174 |
+
#import textstat
|
175 |
+
from textacy import readability
|
176 |
|
177 |
def calculate_metrics(text):
|
178 |
+
flesch_kincaid_grade = readability.flesch_kincaid_grade_level(text) #textstat.flesch_kincaid_grade(text)
|
179 |
+
flesch_reading_ease = readability.flesch_reading_ease(text) #textstat.flesch_reading_ease(text)
|
180 |
+
gunning_fog = readability.gunning_fog_index(text) #textstat.gunning_fog(text)
|
181 |
|
182 |
return flesch_kincaid_grade, flesch_reading_ease, gunning_fog
|
183 |
|