Helpful Review Predictor
The Helpful Review Predictor is a Python package that predicts the helpfulness of reviews using machine learning techniques. It takes textual reviews as input and provides a binary classification indicating whether the review is likely to be helpful or not. A prediction of 1 indicates a helpful review, while a prediction of 0 indicates a review that is not helpful.
For a comprehensive understanding of the model's training process and methodology, I have documented it in an academic research paper. To stay updated on the latest developments and access the research paper upon publication, I invite you to follow my LinkedIn profile: Mojtaba Maleki.
Dataset
The data used for training the model is sourced from the Amazon Electronics Reviews dataset available on Kaggle. This 5-core dataset contains product reviews from the Electronics category on Amazon from May 1996 to July 2014, totaling 1,689,188 entries.
The dataset is provided by Julian McAuley, UCSD, and is available here.
Features
-
Preprocesses textual reviews, including lowercasing, punctuation removal, contractions expansion, and lemmatization.
-
Utilizes TF-IDF vectorization to convert text data into numerical feature vectors.
-
Addresses class imbalance using Random Over Sampling.
-
Supports training and evaluation of multiple classifiers, including Gaussian Naive Bayes, Logistic Regression, and Decision Trees.
-
Performs hyperparameter tuning using Grid Search and Stratified K-Fold Cross Validation.
-
Provides visualization tools for comparing different classifiers and evaluating model performance.
-
Saves the best model and TF-IDF vectorizer for future use.
Installation
You can install the Helpful Review Predictor package using pip:
pip install helpful-review-predictor
Usage
from helpfulReviewPredictor import PredictHelpfulness
string_input = "Your input string here"
predictor = PredictHelpfulness(string_input)
result = predictor.get_result()
print(result) # Output: 1 for Helpful, 0 for Not Helpful
Requirements
-
joblib
-
numpy
-
scikit-learn
-
scipy
-
TfidfVectorizer from sklearn.feature_extraction.text
These changes provide more clarity about the purpose of the package, the dataset used, and the expected output. They also improve the formatting and readability of the document.
Metadata
Release files for helpful-review-predictor 6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| helpful_review_predictor-6.tar.gz | 2.1 MB | Without provenance | Details for helpful_review_predictor-6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| helpful_review_predictor-6-py3-none-any.whl | Python 3 | none | any | Details for helpful_review_predictor-6-py3-none-any.whl |
Total release size: 4.3 MB
Release files / helpful_review_predictor-6.tar.gz
| Download URL | helpful_review_predictor-6.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0058c3d26b13f47d33568b5131952d975a9309a5f2098b12f0e55d49f34da412
|
|
BLAKE2b-256 checksum How to use checksums |
b3b2becda502e6d6e0bf9826e8dbc873a0ef8d662dafdddb817f427f6f848257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.1
|
Release files / helpful_review_predictor-6-py3-none-any.whl
| Download URL | helpful_review_predictor-6-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
686c88a53d1ef225b493efccb55a10127ca14c4b52c2eb5059c37475b8aaedb9
|
|
BLAKE2b-256 checksum How to use checksums |
aa9bb3569d1cda5e47faad9dd7277dd0a14a90ecf65e9f25bf412a94c8a8abe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.1
|
Security for helpful-review-predictor 6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.