Like Tree4Likes
  • 1 Post By failCprogrammer
  • 3 Post By anduril462

AI chat bot... C or C++?

This is a discussion on AI chat bot... C or C++? within the General AI Programming forums, part of the Cprogramming.com and AIHorizon.com's Artificial Intelligence Boards category; I've always wanted to make an AI chat bot, like Alice, but I'm not sure if I should do it ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    9

    AI chat bot... C or C++?

    I've always wanted to make an AI chat bot, like Alice, but I'm not sure if I should do it in C or C++. I started it in C, then quickly found out I need to know a lot more C before I can create it. I posted on a few forums here and there, and responses from there and as well as my AI professor to go with C++, because I can use classes. I don't mind learning a new language, and from looking at examples C++ doesn't look TOO different from C.

    So which language is best, C or C++? I would want my AI to be portable, so that I can distribute it to my friends and online.

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    9
    Also, I really need to know the entire language to make one? All I want to make is a simple response program, I enter 'Hello', it responds, etc. Maybe have it remember a few responses back, so it sounds better than most AI chat bots.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,565
    Did you decide that the help you got here wasn't sufficient? Did we not convince you that even a crappy chat bot is hard to make? If you want this bot to respond meaningfully, and not with random phrases, you're going to have to do some natural language processing (NLP). This involves, at the very least, parsing what the user types grammatically, determine traits for a word (i.e. does this word imply some sense of happiness, humor, tiredness, etc). And what about context? If the user types "It makes me happy", you have to remember what it refers to. That means tracing back through the conversation looking for the antecedent for that pronoun. Think of all the ways people open a conversation. There's hi, hello, hey, yo, what's up, sup, hows it going, whats new, and dozens more. And that's just the opener, where you don't have to worry about context. How many ways can the user answer "how are you?" You're jumping in the deep end, with a 10 ton weight tied to you, and you don't even know how to swim yet. You will sink in no time, and probably never want to get back in the water again. Stop even thinking about a chat bot. I'd guess it would take you a minimum of 6-12 months of very dedicated work/study to build the skills for this project.

    If, on the other hand, you are okay with your bot speaking a very narrow subset of English, then you can hack it with if-else. But you would have to severely limit your language to things like "hi", "hello" and "how are you", with responses like "good", "fine", "okay" and "bad". That's not really chatting though, more like following a script.

    As for your other question, syntactically, C and C++ are similar, with C++ almost being a superset of C. There are other differences though, some crucial. Read: Cprogramming.com FAQ > C and C++? and Differences Between C and C++ - Cprogramming.com. Both are very suitable, neither is more portable. Learn both, and especially learn the different paradigms, procedural programming using C and OOP using C++.

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    9
    Why is everyone on these forums so rude and mean wtf? I just want to know more about what the process of making a bot like this would consist of... holy crap. I already know I need to apply months of work before I can begin the process, but what's the harm in asking more about it? Even if I knew C/C++ inside and out, I'd still need some advice on making it... geeze
    Rehman khan likes this.

  5. #5
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,565
    I'm not trying to be rude or mean, but you don't seem to be listening to what we've been saying, hence the blunt tone. I'm not saying you wont get there, or that you can't do it. Just that now is not the time to focus on this. You aren't ready for a chat bot. It's like you've had your algebra lessons, and now want to design a space ship, but lack any understanding of trigenometry, calculus, astronomy and physics, making it difficult for us to communicate to you what you need to do to design/build the space ship, and difficult for you to glean any meaningful information from what we say. This is also as much a linguistics problem as it is a programming problem. You need a fairly thorough understanding of linguistics for this as well. Can you diagram a sentence? Do you know what morphology is? Do you know the formal grammar of the English language (or whatever language this bot will speak)?

    Our responses sounded "rude and mean" because any significant discussion on the topic sounds like a big waste of time on our part, because you don't sound anywhere near ready yet. Your passion and ambition are admirable, and I'm sure all the regulars here would like to see you succeed in this, and would even be happy to help, when the time comes. When you come back and demonstrate you are in a suitable place to start this project, you will get help.

    Read the following:Natural language processing - Wikipedia, the free encyclopedia. From the list of "Major tasks in NLP", I would think at a minimum you need:
    • Word segmentation and sentence breaking
    • Parsing
    • Part-of-speech tagging
    • Morphological segmentation and/or stemming
    • Natural language understanding
    • Coreference resolution
    • Sentiment analysis

    Yes, all those things, even for a simple chat bot. That is, if you want your chat bot to be able to chat about a number of things, instead of one or a very narrow range of subjects with a small, fixed vocabulary.

    It sounds like you're at a university. If NLP is a real passion of yours, take some linguistics classes. Look at all the CS and linguistic professor's web pages where they talk about research interests. Find the ones interested in NLP and talk to them.

    And no, you don't technically need to know "the entire language" to do this, but you probably need to know 90% or so. The other 10% are the obscure, unused features and stuff that will be trivial to learn by the time you've hit the 90% mark.

    EDIT: If you've taken a compilers class, or when you do, realize that this is much, much, much harder than that. Computer languages are very small and specific, both in vocabulary and grammar, and there is a little or no ambiguity -- the complete opposite of natural languages.
    Last edited by anduril462; 09-14-2011 at 11:58 AM.

  6. #6
    Registered User
    Join Date
    Sep 2011
    Posts
    9
    Alright, thanks for explaining. I bought Sams Teach Yourself C++ in One Hour a Day (6th Edition) by Jesse Liberty, it seemed to be include all the basics as well as advanced topics, so I will learn all of it and then come back to these forums in 6 months or so when I know 90% of C++. Thanks for being honest.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Chat Bot Help!!
    By arealfind08 in forum C Programming
    Replies: 1
    Last Post: 03-09-2009, 06:52 AM
  2. tcp/ip chat
    By gopal_85 in forum C Programming
    Replies: 12
    Last Post: 12-12-2007, 10:55 PM
  3. Chat
    By Driveway in forum C++ Programming
    Replies: 5
    Last Post: 06-18-2002, 05:57 PM
  4. AOL Chat
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 06-13-2002, 10:41 PM
  5. C/C++ Chat
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 09-20-2001, 02:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21