By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,091 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

Ai chatbot using python

P: 2
hey.. i have been learning python for like a month now...
(using zed shaw's lpthw)
(i'm in ex43 so i "THINK NOT SURE" that should be enough)
i know that i can make an ai chatbot
Expand|Select|Wrap|Line Numbers
  1. while True:
  2.     msg = raw_input(">>>>>")
  3.  
  4.     if msg in "hi""hello""sup""hey":
  5.         print "hello"
  6.     elif msg in "bye""gotta go""bye bye""byebye""bb""b b"" bb"" b b"" b b ""see you later""see you""see ya""cu""see u""c you""seeu""cyou":
  7.         print "so long"
  8.     elif msg in "what\'s up""what up""sup""how you doing""how you doin\'""how you doin""how are you""how are u""how r u""how ru""howru""howr u":
  9.         print "i\'m fine"
  10.     else:
  11.         print "some times i don\'t understand you"
using this infact i made one but cmn there should be any other
way to create one.. cuz i can't(i don't think anyone can) add every possible text for just hi and bye......
so all i am asking is,"is there any way to create an ai chatbot
with some small (smaller than this one) piece of code???????"
Apr 14 '17 #1
Share this Question
Share on Google+
1 Reply


P: 3
For learning Python visit here https://hackr.io/tutorials/learn-python

The boundaries of a bot
When you begin work on a conversational UI, even a trivial one, you’ll need to answer these fundamental design questions:

Domain knowledge: What does a user expect this bot to understand?
Personality: What tone or vocabulary does the bot employ?
Domain knowledge
True artificial intelligence does not exist, so while some AIs can imitate humans quite convincingly or answer some kinds of factual questions, all bots are restricted to a subset of topics or conversational gambits. IBM's Jeopardy-playing Watson “knew” facts and could construct realistic natural language responses, but it couldn’t schedule your meetings or deliver your groceries. Simpler commercial bots like SlackBot can successfully help users set up their Slack accounts, but aren’t designed to engage you in open-ended dialogue.

Personality
Bots have historically been personified as something less than fully human to excuse their rote responses and frustrating lack of comprehension. This can be an opportunity for creativity and playful invention—the first bot I helped design was modelled after a famous parrot—but it can also be a minefield of unexamined assumptions. It’s disappointing that so many bots are personified as female or teenagers, as if those groups were naturally subservient or not fully human. It’s probably better for everyone if your bot is personified simply as itself—a computer program—or something truly non-human.

Often the dual axes of domain and personality align: in the program ELIZA, the domain was a therapy session, and the bot’s personality was that of a Rogerian therapist. Domain and personality don’t necessarily need to be tightly coupled, though—an ecommerce bot needs to know about products, sizing, and order status, but that domain doesn’t imply any particular kind of personality. A shopping bot could have the persona of a helpful person, a cheerful kitten, or have no personality at all.

Meet “Brobot”
Having warned you away from human personifications, I’m going to break my own rule and create a bot with a particular set of well-known personality traits and interaction models. I’ll show you some introductory level chatbot techniques by writing software modeled after the dialectical capabilities of a brogrammer.

In this tutorial you can interact with Brobot by talking with it, and in some examples, you can override selected examples of its code to observe the effect on its behavior.
Apr 19 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.