The purpose of this project is to predict the most relevent tag or topic for a question or text depends on pre-defined tags.
- Machine Learning
- Data Visualization
- Linear Support Vector Machine
- Python3
- MySql
- Pandas, jupyter
- Flask
using this code you can create tag prediction model, the main alg. used is Linear Support Vector Machine, and for database i used mysql.connector lib after training and create this prediction model you can deply it as flask app, to get best accurace you can automate the training process (use all data for training give us more accurace).
-
Clone this repo (for help see this tutorial).
-
Raw Data that used in stackoverflow example available here.
to get faster training process you can download data set one, and in examples/stackoverflow_data_example.py change the data source to your local dataset
-
Data transfaring/database fetching model are being kept here
-
Data pre-processing/transformation model are being kept here
-
model training and saving as pickle mdoel are being kept here
after install requered libs, to create model using stackoverflow data use this :
$ python3 examples/stackoverflow_data_example.py
to run api that provides prediction service using stackoverflow trained model use this :
$ python3 predictor_api.py
after run predictor_api.py create post request to localhost:5000/tags and add json object to request body
in console you can see request status 200 and prediction result is correct