To determine if a product is fake, we can implement a rule-based system that checks multiple indicators. Here's a Python function that evaluates a product based on key attributes:
def is_fake_product(product):
"""
Determines if a product is fake based on predefined rules.
Args:
product (dict): A dictionary containing product details with keys:
- 'price': float
- 'seller_rating': float (0-5 scale)
- 'description': str
- 'category': str
- 'avg_category_price': float (optional)
Returns:
bool: True if the product is likely fake, False otherwise.
"""
# Rule 1: Unusually low price (below 50% of category average)
if 'avg_category_price' in product:
if product['price'] < 0.5 * product['avg_category_price']:
return True
# Rule 2: Suspicious seller rating (below 3.0)
if product['seller_rating'] < 3.0:
return True
# Rule 3: Fake keywords in description
fake_keywords = {'fake', 'replica', 'imitation', 'counterfeit', 'knockoff'}
description = product['description'].lower()
if any(keyword in description for keyword in fake_keywords):
return True
# Rule 4: Unusual price-to-rating ratio
# Low-rated sellers with very low prices are high-risk
if product['seller_rating'] <= 2.0 and product['price'] < 20:
return True
return False
How It Works:
- Price Check: Compares the product's price to the average price for its category. If it's below 50% of the average, it's flagged as fake.
- Seller Rating: Checks if the seller's rating is below 3.0 (on a 5-point scale), indicating potential unreliability.
- Description Keywords: Scans the product description for terms like "fake," "replica," or "imitation."
- Combined Risk Factor: Flags products from low-rated sellers (≤2.0) priced under $20, as this combination strongly suggests fakes.
Example Usage:
'price': 99.99,
'seller_rating': 4.5,
'description': "Authentic leather wallet",
'category': 'accessories',
'avg_category_price': 120.0
}
print(is_fake_product(genuine)) # Output: False
# Fake product
fake = {
'price': 15.0,
'seller_rating': 2.0,
'description': "Fake designer imitation bag",
'category': 'accessories',
'avg_category_price': 150.0
}
print(is_fake_product(fake)) # Output: True
Key Notes:
- Customizable Rules: Adjust thresholds (e.g., price percentage, rating cutoff) based on your data.
- Data Requirements: For accurate results, include
avg_category_price(calculated from historical data). - Scalability: For large datasets, integrate this with a machine learning model trained on labeled fake/genuine products.
This approach provides a quick, rule-based initial screening to identify high-risk products before deeper analysis.
Request an On-site Audit / Inquiry