0% found this document useful (0 votes)
22 views2 pages

Assignment 3 2

The assignment requires students to implement Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM) networks for sentiment analysis of movie reviews using the IMDb dataset. Students will preprocess the data, train both models, evaluate their performance, and compare the results. Optional tasks include hyperparameter tuning to enhance model performance.

Uploaded by

wolego7235
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Assignment 3 2

The assignment requires students to implement Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM) networks for sentiment analysis of movie reviews using the IMDb dataset. Students will preprocess the data, train both models, evaluate their performance, and compare the results. Optional tasks include hyperparameter tuning to enhance model performance.

Uploaded by

wolego7235
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Department of Computer Science

COMSATS University Islamabad


Fall 2024 - Artificial Neural Networks

Assignment 3
Due Date: December 16, 2024

Assignment: Implement Recurrent Neural Networks and Long


Short-term Memory for Text Processing

• Objective:
In this assignment, you will implement a Recurrent Neural Network (RNN) and a
Long Short-Term Memory (LSTM) network for Natural Language Processing (NLP)
tasks. Specifically, you will build models to perform text classification based on
sentiment analysis of movie reviews.
• Dataset:
You will use the IMDb movie reviews dataset, which consists of 50,000 labeled movie
reviews, split into 25,000 for training and 25,000 for testing. Each review is labeled as
positive or negative.
Dataset link: IMDb Dataset
Note: If the dataset is not accessible, you can use a similar dataset, such as from the
tensorflow_datasets library.
• Tasks:
• Data Preprocessing: Load the IMDb movie reviews dataset.
• Preprocess the text data:
• Tokenize the text, convert to sequences, and pad the sequences.
• Prepare the data for training and testing.
• RNN Implementation:
• Implement a simple Recurrent Neural Network (RNN) model.
• Compile the model with an appropriate loss function and optimizer.
• Train the RNN model on the training data.
• Evaluate the RNN model on the test data and report the accuracy.
• LSTM Implementation:
• Implement a Long Short-Term Memory (LSTM) network.
• Compile the model with an appropriate loss function and optimizer.
• Train the LSTM model on the training data.
• Evaluate the LSTM model on the test data and report the accuracy.
• Comparison:
• Compare the performance of the RNN and LSTM models.
• Discuss which model performs better and why.
• Optional - Hyperparameter Tuning:
• Experiment with different hyperparameters (e.g., number of layers, units,
dropout rates) to improve the model performance.
• Report the best configuration you found.

You might also like