Josebert commited on
Commit
eebcadd
·
verified ·
1 Parent(s): 5b14ccc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -18
app.py CHANGED
@@ -17,24 +17,16 @@ def analyze_figure_of_speech(verse):
17
  return "Please enter a Bible verse."
18
 
19
  # Construct a prompt to instruct the model to analyze figures of speech in the verse.
20
- prompt = f"""
21
- [INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in Bible figures of speech.
22
- Identify the literary device in the following verse (e.g., Synecdoche, Metonymy, Hyperbole, Simile, Paradox) and structure the response as JSON:
23
-
24
- {{
25
- "verse": "{verse}",
26
- "figure": "[Identify the figure of speech]",
27
- "explanation": "[Give a detailed yet concise explanation]",
28
- "examples": [
29
- {{
30
- "phrase": "[Highlight the specific phrase]",
31
- "analysis": "[Explain why this phrase fits the identified figure of speech]"
32
- }}
33
- ]
34
- }}
35
- [/INST]
36
- """
37
-
38
  payload = {"inputs": prompt, "parameters": {"max_new_tokens": 250, "temperature": 0.7, "top_p": 0.9}}
39
 
40
  try:
 
17
  return "Please enter a Bible verse."
18
 
19
  # Construct a prompt to instruct the model to analyze figures of speech in the verse.
20
+ prompt = f"""<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in Bible analysis.
21
+ Analyze the following Bible verse to identify any figures of speech (e.g., Metaphor, Synecdoche, Hyperbole, Simile, Paradox).
22
+ Return your answer as a JSON array where each element includes:
23
+ - "verses": the Bible verse reference,
24
+ - "figure": the type of figure of speech,
25
+ - "phrase": the exact phrase from the verse,
26
+ - "explanation": a brief explanation in biblical context.
27
+ Bible Verse: "{verse}"
28
+ [/INST] Figures:</s>"""
29
+
 
 
 
 
 
 
 
 
30
  payload = {"inputs": prompt, "parameters": {"max_new_tokens": 250, "temperature": 0.7, "top_p": 0.9}}
31
 
32
  try: