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:
Tokenizerfor text preprocessingpad_sequencesfor sequence paddingEmbeddingfor word representationsSimpleRNNfor sequence modelingDensewith sigmoid activation for binary output
The notebook follows these steps:
- Create a small labeled dataset of positive and negative sentences.
- Fit a tokenizer on the text data.
- Convert sentences to integer sequences.
- Pad all sequences to the same length.
- Build and compile a Simple RNN model.
- Train the model for a few epochs.
- Python 3.x
- NumPy
- Pandas
- TensorFlow
- Open
RNN.ipynbin Jupyter Notebook or VS Code or use Google Colab Notebook. - Make sure the required packages are installed.
- Run the cells from top to bottom.