Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: Melodix on March 23, 2018, 06:34:17 pm

Title: Advice for Natural Language Processing etc.
Post by: Melodix on March 23, 2018, 06:34:17 pm
Hi, I'm pretty new here, so I hope this is the right forum.
I recently took an Introduction course to AI and got interested.
I want to write a program which takes a question as input and give an answer depending on a "Facts-Database".
For example, if the user asks "How tall are you?" the program looks into the database for height and answers the question.
So kinda like a Chatbot but with a fixed set of knowledge.
My problem is just that I have no idea where to start, so I would be glad if someone could link me any papers, projects etc. which could help me.

Thanks in advance
Melodix
Title: Re: Advice for Natural Language Processing etc.
Post by: Freddy on March 23, 2018, 07:04:08 pm
Welcome to the site :)

Since the input/output is fixed then a scripting language like AIML would work for that.

You would be doing things like this :

Code
<category>
      <pattern>HOW TALL ARE YOU</pattern>   
      <template>Oh about 8 feet !</template>
</category>

Here's something to read on AIML : Learn AIML (https://www.tutorialspoint.com/aiml/index.htm)

And a more general article we have here : How To Create Your Own Customised Chatbot For Beginners - Chatbots 101 (http://aidreams.co.uk/forum/index.php?page=How_To_Create_Your_Own_Customised_Chatbot_For_Beginners_-_Chatbots_101)

Part two of the latter (A Web-Based Chatbot - Pandorabots) you might want to read first as that deals with a service that will run AIML bots.
Title: Re: Advice for Natural Language Processing etc.
Post by: Art on March 24, 2018, 01:13:52 pm
Hello Melodix! Good to have you aboard! O0
Title: Re: Advice for Natural Language Processing etc.
Post by: keghn on March 24, 2018, 05:40:15 pm
Here is a more advanced model that dose not rely on a return button and really speaks. You will like. It no of the long gone
age of text bot,

https://www.youtube.com/watch?time_continue=1&v=rcdhUMBN8P0
Title: Re: Advice for Natural Language Processing etc.
Post by: LOCKSUIT on March 24, 2018, 05:48:52 pm
Advice - use a LSTM

DNC is a type of ANN-computer storing invention that recently came out by Deep Mind team. It can answer questions and explain the underground map of London or somethin like that.
Title: Re: Advice for Natural Language Processing etc.
Post by: Don Patrick on March 25, 2018, 08:29:52 am
I should mention that ChatScript (http://"http://chatscript.sourceforge.net/"), a chatbot scripting language, supports using a fact database. I've often enough seen the topic pass on its support site (http://"https://www.chatbots.org/ai_zone/viewforum/44/"). I've seen people hook it up to WordNet, which can make do as a knowledge database, although it's not supposed to be one. Of course Chatscript allows building one's own database of facts, and in my opinion it is well suited for programmers.

In NLP, I have yet to come across papers that address both chatbottery and fact databases aka ontologies. We have had a helpful topic on the latter recently that names some:
http://aidreams.co.uk/forum/index.php?topic=12946.0
Title: Re: Advice for Natural Language Processing etc.
Post by: spydaz on April 12, 2018, 04:42:36 pm


NLP is Not so hard to understand;
Tokenizing - Turning stings into tokens?
Categorising - Extracting categorical data
Counting freqs - Self explanatory...... If a word is highly frequent it may be assumed that the String is about that topic......or even a group of words can also be attributed to a particular writing style denoting the Writer of the text etc......
Sentence meaning---- Attempts to understand the sentences .... John is Paul's father, I am happy
Sentiment analysis - i am happy .... User sentiment / object sentiment etc.....

All can be achieved with collected lists (dictionaries), (Word polarities) etc.... Utilising these lists with functions which check the sentence for elements which have information pertaining to the technique being applied.

Yes After these elements and functions created , data collected.... It can be used in Some form of (probability learning mechanism) such as neural networks... based on patterns which element would here ..... The cat sat on the .... but we can all guess the answer... the neural network could predict the answer but ...... so could normal programming code and frequencies... some basic maths (not calculus) .....

the simplest answer is generally the best option.... to have a neural network performing a single task in your AI, and multiple neural networks performing other tasks is a very high overhead, being a part of these Royal societies and institutes in the u.k .....Statistics / Mathematics/computer the is not a massive crossover of skills.  mathematicians and statisticians approach things from a different perspective than programmers. Computer programs produce results which often cannot be recreated mathematically. Becoming a data scientist - made me realise this factor . O lot of NLP product are Mathematical..... such as a neural network.... but the same functionality can be recreated without a neural network......a simple program can often do the trick. A car can be programmed to park itself.... no problem but for every possible parking space there is an issue.... but if enough data is collected any problem can be scaled up or down. but they also have used neural networks to learn how to park .... this does not mean that they needed to.... DARPA was working on this in 2000... and solved the self parking car/AUTO PILOT!
Neural networks can be applied to any problem if re-framed mathematically ....

outputs can be framed to give YES / NO Answers!

So maybe LSTM can select the right answer from the database for you.... but SQL can do that too!

Title: Re: Advice for Natural Language Processing etc.
Post by: spydaz on April 12, 2018, 04:52:24 pm
To start  -
Think about your storage for your database;
the SQL to retrieve the answer from the database should be relatively simple.
Build your basic interface (Input / Output)
Make sure your QUESTIONS are all in a SINGLE CASE; when retrieving the user sentence; Make sure its in the SAME CASE;
If answer is not in DB then Ask the User for Answer to be stored for Future reference.

This is your basic loop! begin here!

Then you can develop new methods and functions and mechanisms - to understand more or respond in a different way!

Recently i was informed that you should always begin with your "basic game loop" ... its correct! then you can build upon your idea as your knowledge grows.

When starting in AI begin simple.... Add what you know.....
Soon the Program itself will evolve;  there are always API's in the world which can deliver functionality to your AI; There are always library's to experiment with .... with all these functions etc you will soon have a rich Chat-bot ....

DoNOT Swamp your self with lots of Mad knowledge.... have some goals in mind...Achieve them.

Good luck!
 
Title: Re: Advice for Natural Language Processing etc.
Post by: Art on April 13, 2018, 02:51:35 am
No one has asked nor did you mention whether or not you have prior programming experience or not. If so in which arena?
You did mention in your title that you wanted advice for NLP which in and of itself is no trivial task to accomplish.

For a Chatbot with a Fixed set of knowledge, I would follow those other recommendations for learning AIML, ElfScript or RiveScript.

ChatScript, while a very powerful programming platform is not very beginner-friendly and has a somewhat steep learning curve.

ElfScript or RiveScript are much more friendly and every bit as powerful (debatable) than even AIML and can do most of those things you asked with ease.

Just my take. Happy Trails! O0