An end-to-end solution for analyzing hotel customer reviews using artificial neural networks (ANN) and Ordinary Least Squares (OLS) regression. This platform provides a comprehensive ecosystem that enables researchers to advance sentiment analysis capabilities and allows developers to build and deploy sentiment analysis applications.
The platform focuses on efficient sentiment analysis through:
- Situational
model application Model training and validationModel refinement
Implementation is handled via Over-The-Air deployment of:
- AI/OLS models (
knowledge base) - Model activations (
activation base) - Training material (
learning base) - Analysis routines (
codeBase)
Our analysis is based on Booking.com reviews for hotels in Spain, comprising approximately 950 reviews. The collected features include:
- Customer review scores (1-10 scale)
- Review text classifications
- Free cancellation information
- Review counts and price metrics
- RΒ² score: 0.875 (87.5% variance explained)
- RMSE: 0.212 (average deviation of 0.21 points on 10-point scale)
- MAE: 0.161 (predictions off by 0.16 points on average)
- RΒ² score: 0.576 (57.6% variance explained)
- RMSE: 0.391
- MAE: 0.170
The Neural Network outperforms the OLS model due to its ability to capture non-linear relationships. While both models maintain consistent prediction accuracy (similar MAE), the Neural Network's lower RMSE indicates fewer extreme prediction errors.
pip install tensorflow==2.15.0
pip install pandas==2.1.4
pip install numpy==1.26.3
pip install matplotlib==3.8.2
pip install seaborn==0.13.1
pip install scikit-learn==1.3.2
pip install statsmodels==0.14.1- Install Docker Desktop from the official website
- Create required volume:
docker volume create ai_system- Pull Docker Images:
docker pull wasif89/knowledgebase_sentiment_analysis:latest
docker pull wasif89/codespace_sentiment_analysis:latestcode/
βββ scrape_reviews.py # Data collection script
βββ data_clean.ipynb # Preprocessing notebook
βββ train_model.py # Neural network implementation
βββ train_ols.py # OLS model implementation
data/
βββ hotels_list.csv # Raw data
βββ joint_data_collection.csv # Processed data
images/
βββ knowledgeBase_sentiment_analysis/ # Model container
βββ codeBase_sentiment_analysis/ # Data container
- review_text: Text sentiment (0-4)
- free_cancellation: Binary flag
- reviews_count_scaled: Normalized count
- price_scaled: Normalized price
For AI analysis:
cd scenarios/apply_ai_sentiment_analysis
docker-compose upFor OLS analysis:
cd ../apply_ols_sentiment_analysis
docker-compose upversion: '3'
services:
knowledgebase:
image: wasif89/knowledgebase_sentiment_analysis:latest
volumes:
- ai_system:/tmp
codespace:
image: wasif89/codespace_sentiment_analysis:latest
volumes:
- ai_system:/tmp
volumes:
ai_system:
external: trueThis repository is created and maintained by Mustafa Wasif as part of the course 'M. Grum: Advanced AI-based Application Systems' by the Junior Chair for Business Information Science, esp. AI-based Application Systems at University of Potsdam.
This project is licensed under the AGPL-3.0 license.