Automated review scanning, sentiment analysis, and anomaly detection for online stores.
import requests, json, time
from openai import OpenAI
API_BASE = "http://192.168.1.50:8000/v1"
client = OpenAI(base_url=API_BASE, api_key="not-needed")
SHOPEE_API = "https://partner.shopeemobile.com/api/v2"
def fetch_reviews(shop_id, days=7):
# Get recent reviews
resp = requests.get(f"{SHOPEE_API}/orders/get_escrow_detail")
return resp.json().get("reviews", [])
def analyze_sentiment(text):
resp = client.chat.completions.create(
model="llama-3.1-8b",
messages=[{"role":"user","content":
f"Classify this review sentiment (+/β/0): {text}"}])
return resp.choices[0].message.content
def flag_anomaly(review):
rules = ["bot pattern", "repeated text", "fake rating"]
return any(r in review.get("text","").lower() for r in rules)
while True:
reviews = fetch_reviews(shop_id="12345")
flagged = [r for r in reviews if flag_anomaly(r)]
for r in reviews[:10]:
sentiment = analyze_sentiment(r["text"])
print(json.dumps({"id":r["id"],"sentiment":sentiment}))
time.sleep(3600)
Basic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer β
Ask about AINNA pages, services and articles.
AINNA sources only Β· up to 5 lines Β· 20 questions/hour
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy