Spaces:
Runtime error
Runtime error
Commit
•
bb1fe6c
1
Parent(s):
7da8f9a
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def speed_reading_test(text):
|
4 |
+
# Calculate reading speed based on your existing logic (replace with your code)
|
5 |
+
word_count = len(text.split(" "))
|
6 |
+
# ... (rest of your reading speed calculation code)
|
7 |
+
|
8 |
+
# Display results using Gradio components
|
9 |
+
results = f"Your reading speed is {reading_speed} words per minute.\n" \
|
10 |
+
f"This aligns with the {reading_level} level.\n" \
|
11 |
+
f"Your reading speed is approximately {capped_percentage}% of the average reading speed."
|
12 |
+
return results
|
13 |
+
|
14 |
+
iface = gr.Interface(
|
15 |
+
fn=speed_reading_test,
|
16 |
+
inputs=[gr.Textbox(label="Enter text to read:")],
|
17 |
+
outputs="textbox",
|
18 |
+
title="Speed Reading Test",
|
19 |
+
description="Test your reading speed and get an estimate of your reading level."
|
20 |
+
)
|
21 |
+
|
22 |
+
iface.launch()
|