My code uses KNN to categorize articles.
To run the code:
-
Make sure train.py, knn.py and tfidf.cpp are in the same directory
-
Compile C++ tfidf compenent by running g++ -std=c++17 -O2 -o tfidf tfidf.cpp
-
Run python trainme file (assumes numpy is already installed) python3 train.py
PS: 2 csv files are created for tfidf indexing, the program will ask you how to name them.