View Code? Open in Web Editor
NEW
Pipeline for sentiment classification, use trainer of HuggingFace and use ONNX to export model
Python 36.40%
Jupyter Notebook 63.60%
sentiment-analysis's Introduction
Finetune pretrained model for Sentiment analysis
- Try some pretrained model:
- Architecture: XXXXForSequenceClassification
- Use Trainer of Huggingface to training model
- Use some optimization techniques to optimize ONNX - Optim
- See: pipeline/onnx_converter.py
- Note!!!
- Pass
model_class
to init class SentimentProcessor.
- Pass
n_folds
!= None if you want to training with K-fold validation
- If you use Bloom, you should pass
use_lora=True
- Export environment variables:
while read LINE; do export "$LINE"; done < .env
- Run training:
PRETRAINED_PATH=bigscience/bloom-560m CUDA_VISIBLE_DEVICES=1,2 python -m torch.distributed.launch --nproc_per_node 2 --master-port=30000 pipeline/trainer.py
sentiment-analysis's People
Contributors
Watchers