With the rapid growth of e-commerce platforms, online reviews have become a key factor influencing consumer decisions. However, the rise of deceptive or fake reviews has introduced serious challenges to trust, transparency, and platform reliability.
This project presents a machine learning-based framework for fake review detection using three different text representation techniques: Bag of Words, TF-IDF, and Word2Vec. Multiple classification models — Logistic Regression, SVM, Decision Tree, and Random Forest — are applied and compared to evaluate performance across representations.
Executive Summary
The results show that traditional approaches like Bag of Words with Logistic Regression (87.3% accuracy) and TF-IDF provide competitive performance with SVM (87.1% accuracy), but semantic-based representation using Word2Vec significantly improves classification accuracy, with SVM achieving the best performance (91.4% accuracy). These findings highlight the importance of capturing contextual meaning in text for more effective fake review detection.
Introduction
Online review ecosystems have become foundational infrastructure for modern digital commerce, directly influencing consumer trust, purchasing behavior, conversion rates, and long-term brand equity. As reliance on user-generated feedback intensifies, these systems have increasingly become targets for coordinated manipulation. Deceptive practices — including fabricated and incentivized generated reviews — introduce systemic bias into platform rankings, distort product perception, and erode the credibility of digital marketplaces. Addressing this challenge is critical to preserving the integrity and reliability of online ecosystems.
This work tackles the problem of deceptive review detection through a machine learning-driven framework developed and operationalized using Terno AI. The system is trained on the Fake Reviews Dataset by Maxwell from Kaggle, comprising approximately 40,000 labeled reviews balanced between genuine and computer-generated content. By leveraging advanced natural language processing (BoW, TF-IDF, and Word2Vec) techniques alongside supervised learning models, the framework identifies both linguistic irregularities and deeper semantic inconsistencies that are indicative of fraudulent behavior.
Unlike traditional approaches that rely on surface-level textual features, the proposed solution emphasizes richer feature representations, incorporating contextual embeddings and statistical patterns to improve robustness in noisy, real-world environments. Implemented within Terno AI, the pipeline enables efficient experimentation, model optimization, and deployment-ready workflows, supporting scalable and reproducible detection systems.
The proposed framework is designed for seamless integration into digital platforms, enabling continuous monitoring and near real-time filtering of suspicious reviews. Its adoption is particularly relevant for e-commerce platforms, marketplace operators, digital marketing teams, and trust & safety stakeholders seeking to safeguard platform integrity. By mitigating the impact of manipulative actors, this solution contributes to restoring consumer confidence, enhancing decision transparency, and promoting fair competition in increasingly complex digital marketplaces.
Dataset Description
This study is based on a publicly available Fake Reviews Dataset obtained from Kaggle, designed for analyzing deceptive opinion content in online platforms. The dataset was utilized within a machine learning pipeline to examine the impact of different text representation techniques on classification performance.
Data Volume:
40,432 total entries
40,420 entries after duplicate removal by Terno AI
Class Labels:
Original (OR): Genuine reviews written by real users
Computer-Generated (CG): Fake or deceptive reviews
Features:
Text: Unstructured textual content used for feature extraction and modeling
Category: Represents the type or domain of the product/service being reviewed
Rating: Numerical score given by the reviewer (typically on a scale such as 1–5)
Target Variable: A binary label indicating whether a review is authentic or deceptive.
Exploratory Data Analysis (EDA)
Target Variable Analysis
The dataset exhibits a nearly perfect class balance, with 20,205 fake reviews and 20,215 genuine reviews, resulting in an approximate 50:50 distribution. This balanced structure eliminates class imbalance issues, ensuring unbiased model training and reliable evaluation. Consequently, standard classification metrics such as accuracy, precision, recall, and F1-score remain meaningful and interpretable. Furthermore, the dataset provides an ideal foundation for training supervised machine learning models, enabling robust pattern learning and improved generalization in real-world deceptive review detection tasks.
Feature Variables Analysis
Rating Distribution by Review Label
The rating distribution analysis reveals a pronounced skew toward 5-star ratings for both fake and genuine reviews, with more than 60% of the total entries concentrated in the highest rating category. This indicates a strong overall positivity bias within the dataset, which is commonly observed in online review ecosystems. Notably, fake reviews demonstrate a marginally higher proportion of 5-star ratings compared to authentic reviews, suggesting their potential role in artificially inflating product reputation and influencing consumer perception.
Despite this slight difference, the overall rating distributions of fake and real reviews remain highly similar, with significant overlap across all rating levels. Lower ratings (1–3 stars) are relatively rare in both classes and do not exhibit any meaningful divergence, making them ineffective as distinguishing signals for detecting deceptive content. This overlap highlights a critical limitation of relying solely on rating-based features for classification tasks.
Consequently, these findings underscore the need for more advanced detection approaches that incorporate textual semantics, linguistic patterns, and user behavioral signals. Leveraging such multidimensional features can significantly enhance the robustness and accuracy of fake review detection systems, particularly in scenarios where superficial indicators like ratings fail to provide sufficient discriminatory power.
Category by Review Label
The category-wise analysis demonstrates that fake reviews are distributed across all product categories, indicating that deceptive practices are not confined to a specific domain. However, higher concentrations of fake reviews are observed in categories such as Kindle Store, Books, Pet Supplies, Home and Kitchen, and Electronics, which are typically high-demand and competitive markets. The relatively balanced distribution of fake and genuine reviews within each category suggests minimal category-specific bias, ensuring fair model training. Furthermore, digital and consumer-focused product categories appear more susceptible to manipulation, likely due to their high visibility and ease of generating large volumes of reviews.
Word Count Distribution: Fake vs Original Reviews
The histogram illustrates the distribution of review lengths (in word count) for both fake and original reviews. The distribution is highly right-skewed, with approximately 70–80% of reviews containing fewer than 100 words, indicating that most reviews are short. Only around 5–10% of reviews exceed 200 words, forming a long tail of detailed feedback.
A clear difference is observed between the two classes. Original reviews are generally longer, with an average length of ~73.6 words, compared to ~61.3 words for fake reviews (≈ 20% shorter). Similarly, the median length of original reviews (42 words) is higher than fake reviews (35 words), showing a consistent shift toward longer content.
In terms of distribution spread, the 75th percentile for original reviews (93 words) is noticeably higher than that of fake reviews (77 words), indicating that genuine reviews are more likely to include detailed descriptions. This suggests roughly a 15–20% increase in upper-range length for original reviews.
Fake reviews are heavily concentrated in the lower word count range, with a large proportion falling below 50 words, highlighting their tendency to be short and less informative. In contrast, original reviews are more evenly distributed and extend further into higher word counts, reflecting richer and more elaborate user feedback.
Despite some overlap between the two distributions, these findings indicate that word count provides moderate discriminative power. While it cannot independently separate fake and genuine reviews, it serves as a valuable supporting feature when combined with linguistic and behavioral signals.
Most Common Words in Fake and Original Reviews (Wordcloud Analysis)
The word cloud analysis reveals a significant lexical overlap between fake and genuine reviews, with both classes frequently using common terms such as "book," "read," "story," and "character." This suggests that deceptive reviews are designed to closely mimic authentic language. However, clear stylistic differences emerge upon closer examination. Genuine reviews tend to display greater linguistic diversity and contextual richness, often reflecting personal experiences and nuanced emotional expressions. In contrast, fake reviews rely more on generic, repetitive, and promotional phrases like "highly recommend" and "well written," indicating lower originality and depth.
Additionally, fake reviews often exhibit overly positive sentiment with limited variation, suggesting intentional exaggeration. Genuine reviews, on the other hand, include more context-specific vocabulary and mixed sentiments, enhancing their realism and credibility.
Despite these differences, the strong vocabulary overlap limits the effectiveness of simple word frequency-based methods. While word clouds are useful for visualization, they fail to capture deeper semantic and contextual patterns. Therefore, advanced techniques such as BoW, TF-IDF, Word2Vec, and contextual embeddings, combined with machine learning models, are necessary for accurate and reliable fake review detection.
Pair Plot of Text Features vs Review Label
The pair plot analysis highlights strong inter-feature correlations and reveals subtle distributional differences between fake and genuine reviews. While genuine reviews tend to be longer and more variable in structure, a substantial overlap persists between the two classes. This indicates that length-based features alone lack sufficient discriminative power, emphasizing the need for more advanced linguistic, semantic, and contextual features for effective fake review detection.
Methodology
Data Ingestion
The first stage involves collecting a high-quality dataset of reviews from reliable sources. The dataset consists of labeled instances categorized as genuine and fake reviews. Data is sourced from publicly available (Kaggle) datasets.
Data Preparation
Raw textual data is preprocessed to remove noise and standardize the input for modeling. Key preprocessing steps include:
Lowercasing: All text was converted to lowercase to maintain uniformity
Punctuation Removal: Special characters and punctuation marks were removed
Whitespace Trimming: Extra spaces were eliminated
Stopwords Removal: Common words (e.g., "the", "is") were removed to reduce noise
Lemmatization: Words were reduced to their base/root form
Tokenization: Text was split into individual words/tokens
Feature Engineering
Feature engineering focuses on extracting meaningful patterns from textual data that help distinguish fake reviews from genuine ones.
Word Embedding Techniques
To capture semantic meaning and contextual relationships, text data is transformed into numerical vectors using embedding techniques. The following methods are applied:
Bag of Words (BoW) — frequency-based representation
TF-IDF (Term Frequency–Inverse Document Frequency) — importance-weighted features
Word2Vec — semantic vector representations
Multi-Model Analysis
Multiple machine learning models are implemented to evaluate performance across different approaches.
Models Used: Logistic Regression, Support Vector Machine (SVM), Random Forest, Decision Tree
Evaluation Metrics
The final stage evaluates model performance using standard classification metrics.
Accuracy — overall correctness
Precision — correctness of predicted fake reviews
Recall — ability to detect actual fake reviews
Traditional Machine Learning Approach for Fake Review Detection (BoW and TF-IDF)
Advantages of Bag-of-Words and TF-IDF
Bag-of-Words (BoW) and TF-IDF provide simple and effective ways to convert textual data into numerical form for machine learning models. BoW represents text based on word frequency, while TF-IDF enhances this by giving more importance to informative words and reducing the impact of commonly occurring terms.
These techniques are computationally efficient and easy to implement, making them suitable for large datasets and baseline model development. They also work well with traditional classifiers such as Logistic Regression and SVM, often delivering reliable performance.
Additionally, both methods offer high interpretability, as the contribution of each word to the model can be easily understood, which is useful for analysis and evaluation in text classification tasks.
Text Preprocessing for Fake Review Detection
This study presents a machine learning-based approach for detecting fake reviews using natural language processing techniques. The dataset was first preprocessed by converting text to lowercase, removing punctuation, trimming extra spaces, eliminating stopwords, and applying lemmatization to standardize the text.
Bag-of-Words Approach for Fake Review Detection
The cleaned text was then transformed into numerical features using the Bag-of-Words (BoW) technique with a maximum feature limit of 10,000. The dataset was split into training and testing sets, and multiple classification models were trained, including Logistic Regression, Support Vector Machine (SVM), Decision Tree, and Random Forest.
| Model | ~Accuracy (%) | ~Precision (%) | ~Recall (%) |
|---|---|---|---|
| Logistic Regression | 87.39 | 87.28 | 87.54 |
| SVM | 86.04 | 85.45 | 86.87 |
| Decision Tree | 72.67 | 72.37 | 73.37 |
| Random Forest | 84.30 | 81.45 | 88.82 |
Figure 2.1: Model Comparison — Accuracy, Precision and Recall (BoW).
The performance of the models was evaluated using accuracy, precision, and recall. Logistic Regression achieved the best overall performance with an accuracy of approximately 87%, indicating better detection of fake reviews, followed closely by SVM (86%). Random Forest showed strong recall (84%), while Decision Tree performed comparatively lower (~72%).
TF-IDF Approach for Fake Review Detection
The cleaned text was transformed into numerical representations using the TF-IDF technique with a maximum feature limit of 10,000. The dataset was then divided into training and testing sets, and multiple classification models were implemented, including Logistic Regression, Support Vector Machine (SVM), Decision Tree, and Random Forest.
The models were evaluated using accuracy, precision, and recall. Logistic Regression achieved the best overall performance with an accuracy of approximately 87%, demonstrating a strong balance between precision and recall. SVM followed closely with similar performance (87%). Random Forest showed comparatively high recall (88%), indicating better detection capability, but with slightly lower precision. In contrast, the Decision Tree model performed the weakest, with accuracy around 75%.
| Model | ~Accuracy (%) | ~Precision (%) | ~Recall (%) |
|---|---|---|---|
| Logistic Regression | 87 | 87 | 88 |
| SVM | 87 | 86 | 87 |
| Decision Tree | 75 | 74 | 75 |
| Random Forest | 85 | 82 | 88 |
Figure 2.3: Model Comparison — Accuracy, Precision and Recall (TF-IDF).
Overall, the results demonstrate that traditional NLP preprocessing combined with classical machine learning models can effectively identify fake reviews, with Logistic Regression providing the most balanced performance.
Limitations of Bag-of-Words (BoW) and TF-IDF in Fake Review Detection
Bag-of-Words (BoW) and TF-IDF have certain limitations when applied to fake review detection. These techniques treat words independently and fail to capture semantic meaning and contextual relationships between words. As a result, they may misinterpret phrases where meaning depends on context, such as negations. Additionally, both methods ignore word order, which can further affect the understanding of review text.
Another limitation is that they produce high-dimensional and sparse feature vectors, increasing computational complexity. TF-IDF may also assign higher importance to less relevant or noisy words. Due to these limitations, BoW and TF-IDF are less effective in capturing deeper linguistic patterns compared to advanced embedding techniques like Word2Vec.
Word Embedding-Based Machine Learning Approach for Fake Review Detection (Word2Vec)
Benefits of Word2Vec in Text Classification
Word2Vec provides a more effective representation of textual data by capturing semantic relationships between words in a continuous vector space. Words with similar meanings are mapped closer together, allowing models to better understand context and overall sentence meaning.
Unlike BoW and TF-IDF, it generates dense and low-dimensional vectors, reducing sparsity and improving computational efficiency. It also captures contextual similarity, which helps in identifying subtle patterns and variations in review text. This richer representation of language enables machine learning models to achieve improved performance in tasks such as fake review detection.
Text Preprocessing
The raw review text was preprocessed to ensure consistency and improve data quality. All text was converted into lowercase to eliminate case sensitivity, followed by tokenization to split each review into individual words. The resulting tokenized text was then used for generating Word2Vec embeddings.
Word2Vec-Based Approach for Fake Review Detection
A Word2Vec model with a vector size of 100 was trained to generate dense word embeddings. Each word in the corpus was mapped to a 100-dimensional vector capturing semantic relationships. To obtain fixed-length representations for classification, review-level vectors were generated by averaging the embeddings of all words within each review.
These high-dimensional embeddings capture semantic relationships between words but are difficult to visualize directly. To address this, Principal Component Analysis (PCA) was applied to reduce the 100-dimensional vectors into 3 principal components (PCA1, PCA2, PCA3) while retaining the most important variance in the data.
The 3D plot shows the distribution of reviews after reducing 100-dimensional Word2Vec vectors into three principal components. The two classes exhibit significant overlap, indicating that fake and genuine reviews are not easily separable in the reduced space. This suggests that the dataset contains similar semantic patterns across classes and requires effective classification models for accurate detection.
Model Evaluation and Results
The dataset was evaluated using Word2Vec-based feature representations, and multiple classification models were implemented, including Logistic Regression, Support Vector Machine (SVM), Decision Tree, and XGBoost. The models were assessed using accuracy, precision, and recall.
Support Vector Machine (SVM) achieved the best overall performance with an accuracy of approximately 91%, demonstrating a strong balance between precision and recall. Logistic Regression and XGBoost followed closely with similar performance (~90%), indicating their effectiveness in handling semantic embeddings. In contrast, the Decision Tree model performed the weakest, with accuracy around 82%, reflecting its limited ability to generalize on high-dimensional Word2Vec features.
| Model | ~Accuracy (%) | ~Precision (%) | ~Recall (%) |
|---|---|---|---|
| Logistic Regression | 89.9 | 89.9 | 89.9 |
| SVM | 91.4 | 91.4 | 91.4 |
| Decision Tree | 81.8 | 81.8 | 81.8 |
| Random Forest | 89.9 | 89.9 | 89.9 |
Figure 2.5: Model Comparison — Accuracy, Precision and Recall (Word2Vec).
Overall, the results demonstrate that Word2Vec-based feature extraction combined with machine learning models can effectively identify fake reviews. Among all models, SVM provides the most balanced and highest performance, making it the most suitable choice for this approach.
This graph presents a 2D visualization of high-dimensional Word2Vec embeddings using t-SNE, where each point represents a review. The axes (tsne_1 and tsne_2) reflect relative similarity, meaning closer points indicate semantically similar reviews.
The visualization shows a significant overlap between classes, indicating that both types of reviews share similar language patterns, making classification challenging. However, partial clustering is observed in some regions, suggesting that the model captures certain distinguishing features.
The non-linear distribution of points supports the use of SVM, while the dense central region with mixed labels highlights ambiguous cases. In contrast, outer regions show better separation, representing more distinct and easily classifiable reviews.
Comparative Analysis: Traditional Approaches (BoW and TF-IDF) vs Word2Vec Approach
To ensure a fair evaluation, the best-performing model for each feature representation was selected. Logistic Regression was used with BoW and TF-IDF, while SVM showed the best performance with Word2Vec embeddings.
Among traditional approaches, BoW with Logistic Regression achieves slightly higher accuracy and precision, while TF-IDF with Logistic Regression shows marginally better recall. This indicates that both methods perform similarly, with minor trade-offs in evaluation metrics.
| Model / Feature Method | ~Accuracy (%) | ~Precision (%) | ~Recall (%) |
|---|---|---|---|
| BoW + Logistic Regression | 87.39 | 87.28 | 87.54 |
| TF-IDF + Logistic Regression | 87 | 87 | 88 |
| Word2Vec + SVM | 91.4 | 91.4 | 91.4 |
However, the Word2Vec + SVM model clearly outperforms both traditional approaches across all metrics, achieving the highest accuracy, precision, and recall (91.4%). This demonstrates the effectiveness of Word2Vec in capturing semantic relationships, enabling better discrimination between fake and genuine reviews.
Future Work
Future work will focus on integrating advanced contextual embedding techniques, such as transformer-based models, to improve the system's ability to capture semantic meaning and nuanced language patterns. Additionally, combining textual features with behavioral signals — such as user activity patterns, review frequency, and rating distributions — can provide a more comprehensive representation of review authenticity. Incorporating sequence-aware features, including n-grams, may further improve the model's ability to preserve word order and contextual relationships.
Read the full whitepaper
18 August 2026
The Honest Number Was 83%: Leakage, Abstention, and a Complaint Router You Can Actually Deploy
The same complaint-routing model scores 96.3% or 83.2% depending on which three columns you leave in the training data. The high number is the intake form being read back to you. This is what the leakage audit found before a single model was trained, why 83.2% is the honest figure, and how the same model — given permission to say "I don't know" — becomes deployable at 90.7% accuracy on 79.5% of traffic.
29 July 2026
EdgeGuard: AI-Driven Predictive Maintenance for Power Transformers
Power transformers are among the most critical assets in electrical distribution infrastructure. Their unexpected failure can result in power outages, safety hazards, equipment damage, expensive repairs, and long service interruptions. Traditional transformer maintenance practices often rely on periodic manual inspection, offline testing, or run-to-failure maintenance. These methods are expensive, slow, labor-intensive, and unable to detect rapidly developing faults in real time. EdgeGuard is an AI-driven, edge-computing predictive maintenance system designed to continuously monitor transformer health and forecast failures before catastrophic damage occurs. The system acts as a retrofittable “Digital Doctor” for distribution transformers by combining low-cost industrial sensors, an ESP32 microcontroller, local intelligence, machine learning-based risk prediction, autonomous relay control, and a real-time web dashboard. The proposed system monitors six major transformer health indicators: temperature, humidity, vibration, oil level, current, and voltage. These signals are normalized and processed through a Multi-Layer Perceptron neural network to classify transformer condition and estimate failure risk. If the predicted risk crosses a critical threshold of 80%, EdgeGuard automatically triggers a relay through GPIO 26 to isolate the transformer from the electrical network. The system also supports secure remote control, dashboard monitoring, API-key-based hardware authentication, JWT-based user access, WebSocket live updates, and automatic live-hardware detection. With an estimated deployment cost of approximately ₹3,850, EdgeGuard offers a low-cost alternative to conventional transformer monitoring systems. Its cloud-independent operation and edge-based decision-making make it especially useful for rural and semi-urban distribution grids where connectivity and maintenance resources are limited.
28 July 2026
ANALYZING TOXIC USER BEHAVIOR AND RISK PATTERNS IN ONLINE GAMING PLATFORMS
This study shows that behavioral data alone can't reliably predict gaming toxicity — but a risk-based model combining behavioral and engineered features does a much better job of flagging the small segment of high-risk users driving disproportionate harm.