Improving the Model
Tips and advice on how to improve the BiLSTM model performance.
We'll cover the following
Chapter Goals:
- Learn how to improve the performance of the BiLSTM classifier
A. Model performance
The current iteration of the model will perform well on relatively simple datasets and can even perform adequately on larger datasets. However, there are still improvements that can be made to the model.
An easy way to improve the model would be to use more LSTM layers or hidden LSTM units. Our model only used a single LSTM layer with 512 hidden units, so adding more LSTM layers may benefit the model's performance. However, similar to adding hidden layers to a feed-forward neural network, it is important to make sure that additional LSTM layers don't lead to the model overfitting the training dataset.
B. Movie review sentiment analysis model
The code below runs a text classification model which has been implemented in the backend. The model classifies a given movie review as either positive or negative.
Paste in your own movie review to the text prompt and see whether the model thinks it’s positive or negative!
run_movie_model()
Enter the input below to be saved in file __ed_input.txt
Get hands-on with 1300+ tech skills courses.