d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Chat Ai
1237Next
Add Reply New Topic New Poll
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 13 2016 03:49pm
I've been working on and off on a chat AI for a while and I've hit a brick wall with what I can further accomplish with it. This AI is not special by any means and have been done many times before, but I can't find any more knowledge on how to make it more complete.

My current platform is a Markov Chain based SQL backed database in which I can train from various sources. The problem I am facing as of right now is how to generate responses that relate to the input subject. For example in the current state of the project I can seed the chain with "Hello my name is abduct" and through the NLP library pull apart the subject and verbs to seed the Markov chain, but it would generate something completely non related to the input. Which is more or less due to how Markov Chains work in a random selection state.

Through my research so far the only way people have gotten around this is by creating a markup language (ALICE, CHATSCRIPT, etc) of question+answer pairs with wildcard matching allowing users to create large databases of input/output responses. This makes it easy to output related data based on the input, but there is no real way to vary the output based on what the trained database as learned. Furthermore training such a question+answer database is difficult since it more or less has to be done by hand.

-------------------------------------------------------------------------------------------------------------

Does anyone have any papers or research material that may lead to a suitable answer to this problem?

I've thought about tagging my database somehow so that when it stores the Markov chains given a specific subject and seed the chain will lead more heavily down a specific path instead of purely random. Although I am not sure how I would format my database to achieve this since there are so many subjects in English, and not to mention subjects that are the same but use different words, it would become a huge mess to try to tag and weight all the chains based on this method.

-------------------------------------------------------------------------------------------------------------

By this point, I don't think Markov chains are what I need to be using for such a AI and I should be looking into some other predictive models.

This post was edited by AbDuCt on Mar 13 2016 04:11pm
Member
Posts: 62,215
Joined: Jun 3 2007
Gold: 9,039.20
Mar 13 2016 06:02pm
babies first IRC bot
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 13 2016 06:55pm
Quote (j0ltk0la @ Mar 13 2016 08:02pm)
babies first IRC bot


This has nothing to do with IRC lol.
Member
Posts: 62,215
Joined: Jun 3 2007
Gold: 9,039.20
Mar 13 2016 07:41pm
Quote (AbDuCt @ Mar 13 2016 06:55pm)
This has nothing to do with IRC lol.


put your loli in markov chains
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 13 2016 08:42pm
Quote (j0ltk0la @ Mar 13 2016 09:41pm)
put your loli in markov chains


Trying to, but for some reason she keeps blushing and saying "not now senpai".
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 14 2016 08:05pm
I had a new idea to try to solve this. Although it completely disregards the self learning aspect (unlike my first attempt which could be trained off of almost any chat source) it can still be semi easily trained.

I am going to take the ideas from AIML and ChatScript in which are based off question answer pairs, but for each question match the answer will consist of Markov chains. This means that if the AI matches "Hello", it will search for all chains that belong to that question, then randomly follow them to generate an answer related to "Hello".

A more practical example may be:

Code

Q: "I like the color red"
Marchov chains that were prior learned
-> "I do too", "So do I", "I don't like that one", "I don't prefer that one", "I don't prefer that shade"
A: I do I don't prefer that one (Or some shit like that).


This allows for self creation of unique responses based on prior answers/responses to the initial match. The downside is you have to train the input/output matches by hand for the first long while since it is hard to come across chat sequences where a person talks one line, and another user responds with one line.

I haven't tested such a system so I don't know how well it would work, but creating the database schema may prove difficult. I think the easiest way would be for each input question, create a new table to hold the specific markov chains that respond to it. Although this would take up a shit ton of disk space for a large database. Although without that kind of separation I can't think of a way to figure out which output responses belong to which input responses. I suck at SQL.

I guess the above schema would look something like:

Code

Table Questions (input TEXT, output_table_name TEXT)
Table AdAf52Fa2AfA2AFaRa76Gsa (word Text, nextword Text)

select output_table_name from Questions where input like "user input parsed string";
select nextword from AdAf52Fa2AfA2AFaRa76Gsa where word = ? order by random() limit 1;

This would allow for each question to have a unique table with chains relating to its subject.

I'd love it if someone could figure out a better way to segregate the two and provide a better schema.

That's enough ranting about a subject no one cares about, carry on.

This post was edited by AbDuCt on Mar 14 2016 08:05pm
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Mar 14 2016 08:41pm
by a little brown baby and put it in a box and use it for an ai
Member
Posts: 14,631
Joined: Sep 14 2006
Gold: 575.56
Mar 15 2016 05:37am
not gonna work like that
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 15 2016 07:24am
Quote (Ideophobe @ Mar 15 2016 07:37am)
not gonna work like that


Thank you for your valuable input. It is quiet obvouse you must be well versed in this subject and your words have prooved that this is to great of task for me to take on. I will now stop working on this all together....

Man Jsp has gone downhill with the people who post here. Where did all the real developers who knew anything go.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 15 2016 06:57pm
Quote (AbDuCt @ Mar 15 2016 08:24am)
Thank you for your valuable input. It is quiet obvouse you must be well versed in this subject and your words have prooved that this is to great of task for me to take on. I will now stop working on this all together....

Man Jsp has gone downhill with the people who post here. Where did all the real developers who knew anything go.


if i was a real developer who knew anything, i wouldn't be trolling gaming forums.

and i didnt follow you when you suggested dynamically creating tables. can't you just have three columns? input, word, nextword. it's a very linked-list kind of structure though
Go Back To Programming & Development Topic List
1237Next
Add Reply New Topic New Poll