File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # sentimental_analyses
2- Tweet sentimental analyses
1+ # Sentimental analyses with MLFLOW and models Wrappers
32
3+ Tweet sentimental analyses with different models.
4+
5+ Four wrapper of models:
6+ - Logistic Regression
7+ - Random Forest
8+ - LightGBM
9+ - Bert
10+ - Roberta
11+ - LSTM
12+
13+ MLFlow is used to list all experiments and easily commpare results for several differents configurations and select the bests
14+
15+ Optuna is used to optimise parameters. It run a set of experiments with a variation of parameters and select the best configuration
16+ maximising the accuraty
17+
18+
19+ The app is dockerised and can be installed launching the command
20+ ``` bash
21+ docker compose up
22+ ```
23+ or to run in background
24+ ``` bash
25+ docker compose up -d
26+ ```
27+
28+ ## Access and architecture
29+ The application contains alerting system and monitoring on grafana on port 3000
30+ MLFLO
31+
32+ ## Installation in dev
433# Install uv (Rust package to fastly install package)
534``` bash
635curl -Ls https://astral.sh/uv/install.sh | bash
Original file line number Diff line number Diff line change 2323from sklearn .metrics import confusion_matrix , classification_report
2424from sklearn .ensemble import RandomForestClassifier
2525import seaborn as sns
26- from transformers import AutoTokenizer , AutoModelForSequenceClassification
26+ from transformers import AutoTokenizer , AutoModelForSequenceClassification , get_linear_schedule_with_warmup
2727import pandas as pd
2828from skopt import BayesSearchCV , gp_minimize
2929from skopt .space import Real , Categorical
@@ -421,8 +421,11 @@ def load_checkpoint(self):
421421 self .parralle_model ()
422422
423423 self .optimizer = torch .optim .Adam (self .model .parameters (), lr = self .lr )
424- self .scheduler = torch .optim .lr_scheduler .StepLR (
425- self .optimizer , step_size = 8 , gamma = 0.248
424+ total_steps = len (self .dataloader ) * self .epoch
425+ self .scheduler = get_linear_schedule_with_warmup (
426+ self .optimizer ,
427+ num_warmup_steps = int (0.1 * total_steps ), # 10% warmup
428+ num_training_steps = total_steps
426429 )
427430 self .criterion = torch .nn .CrossEntropyLoss ()
428431
You can’t perform that action at this time.
0 commit comments