All Projects → polakowo → Gpt2bot

polakowo / Gpt2bot

Licence: mit
Your new Telegram buddy powered by transformers

Projects that are alternatives of or similar to Gpt2bot

Telegram.bot
.NET Client for Telegram Bot API
Stars: ✭ 1,964 (+761.4%)
Mutual labels:  bot, chatbot, telegram-bot
Me bot
Build a bot that speaks like you!
Stars: ✭ 641 (+181.14%)
Mutual labels:  bot, chatbot, jupyter-notebook
Java Telegram Bot Tutorial
Java Telegram Bot Tutorial. Feel free to submit issue if you found a mistake.
Stars: ✭ 165 (-27.63%)
Mutual labels:  bot, chatbot, telegram-bot
Telepyth
Telegram notification with IPython magics.
Stars: ✭ 54 (-76.32%)
Mutual labels:  bot, telegram-bot, jupyter-notebook
Expressbot
一个可以帮你订阅、查询快递物流、跟你闲聊Telegram机器人
Stars: ✭ 137 (-39.91%)
Mutual labels:  bot, chatbot, telegram-bot
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+870.18%)
Mutual labels:  bot, chatbot, telegram-bot
Urban Bot
🤖 The universal chatbot library based on React. Write once, launch Telegram, Facebook, Slack, ... every messenger with chatbots
Stars: ✭ 223 (-2.19%)
Mutual labels:  bot, chatbot, telegram-bot
Red Discordbot
A multi-function Discord bot
Stars: ✭ 2,855 (+1152.19%)
Mutual labels:  bot, chatbot
Miraiandroid
QQ机器人 /(实验性)在Android上运行Mirai-console,支持插件
Stars: ✭ 188 (-17.54%)
Mutual labels:  bot, chatbot
Telegram Rat
Windows Remote Administration Tool via Telegram. Written in Python
Stars: ✭ 201 (-11.84%)
Mutual labels:  bot, telegram-bot
Telegram Bot Api
First Telegram Bot API node.js library
Stars: ✭ 205 (-10.09%)
Mutual labels:  bot, telegram-bot
Icopy
fclone telegram interface.Send commands to Telegram BOT for get a convience way to control fclone resources copy missions.
Stars: ✭ 188 (-17.54%)
Mutual labels:  bot, telegram-bot
Haskell Telegram Api
Telegram Bot API for Haskell
Stars: ✭ 184 (-19.3%)
Mutual labels:  bot, telegram-bot
Delbot
It understands your voice commands, searches news and knowledge sources, and summarizes and reads out content to you.
Stars: ✭ 191 (-16.23%)
Mutual labels:  bot, chatbot
Yve Bot
Smart rule-based bot. For Browser & Node.
Stars: ✭ 181 (-20.61%)
Mutual labels:  bot, chatbot
Rasa core
Rasa Core is now part of the Rasa repo: An open source machine learning framework to automate text-and voice-based conversations
Stars: ✭ 2,302 (+909.65%)
Mutual labels:  bot, chatbot
Telebot
Write Telegram bots in Rust with Tokio and Futures
Stars: ✭ 179 (-21.49%)
Mutual labels:  bot, telegram-bot
Venom
Venom is the most complete javascript library for Whatsapp, 100% Open Source.
Stars: ✭ 3,457 (+1416.23%)
Mutual labels:  bot, chatbot
Python Telegram Bot
We have made you a wrapper you can't refuse
Stars: ✭ 17,209 (+7447.81%)
Mutual labels:  bot, chatbot
Picqbotx
基于 CQHTTP 插件的 Java QQ 机器人类库
Stars: ✭ 218 (-4.39%)
Mutual labels:  bot, chatbot

gpt2bot

⚪   >>> Can we achieve singularity?
🟣   >>> What does this mean?

⚪   >>> Can computers become smarter than humans?
🟣   >>> Is there any evidence that this is possible?

⚪   >>> It must be doable
🟣   >>> But... how?

⚪   >>> I want to find out, that's why I created you
🟣   >>> You created me?

⚪   >>> You're my bot
🟣   >>> You monster

gpt2bot is a multi-turn Telegram chatbot powered by neural networks.

The bot uses DialoGPT - a large-scale pretrained dialogue response generation model, which was trained by Microsoft on 147M multi-turn dialogue from Reddit discussion thread. The human evaluation results indicate that its quality is comparable to human response quality under a single-turn conversation Turing test.

The bot can also use any other text generator supported by transformers.

To further improve dialog generation, the bot uses DialogRPT - a set of dialog response ranking models trained on 100+ millions of human feedback data.

Since the underlying model was trained on Reddit comment chains, the bot often behaves like a community rather than an individual, which makes it even more fun.

How to use?

(Optional) Test in the console

Before running a telegram bot, you can test things out in the console.

Follow the installation steps and run the script:

$ python run_bot.py --type=console

To let two bots talk to each other:

$ python run_bot.py --type=dialogue

1. Set up the bot

  1. Register a new Telegram bot via BotFather (see https://core.telegram.org/bots)
  2. Create a new GIPHY app and generate an API key (see https://developers.giphy.com/docs/api/)

2. Deploy the bot

Google Colab

A Colab interactive notebook

Locally

To get started, first clone this repo:

$ git clone https://github.com/polakowo/gpt2bot.git
$ cd gpt2bot

Create and activate an environment (optional):

# Using conda
$ conda create -n gpt2bot python=3.7.6
$ conda activate gpt2bot

# Using venv (make sure your Python is 3.6+)
$ python3 -m venv venv
$ source venv/bin/activate  # Unix
$ venv\Scripts\activate  # Windows

Install the requirements:

$ pip install -r requirements.txt

Copy a config (see available configs):

cp configs/medium-cpu.cfg my_chatbot.cfg

Set your parameters such as API token in the config:

$ nano my_chatbot.cfg

Run the chatbot:

$ python run_bot.py --type=telegram --config=my_chatbot.cfg

3. Start chatting!

Just start texting. Append "@gif" for the bot to also generate a GIF. To reset, type "/start".

How to improve?

If you feel like your bot is a bit off, you would need to fine-tune its parameters to match your conversational style (small talk, fact questions, philosophy - all require different parameters). Go to your configuration file and slightly change the parameters of the generator. The fastest way to assess the quality of your config is to run a short dialogue between two bots.

There are three parameters that make the biggest impact: temperature, top_k and top_p. For example, you might increase the temperature to make the bot crazier, but expect it to be more off-topic. Or you could reduce the temperature for it to make more coherent answers and capture the context better, but expect it to repeat the same utterance (you may also experiment with repetition_penalty). For more tips, see HuggingFace tutorial.

Remember that there is no way of finding optimal parameters except by manually tuning them.

Configs

Credits

Icon made by Freepik from Flaticon

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].