Skip to content

MAhmad25/Simple-RNN-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Simple RNN Implementation

This project contains a small TensorFlow/Keras notebook that demonstrates a text classification workflow with a Simple RNN.

The notebook builds a tiny sentiment dataset with positive and negative sentences, converts the text into token sequences, pads them to a fixed length, and trains a binary classifier using:

  • Tokenizer for text preprocessing
  • pad_sequences for sequence padding
  • Embedding for word representations
  • SimpleRNN for sequence modeling
  • Dense with sigmoid activation for binary output

Notebook Overview

The notebook follows these steps:

  1. Create a small labeled dataset of positive and negative sentences.
  2. Fit a tokenizer on the text data.
  3. Convert sentences to integer sequences.
  4. Pad all sequences to the same length.
  5. Build and compile a Simple RNN model.
  6. Train the model for a few epochs.

Requirements

  • Python 3.x
  • NumPy
  • Pandas
  • TensorFlow

How to Run

  1. Open RNN.ipynb in Jupyter Notebook or VS Code or use Google Colab Notebook.
  2. Make sure the required packages are installed.
  3. Run the cells from top to bottom.

Contributors