Skip to content

Text detoxification solutions for practical deep learning and machine learning assignment fall 2023 offered at Innopolis University Data Science and AI Bachelors 4th year.

Notifications You must be signed in to change notification settings

Jayveersinh-Raj/text-detoxification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jayveersinh Raj

BS20-DS01

To get the interim data from raw data

First, install the requirements in the environment, then navigate tosrc/data/make_dataset.py.

python3 make_dataset.py

The interim dataset would be stored in the data/interim directory in the root folder, which would be used for training the model, from this dataset itself test set would be split with a seed of 42.

To train the final solution model (bloom-3b-8bit-quantized-lora-adapter):

First, install the requirements in the environment, then navigate tosrc/models/train_model.py.

python3 train_model.py

The trained checkpoints will be stored in the models/bloom-detoxification/checkpoint-800/ of the root folder, the repository already has trained checpoints, if its trained again the checkpoints will be updated.

To use and check the model for inference (bloom-3b-8bit-quantized-lora-adapter):

Navigate tosrc/models/predict_model.py

python3 predict_model.py

You'll be asked for input of the toxic text, and the output would be both the toxic text and the corresponding result.

Example

image

Note:

It requires a GPU of atleast 16 GBs (free version of google colab would help) because of a 3 billion parameterized base large language model.

About

Text detoxification solutions for practical deep learning and machine learning assignment fall 2023 offered at Innopolis University Data Science and AI Bachelors 4th year.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published