Update spoken_module.py
Browse files- spoken_module.py +3 -3
spoken_module.py
CHANGED
|
@@ -20,9 +20,9 @@ def generate_feedback(transcript, language, goal="general improvement", focus_ar
|
|
| 20 |
|
| 21 |
prompt = f"""
|
| 22 |
You are a supportive communication coach helping a learner whose goal is: **{goal}**.
|
| 23 |
-
|
| 24 |
{focus_str}
|
| 25 |
-
Give a score out of 10 and a short explanation for each area.
|
| 26 |
Then provide:
|
| 27 |
- A detailed summary of strengths and improvement areas.
|
| 28 |
- One motivational line to end with. Do not specifically add motivational keyword, just add the line.
|
|
@@ -59,7 +59,7 @@ Transcript:
|
|
| 59 |
def render_empty_chart(title):
|
| 60 |
fig, ax = plt.subplots()
|
| 61 |
ax.set_title(title)
|
| 62 |
-
ax.text(0.5, 0.5, "No
|
| 63 |
ax.axis('off')
|
| 64 |
return fig
|
| 65 |
|
|
|
|
| 20 |
|
| 21 |
prompt = f"""
|
| 22 |
You are a supportive communication coach helping a learner whose goal is: **{goal}**.
|
| 23 |
+
First, return a JSON object of scores (0–10) for these areas:
|
| 24 |
{focus_str}
|
| 25 |
+
Evaluate the user's current speech based on these areas. Give a score out of 10 and a short explanation for each area.
|
| 26 |
Then provide:
|
| 27 |
- A detailed summary of strengths and improvement areas.
|
| 28 |
- One motivational line to end with. Do not specifically add motivational keyword, just add the line.
|
|
|
|
| 59 |
def render_empty_chart(title):
|
| 60 |
fig, ax = plt.subplots()
|
| 61 |
ax.set_title(title)
|
| 62 |
+
ax.text(0.5, 0.5, "No scores yet.\nSpeak again to generate progress!", ha='center', va='center', fontsize=12)
|
| 63 |
ax.axis('off')
|
| 64 |
return fig
|
| 65 |
|