{"id":20807580,"url":"https://github.com/vdoninav/nlp_practice","last_synced_at":"2026-04-22T11:07:18.582Z","repository":{"id":253185561,"uuid":"842740074","full_name":"vdoninav/nlp_practice","owner":"vdoninav","description":"ruGPT3Small chatbots in Telegram","archived":false,"fork":false,"pushed_at":"2024-08-19T17:05:32.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T22:48:53.066Z","etag":null,"topics":["ai","chatbot","gpt","gpt2","gpt3","nlp","pytelegrambotapi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vdoninav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-15T01:36:00.000Z","updated_at":"2024-08-19T20:48:21.000Z","dependencies_parsed_at":"2024-08-19T20:10:26.818Z","dependency_job_id":null,"html_url":"https://github.com/vdoninav/nlp_practice","commit_stats":null,"previous_names":["vdoninav/nlp_practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vdoninav/nlp_practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdoninav%2Fnlp_practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdoninav%2Fnlp_practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdoninav%2Fnlp_practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdoninav%2Fnlp_practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdoninav","download_url":"https://codeload.github.com/vdoninav/nlp_practice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdoninav%2Fnlp_practice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"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":["ai","chatbot","gpt","gpt2","gpt3","nlp","pytelegrambotapi"],"created_at":"2024-11-17T19:38:49.377Z","updated_at":"2026-04-22T11:07:18.560Z","avatar_url":"https://github.com/vdoninav.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLP Telegram Bots based on ruGPT3Small\n\n## Problem Statement:\nThe project aims to create Telegram bots capable of engaging in natural language conversations in a specific style or manner. The challenge is to fine-tune a pre-existing language model (ruGPT3Small) on custom datasets to adopt particular communication patterns or personalities. This involves:\n\n1. Collecting and preprocessing conversation data from specific sources.\n2. Fine-tuning the ruGPT3Small model on this data.\n3. Implementing the fine-tuned models in Telegram bots.\n4. Hosting these bots for user interaction.\n\n## Architecture:\n\n### Base Model:\n\nruGPT3Small, based on GPT-2 architecture\nPretrained on Russian language texts\n125 million parameters\n\n\n### Fine-tuning Process:\n\nUsed Hugging Face's Transformers library\nImplemented using PyTorch\nTraining script: run_clm.py (Causal Language Modeling)\n\n\n### Data Processing:\n\nCustom scripts (extract_messages_avtobus.py, extract_messages_polkson.py) for data extraction and preprocessing\n\nTokenization using GPT2Tokenizer\n\n\n## Bot Implementation:\n\nPython-based Telegram bots (bot_avtobus.py, bot_polkson.py)\nIntegration with fine-tuned models for response generation\n\n\n### Hosting:\n\nBots deployed on an vds server for continuous operation\n\n\n## Results:\n\n### Model Performance:\n\nTraining loss: 1.5335 (as seen in the training output)\nEvaluation perplexity: 61.5162\nAccuracy: 0.5105\n\n\n### Bot Functionality:\n\nTwo separate bots created: \"Avtobus\" and \"Polkson\"\n\nBots capable of generating responses in their respective styles\nImplemented features:\n\n1. Responding to direct messages\n\n2. Replying when mentioned in group chats\n\n3. An \"insanity mode\", when bots reply to all messages in a group, that can be toggled on/off\n\n\n\n\n### User Interaction:\n\nBots successfully deployed and accessible via Telegram\nCapable of engaging in conversations, mimicking specific communication styles based on their training data\n\n\n### Limitations:\n\nResponse generation limited to 128 tokens\nPotential for generating inappropriate content, requiring careful prompt engineering and possibly content filtering\n\n\n\nThe project successfully demonstrates the ability to fine-tune a pre-existing language model for specific conversational tasks and deploy it in a practical application through Telegram bots. The resulting bots can engage in conversations with users, adopting particular communication styles based on their training data.\nFor future improvements, considerations could include:\n\nExpanding the training dataset for better performance\nImplementing more sophisticated content filtering\nOptimizing the model for faster response times\nAdding more interactive features to the bots\n\nLink to finetuned models: https://drive.google.com/file/d/1ehw7yZp8GPQvVMrDfFpnkgz9P94T0aMF/view?usp=sharing\n\nBase language model used in this project: https://huggingface.co/ai-forever/rugpt3small_based_on_gpt2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdoninav%2Fnlp_practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdoninav%2Fnlp_practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdoninav%2Fnlp_practice/lists"}