Views
No views yet
"Multi-class Review Rating Classification using Deep Recurrent Neural Network"
Junaid Hassan, Umar Shoaib
Neural Computing and Applications (Springer), 2019
DOI: 10.1007/s11063-019-10125-6
jniimi/tripadvisor-review-rating)| Metric | Value |
|---|---|
| Accuracy | 0.629 |
| F1 (weighted) | 0.618 |
| F1 (macro) | 0.518 |
| Method | Accuracy |
|---|---|
| WE-SimpleNN | 0.8024 |
| CNN | 0.7877 |
| LSTM | 0.8092 |
| CNN-LSTM | 0.7843 |
| DSWE-GRNN (paper) | 0.8132 |
max_len=128-200 vs paper's full review lengths1import torch
2from dswe_grnn import DSWE_GRNN, TextPreprocessor, Vocabulary
3
4# Load model checkpoint
5checkpoint = torch.load("dswe_grnn_hotel_5k.pt")
6model = DSWE_GRNN(
7 vocab_size=10489,
8 embedding_dim=32,
9 hidden_dim=64,
10 num_classes=5,
11 num_layers=2,
12 dropout=0.2
13)
14model.load_state_dict(checkpoint)
15model.eval()
16
17# Preprocess text
18preprocessor = TextPreprocessor()
19tokens = preprocessor.preprocess("Great hotel, amazing service and beautiful rooms!")dswe_grnn.py — Core model implementationrun_experiment.py — Training scriptresults_hotel_5k.json — Evaluation metricsdswe_grnn_hotel_5k.pt — Model weights1@article{hassan2019multicl ass,
2 title={Multi-class Review Rating Classification using Deep Recurrent Neural Network},
3 author={Hassan, Junaid and Shoaib, Umar},
4 journal={Neural Computing and Applications},
5 year={2019},
6 publisher={Springer},
7 doi={10.1007/s11063-019-10125-6}
8}