by: Sk ML team
Set up the environment conda env create --file environment.yml conda activate tatar
Finetune the model: python ./script_models/finetune_mt0_tatar_lora.py
Run the detoxification python script_models/mt0_ranked_lexicon_penalty_v3.py --input ./input_data/test_inputs.tsv --out dev_mt0_ranked_lexicon_ft_ru_big.tsv --text-col tat_toxic --out-col tat_detox1 --lang tt --batch-size 8 --model ./mt0-xl-detox-orpo-tt-lora --n-candidates 32 --num-beams 32 --temperature 0.88 --top-p 0.81 --repetition-penalty 1.2 --sim-weight 1.14 --tox-weight 1.68 --lex-weight 0.63 --tox-threshold 0.3
Evaluate the result python ./scripts_metric/run_all_metrics.py --input ./dev_mt0_ranked_lexicon_ft_ru_big.tsv
We ran this pipeline on 1xNvidia-5090 & Intel Core Ultra 7 265 KF. It took ~10 minutes to recieve the results from scratch
Our final solution was based on mT0-XL model. Also, we used XLM-R for toxicity score computation, LaBSE and X-COMET for semantic similarity.
The pipeline was the following:
First, we preprocessed texts and removed some bad words of Tatar language (we googled them)
Next we used MT0 to generate n=32 candidates (detoxified texts for each sample)
Each candidate was scored by several criteria. The final score was the weighted sum of the following scores.
The best candidate was taken as a final answer for the sample
This pipeline was quite stable both on dev and test. But the final version included fine-tuning of the MT0 on its own answers for dev data. This fine-tuned model was applied to the test data then and we got the score of 0.67 on the test set.
We tuned hyperparameters such as weights for scoring, temperature, n_candidates, num_beams, top_p using latin hypercube algorithm (./script_models/tune_mt0_tatar.py)
11 commits
3 commits
Python
100.0%
by: Sk ML team
Set up the environment conda env create --file environment.yml conda activate tatar
Finetune the model: python ./script_models/finetune_mt0_tatar_lora.py
Run the detoxification python script_models/mt0_ranked_lexicon_penalty_v3.py --input ./input_data/test_inputs.tsv --out dev_mt0_ranked_lexicon_ft_ru_big.tsv --text-col tat_toxic --out-col tat_detox1 --lang tt --batch-size 8 --model ./mt0-xl-detox-orpo-tt-lora --n-candidates 32 --num-beams 32 --temperature 0.88 --top-p 0.81 --repetition-penalty 1.2 --sim-weight 1.14 --tox-weight 1.68 --lex-weight 0.63 --tox-threshold 0.3
Evaluate the result python ./scripts_metric/run_all_metrics.py --input ./dev_mt0_ranked_lexicon_ft_ru_big.tsv
We ran this pipeline on 1xNvidia-5090 & Intel Core Ultra 7 265 KF. It took ~10 minutes to recieve the results from scratch
Our final solution was based on mT0-XL model. Also, we used XLM-R for toxicity score computation, LaBSE and X-COMET for semantic similarity.
The pipeline was the following:
First, we preprocessed texts and removed some bad words of Tatar language (we googled them)
Next we used MT0 to generate n=32 candidates (detoxified texts for each sample)
Each candidate was scored by several criteria. The final score was the weighted sum of the following scores.
The best candidate was taken as a final answer for the sample
This pipeline was quite stable both on dev and test. But the final version included fine-tuning of the MT0 on its own answers for dev data. This fine-tuned model was applied to the test data then and we got the score of 0.67 on the test set.
We tuned hyperparameters such as weights for scoring, temperature, n_candidates, num_beams, top_p using latin hypercube algorithm (./script_models/tune_mt0_tatar.py)
11 commits
3 commits
Python
100.0%