ChatterBot backend

Created on 10 Jun 2017  路  3Comments  路  Source: gunthercox/ChatterBot

  1. Can you please shed some light on how chatter bot training works and how it chooses the utterance for a response.

I mean, do you use Neural networks, ML, deep learning or just some rule based (string distance -
levenshtein distance) methodologies?

  1. Is it contextual?

Thanks,
Yuval

Most helpful comment

  1. Neural networks :heavy_multiplication_x:
  2. ML :heavy_check_mark:
  3. Deep learning :heavy_multiplication_x:
  4. just some rule based (string distance -levenshtein distance) methodologies :heavy_check_mark:
  5. contextual :heavy_check_mark:

All 3 comments

So I just started delving into the backend, and I can share what I know with you. If you wanted to know the exact lines of code, you can find the relevant code in chatterbot.generate_response method. Basically, when you setup your chatbot instance, you should setup the logic adapters you want to use:

bot = ChatBot('Ava',
    logic_adapters=[
        {
            "import_path": "chatterbot.logic.BestMatch",
        "statement_comparison_function": "chatterbot.comparisons.levenshtein_distance",
            "response_selection_method": "chatterbot.response_selection.get_first_response"
        }
    ],
    filters=[
        'chatterbot.filters.RepetitiveResponseFilter'
    ]
)

In the above snippet, I use Levenshtein Distance for statement comparison, but I also use the Best Match algorithm for lookups, as well a last adapter for response selection. These logic adapters will be used after the preprocessor code (trim white space, escape chars, anything else you added) is executed.

Hope this helps!

  1. Neural networks :heavy_multiplication_x:
  2. ML :heavy_check_mark:
  3. Deep learning :heavy_multiplication_x:
  4. just some rule based (string distance -levenshtein distance) methodologies :heavy_check_mark:
  5. contextual :heavy_check_mark:

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings