{"id":20812378,"url":"https://github.com/osmr/tgchatbot","last_synced_at":"2026-04-26T07:35:07.476Z","repository":{"id":131249500,"uuid":"410589770","full_name":"osmr/tgchatbot","owner":"osmr","description":"Telegram text/voice AI chatbot","archived":false,"fork":false,"pushed_at":"2021-12-22T09:09:13.000Z","size":90,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T04:45:25.731Z","etag":null,"topics":["asr","chatbot","nlp","nlu","telegram-bot","tts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-26T15:30:54.000Z","updated_at":"2024-05-21T04:10:56.000Z","dependencies_parsed_at":"2023-03-10T16:45:52.568Z","dependency_job_id":null,"html_url":"https://github.com/osmr/tgchatbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osmr/tgchatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmr%2Ftgchatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmr%2Ftgchatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmr%2Ftgchatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmr%2Ftgchatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osmr","download_url":"https://codeload.github.com/osmr/tgchatbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmr%2Ftgchatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32289926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T06:26:00.361Z","status":"ssl_error","status_checked_at":"2026-04-26T06:25:58.791Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asr","chatbot","nlp","nlu","telegram-bot","tts"],"created_at":"2024-11-17T20:53:44.000Z","updated_at":"2026-04-26T07:35:07.450Z","avatar_url":"https://github.com/osmr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram AI chatbot\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/osmr/tgchatbot/push-test)\n[![GitHub License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Python Version](https://img.shields.io/badge/python-3.7%2C3.8-lightgrey.svg)](https://github.com/osmr/tgchatbot)\n\nThis is a chatbot for the [Telegram](https://telegram.org) instance messenger, which uses various free conversational\nNatural Language Understanding, Automatic Speech Recognition and Text-To-Speech neural networks for different languages.\n\n## Used neural networks\n1. Text Conversational networks\n   1. Facebook's BlenderBot ([English](https://huggingface.co/facebook/blenderbot-400M-distill))\n   2. Microsoft's DialogGPT ([English](https://github.com/microsoft/DialoGPT), [French](https://huggingface.co/cedpsam/chatbot_fr), [Russian](https://huggingface.co/Grossmend/rudialogpt3_medium_based_on_gpt2))\n\n2. Text Neural Machine Translation\n   - MarianMT/OpusMT [models](https://github.com/Helsinki-NLP/Opus-MT)\n\n3. Text Punctuation and Capitalization\n   - NVIDIA NeMo Bert [models](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/nlp/punctuation_and_capitalization.html)\n\n4. Automatic Speech Recognition\n   1. PytorchCV QuartzNet [models](https://github.com/osmr/imgclsmob)\n   2. Facebook's Wav2Vec2 XLSR-53 [models](https://github.com/jonatasgrosman/wav2vec2-sprint)\n   3. Facebook's Speech to Text Transformer [models](https://github.com/pytorch/fairseq/tree/main/examples/speech_to_text)\n\n5. Text-To-Speech\n   1. NVIDIA NeMo TTS [models](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/tts/intro.html)\n   2. TensorSpeech TensorFlowTTS [models](https://github.com/TensorSpeech/TensorFlowTTS)\n\n6. Audio Language Identification\n   - ECAPA-TDNN [model](https://huggingface.co/TalTechNLP/voxlingua107-epaca-tdnn-ce)\n\n7. Audio Emotion Recognition\n   1. S3PRL's Wav2Vec2 based [model](https://huggingface.co/superb/wav2vec2-base-superb-er)\n   2. S3PRL's Hubert based [model](https://huggingface.co/superb/hubert-large-superb-er)\n\n## Used conversational AI cloud services\n1. Google [Cloud](https://cloud.google.com/)\n2. Amazon [Transcribe](https://aws.amazon.com/transcribe/) and [Polly](https://aws.amazon.com/polly/)\n3. Yandex [Cloud](https://cloud.yandex.com/en-ru/)\n\n## Deployment\n\n### Docker way\n\n1. Install docker engine (actual [instructions](https://docs.docker.com/engine/install/)):\n```\nsudo apt update\nsudo apt upgrade -y\nsudo apt dist-upgrade -y\nsudo apt autoremove -y\n\nsudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\n\nsudo apt update\nsudo apt-get install docker-ce docker-ce-cli containerd.io\n\nsudo systemctl status docker\n\nsudo usermod -aG docker $USER\nnewgrp docker\n```\n2. Install NVIDIA Container Toolkit (actual [instructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)):\n```\ndistribution=$(. /etc/os-release;echo $ID$VERSION_ID) \\\n   \u0026\u0026 curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \\\n   \u0026\u0026 curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list\nsudo apt update\nsudo apt install -y nvidia-container-toolkit\nsudo systemctl restart docker\n```\n3. Build docker image:\n```\ngit clone https://github.com/osmr/tgchatbot.git\ncd tgchatbot\ndocker build -t tgchatbot .\n```\n4. Run docker container (fill the `token` value):\n```\ndocker run -it --rm --name=tgchatbot1 tgchatbot --token=\"\u003cYour token\u003e\"\n```\nor\n```\ndocker run -it --rm --gpus=all --name=tgchatbot1 tgchatbot --token=\"\u003cYour token\u003e\" --use-cuda\n```\n\n### Virtualenv way\n\nNB: You need `Python` \u003e= 3.7 due to requirements of the `aiogram` and `SpeechBrain` packages.\n\n1. Install prerequisites:\n```\napt-get update \u0026\u0026 apt-get upgrade -y \u0026\u0026 apt-get autoremove\napt-get install -y libsndfile1-dev ffmpeg\n```\n2. Install virtualenv (actual [instructions](https://virtualenv.pypa.io/en/latest/installation.html)):\n```\nsudo -H pip install --upgrade pip setuptools wheel\nsudo -H pip install Cython\nsudo -H pip install virtualenv\n```\n3. Clone repo, create and activate environment:\n```\ngit clone https://github.com/osmr/tgchatbot.git\ncd tgchatbot\nvirtualenv venv\nsource venv/bin/activate\n```\n4. Install dependencies:\n```\npip install torch==1.9.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html\npip install -r requirements.txt\npip install TensorFlowTTS==1.8\npip install huggingface-hub==0.0.17 six==1.16.0\npip install --upgrade numpy llvmlite numba typing-extensions h5py\npip install pytest\npip install .\n```\n5. Run tests:\n```\npytest\n```\n6. Run the chatbot (fill the `token` value):\n```\npython -m tgchatbot.launch --token=\"\u003cYour token\u003e\"\ndocker run -it --rm --name=tgchatbot1 tgchatbot --token=\"\u003cYour token\u003e\"\n```\nor\n```\npython -m tgchatbot.launch --token=\"\u003cYour token\u003e\" --use-cuda\n```\n7. Deactivate environment:\n```\ndeactivate\n```\n\n## Chatbot commands in Telegram\n1. `/start` or `/help` - Welcome information.\n2. `/start en` - Set input/output language to `en` (English). It can be `en`, `fr`, `de`, and `ru`.\n3. `/lang` - Show current input/output languages status.\n4. `/lang_src` - Show current input (your messages or speech) language status.\n5. `/lang_dst` - Show current output (chatbot's messages and speech) language status.\n6. `/lang en` - Set input/output language to `en` (English).\n7. `/lang_src en` - Set input language to `en` (English).\n8. `/lang_dst en` - Set output language to `en` (English).\n9. `/tts` - Show current Text-To-Speech (TTS) activity status. It can be `yes` or `no`.\n10. `/tts yes` - Activate TTS.\n11. `/context` - Show contest for text (NLU) chatbot context corresponding the current user and output language.\n12. `/context \"\"` - Erase NLU chatbot contest.\n13. `Hello` - Text `Hello` to the chatbot. You can text amy message. \n13. `\u003cAudio with speech\u003e` - Say something to the chatbot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmr%2Ftgchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosmr%2Ftgchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmr%2Ftgchatbot/lists"}