How koziev/chatbot works
Project type and purpose
• This is a dialog Q&A chatbot written in Python. It implements a “neurosymbolic” pipeline combining neural models (ruT5 text interpreter, sentence‐transformer retriever, ruGPT chitchat/reasoner, Rubert paraphrase detector) with a scripting engine (DSL rules & scenarios) and a plain-text facts knowledge base.
• The bot exposes multiple frontends (console, Flask REST, Telegram) and is delivered as a Docker image.
File‐structure analysis
• Top‐level:
• data/ – profiles, facts, rules, scenarios
• ruchatbot/
– bot/ – core pipeline code, base classes, model wrappers, conversation_engine.py
– frontend/ – adapters (console_chatbot, flask_service_bot, telegram_bot)
– scripting/ – DSL rule & scenario engine, matcher, generator
– utils/ – shared text utilities, tokenizer, lemmatizer, logging helpers
• docs/ – architecture write-ups, PDFs
• scripts/ – tg_bot.sh launch script
• dockerfile – container packaging
• Key orchestration: ruchatbot/bot/conversation_engine.py
• Models are wrapped under bot/: interpreter, retriever, chitchat, detectors, model_applicator
• Frontend adapters call ConversationEngine APIs and handle I/O.
README insights
• Describes 4 neural sub‐components + scripting engine.
• Profiles drive the knowledge base and constants injection.
• Rules (“greedy” and “smalltalk”) augment or override generative output.