How erkan3034/nlpminiproject works
Main Components
a. User’s Telegram Client (Mobile/Desktop)
b. Telegram Bot API (External Service)
c. Bot Application (ItDesk.py)
• Update handler
• Command router
• NLP-style keyword matcher
d. Knowledge Base Module (bilgi_tabani.py)
• Data access functions (read/write)
• In-memory vs. file persistence (e.g., JSON or plain text)
e. Persistent Storage (flat files under the project directory)
f. Environment & Config
• TELEGRAM_BOT_TOKEN (env var)
• Third-party library: python-telegram-bot
Relationships & Data Flows
1) User sends a message in Telegram → goes to Telegram Bot API
2) API forwards Update to ItDesk.py via webhook or polling
3) ItDesk.py parses the Update, routes it to the appropriate handler:
• “Report Issue” → keyword extractor → knowledge base lookup
• “Add Solution” → knowledge base write
• “Unknown Questions” → knowledge base query
4) Handlers call functions in bilgi_tabani.py to fetch or store data
5) The bot assembles a response and sends it back through the Telegram Bot API → to the User
Architectural Patterns & Principles
• Separation of Concerns:
• ItDesk.py handles messaging and command logic
• bilgi_tabani.py handles data access and rule-based matching
• Rule-based NLP: keyword matching rather than ML pipeline
• Single Python process (no microservices) but modular code for easy extension
Relevant Technologies & Frameworks
• Language: Python 3.7+
• Telegram integration: python-telegram-bot library
• Data storage: flat files (no external DB)
• Environment config: OS env vars for secrets
Essential Elements Checklist
[ ] User (Telegram client)
[ ] Telegram Bot API (external)
[ ] Bot Application
• Update Receiver
• Command Router
• Response Generator
[ ] Knowledge Base Module
[ ] Persistent Storage (files)
[ ] Environment/Config