Josebert commited on
Commit
291f0c0
·
verified ·
1 Parent(s): c7a75ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -10
app.py CHANGED
@@ -17,16 +17,41 @@ 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"""<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in the analysis of Bible verses.
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 contains:
23
- - "verse": show the Bible verse in NKJV
24
- - "figure": the type of figure of speech,
25
- - "phrase": the exact phrase in the verse,
26
- - "explanation": a brief explanation of why it qualifies as that figure in a biblical context,
27
- - "parahrase": give different parahrase of the of the verse after explanation to help understand.
28
- Bible Verse: "{verse}"
29
- [/INST] Figures:</s>"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  payload = {
32
  "inputs": prompt,
 
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"""Y<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in the analysis of Bible verses.
21
+ Your task is to analyze the given Bible verse and determine if it contains a figure of speech such as Synecdoche, Metonymy, Hyperbole, Simile, or Paradox.
22
+
23
+ Follow this structured output format:
24
+
25
+ {
26
+ "verse": "[Provide the NKJV Bible verse]",
27
+ "figure": "[Identify the figure of speech]",
28
+ "explanation": "[Give a clear explanation similar to the reference examples]",
29
+ "examples": [
30
+ {
31
+ "phrase": "[Identify the phrase from the verse]",
32
+ "analysis": "[Explain why this phrase qualifies as the identified figure of speech]"
33
+ }
34
+ ]
35
+ }
36
+
37
+ Use the reference structure below to format your analysis:
38
+
39
+ Example:
40
+ {
41
+ "verse": "Acts 5:9 - 'The feet of those who have buried your husband are at the door…'",
42
+ "figure": "Synecdoche",
43
+ "explanation": "'Feet' here stands for the entire persons (the men) who buried her husband. It focuses on one part (their feet) to represent the whole person.",
44
+ "examples": [
45
+ {
46
+ "phrase": "feet",
47
+ "analysis": "The term 'feet' is used to represent the whole person."
48
+ }
49
+ ]
50
+ }
51
+
52
+ Now, analyze the following Bible verse:
53
+ "{verse}"
54
+ [/INST]</s>"""
55
 
56
  payload = {
57
  "inputs": prompt,