Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which dialogue algorithm is adopted in this project? #64

Closed
muatik opened this issue Oct 18, 2015 · 6 comments
Closed

which dialogue algorithm is adopted in this project? #64

muatik opened this issue Oct 18, 2015 · 6 comments

Comments

@muatik
Copy link

muatik commented Oct 18, 2015

I am curious about which of the following features are available;

  • enriching or at least retaining a context during a dialogue
  • learning from humans
  • making prediction or/and deduction based on available knowledge

Another thing is: Is it just simple statement matcher in which user questions and bot questions have to be the exactly same?

For instance, suppose i trained the bot with:
q: "where is the post office? "
a: "it is right behind you"

and user may ask like this:
q: "looking for the post office"

What will the chatbot give to the user?

@gunthercox
Copy link
Owner

ChatterBot currently supports two different dialogue algorithms.

The first is the closest match algorithm that determines the similarity between the statement provided by the user and a set of known statements. For example, based on the sample input you provided, there is a 65% similarity between "where is the post office?" and "looking for the post office". The closest match algorithm selects the highest matching known statements and returns a response based on that selection.

The second is the closest meaning algorithm. This algorithm uses the wordnet functionality of nltk to determine the similarity of two statements based on the path similarity between each token in each statement. The sum of the path similarities is used so that the statement that has the closest path similarity (basically the closeness of synonyms) is returned.

  • In the case of both algorithms and the training examples you provided, the input of "looking for the post office" would match close enough to "where is the post office?" to return "it is right behind you".

So, to answer your questions about what functionality is available:

  • enriching or at least retaining a context during a dialogue
    (Currently not present.) ChatterBot does retain a copy of the current conversation and it a parameter that is provided to all logic adapters. However, it is currently not used. I have plans to create a new logic adapter that uses the context of the current conversation to alter the decision of what result is returned. This feature is most likely to be added next.
  • learning from humans
    (Yes) ChatterBot does have a readonly mode where it will not learn, however by default the ChatterBot will add to it's known selection of responses as an individual communicates with it. It maintains the context of what the statement was and what it was in response to. It also records the number of times a given response has occurred, a useful metric when selecting the most likely response to a given statement.
  • making prediction or/and deduction based on available knowledge
    (Yes) The logic that is currently available is more deduction based, but it just comes down to how each selection is chosen in a given response algorithm. In all cases, the current selection of response algorithms always go with the most likely response.

Additionally, creating new response algorithms is fairly simple. To create one, just define a class that completed this interface:

class MyLogicAdapter(LogicAdapter):
    def get(self, text, statement_list, current_conversation):
        # TODO
        return selected_statement

@muatik
Copy link
Author

muatik commented Oct 18, 2015

👍 very detailed explanation. I couldn't find this information anywhere, maybe you can consider to present it in this project's wiki pages.

@gunthercox
Copy link
Owner

Thank you, I am planning on making these updates to the documentation soon.

@gunthercox
Copy link
Owner

I have updated these sections in the wiki. Thank you for posting these questions, please let me know if there is anything else I can improve or clarify.

@muatik
Copy link
Author

muatik commented Oct 19, 2015

In near future, I may make some contribution to this project because I am planning to use something similar to chatterbot in one of my spare time works. Thank you.

@lock
Copy link

lock bot commented Mar 10, 2019

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.

@lock lock bot locked and limited conversation to collaborators Mar 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants