Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,7 +82,7 @@ Return only: safe OR unsafe.
|
|
| 82 |
def get_sentiment(review_text: str) -> str:
|
| 83 |
prompt = f"""
|
| 84 |
Classify sentiment of this review in English or Roman Urdu.
|
| 85 |
-
Return EXACTLY one word: positive, negative
|
| 86 |
|
| 87 |
Rules (priority order, MUST follow strictly):
|
| 88 |
|
|
@@ -95,31 +95,22 @@ Rules (priority order, MUST follow strictly):
|
|
| 95 |
shipping time, support, or Priceoye as a company/brand overall,
|
| 96 |
ALWAYS respond with "negative".
|
| 97 |
This overrides everything else except abusive language.
|
| 98 |
-
|
| 99 |
-
2A. If the review criticizes ONLY the product quality or features,
|
| 100 |
-
but clearly praises Priceoye's service, delivery, support, or company,
|
| 101 |
-
and does NOT contain abusive language,
|
| 102 |
-
respond with "positive".
|
| 103 |
|
| 104 |
3. If the review only criticizes or complains about a product
|
| 105 |
(e.g., "yeh phone bekaar hai", "battery weak hai","bohut ghatiya product")
|
| 106 |
but does NOT contain abusive words,
|
| 107 |
DO NOT treat it as negative β respond based on the overall tone:
|
| 108 |
-
- If it seems disappointed but polite β "
|
| 109 |
- If it praises other things β "positive"
|
| 110 |
|
| 111 |
4. If both positive and negative opinions are present but not directly about
|
| 112 |
-
Priceoye's website, service, or delivery β respond "
|
| 113 |
-
|
| 114 |
-
5. Otherwise:
|
| 115 |
-
- Respond "positive" if the review is praising.
|
| 116 |
-
- Respond "neutral" if it is neither.
|
| 117 |
|
| 118 |
-
|
| 119 |
or loss of trust related to the company or seller,
|
| 120 |
ALWAYS respond "negative" even if product praise exists.
|
| 121 |
|
| 122 |
-
|
| 123 |
Do NOT explain. Do NOT add anything else.
|
| 124 |
|
| 125 |
Review: {review_text}
|
|
|
|
| 82 |
def get_sentiment(review_text: str) -> str:
|
| 83 |
prompt = f"""
|
| 84 |
Classify sentiment of this review in English or Roman Urdu.
|
| 85 |
+
Return EXACTLY one word: positive, negative.
|
| 86 |
|
| 87 |
Rules (priority order, MUST follow strictly):
|
| 88 |
|
|
|
|
| 95 |
shipping time, support, or Priceoye as a company/brand overall,
|
| 96 |
ALWAYS respond with "negative".
|
| 97 |
This overrides everything else except abusive language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
3. If the review only criticizes or complains about a product
|
| 100 |
(e.g., "yeh phone bekaar hai", "battery weak hai","bohut ghatiya product")
|
| 101 |
but does NOT contain abusive words,
|
| 102 |
DO NOT treat it as negative β respond based on the overall tone:
|
| 103 |
+
- If it seems disappointed but polite β "positive"
|
| 104 |
- If it praises other things β "positive"
|
| 105 |
|
| 106 |
4. If both positive and negative opinions are present but not directly about
|
| 107 |
+
Priceoye's website, service, or delivery β respond "positive".
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
+
5. If the review mentions fraud, repacked, fake, reputation damage,
|
| 110 |
or loss of trust related to the company or seller,
|
| 111 |
ALWAYS respond "negative" even if product praise exists.
|
| 112 |
|
| 113 |
+
6. Respond with only one word.
|
| 114 |
Do NOT explain. Do NOT add anything else.
|
| 115 |
|
| 116 |
Review: {review_text}
|