djuzeppe
djuzeppe - is a web-based AI Engine and AI Editor. Main goal of this project - Help to create and maintain your own web AI bots. AI Editor provides intuitive web-interface and handy tools for building AI Knowledge Bases. Editor supports multiuser development of each bot.
You can test AI bot "Natasha" on page: http://83.167.97.48/ai/ai.php.
Documentation for djuzeppe source code: http://83.167.97.48/ai_demo/devel_doc/html/index.html. Generated with doxygen.
System requirements: php, mySQL 5.
djuzeppe consists of 3 parts:
- AI Engine
- AI Editor
- Data Base
The main idea of this AI is – THEMES. Keywords and answers are not connected directly to each other. But there are list of themes. Each keyword or answer is connected to one or more themes. So in short, ai_engine get keywords from user question, select themes for this keywords and choose appropriate answer for this themes.
There are 3 variants of reaction on user questions (look AI Engine scheme).
- AI Engine selects only that answers which are connected to the largest quantity (combination) of used in the question themes. (In djuzeppe you can assigne several themes to answer. So this answers usually are most relevant.)
- AI Engine can't find answers which are connected for combination of used in question themes. Then Engine define which theme from question meets in log less. (There are table for logging all themes which were used in talks.) We suppose, that answer for most rare, uncommon theme is the most relevant (interesting).
- Finally, if AI Engine can't find any themes for keywords, then it use special predefined themes like "Bla-bla-bla". This theme is associated with dim, uncertain answers.
- To create your own AI go to page /ai/admin.php and login there. Default login –
admin, password – 12345678. You'll be transferred to /ai/ai.php page, but on top of it you'll see menu of AI Editor.
- In a fresh
installed project (after inserting fresh dump in a database) on page “Themes” (ai/theme.php) you’ll find
only 4 themes. They are predefined themes and each of them have
special keyword in comment column. By this keywords ai-engine finds
in database this predefined themes for special cases. Predefined keywords and cases:
- “repeatedquestion”
- Question was repeated
- “repeatedanswer”
- Question is copied robots answer
- “nosymbolsinquestion”
- Question contains no symbols
- “nothemesfoundforquestion”
- There is no themes in database for words in the question. AI
does’t understand the question.
- On page
“Answers” (ai/ans.php) click “Add answer”. Write new answer
for one of the predefined themes, don’t forget to check this theme
in the list. 2-3 answers for each theme at first will be enough. For
“repeatedanswer” you can write – “Don’t repeat my answers,
please”, for “nothemesfoundforquestion” – “I see” or
“Why do you think so?”.
- Then return on page “Themes”
(ai/theme.php). Add here some new themes: “Computers”, “Sport”,
“Weather”, “Time”, “Red squirrels”…
- Go to page
“Questions” (ai/quest.php). Here you can add new keywords. Each
keyword must contain only alphabet letters (no numbers, spaces,
dots…). For each keyword check only one appropriate theme.
- Go to page
“Answers” (ai/ans.php). Add new answers. This is very important that you can check several themes for each answer. User’s questions can contain several keywords, for this keywords ai-engine will search themes in the database. Exact answer for these themes is the most “clever” answer. So predict this combinations of themes and write for them ready answers.
-
So, insert into the database new themes, questions, answers and
experiment on it.
On page free.php you'll find a lists of themes, keywords and answers which are not connected.
Push.php is a special page for fast and handy adding packs of new
keywords and answers for combinations of themes. So, let us suppose,
that you want to add several keywords and answers for some idea,
thought, conception, situation. On quest.php and ans.php you can add
them one by one. But on push.php you just select theme or themes which
show the best correlation with you thought or situation and press "For
selected themes add keywords (questions) and answers" button. You'll
see a list of keyword and answers which are already connected for
selected themes and inputboxes for your new keywords and answers. Fill
this inputboxes and press "Push".
AI mind is located in the database. There are 8 tables: 6 for AI itself and 2 for logs and user accounts.
We provide two mySQL dumps for this database. One (provided for beginning your new AI ) contains only 11 predefined themes, some keywords, answers for example, user of the project “admin” and new user of database “apache”, their passwords - “12345678”. Another is dump of AI - “Natasha” from our first site http://83.167.97.48/ai/ai.php with 100 themes, 1050 keywords and 701 answers. Both dumps provided under GPL.
quest_tab
| quest_id |
serial, |
| quest_word |
character varying(255), |
| quest_komment |
text, |
| quest_time |
timestamp |
List of keywords (questions). Row contains keyword and comment.
quest_key_tab
| quest_key_id |
serial, |
| quest_keyid |
integer, |
| quest_theme_keyid |
integer, |
| quest_key_time |
timestamp |
Each row contains ID of keyword
(question) and ID of theme. This mean that keyword (question) and
theme are connected.
answer_tab
| answer_id |
serial, |
| answer_word |
text, |
| answer_komment |
text, |
| answer_time |
timestamp |
List of answers. Row contains answer
sentence and comment.
answer_key_tab
| answer_key_id |
serial, |
| answer_keyid |
integer, |
| answer_theme_keyid |
integer, |
| answer_key_time |
timestamp |
Each row contains ID of answer and ID
of theme. This mean that answer and theme are connected.
theme_tab
| theme_id |
serial, |
| theme_word |
text, |
| theme_komment |
text, |
| theme_time |
timestamp |
List of themes. Row contains theme's
name and comment.
log_theme_tab
| log_theme_id |
serial, |
| log_theme_ip |
text, |
| log_theme_sessid |
text, |
| log_themeid |
character varying(100), |
| log_theme_time |
timestamp |
All used themes from each questions are here. Row contains user's IP, user's session, theme ID.
log_tab
| log_id |
serial, |
| log_quest |
text, |
| log_answer |
text, |
| log_ip |
character varying(100), |
| log_time |
timestamp |
Log of all ai_bot talks. Each row contains question, answer and user's IP.
user_tab
| user_id |
serial, |
| user_name |
text, |
| user_pass |
text, |
| user_komment |
text, |
| user_time |
timestamp |
List of ai_editor users. Row contains user's name, password and some comments.
|
|
|
|