/IntentClassifier

An easy-to-use intent classifier Python Interface using Naive Bayes Classifier from Textblob

Primary LanguagePython

IntentClassifier

An easy-to-use intent classifier Python Interface using Naive Bayes Classifier from Textblob

Make training data in the data folder with the following format in json:

{
  "name": (name of intent),
  "utterances": [(list of training phrases)],
  "responses": [(list of responses)]
}

Make testing data in the test folder:

{
  "tests": [
    {
      "utterance": (phrase for test),
      "intent": (intent name)
    },
    {
      (other testing data)
    } ...]
}


Create a classifier

r = IntentClassifier()

Train the classifier

r.train()
  • make sure your data folder contains the training data

Test for accuracy

r.test()
  • make sure your text folder contains the testing data

Classify a target

r.classify(text)

Get a response

r.response(text)