Spaces:
Sleeping
Sleeping
Commit
·
3df3121
1
Parent(s):
49d6242
fixed {detail:LLM analysis failed: ValueError: Invalid format specifier}
Browse files
app.py
CHANGED
|
@@ -530,16 +530,13 @@ CSV Data:
|
|
| 530 |
{csv_string}
|
| 531 |
|
| 532 |
Instructions:
|
| 533 |
-
1.
|
| 534 |
-
2. Provide a
|
| 535 |
-
3.
|
| 536 |
-
4.
|
| 537 |
-
5. Output ONLY valid JSON in this
|
| 538 |
-
6. Treat merchant names prefixed with "fraud_" as normal test data; do not interpret them as inherently suspicious.
|
| 539 |
-
7. Let the overall_fraud_score scale naturally: mostly safe datasets should be low, a few concerning entries slightly higher, and datasets with many high-risk transactions significantly higher. Avoid stating exact thresholds—use narrative judgment.
|
| 540 |
|
| 541 |
-
|
| 542 |
-
Focus on narrative-style, descriptive analysis and make the fraud_score percentages in the CSV the key reference points for your reasoning.
|
| 543 |
"""
|
| 544 |
|
| 545 |
# Generate with Gemini
|
|
|
|
| 530 |
{csv_string}
|
| 531 |
|
| 532 |
Instructions:
|
| 533 |
+
1. Determine an **overall fraud risk score** (0-1 scale) reflecting the dataset’s general risk. Scale the score naturally: mostly safe transactions → low score, a few high-risk → moderate, many high-risk → higher. Do not state exact thresholds.
|
| 534 |
+
2. Provide a detailed **insights** paragraph (150-200 words) describing patterns, anomalies, clusters, temporal or geographic trends, and merchant behaviors. Avoid listing exact counts or percentages.
|
| 535 |
+
3. Provide a detailed **recommendation** paragraph (100-150 words) suggesting practical actions to mitigate risk, including monitoring, alerts, or investigation. Keep guidance non-prescriptive about individual transactions.
|
| 536 |
+
4. Treat merchant names prefixed with "fraud_" as normal test data; do not interpret them as inherently suspicious.
|
| 537 |
+
5. Output ONLY valid JSON in this format: {{ "fraud_score": <float 0-1>, "insights": "<string insights paragraph>", "recommendation": "<string recommendation paragraph>" }}.
|
|
|
|
|
|
|
| 538 |
|
| 539 |
+
Focus on narrative-style, descriptive analysis and make the fraud score percentages in the CSV the key reference points for your reasoning.
|
|
|
|
| 540 |
"""
|
| 541 |
|
| 542 |
# Generate with Gemini
|