TA
Tauses/EngageMachineLearning
Submitted as part of my Machine Learning exam.
Gaming Chatbot & Player Profiler
A compact Python toolkit for analysing gamers behavioural data and chatting with them through locally‑run Llama 2 models. The project demonstrates end‑to‑end ML: clustering, classification, sentiment analysis and an interactive recommendation bot. Using the K-means and RandomForest pipeline for optimal prediction capabilities.
Key Features
- Data profiling — K-Means clustering (
TrainProfiler.py) categorizes players into six intuitive segments. - Engagement prediction — Random-Forest classifier (
RFTrainBot.py) forecasts each player's engagement level. - Three chatbots
- Heavy — fully automated ML + Llama; uses regex to extract user features (
Chatbot_Heavy_Model.py). - Light — semi-automated, keyword-triggered ML for user-feature extraction (
Chatbot_Lighter_Model.py). - Stupid — rule-based fallback with canned responses (
Chatbot_Stupid.py).
- Heavy — fully automated ML + Llama; uses regex to extract user features (
- Sentiment and keyword tracking with NLTK.
- Local Llama 2 inference via llama-cpp-python (no external API keys required).
REQUIREMENTS
In order to run the light and heavy model, you must first install Visual Studio BuildTools for desktop. https://visualstudio.microsoft.com/visual-cpp-build-tools/ Under "Workloads" after installing the BuildTools Choose "Desktop Development with C++" and wait for it to install the packages.Now you should be able to run it.
Customising the Models
Wish to try my models?You can try editing the n_clusters in TrainProfiler.py.
There's quite a few other settings to mess around with aswell. Watch out for the context window, the max is 4096, setting it higher results in crashing the program.
On this page
Contributors
Created May 11, 2025
Updated June 28, 2025