An open API service indexing awesome lists of open source software.

https://github.com/samadpls/sentimentfinetuning

Efficient fine-tuned large language model (LLM) for the task of sentiment analysis using the IMDB dataset.
https://github.com/samadpls/sentimentfinetuning

finetuning huggingface llm low-rank-adaptation opensource sentiment-analysis transformer

Last synced: about 1 year ago
JSON representation

Efficient fine-tuned large language model (LLM) for the task of sentiment analysis using the IMDB dataset.

Awesome Lists containing this project

README

          

# Fine-Tuning LLM for Sentiment Analysis

This repository includes the steps I took to fine-tune a large language model (LLM) for sentiment analysis using the IMDB dataset. The process leverages Hugging Face's `transformers` and `datasets` libraries, as well as the `peft` library for parameter-efficient fine-tuning using LoRA (Low-Rank Adaptation).

The fine-tuned sentiment analysis model can be found on Hugging Face at: [samadpls/sentiment-analysis](https://huggingface.co/samadpls/sentiment-analysis).

## Model

We use the `distilbert-base-uncased` model as the base model for fine-tuning. The model is configured for sequence classification with two labels (positive and negative sentiment).

## LoRA Configuration

LoRA (Low-Rank Adaptation) is used to fine-tune the model efficiently by adding trainable low-rank adaptation matrices to certain model layers. The configuration parameters for LoRA used in this project are:

By leveraging LoRA, we achieve efficient fine-tuning with reduced computational resources, making it a key component of this project.

## Evaluation

The model's performance is evaluated using accuracy as the metric. The trained model is tested on a set of example texts to verify its predictions.

## Conclusion

I developed this project in 2023 while learning to run and fine-tune LLMs. This project serves as a starting point for fine-tuning LLMs. Using LoRA, we can efficiently fine-tune large models with reduced computational resources. Feel free to experiment with various models, datasets, and configurations to enhance your understanding and achieve better results.