Summary:
It was an Q&A Machine like IBM Watson. It can process English language, given as inputs, by user and tell answers from a document based upon keywords into question.
It takes some row data as input to brain and then some queries from command line as query input, from user.
It has also has a web interface, which can be used by outside users to ask any question. They will get answer on the same page.
Programming Language:
- Python 3 ( for Backend )
- HTML and CSS ( For front end web interface )
Tools/Technology used:
- NLTK (For Natural Language Processing)
- Anaconda 4 ( For Python Packages Management )
- Flask ( For web request Handling )
- PyCharm Community Edition ( as IDE )
Working:
Step 1 :
User's Input is either taken from web interface or from CLI. This input is sent vai HTTP POST request in case of web interface. Flask handles that HTTP POST request and extracts the query in question. This query is then filtered out using WordNet of NTLK.
In case of query from CLI, it is directly sent for filtration.
Step 2:
After filtration of query, we find out the synonyms of keywords in query. Again, WordNet of NLTK is used here. A list (Python Data Structure) of synonyms and their meaning is created.
Step 3:
Raw data, which has to be used as learning material should be in English. This raw data is given as a text file with name 'brain.txt'.
Step 4:
Once after creating a list of keyword and their synonyms from query, we process the data given into brain.txt file. We, create a dictionary (Python Data Structure) of all possible answers and sentences which are related to the query.
Step 5:
Then, we calculate probability of correctness of all these answers. This probability is calculated based upon, frequency of word, distance, meaningfulness and relatedness to query. We have a separate algorithm for that. Finally answer with highest probability is sent to output.