Help with Neural Nets
I am making great progress on a chat bot I am currently working on, but I want to train it to do something... ask a question when it doesnt have the knowledge to answer a question. I know nueral nets have the ability to learn from training data, but I dont know too much about them.
Could somebody help me implement a neural net example to help me with my problem, or point me in the right direction. Neural nets may be the wrong direction to go in and I would be open to other solutions.
Consider the bot being asked: Who is the president of the US?
The bot will then search its knowledge database and once it sees that it has no data on president, I want it to be able to take the sentence given by the user and ask a question back to get the data it needs to answer the question in the future. Expected Response from bot: I do not know. Can you tell me who the president of the US is?
Then test data could include a sentence such as: Who was the president in 1917?
Expected response: I do not know. Can you tell me who the president in 1917 was?
How would I implement neural nets to train this question behavior? Am I even going about it the right way or are neural nets not the way to go?
Oh no. Neural networks are not what you need!.
What you need is some NLP lessons.
NLP
Look there, and read for a while.
Ok, you need to get a serious system together to take in input, and format it into a standered format.
For eg.
Who was the presedent in 1991 in the us
Becomes
Ask Who Presedent 1991 US Past
Which you can then route into a module which takes the question,
And does a search for "Presedent 1991" in its databank.
Theres a couple of ways you can store data.
You can store things like:
Presedent is a subset of people
Isenhower is a subset of presedent
People have names, so Presedents have names So isenhower had a name.
Read up on logical systems, if you design your system properly (ie. only check related records...), you can get heaps of stuff like this for free. And fast too. (you could even get it to do the logical analisis whe n its waiting.)
You also should have a facts store.
This is how you make one.
You get key words "Presedent, Isenhower, US," Famous Dates, Times, ect.
Each key word has a weighting.
You store the key words in a vector, so you have a vector of pointers inside the keyword pointer. Each pointer leads to a record. Those records contain a list of keywords on the sentence eg. "PRESEDENT ISENHOWER US 1991"
It also contains the actual sentence "Presedent isenhower has the presendent of the united states of america in 1991"
Now, you take the input sentence, remove any non-key words, and you take every record that contains at leas one of the keywords.
You then figure out a final weighting, out of the weightings of each of the key words that were present in the input string.
If that weighting is heigh enough, you output that records string.
Adding to its easy enough too.
You should also add a synonym engine.
What it does, is basically threefold:
1. it corrects spelling mistakes. (simple ones, like teh tran instead of the train)
2. It makes words simpler, so instead of having to learn what a car is, and what an automobile is, it only needs to learn one thing.
3. It cuts down on repitition "Are you taking your car out tonight?" "Are you taking your automibile out after dark?" ect.
From,
Nice coder
[Edited by - Nice Coder on January 4, 2005 6:14:03 AM]
What you need is some NLP lessons.
NLP
Look there, and read for a while.
Ok, you need to get a serious system together to take in input, and format it into a standered format.
For eg.
Who was the presedent in 1991 in the us
Becomes
Ask Who Presedent 1991 US Past
Which you can then route into a module which takes the question,
And does a search for "Presedent 1991" in its databank.
Theres a couple of ways you can store data.
You can store things like:
Presedent is a subset of people
Isenhower is a subset of presedent
People have names, so Presedents have names So isenhower had a name.
Read up on logical systems, if you design your system properly (ie. only check related records...), you can get heaps of stuff like this for free. And fast too. (you could even get it to do the logical analisis whe n its waiting.)
You also should have a facts store.
This is how you make one.
You get key words "Presedent, Isenhower, US," Famous Dates, Times, ect.
Each key word has a weighting.
You store the key words in a vector, so you have a vector of pointers inside the keyword pointer. Each pointer leads to a record. Those records contain a list of keywords on the sentence eg. "PRESEDENT ISENHOWER US 1991"
It also contains the actual sentence "Presedent isenhower has the presendent of the united states of america in 1991"
Now, you take the input sentence, remove any non-key words, and you take every record that contains at leas one of the keywords.
You then figure out a final weighting, out of the weightings of each of the key words that were present in the input string.
If that weighting is heigh enough, you output that records string.
Adding to its easy enough too.
You should also add a synonym engine.
What it does, is basically threefold:
1. it corrects spelling mistakes. (simple ones, like teh tran instead of the train)
2. It makes words simpler, so instead of having to learn what a car is, and what an automobile is, it only needs to learn one thing.
3. It cuts down on repitition "Are you taking your car out tonight?" "Are you taking your automibile out after dark?" ect.
From,
Nice coder
[Edited by - Nice Coder on January 4, 2005 6:14:03 AM]
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Neural network's strength right now is primarily in pattern recognition. Most of what I've seen with it is you give it a parallel number of inputs and it can be trained to give you specific outputs for those inputs. Now it could be used for a chat bot and one that is better than any other process can create but I think you would spend too much time making the network work compared to other methods.
- My $0.02
Yeah, I have been reading of examples of NN's being used to parse sentences, understand the semantics of relatively simple sentences, and various other NLP tasks, so that is why I asked. I was thinking that if it could be done for the above tasks, then it could be done to understand how to state questions from previous questions, which is pretty simple in itself.
Its harder then it looks.
From,
Nice coder
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement