This repository contains an ATIS (Airline Travel Information System) intent classification model built using deep learning techniques. The model is designed to classify user queries related to flight schedules, airfare, flight details, and more, into predefined intents such as atis_flight
, atis_airfare
, and atis_flight_time
.
- Project Overview
- Dataset
- Model Architecture
- Training
- Testing and Evaluation
- Usage
- Installation
- License
This project uses natural language processing (NLP) techniques and deep learning to classify flight-related queries into specific intents. The model is trained using the ATIS dataset and employs a Bidirectional LSTM network for intent classification.
- Intent Classification: Classify user queries into one of 8 intents.
- Accuracy: Achieves a test accuracy of 97% and high F1-scores for most intents.
- Model: Uses an embedding layer followed by two bidirectional LSTM layers and dense layers for classification.
The model is trained on the ATIS dataset, which consists of natural language queries related to flight details. The dataset is divided into:
- Training Data: 4,833 queries
- Testing Data: 799 queries
- Intent: The intent label (e.g.,
atis_flight
,atis_airfare
). - Query: The user's flight-related query.
The model architecture consists of the following layers:
- Embedding Layer: Converts words into 128-dimensional vectors.
- Bidirectional LSTM Layers: Capture contextual information from both directions of the input sequence.
- Dropout Layers: Help prevent overfitting by randomly dropping connections during training.
- Dense Layers: Final classification layer that outputs the predicted intent.
- Vocabulary Size: 872
- Max Sequence Length: 46
- Number of Classes (Intents): 8
- Total Parameters: 253,992 (All trainable)
- The model is trained for 10 epochs.
- Training Accuracy: Ranges from 96.25% (Epoch 1) to 98.77% (Epoch 10).
- Validation Accuracy: Peaked at 98.24%.
- Loss: Training loss decreased from 0.1218 to 0.0457, with minimal overfitting.
- The model shows excellent performance, but certain underrepresented classes such as
atis_quantity
andatis_flight_time
need more attention. - Training Accuracy: 98.77%
- Validation Accuracy: 98.24%
- Test Accuracy: 97%
- Precision, Recall, and F1-Score:
atis_flight
: Precision 0.99, Recall 0.98atis_airfare
: Precision 0.90, Recall 0.90atis_abbreviation
: Precision 0.94, Recall 1.00- F1-Scores are lower for some classes like
atis_quantity
(0.55) andatis_flight_time
(0.67).
To classify the intent of a query, use the predict_intent()
function. Example:
from intent_classifier import predict_intent
query = "show me flights from New York to Los Angeles"
intent = predict_intent(query)
print(f"Predicted Intent: {intent}")