Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Folks have mentioned already that statefulness isn't a big component of typical chatbots:</p> <ul> <li><p>a pure Markov implementations may express a very loose sort of state if it is growing its lexicon and table in real time&mdash;earlier utterances by the human interlocutor may get regurgitated by chance later in the conversation&mdash;but the Markov model doesn't have any inherent mechanism for selecting or producing such responses.</p></li> <li><p>a parsing-based bot (e.g. ELIZA) generally attempts to respond to (some of the) semantic content of the most recent input from the user without significant regard for prior exchanges.</p></li> </ul> <p>That said, you certainly <i>can</i> add some amount of state to a chatbot, regardless of the input-parsing and statement-synthesis model you're using. How to do that depends a lot on what you want to accomplish with your statefulness, and that's not really clear from your question. A couple general ideas, however:</p> <ul> <li><p>Create a keyword stack. As your human offers input, parse out keywords from their statements/questions and throw those keywords onto a stack of some sort. When your chatbot fails to come up with something compelling to respond to in the most recent input&mdash;or, perhaps, just at random, to mix things up&mdash;go back to your stack, grab a previous keyword, and use that to seed your next synthesis. For bonus points, have the bot explicitly acknowledge that it's going back to a previous subject, e.g. "Wait, HUMAN, earlier you mentioned foo. [Sentence seeded by foo]".</p></li> <li><p>Build RPG-like dialogue logic into the bot. As your parsing human input, toggle flags for specific conversational prompts or content from the user and conditionally alter what the chatbot can talk about, or how it communicates. For example, a chatbot bristling (or scolding, or laughing) at foul language is fairly common; a chatbot that will get het up, and conditionally <i>remain so until apologized to</i>, would be an interesting stateful variation on this. Switch output to ALL CAPS, throw in confrontational rhetoric or demands or sobbing, etc.</p></li> </ul> <p>Can you clarify a little what you want the state to help you accomplish?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload