Giter Site home page Giter Site logo

imbalanced-llm's Introduction

Imbalanced-LLM

Classification of Imbalanced Data with LLM (Large Language Model)

This project code uses TabLLM and T-few project and its paper.

As an Undergraduate Researcher, I did not had the luxury to have over 30GB GPU, and did not want to spend money on Colab. So I had to modify lots of code and versionings to make it work on free tier Colab, and even locally with smaller LLMs.

If there are questions, please leave an issue on github to talk more about it, or email me at [email protected]

Version

  • This code is ran on Google Colab Free Tier. It will follow those versions.
  • Used Python Black Formatter

Folders

  • /.old: Old attempt for Imbalanced LLM. Testing Idea.
  • /bin: Shell code to run the project
  • /configs: Configuration Data, related to /src/utils/Config.py
  • /Datasets: Raw csv datasets (Not included, go to TabLLM Project)
  • /Datasets-serialized: Serialized datasets (Not included, go to TabLLM Project)
  • /exp_out: Your Train result (Not included)
  • /pretrained_checkpoints: Saved Model (Not included)
    • If using model T0 or T0_3b, get the file from TabLLM Project, turn on load_model() in EncoderDecoder() and add file
  • /src: Your Source
  • /templates:

Testing

This tutorial is modified from TabLLM Project.

We will use Google Colab Free Tier to run.

How to add your own Dataset

For my case, we will use stroke-prediction-dataset/data

1. Serialize Dataset

  • Run Make_Datset.ipynb Or
  • create_external_datasets.py --dataset stroke

2. Add files

  • Go to evaluate_external_dataset and add your dataset name on args_datasets variable
  • Make a new file called template_<datasetName> on templates folder. Use other templates as reference.
  • Go to bin/few-shot-pretrained-100k.sh and add your dataset on for dataset in <dataSetName>

Train/Fine Tune

  • Run TabLLM.ipynb

Get Result

For Stroke Dataset

  • python src/scripts/get_result_table.py -e t5_\* -d stroke

imbalanced-llm's People

Contributors

notjameshan avatar

Watchers

 avatar

imbalanced-llm's Issues

Train with setfit

Use setfit provided by hugging face and see if good to use for a few shots.
I will tweak some code to make it beneficial for our research of imbalanced data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.