This repository contains two complete Python projects built with Hugging Face Transformers.
-
Text Classification Project (text_classification/) - Fine-tunes distilbert-base-uncased on a small sentiment dataset - Uses tokenization with padding and truncation - Trains with the Trainer API - Evaluates accuracy - Saves the trained model locally
-
Multi-Task Pipeline Project (project/) - Runs Sentiment Analysis, NER, and Summarization with pipeline() - Supports multiple sentence inputs - Returns structured JSON output - Includes optional CLI mode
transformers_nlp_suite/ ├── text_classification/ │ ├── data/ │ └── sentiment_dataset.csv │ ├── train.py │ ├── predict.py │ ├── requirements.txt │ └── README.md ├── project/ │ ├── main.py │ ├── utils.py │ ├── requirements.txt │ └── README.md ├── .gitignore └── README.md
- Clone Repository
bash git clone cd transformers_nlp_suite
bash cd text_classification pip install -r requirements.txt python train.py python predict.py --text "I love this product." --text "This is not good."
bash cd ../project pip install -r requirements.txt python main.py --text "Microsoft opened a new office in London." --text "The service was amazing."
bash git init git branch -M main git add . git commit -m "Add Transformers text classification and multi-task NLP projects" git remote add origin git push -u origin main
If a remote already exists, update and push with:
bash git add . git commit -m "Update project files" git push