Skip to content

Implementation of a Feedforward Neural Network for intent classification using only Python and NumPy. The model classifies user intents from text input using the Sonos NLU Benchmark dataset.

License

Notifications You must be signed in to change notification settings

lam1aa/Intent-classification-with-FNN

Repository files navigation

Intent Classification with Feedforward Neural Network

Overview | Features | Requirements | Project Structure | Usage | Implementation Details | Dataset

Overview

Implementation of a Feedforward Neural Network for intent classification using only Python and NumPy. The model classifies user intents from text input using the Sonos NLU Benchmark dataset.

Features

  • Bag-of-Words text representation
  • Neural Network implementation with:
    • Input layer
    • Hidden layer with ReLU activation
    • Output layer with Softmax activation
  • Training methods:
    • Batch gradient descent
    • Mini-batch gradient descent
    • Stochastic gradient descent

Requirements

  • Python
  • NumPy
  • matplotlib (for plotting)

Install requirements:

pip install -r requirements.txt

Project Structure

assignment2/
├── data/
│   └── dataset.csv
├── model/
│   ├── __init__.py
│   ├── ffnn.py
│   └── model_utils.py
├── assignment2.py
├── utils.py
└── helper.py

Usage

  1. Basic training with batch gradient descent:
python assignment2.py --train
  1. Training with mini-batch/stochastic gradient descent:
python assignment2.py --minibatch --train

Implementation Details

  • Learning rate: 0.005
  • Number of epochs: 1000
  • Mini-batch size: 64 (for mini-batch mode)
  • Hidden layer size: 150 neurons
  • Activation functions: ReLU (hidden layer), Softmax (output layer)
  • Loss function: Cross-entropy

Dataset

Uses the Sonos NLU Benchmark dataset under Creative Commons Zero v1.0 Universal license.

About

Implementation of a Feedforward Neural Network for intent classification using only Python and NumPy. The model classifies user intents from text input using the Sonos NLU Benchmark dataset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published