Tuesday 9 May 2023

AI framework for self learning Q&A agent

 Pantomath AI bot framework

Definition: A pantomath is a person who wants to know and knows everything.

What is Pantomath

Pantomath is an AI framework inspired by human learning pattern developed with ZERO cost using ZERO propriety software or framework using open source R that can learn any subject and respond to a query when asked about it. It can learn any domain, topic and subject and keeps getting better and more knowledgeable with time and experience.

Why Pantomath?

· Pantomath has been designed on the idea of general AI which has the capability of learning different domains.
· While different enterprise solutions may be present they concentrate towards a particular domain
· It has been developed from open source framework hence there is no attached proprietary price.
· Business can easily enable Pantomath to automate FAQs, knowledge management, menu handling, computer trouble shooting etc.? If anything that has the pattern of resolving a query and does not need a detailed conversation or diagnosis, Pantomath can scale extremely well and can save significant cost while improving Customer Satisfaction.
· It has one of the best research oriented, scalable, technical back-end developed.

Pantomath: How does it work?

Steps

1. Enter few sample Q&A on different topics for it to start the learning & conversation.
2. On given the sample it tries to learn how it can answer questions on same topics asked differently or similar questions on the same topic.
3. And with each conversation it reinforces and reconfirms its knowledge.
4. If it does not know a topic it confirms it does not know about it and asks for more knowledge materials or hints to be fed into it.
5. With more conversations it learns more about language subtlety and gathers knowledge about different topics. (Just like us).

Pantomath: How does it constantly learn?

Pantomath’s learning model has been inspired from David Kolb’s learning model and human learning pattern from birth to adulthood.

David Kolb’s learning model

1. Concrete Experience- (a new experience of situation is encountered, or a reinterpretation of existing experience).
2. Reflective Observation (of the new experience. Of particular importance are any inconsistencies between experience and understanding).
3. Abstract Conceptualization (Reflection gives rise to a new idea, or a modification of an existing abstract concept).
4. Active Experimentation (the learner applies them to the world around them to see what results). Reference: https://medium.com/@johnharrydsouza/david-kolb-s-cycle-of-learning-2777d150d09e#.xitj0ph53

Human learning development


1. After Birth – A baby is born with basic human instincts while it gradually learns initial movements.
2. Toddler – It starts interacting with environment, still learning basic movements with the guidance by parents at this stage being very critical.
3. Childhood – It has almost completed learning its basic movements, while most of its learning coming from interacting with environment while asking for guidance much less.
4. Adulthood – It has learned most of its survival skills from learning independently from environment while rarely needing guidance now.

Learning trajectory for the algorithm with experience
Similarly the bot with more experience and maturity needs less guidance and is more self-sufficient.

Pantomath: Stages of development

Text similarity – It is implemented using text similarity pattern matching and recommending responses that might be best suitable for the current question.
A string metric is a metric that measures similarity or dissimilarity (distance) between two text strings for approximate string matching or comparison. Corpus-Based similarity is a semantic similarity measure that determines the similarity between words according to information gained from large corpora.

Neural Net – After that we would like to implement an ANN (Artificial Neural Net) to understand the weightage of different words used in the conversation and recommend the best response.
Reinforcement learning is an area of Machine Learning. Reinforcement. It is about taking suitable action to maximize reward in a particular situation. It is employed by various software and machines to find the best possible behavior or path it should take in a specific situation.

Reinforcement Learning – Next stage would be assigning an agent to the bot which will interact with its environment and would be rewarded for the right response and penalized for the wrong response. Thus the agent with time will learn and adjust itself to better responses.
Neural networks are a set of algorithms, modeled loosely after the human brain, that are designed to recognize patterns. It is a network or circuit of neurons, or in a modern sense, an artificial neural network, composed of artificial neurons or nodes.

Working code example

The below sample use case is to feed Pantomath with sample computer trouble shooting scenarios.
Some records of the initial set being.
Internally it creates an auto mapping rule in its brain. Let’s see how the mapping table looks internally at each stage of conversation.
Initial stage, it creates auto tags for all the sample issues provided which would help it to recommend a solution using text similarity pattern via string metric. –
*Trouble shooting steps are as above sample and I haven’t rewritten them to save space.
Scenario 1 - Show a result based on probability match
First issue we asked the bot –
mouse not moving correctly
Bot suggests –
"Check if the mouse is securely plugged into the computer. If not, plug it in completely.\r\n· Check to see if the cord has been damaged. If so, the mouse may need replacing.\r\n· If you are using a cordless mouse, try pushing the connection button on the underside of the\r\nmouse to reestablish a connection.\r\n· Clean the mouse, especially on the bottom.
Which if we move up on the sample provided we see is a solution for the issue –
Then the bot reconfirms if I am happy with the solution it provided. If I say YES, it responds.
"Glad to hear i could help and it has made me wiser"

Scenario 2 - Store queries which it could not resolve
Next scenario let’s try to ask a question which it may not know and needs to learn externally.
Let’s ask-
Not able to use the mouse
Bot says
Sorry i can’t help you regarding this. I will pass you to the next level engineer
And we see in its internal memory map it has made another entry with the new query and auto tags and there is no TroubleShootingSteps corresponding to it as it does not know how to solve it.

So the bot goes back to its human handler and tells this is a topic it does not know and haven’t been able to learn from the conversations and asks it to provide some knowledge.

Scenario 3 - show multiple options ordered based on similarity - learn based on the option chosen - Next time show the better option
Next scenario let’s try to ask a question for which it may have multiple recommendation
Let’s ask-
"keyboard problem"
Bot gives two recommendation
[1] "Make sure the keyboard is connected to the computer. If not, connect it to the computer.\r\nIf you are using a wireless keyboard, try changing the batteries.\r\nIf one of the keys on your keyboard gets stuck, turn the computer off and clean with a damp\r\ncloth.\r\nUse the mouse to restart the computer."
and
[2] "Clean the keys thoroughly"
BOT then asks me to confirm which actually solved the ticket so that it can refine its learning. I said 2 as the second recommendation solved the ticket for me. Bot responds -
"Glad to hear i could help and it has made me wiser"
And we see in its internal memory map it has made another entry with the new query and auto tags the number 2 solution for this question, so next time on being asked the same thing it can respond better,
So when again asked the same question
"keyboard problem"
It responds
[1] "Clean the key throughly"                                                                                                                                                          
and
[2] "Make sure the keyboard is connected to the computer. If not, connect it to the computer.\r\nIf you are using a wireless keyboard, try changing the batteries.\r\nIf one of the keys on your keyboard gets stuck, turn the computer off and clean with a damp\r\ncloth.\r\nUse the mouse to restart the computer."                                 
Interestingly on learning from its last interaction it now suggests Clean the keys thoroughly as the first option and the other one as the next option.  

Scenario 4 - The user does not like any option chosen, store queries which it could not resolve
Next scenario let’s again try to ask a question but we don’t choose its recommendation
Let’s ask-
“The mouse is slow"     
Bot gives me a recommendation  
[1] "Restart your computer.\r\n· Verify that there is at least 200-500 MB of free hard drive space. To do so, select Start and\r\nclick on My Computer or Computer. Then highlight the local C drive by clicking on it once.\r\nSelect the Properties button at the top left-hand corner of the window; this will display a\r\nwindow showing …                                             
BOT then asks me to confirm if I found the recommendation usable to which I said NO.
BOT responds –
"Sorry i could not help you. We will add content to fulfill your request in future."
And we see in its internal memory map it has made another entry since it realized it needs to learn more on this issue. So the bot goes back to its human handler and tells this is a topic it does not know enough of and asks to give more hint so that it can give a better hint next time.
What Pantomath is not
· Pantomath is not a conversational agent. It is a Q&A agent. Though it learns from each conversation and remembers how the user responded to its previous answers it does not remember personal conversational context or non-business critical facts.
· Pantomath is not a diagnosis tool. Though it may with time, learn to suggest recommendation for general questions, it is not build to find the root-cause using series of questions.
· Pantomath cannot go and open tickets for you in another environment. It provides information to the user, but it cannot take action for them.

Conclusion

Business on a daily basis employs enormous human resource to respond to user questions on various topics. While some of them need complex diagnosis, most of them are rudimentary and repetitive in nature. Pantomath can be easily deployed and scaled to automate a major proportion of this task. It’s an AI platform developed based on human learning pattern. It learns from conversations and asks for help wherever it needs, and gets more mature with time. It can adjust to any domain and learn any topic.
Business can easily enable Pantomath to automate
· FAQs
· knowledge management
· menu handling
· Computer trouble shooting etc.
If anything that has the pattern of resolving a query and does not need a detailed conversation or diagnosis, Pantomath can scale extremely well. It is extremely cost effective as it is completely build without using any third party enterprise component.