Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,7 @@ def analyze_figure_of_speech(verse):
|
|
| 22 |
Return your answer as a JSON array where each element includes:
|
| 23 |
- "verses": the Bible verse in NJV,
|
| 24 |
- "figure": the type of figure of speech,
|
|
|
|
| 25 |
- "phrase": the exact phrase from the verse,
|
| 26 |
- "explanation": a brief explanation in the biblical context.
|
| 27 |
Bible Verse: "{verse}"
|
|
@@ -44,10 +45,9 @@ def analyze_figure_of_speech(verse):
|
|
| 44 |
if isinstance(output_json, list): # Ensure it's a list
|
| 45 |
# Extract and format only the values, skipping keys
|
| 46 |
formatted_output = "\n\n".join(
|
| 47 |
-
f"{item.get('
|
| 48 |
-
f"{item.get(
|
| 49 |
-
f
|
| 50 |
-
f"{item.get('explanation', '')}"
|
| 51 |
for item in output_json
|
| 52 |
)
|
| 53 |
return formatted_output
|
|
@@ -73,4 +73,4 @@ demo = gr.Interface(
|
|
| 73 |
)
|
| 74 |
|
| 75 |
if __name__ == "__main__":
|
| 76 |
-
demo.launch()
|
|
|
|
| 22 |
Return your answer as a JSON array where each element includes:
|
| 23 |
- "verses": the Bible verse in NJV,
|
| 24 |
- "figure": the type of figure of speech,
|
| 25 |
+
- "definition": define the figure of speech you identified,
|
| 26 |
- "phrase": the exact phrase from the verse,
|
| 27 |
- "explanation": a brief explanation in the biblical context.
|
| 28 |
Bible Verse: "{verse}"
|
|
|
|
| 45 |
if isinstance(output_json, list): # Ensure it's a list
|
| 46 |
# Extract and format only the values, skipping keys
|
| 47 |
formatted_output = "\n\n".join(
|
| 48 |
+
f"Figure: {item.get('figure', '')}\n"
|
| 49 |
+
f'Phrase: "{item.get("phrase", "")}"\n'
|
| 50 |
+
f"Explanation: {item.get('explanation', '')}"
|
|
|
|
| 51 |
for item in output_json
|
| 52 |
)
|
| 53 |
return formatted_output
|
|
|
|
| 73 |
)
|
| 74 |
|
| 75 |
if __name__ == "__main__":
|
| 76 |
+
demo.launch()
|