Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 1.77 KB

README.md

File metadata and controls

64 lines (39 loc) · 1.77 KB

Yapping Classifier

The Yapping Classifier will classify your yapp either as a negative yapp or a positive yapp.

Example Usage:

To use this model on your project, you can follow this guide

1. Clone / download this repository

You can download this repostiory from GitHub, or clone it:

git clone https://github.com/ahsanzizan/yapping_classifier.git

2. Install the required packages (optional)

If you want to contribute / run the code

After installing the repository, you have to install the required packages from the requirements.txt file. Or just run

pip install

If you just want to use the model

You have to install Tensorflow to load the model because its based on the Tensorflow keras model.

pip install tensorflow

3. Use the model

Now that you've loaded the model, you can now use it to make predictions as such:

- Import the yapp_classifier

The yapp_classifier comes with several useful functions:

  1. clean_yapp for cleaning the input yapp
  2. preprocess_yapps for pre-processing the yapps so that the model understands what you're yapping about
  3. classify_yapp for classifying the yapp as either a negative or positive yapp, will return a confidence dictionary

- Initialize the model

from yapp_classifier import YappClassifier

yapp_classifier = YappClassifier(model_path='./models/yapping_classifier_model',
                                 tokenizer_path='./models/tokenizer.pickle',
                                 stemmer_path='./models/stemmer.pickle')

input_text = "I love you so much that even the moon knows"

# Output: '{'positive': 0.99788, 'negative': 0.00212}'
yapp_classifier.classify_yapp(input_text)

Author

Ahsan Awadullah Azizan - @ahsanzizan