Skip to content

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

Notifications You must be signed in to change notification settings

evanyui/IntentClassifier

Repository files navigation

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)

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages