Giter Site home page Giter Site logo

daspartho / distillclassifier Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.02 MB

Easily generate synthetic data for classification tasks using LLMs

License: MIT License

Python 100.00%
classification distillation classification-models dataset-generation distillation-model distilling-the-knowledge nlp synthetic-data synthetic-dataset-generation text-classification large-language-models

distillclassifier's Introduction

DistillClassifier

About

DistillClassifier is a tool built on top of LLM-VM to easily generate synthetic data for classification tasks using LLMs for distilling LLM knowledge for classification task into much smaller and faster-to-run classification models.

This project was build for the ANARCHY October 2023 Hackathon. Checkout ANARCHY on their github and website.

Team Members:

Setup

clone the project from github

git clone https://github.com/daspartho/DistillClassifier

cd into the project

cd DistillClassifier

install LLM-VM

git clone https://github.com/anarchy-ai/LLM-VM.git
cd LLM-VM
pip3 install .
cd ..

install python dependencies

pip3 install -r requirements.txt

create an .env file and set OpenAI API key (if you want to use openai models) and Huggingface Hub Token (if you want to push the dataset to huggingface):

OPENAI_API_KEY=
HF_HUB_TOKEN=

Run

You can run the tool from command line like this:

python3 generation.py <columns> <n_examples> [-m <model>] [-f <filename>] [-r <repo>]

Arguments:

  • <columns>: Column information as a dictionary.
  • <n_examples>: Number of examples to be generated.
  • -m, --model: (Optional) Model name. Defaults to "chat_gpt".
  • -f, --filename: (Optional) Dataset filename. Defaults to "dataset.json".
  • -r, --repo: (Optional) HuggingFace repo ID". Defaults to "None"

Example:

python3 generation.py '{"text": "either spoiler or not spoiler text", "label": "if text is spoiler or not"}' 25 -m 'chat_gpt' -f 'dataset.json' -r 'spoiler_or_not'

or run the demo.py file directly:

python3 demo.py

example output dataset:

LICENSE

MIT

distillclassifier's People

Contributors

daspartho avatar kmj-007 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.