Open Ended PS: The problem statement did not specify the kind of natural language queries that will be given to the system, so I built it for both kind of queries - simple and short / long and technical
Datasets
Classifier
Source
Size
Characteristics
Conceptual
Curated synthetic questions
246 samples
Short (10-50 words), natural language, paradigm-focused, no code
Technical
StackOverflow
57,235 train
Long format (100-250 tokens), code snippets, errors, real-world posts
Rationale: Conceptual uses dedicated dataset to capture paradigm phrasing without code noise. Technical uses StackOverflow for authentic debugging/implementation queries with rich technical context.
Quick Start
1. Install
pip install -r requirements.txt
2. Run Inference
Conceptual Classifier:
append your queries in the test_texts lists of concept-classifier/
Input text: 'Query: memory overhead of pointers in c/c++\t"I\'m on a 64bit platform, so all memory adrs are 8 bytes.\n\nSo to get an estimate of the memory usage of an array, should I add 8 bytes to the sizeof(DATATYPE) for each entry in the array.\n\nExample:\n\nshort unsigned int *ary = new short unsigned int[1000000]; //length 1mio\n//sizeof(short unsinged int) = 2bytes \n//sizeof(short unsinged int*) = 8 bytes\n\n\nSo does each entry take up 10bytes? and will my 1mio length array therefore use atleast 10megabytes?\n\nthanks\n\n'
============================================================
DEBUG: Model Outputs
============================================================
Token length: 151
Weights: CB=0.50, XGB=0.50
CodeBERT class probabilities:
Functional : 0.0002
Non-Paradigm : 0.0002
Oop : 0.0002
Procedural : 0.9994
→ Predicted: Procedural
XGBoost class probabilities:
Functional : 0.0018
Non-Paradigm : 0.0016
Oop : 0.0018
Procedural : 0.9947
→ Predicted: Procedural
Ensemble class probabilities:
Functional : 0.0010
Non-Paradigm : 0.0009
Oop : 0.0010
Procedural : 0.9971 ← FINAL
Project Structure
krkn-assi/
concept-classifier/ Ready to use (BAAI + SVM)
inference.py
svm_classifier.pkl
sentence_model_name.txt
technical-classifier/ Ready to use (CodeBERT + XGBoost)
inference.py
codebert_model/
xgboost_model.pkl
tfidf_vectorizer.pkl
training/ Training scripts (optional)
conceptual/
technical/
README.md
requirements.txt