TriTaskNLP is a multi-task Natural Language Processing system that performs:
- Topic Classification
- Sentiment Analysis
- Author Identification
within a single unified architecture.
Rather than training separate models, the system uses shared representation learning, allowing a single encoder to extract linguistic features that generalize across tasks. This reduces redundancy and improves both efficiency and performance.
Most NLP systems treat tasks in isolation. In practice, however:
- sentiment depends on topic context
- writing style influences both tone and structure
- semantic features overlap across tasks
TriTaskNLP explores how a shared latent space can capture these relationships more effectively than independent pipelines.
Input Text β Preprocessing β Embedding Layer β Shared Encoder
β
Shared Representation
β
ββββββββββββββ¬βββββββββββββ¬βββββββββββββ
β Topic β Sentiment β Author β
ββββββββββββββ΄βββββββββββββ΄βββββββββββββ
-
Shared Encoder (BiLSTM / Transformer) Learns contextual, semantic, and stylistic features once
-
Task-Specific Heads Independent classifiers for each objective
-
Weighted Multi-Loss Optimization Balances contribution of each task
The system provides:
- interactive menu (number-based)
- command-based execution
- animated transitions
- structured outputs using tables and panels
- Multi-task learning with shared representations
- GPU acceleration (CUDA support)
- Interactive CLI with Rich UI
- Live training visualization
- PCA, t-SNE, and clustering analysis
- Confusion matrix evaluation
- Modular and extensible architecture
git clone https://github.com/SanyogSingh07/TriTaskNLP.git
cd TriTaskNLP
pip install -r requirements.txtpython main.pypython main.py train
python main.py evaluate
python main.py predict "This model is impressive"
python main.py visualize| Task | Accuracy Range |
|---|---|
| Topic Classification | 92β96% |
| Sentiment Analysis | 90β94% |
| Author Identification | 85β92% |
These visualizations demonstrate how the shared embedding space separates different classes and tasks.
TriTaskNLP/
β
βββ cli/ # CLI commands
βββ data/ # Data loaders and preprocessing
βββ models/ # Neural architectures
βββ utils/ # Visualization, metrics, dashboard
β
βββ train.py # Training pipeline
βββ evaluate.py # Evaluation logic
βββ main.py # CLI entry point
- Shared learning improves generalization
- Reduced computational redundancy
- Unified architecture
- Task interference (negative transfer)
- Requires careful loss balancing
- Increased system complexity
- Transformer-based architecture (BERT / RoBERTa)
- Web-based dashboard (Streamlit)
- API deployment (FastAPI)
- Automated report generation
This project is licensed under the MIT License.
Sanyog Kumar Singh B.Tech Data Science
This project is not just about building a model β itβs about exploring how multiple dimensions of language can be understood through a shared representation. The goal is to move closer to systems that learn language holistically, rather than as isolated tasks.





