An intelligent NLP-powered web application that automatically classifies software requirements into structured categories β saving time, reducing manual effort, and improving requirement engineering workflows.
π Launch App
Software requirement classification is a critical but tedious step in requirement engineering. This project uses Natural Language Processing (NLP) and a Naive Bayes classifier trained on labeled requirement data to instantly predict the type of any given requirement.
| Code | Category | Description |
|---|---|---|
FR |
Functional Requirement | What the system must do |
NFR |
Non-Functional Requirement | How the system must perform |
PE |
Performance Requirement | Speed, throughput, response time |
US |
Usability Requirement | Ease of use and accessibility |
A |
Assumption | Conditions assumed to be true |
L |
Limitation | Explicit system constraints |
PO |
Policy Requirement | Legal, regulatory, or organizational rules |
- β‘ Real-time prediction β instant classification as you type
- π Confidence score β shows model certainty for each prediction
- π Full explanations β each category includes a plain-English description
- π¨ Clean interactive UI β built with Streamlit, no setup required for end users
- π€ NLP-based β uses TF-IDF vectorization for robust text understanding
- π Category reference panel β all 7 categories always visible on screen
| Component | Technology |
|---|---|
| Language | Python 3.8+ |
| ML Model | Naive Bayes (MultinomialNB) |
| Vectorizer | TF-IDF (TfidfVectorizer) |
| Label Encoding | LabelEncoder (scikit-learn) |
| Web Framework | Streamlit |
| Model Persistence | Pickle |
User Input (text)
β
βΌ
TF-IDF Vectorizer βββ Converts text into numerical feature vector
β
βΌ
Naive Bayes Model βββ Predicts requirement category
β
βΌ
Label Encoder βββ Maps prediction back to human-readable label
β
βΌ
Result displayed with category name, code, description & confidence score
- User types or pastes a software requirement
- Text is preprocessed and converted into a TF-IDF feature vector
- The trained Naive Bayes model predicts the category
- The label encoder maps the numeric prediction back to a category code
- The UI displays the full category name, description, and confidence score
AI-Requirement-Classifier/
β
βββ app.py # Main Streamlit application
βββ re_nb_model.pkl # Trained Naive Bayes model
βββ tfidf_vectorizer.pkl # Fitted TF-IDF vectorizer
βββ label_encoder.pkl # Fitted label encoder
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Python 3.8 or higher
- pip
# 1. Clone the repository
git clone https://github.com/your-username/AI-Requirement-Classifier.git
# 2. Navigate into the project folder
cd AI-Requirement-Classifier
# 3. Install dependencies
pip install -r requirements.txt
# 4. Launch the app
streamlit run app.pyThe app will open automatically at http://localhost:8501
streamlit
scikit-learn
numpy
| Requirement Text | Predicted Category |
|---|---|
| "The system shall allow users to log in using email and password." | β FR β Functional Requirement |
| "The system must respond to all requests within 2 seconds under normal load." | β PE β Performance Requirement |
| "The UI shall be operable by users with no technical background." | β US β Usability Requirement |
| "The system shall be available 99.9% of the time." | β NFR β Non-Functional Requirement |
| "We assume all users will have internet access." | β A β Assumption |
| "All data storage must comply with GDPR regulations." | β PO β Policy Requirement |
| "The system does not support offline mode." | β L β Limitation |
- Algorithm: Multinomial Naive Bayes β well-suited for text classification tasks
- Vectorization: TF-IDF (Term FrequencyβInverse Document Frequency) captures word importance relative to the dataset
- Training data: Labeled software requirement dataset with 7 categories
- Persistence: Model, vectorizer, and encoder saved as
.pklfiles using Python'spicklemodule for fast loading at runtime
- Real-time single requirement classification
- Confidence score display
- Category reference panel
- Bulk classification via CSV upload
- Model accuracy improvements (SVM, BERT)
- Export results to CSV / PDF
- REST API endpoint for integration
- Support for more requirement categories
- Dark / light mode toggle
Huma
AI & Machine Learning Enthusiast π
Built as part of an NLP & Machine Learning project
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add your feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
This project is licensed under the MIT License β feel free to use, modify, and distribute.
β If you found this project helpful, please give it a star on GitHub β it means a lot!