-
Notifications
You must be signed in to change notification settings - Fork 5
Political Stance Classification Wiki Page
This project has been implemented on PyCharm editor.
The python file which initiates the execution of the project is StanceMain.py, so you need to run that file.
In ml_utils.py, it exists more than one model to run many experiments and decide which one performs best. In this case, we use the SVM model with a linear kernel. For the features, again there are many alternatives under ml_utils, and we used TfIdf feature transformation with uni-bi-tri grams features.
After defining the model and features that will be running, now the build_model function under the class StanceClassifier will be called. This class is handled with several flags, each of which executes the corresponding flow: TRAIN, TEST, PREDICT.
Depending on the need, it is necessary to set the RUN_MODE flag under the globals.py Python file, which is the file including all of the settings for the project.
For the RUN_MODE==train, the training of the classifier will be done containing a set of Python operations including pre-processing steps, and training steps. For the training, you need to define the TRAIN_TYPE, which adjusts the iteration size of the running phase (k-fold, train-test split one-pass, etc). Once the training part is completed, you can store the model for later use on the TEST or PREDICT phase.
TEST and PREDICT flows are also managed by this class, all you need is to set the appropriate RUN_MODE flag, the classification performance will be reported in detail.