1ytic / news2emoji

GPT ❀️ fine-tuning scripts πŸ€” for predicting πŸ‘ the emoji reactions 🀑 for the news πŸ’©

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

News to emoji

This project demonstrates how to fine-tune OpenAI GPT models for news classification tasks. It also includes the source code for the Streamlit application, available online at news2emoji.

Scripts

The scripts have a numerical prefix associated with the execution order. Also, the Makefile includes few commands with the OpenAI CLI tool.

Dataset

The dataset consists of the short news messages extracted from the Telegram channel @varlamov_news. Each message has reactions with a maximum of 10 mutually exclusive emoticons. This means that the person can only select one emoji per news post.

completion_mapping = {
    "❀️": "heart",
    "πŸ‘": "positive",
    "πŸ‘Ž": "negative",
    "πŸ€”": "thinking",
    "😒": "cry",
    "🀣": "laughing",
    "😱": "scream",
    "🀬": "symbols",
    "🀑": "clown",
    "πŸ’©": "shit",
}

Classification models

In this task the model predicts a single token.

model trained tokens costs
ada 2,615,288 $1.05
curie 2,615,288 $7.85
davinci 653,822 $19.61

This chart shows the Validation loss.

Validation loss

This chart shows the Validation token accuracy.

Validation token accuracy

Generation models

In this task the model predicts a sequence of tokens.

model trained tokens costs
ada 1,721,474 $0.69
curie 1,721,474 $5.16

This chart shows the Validation loss.

Validation loss

spaCy baseline

The simple spaCy baseline model achieved only 36% accuracy.

spaCy tutorial

TODO

  • Fine-tune and evaluate more generations models
  • Build a strong baseline model

About

GPT ❀️ fine-tuning scripts πŸ€” for predicting πŸ‘ the emoji reactions 🀑 for the news πŸ’©


Languages

Language:Python 73.6%Language:Makefile 11.4%Language:TypeScript 10.2%Language:HTML 4.0%Language:Shell 0.8%