Giter Club home page Giter Club logo

gpt-tweet-dataset-generator's Introduction

gpt-tweet-dataset-generator

Twitter から取得できる全ツイート履歴から GPT-* の fine-tuning 用データセットを生成するツール

Warning

プロンプト生成部分が未完成です。generatePrompt がうまく動かない (プロンプトエンジニアリングをする必要がある)

何をするやつ?

  • 全ツイート履歴から対話形式のデータセットを生成する
    • RT 直後のツイートは 「RT の内容」「直後のツイート」という会話形式のデータとする
    • そうでないツイートは「???」「ツイート」の「???」の部分を GPT-3.5 API で生成する (ここが現状うまくいってない)
  • 生成したデータセットは out ディレクトリに保存される

使い方

  1. Twitter から全ツイート履歴を取得する
  2. bun install
  3. 環境変数に適切な値を設定 (必要な環境変数は src/env.ts を参照)
    • .env を使用できます。
  4. Twitter から取得しているツイート履歴に含まれる tweets.jstweets-part-*.js などのファイル名を tweet-data-paths.txτ に追加
    • 例: tweet-data-paths.txt
      tweets.js
      tweets-part-1.js
      tweets-part-2.js
      
  5. bun start で実行
    • OpenAI API を叩くことに注意してください
    • 1Password を使用する場合は bun run start-with-op で実行できます

動作環境

Bun 1.0.26 (Bun 固有の機能を使用していないので、TypeScript 入れて適切にコンパイルすれば他のランタイムでも動くはず)

License

MIT

gpt-tweet-dataset-generator's People

Contributors

trpfrog 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.