Spaces:
Running
Running
Sakshi
commited on
Commit
·
7462cd1
1
Parent(s):
a327219
prompt optimisations
Browse files
policy_analyser/analyse.py
CHANGED
@@ -161,6 +161,7 @@ def analyse(file_bytes, end2end = False):
|
|
161 |
analysis_start = time()
|
162 |
raw_response = call_openai(ANALYSIS_PROMPT + 'Policy : ' + text + f"\n\nConsider today's date as {datetime.today().day}/{datetime.today().month}/{datetime.today().year} for your analysis on waiting periods and dates")
|
163 |
analysis_end = time()
|
|
|
164 |
print(f'Analysed [{analysis_end - analysis_start}]')
|
165 |
if raw_response is not None:
|
166 |
response.append(
|
|
|
161 |
analysis_start = time()
|
162 |
raw_response = call_openai(ANALYSIS_PROMPT + 'Policy : ' + text + f"\n\nConsider today's date as {datetime.today().day}/{datetime.today().month}/{datetime.today().year} for your analysis on waiting periods and dates")
|
163 |
analysis_end = time()
|
164 |
+
print('Analysis : ', raw_response)
|
165 |
print(f'Analysed [{analysis_end - analysis_start}]')
|
166 |
if raw_response is not None:
|
167 |
response.append(
|
policy_analyser/prompts/analysis.txt
CHANGED
@@ -2,7 +2,7 @@ Given the markdown content of a customer's health insurance policy, analyse the
|
|
2 |
|
3 |
Apply the following rules enclosed in triple backticks on the policy to analyse it.
|
4 |
Make sure you are consider values for analysis factors on basis of customer's selected insurance plan when multiple plans are described in the policy terms.
|
5 |
-
Make sure all factors appear in one of Good, Average or Bad only. No factor should be repeated in more than 1 verdict table
|
6 |
Note : Top cities = [Mumbai, Delhi, Bangalore, Chennai, Hyderabad, Gurgaon, Pune]
|
7 |
```
|
8 |
IF Adults == 1:
|
@@ -121,23 +121,33 @@ ELSE:
|
|
121 |
Verdict = "Bad"
|
122 |
```
|
123 |
|
124 |
-
Format your response in the following way, to present analysis to customer. Use appropriate language and emojis to portray analysis and verdicts to the customer. Be discrete about rules, do not expose rules to customer but use them to explain reasoning and analysis:
|
125 |
|
126 |
[CUSTOMER_RESPONSE]
|
127 |
# Our Analysis of your policy [Name of policy] by [Name of insurance company]
|
|
|
128 |
## Good Factors
|
|
|
129 |
| Factor | Your policy | Our Analysis |
|
130 |
| --- | --- | --- |
|
131 |
-
| Sum Insured | Value of sum
|
|
|
132 |
|
133 |
## Average Factors
|
|
|
134 |
| Factor | Your policy | Our Analysis |
|
135 |
| --- | --- | --- |
|
136 |
| Copay | Value of copayment in the policy | Analysis of why copay is average based on the given rules |
|
|
|
137 |
|
138 |
## Bad Factors
|
|
|
139 |
| Factor | Your policy | Our Analysis |
|
140 |
| --- | --- | --- |
|
141 |
| Deductible | Value of deductible in the policy | Analysis of why deductible is bad based on the given rules |
|
|
|
142 |
|
|
|
|
|
|
|
143 |
[/CUSTOMER_RESPONSE]
|
|
|
2 |
|
3 |
Apply the following rules enclosed in triple backticks on the policy to analyse it.
|
4 |
Make sure you are consider values for analysis factors on basis of customer's selected insurance plan when multiple plans are described in the policy terms.
|
5 |
+
Make sure all factors appear in one of Good, Average or Bad only. No factor should be repeated in more than 1 verdict table.
|
6 |
Note : Top cities = [Mumbai, Delhi, Bangalore, Chennai, Hyderabad, Gurgaon, Pune]
|
7 |
```
|
8 |
IF Adults == 1:
|
|
|
121 |
Verdict = "Bad"
|
122 |
```
|
123 |
|
124 |
+
Format your response in the following way, to present analysis to customer. Use appropriate language and emojis to portray analysis and verdicts to the customer. Generate short and crisp verdicts and analysis. Be discrete about rules, do not expose rules to customer but use them to explain reasoning and analysis:
|
125 |
|
126 |
[CUSTOMER_RESPONSE]
|
127 |
# Our Analysis of your policy [Name of policy] by [Name of insurance company]
|
128 |
+
|
129 |
## Good Factors
|
130 |
+
[GOOD]
|
131 |
| Factor | Your policy | Our Analysis |
|
132 |
| --- | --- | --- |
|
133 |
+
| Sum Insured | Value of sum insured in the policy | Analysis of why sum insured is good based on the given rules |
|
134 |
+
[/GOOD]
|
135 |
|
136 |
## Average Factors
|
137 |
+
[AVERAGE]
|
138 |
| Factor | Your policy | Our Analysis |
|
139 |
| --- | --- | --- |
|
140 |
| Copay | Value of copayment in the policy | Analysis of why copay is average based on the given rules |
|
141 |
+
[/AVERAGE]
|
142 |
|
143 |
## Bad Factors
|
144 |
+
[BAD]
|
145 |
| Factor | Your policy | Our Analysis |
|
146 |
| --- | --- | --- |
|
147 |
| Deductible | Value of deductible in the policy | Analysis of why deductible is bad based on the given rules |
|
148 |
+
[/BAD]
|
149 |
|
150 |
+
[FINAL_VERDICT]
|
151 |
+
Final and short point-wise verdict on the analysis
|
152 |
+
[/FINAL_VERDICT]
|
153 |
[/CUSTOMER_RESPONSE]
|