Ai chatbot using python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Davy jones
    New Member
    • Apr 2017
    • 2

    Ai chatbot using python

    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
    Code:
    while True:
        msg = raw_input(">>>>>")
    
        if msg in "hi""hello""sup""hey":
            print "hello"
        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":
            print "so long"
        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":
            print "i\'m fine"
        else:
            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???????"
  • hackr
    New Member
    • Apr 2017
    • 3

    #2
    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 personification s, 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.

    Comment

    Working...