winzip icon

A.I Program - Chatterbot Eliza v2.0 (c++ eliza)

Submitted on: 1/8/2015 4:33:00 AM
By: Gonzales Cenelia (from psc cd)  
Level: Advanced
User Rating: By 7 Users
Compatibility: C++ (general), Microsoft Visual C++
Views: 42289
     I HAVE POSTED THIS CODE TO SOME OTHER WEBSITES (CODEPROJECT.COM AND OTHERS) AND I HAVE RECEIVE SOME VERY GOOD FEEDBACKS ABOUT IT. I KNOW THAT THIS CHATBOT IS FAIRLY SMART, SO DONT FORGET TO VOTE FOR ME! This version of the program is smarter than ever, more new features have been added since the last submission and also now the conversation log between the users and the chatbot are automaticaly saved into the file: log.txt And finaly the "script file" (script.txt) wich acts as a knowledge base for the chatbot has been totaly rewritten and it is definitly better than in the previous versions of the program. These program is an Eliza like chatterbot,bots like Eliza are the results of researchs in Artificial Intelligence (more specificly: in NLP and NLU) NLP: Natural Language Processing, NLU: Natural Language Understanding The first chatterbot was published in 1966 by Joseph Weizenbaum a professor of MIT. ( And also,most of the chatterbots that have been written this days are largely based on the original chatterbot Eliza that was written by Joseph Weizenbaum which means that they use some appropriate keywords to select the responses to generate when they get new inputs from the users. More generaly,the technique that are in use in a "chatterbot database" or "script file" to represent the chatterbot knowledge is known as "Case Base Reasoning" or CBR. A very good example of an Eliza like chatterbot would be "Alice",these program has won the Loebner prize for most human chatterbot three times ( The goal of NLP and NLU is to create programs that are capable of understanding natural languages and also capable of processing it to get input from the user by "voice recognition" or to produce output by "text to speech". During the last decades there has been a lot of progress in the domains of "Voice Recognition" and "Text to Speech",however the goal of NLU that is to make software that are capable of showing a good level of understanding of "natural languages" in general seems quiet far to many A.I experts. The general view about this subject is that it would take at list many decades before any computer can begin to really understand "natural language" just as the humans do. These code is Copyrighted and has limited warranty. There are many interesting features in the current program,these chatterbot is capable of avoiding repetitions when selecting new responses,it can also follow the context of a conversation with a user. When the programs detect new keywords that are not part of the "script file", it saves it on the file "unknown.txt" and finaly it simulates a "human typist" when displaying responses on the screen. Actualy,there are many more features in the program,you will be capable of finding them by reading the "source code". The implementation of the program has been improved, the repetitions made by the program are better handled, the context in a conversation is also better handled, the program can now correct grammatical errors that can occure after conjugating verbs. Finaly, the database is bigger than the last time, it includes some of the script that originaly was used in the first implementation of the chatterbot Eliza by Joseph Weizenbaum.


INCLUDE files:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//INCLUDE files for :A.I Program - Chatterbot Eliza v2.0 (c++ eliza)
#include "recorder.h"
#include "strings.h"
#include "tokenizer.h"
#include <windows.h>
#include <sstream>
#include <fstream>
#include <stack>
#include <ctime>
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net

Other 6 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

3/5/2017 6:16:47 AMSabir

Hello , Respected Ma'm/Sir , Anyone have Documentation on ChatterBox C++ Code ??Thanks
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.