Sign In to Follow Application
View All Documents & Correspondence

Method And System For Context Aware Information Processing From A Chatbot

Abstract: This disclosure relates generally to a method and system for context-aware information processing from a chatbot. State-of-art methods for context aware information processing through a chatbot utilizes large language models (LLMs) which are more accurate and advanced than traditional Optical Character Recognition (OCR) techniques. However, LLM based information processing is computationally expensive and time consuming. The chatbot driven responses for an input query are structured and follows a dialogflow. However, integration of dialogflow and LLM for assessing the type of query is not yet achieved. The proposed method of context-aware information processing through a chatbot present a two-way approach of handling the input query. In the first approach, the input query is mapped to the dialogflow to find the relevant match and in the second approach LLM processes the input query based via embedding vectors to generate context-aware response. [To be published with FIG. 6]

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
28 February 2024
Publication Number
35/2025
Publication Type
INA
Invention Field
COMPUTER SCIENCE
Status
Email
Parent Application

Applicants

Tata Consultancy Services Limited
Nirmal Building, 9th floor, Nariman point, Mumbai 400021, Maharashtra, India

Inventors

1. MISHRA, Tapan
Tata Consultancy Services Limited 415/21-24, Kumaran Nagar, Sholinganallur, Old Mahabalipuram, MAA, Chennai 600097, Tamil Nadu India
2. RAGHU, Ravindran
Tata Consultancy Services Limited 415/21-24, Kumaran Nagar, Sholinganallur, Old Mahabalipuram, MAA, Chennai 600097, Tamil Nadu India
3. FATHIMA, Sumayya
Tata Consultancy Services Limited Plot No 1, Survey No. 64/2, Software Units Layout, Serilingampally Mandal, Madhapur, HYD, Hyderabad 500034, Telangana, India
4. RODRIGUES, Thomson Michael
Tata Consultancy Services Limited Park West - II, Raheja Estate, Kulupwadi Road, Borivali (East), BOM, Mumbai 400066, Maharashtra, India

Specification

FORM 2
THE PATENTS ACT, 1970
(39 of 1970)
&
THE PATENT RULES, 2003
COMPLETE SPECIFICATION
(See Section 10 and Rule 13)
Title of invention
METHOD AND SYSTEM FOR CONTEXT-AWARE INFORMATION PROCESSING FROM A CHATBOT
Applicant
Tata Consultancy Services Limited
A company Incorporated in India under the Companies Act, 1956
Having address:
Nirmal Building, 9th floor,
Nariman point, Mumbai 400021,
Maharashtra, India
Preamble to the description:
The following specification particularly describes the invention and the manner in which it is to be performed.
2
TECHNICAL FIELD
[001]
The disclosure herein generally relates to the field of artificial intelligence (AI) technologies, and, more particularly, to a method and system for context-aware information processing from a chatbot.
5
BACKGROUND
[002]
In the field of artificial intelligent computer systems, natural language queries are processed based on knowledge acquired by the system. The AI based systems utilize algorithms to learn from data, create foresights based on this data and processes the natural language queries. With the rapid development of 10 AI technology, chatbots are used widely for natural language processing (NLP). Chatbots are computer programs designed to simulate human interaction, provide users with interactive interactions, and receive information or services. NLP technology has become a tool to make chatbots smarter and able to understand and respond to natural language. By harnessing the power of NLP technology, chatbots 15 can interpret user questions, extract valuable information, and generate meaningful responses in conversations. NLP technology enables chatbots to understand and respond to user intent, manage context and uncertainty, and provide personalized and context-aware interactions. With the advances in getting more accurate response from a chatbot, a dialogue system or a dialogflow employs artificial 20 intelligence and/or natural language processing to facilitate human-computer interaction. A dialogue system generally handles a single task due to the complexity of managing different tasks. Furthermore, a dialogue system generally relies on user statement input provided to the dialogue system and/or intent of user statement input to generate a response to a question provided to the dialogue system. 25 Analyzing the question may refer to deriving the semantic meaning of that question (what the question is actually asking). Features of questions may be learned for a question-answer matching. However, relying on user statement input provided to the dialogue system and/or intent of user statement input to generate a response can, for example, lead to the user input being routed to an incorrect skill of the dialogue 30 system. Natural language processing and the ability of a system to answer natural
3
language questions about the content of a natural language sample is a benchmark
to test for context-specific reasoning about information provided in natural language form. This can be a complex task because there are many different types of natural language questions that can be asked and whose answering may require different types of reasoning and/or different types of analysis. To process natural 5 language, the system may be trained with data derived from a database or corpus of knowledge, but the resulting outcome can be incorrect or inaccurate for a variety of reasons relating to the peculiarities of language constructs and human reasoning or new training data that is incorrect. While existing chatbot technologies listed above have proven to be useful in facilitating natural language queries but in a real 10 dialogue between a user and a robot, user’s context could be substantially complex and continuously changed. Thus, context-aware, and proactive technologies are highly desired to be incorporated into a chatbot system. The current conversational AI systems excel in handling relatively simple and contextually limited interactions. However, handling complex, multi-turn conversations, especially 15 those requiring nuanced understanding, remains a challenge.
SUMMARY
[003]
Embodiments of the present disclosure present technological improvements as solutions to one or more of the above-mentioned technical 20 problems recognized by the inventors in conventional systems. For example, in one embodiment, a method of context-aware information processing by a chatbot is provided. The method includes, creating a dialogflow for the chatbot by scripting a plurality of dialogue elements for the chatbot, and wherein each node of the dialogue element enables forward conversation supporting natural language 25 processing (NLP). The method further includes, receiving a reference document, wherein the chatbot is expected to generate the plurality of contextually aware responses from the reference document and wherein, the reference document is previously mapped to a plurality of nodes of the dialogflow. The reference documents which contain information related to the nodes are mapped to respective 30 nodes of the dialogflow. When chatbot is activated, input query along with the
4
respective documents mapped to the current node selected in the conversation, are
sent to the chatbot. These documents are used as reference by the chatbot to generate contextually aware responses for the input query. The method further includes receiving an input query from a user. This is the first step of the user screen, wherein the input provided by the user is referred to as input query. The method 5 further includes probing the input query against the dialogflow to derive a confidence score. Once the input query is received it is given as input to a matching algorithm. This algorithm takes the input query and performs a full search on the nodes present in the dialogflow to derive a confidence score. If a match is found, the matched node is returned as response to the user. The method further includes 10 processing the input query as (a) routine input query or (b) atypical input query based on the confidence score. Once the input query is received, it is sent as input to matching algorithm to get a confidence score against all the nodes present in the dialogflow. Based on the confidence score, if a match is found then the query is categorized as routine input query. If no match is found for the given query it will 15 be categorized as atypical input query. The confidence score for the input query is derived by (a) analyzing conversation history to identify a matching query, (b) response of the chatbot for the matching query, and (c) user feedback against chatbot response for the matching query. The routine input query is processed by the dialogflow module by first scanning the dialogflow to find a suitable response 20 for the input query and then triggering the contextually aware response to the user. On the other hand, if the match is not found within the nodes of the dialogflow, the input query is treated as the atypical input query. The processing of the atypical input query by the LLM module involves tokenizing the atypical input query to obtain a query vector through an embedding model. According to an embodiment 25 Croma database (CromaDBTM) is used to generate embeddings. However, other embedding models such as BERT model can also be used for the same purpose. During tokenization the query is split word by word into small tokens along with preserving the semantic meaning of the tokens. Then these tokens are sent to embedding model to generate embedding vector. This vector of the atypical input 30 query is referred to as “query vector”. According to an embodiment, embeddings
5
are generated within vector database and vectors thus created are stored in the
vector database itself. Similarly, the reference document is tokenized into chunks to obtain a plurality of context vectors through the embedding model. Text of the reference document is extracted from the document and is divided into context-chunks of a defined token length using character splitters. These context-chunks are 5 sent to the tokenizer model to get tokenized and then to the embedding model for generation of embedding vectors of the context-chunks. These context-chunks are then indexed and stored in a vector database along with their respective embedding vectors. These embedding vectors of the given document are referred to as “context-vectors”. Further, the vector database is scanned to identify a suitable match for the 10 query vector wherein the vector database comprises of a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element. Further, cosine similarity is derived among the query vector and the plurality of context vectors stored in the vector database. Further, context of the reference 15 document is obtained for the input query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than pre-defined threshold. Based on the pre-defined threshold, context-chunks of all the matches of the cosine similarity, performed between query vector and context vectors, that are above the threshold value are augmented and passed as 20 context to the LLM model along with the input query to generate the answer. Therefore, the chatbot generates a contextually aware response to the input query from the LLM.
[004]
In another aspect, a system for context-aware information processing by a chatbot is provided. The system includes at least one memory 25 storing programmed instructions; one or more Input /Output (I/O) interfaces; and one or more hardware processors, an information processing model, operatively coupled to a corresponding at least one memory, wherein the system is configured to create, via one or more hardware processors, a dialogflow for the chatbot by scripting a plurality of dialogue elements for the chatbot, and wherein each node of 30 the dialogue element enables forward conversation supporting natural language
6
processing (NLP). Further, the system is configured to receive, via the one or more
hardware processors, the reference document, wherein the chatbot is expected to generate the plurality of contextually aware responses from the reference document and wherein, the reference document is previously mapped to a plurality of nodes of the dialogflow. The reference documents which contain information related to 5 the nodes are mapped to respective nodes of the dialogflow. When chatbot is activated, input query along with the respective documents mapped to the current node selected in the conversation, are sent to the chatbot. These documents are used as reference by the chatbot to generate contextually aware responses for the input query. Further, the system is configured to receive, via the one or more hardware 10 processors, an input query from a user. This is the first step of the user screen, wherein the input provided by the user is referred to as input query. Further, the system is configured to probe, via the one or more hardware processors, the input query against the dialogflow to derive a confidence score. Once the input query is received it is given as input to a matching algorithm. This algorithm takes the input 15 query and performs a full search on the nodes present in the dialogflow to derive a confidence score. If a match is found, the matched node is returned as response to the user. Further, the system is configured to process, via the one or more hardware processors, the input query as (a) routine input query or (b) atypical input query based on the confidence score. Once the input query is received, it is sent as input 20 to matching algorithm to get a confidence score against all the nodes present in the dialogflow. Based on the confidence score, if a match is found then the query is categorized as routine input query. If no match is found for the given query it will be categorized as atypical input query. The routine input query is processed by the dialogflow module 110A by first scanning the dialogflow to find a suitable response 25 for the input query and then triggering the contextually aware response to the user. On the other hand, if the match is not found within the nodes of the dialogflow, the input query is treated as the atypical input query. The processing of the atypical input query by the LLM module 110B involves tokenizing the atypical input query to obtain a query vector through the embedding model. During tokenization the 30 query is split word by word into small tokens along with preserving the semantic
7
meaning of the tokens.
Then these tokens are sent to embedding model to generate embedding vector. This vector of the atypical input query is referred to as “query vector”. Similarly, the reference document is tokenized into chunks to obtain a plurality of context vectors through the embedding model. Text of the reference document is extracted from the document and is divided into context-chunks of a 5 defined token length using character splitters. These context-chunks are sent to the tokenizer model to get tokenized and then to the embedding model for generation of embedding vectors of the context-chunks. These context-chunks are then indexed and stored in a vector database along with their respective embedding vectors. These embedding vectors of the given document are referred to as “context-10 vectors”. Further, the vector database is scanned to identify a suitable match for the query vector wherein the vector database comprises of a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element. Further, cosine similarity is derived among the query vector and the plurality of 15 context vectors stored in the vector database. Further, context of the reference document is obtained for the input query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than pre-defined threshold. Based on the pre-defined threshold, context-chunks of all the matches of the cosine similarity, performed between query vector and 20 context vectors, that are above the threshold value are augmented and passed as context to the LLM model along with the input query to generate the answer. Therefore, the chatbot generates a contextually aware response to the input query from the LLM.
[005]
In yet another aspect, a computer program product including a non-25 transitory computer-readable medium embodied therein a computer program for context-ware information processing by a chatbot is provided. The computer readable program, when executed on a computing device, causes the computing device to create, via one or more hardware processors, a dialogflow for the chatbot by scripting a plurality of dialogue elements for the chatbot, and wherein each node 30 of the dialogue element enables forward conversation supporting natural language
8
processing (NLP). The computer readable program, when executed on a computing
device, causes the computing device to receive, via one or more hardware processors, the reference document, wherein the chatbot is expected to generate the plurality of contextually aware responses from the reference document and wherein, the reference document is previously mapped to a plurality of nodes of the 5 dialogflow. The reference documents which contains information related to the nodes are mapped to respective nodes of the dialogflow. When chatbot is activated, input query along with the respective documents mapped to the current node selected in the conversation, are sent to the chatbot. These documents are used as reference by the chatbot to generate contextually aware responses for the input 10 query. The computer readable program, when executed on a computing device, causes the computing device to receive, via one or more hardware processors, an input query from a user. This is the first step of the user screen, wherein the input provided by the user is referred to as input query. The computer readable program, when executed on a computing device, causes the computing device to probe, via 15 one or more hardware processors, the input query against the dialogflow to derive a confidence score. Once the input query is received it is given as input to a matching algorithm. This algorithm takes the input query and performs a full search on the nodes present in the dialogflow to derive a confidence score. If a match is found, the matched node is returned as response to the user. The computer readable 20 program, when executed on a computing device, causes the computing device to process, via one or more hardware processors, the input query as (a) routine input query or (b) atypical input query based on the confidence score. Once the input query is received, it is sent as input to matching algorithm to get a confidence score against all the nodes present in the dialogflow. Based on the confidence score, if a 25 match is found then the query is categorized as routine input query. If no match is found for the given query it will be categorized as atypical input query. The routine input query is processed by the dialogflow module 110A by first scanning the dialogflow to find a suitable response for the input query and then triggering the contextually aware response to the user. On the other hand, if the match is not found 30 within the nodes of the dialogflow, the input query is treated as the atypical input
9
query
. The processing of the atypical input query by the LLM module 110B involves tokenizing the atypical input query to obtain a query vector through the embedding model. During tokenization the query is split word by word into small tokens along with preserving the semantic meaning of the tokens. Then these tokens are sent to embedding model to generate embedding vector. This vector of the 5 atypical input query is referred to as “query vector”. Similarly, the reference document is tokenized into chunks to obtain a plurality of context vectors through the embedding model. Text of the reference document is extracted from the document and is divided into context-chunks of a defined token length using character splitters. These context-chunks are sent to the tokenizer model to get 10 tokenized and then to the embedding model for generation of embedding vectors of the context-chunks. These context-chunks are then indexed and stored in a vector database along with their respective embedding vectors. These embedding vectors of the given document are referred to as “context-vectors”. Further, the vector database is scanned to identify a suitable match for the query vector wherein the 15 vector database comprises of a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element. Further, cosine similarity is derived among the query vector and the plurality of context vectors stored in the vector database. Further, context of the reference document is obtained for the input 20 query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than pre-defined threshold. Based on the pre-defined threshold, context-chunks of all the matches of the cosine similarity, performed between query vector and context vectors, that are above the threshold value are augmented and passed as context to the LLM model along with the input 25 query to generate the answer. Therefore, the chatbot generates a contextually aware response to the input query from the LLM.
30
10
BRIEF DESCRIPTION OF THE DRAWINGS
[006]
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate exemplary embodiments and, together with the description, serve to explain the disclosed principles:
[007]
FIG. 1 illustrates an exemplary block diagram of a system 100 for 5 context aware information processing from a chatbot, according to some embodiments of the present disclosure.
[008]
FIG. 2 illustrates an exemplary environment 200 for context aware information processing from the chatbot, according to some embodiments of the present disclosure. 10
[009]
FIG. 3 is a flow diagram of an illustrative method 300 for context aware information processing from the chatbot, according to some embodiments of the present disclosure.
[010]
FIG. 4 is a flow diagram illustrating creation of embedding vectors from a reference document, according to some of the embodiments of the present 15 invention.
[011]
FIG. 5 is a flow diagram depicting preferential selection of routes to process the input query as a routine query or as a new query, according to some of the embodiments of the present invention.
[012]
FIG. 6 illustrates end-to-end flow of query-response cycle executed 20 by the chatbot using the large language model (LLM) model, according to some of the embodiments of the present invention.
DETAILED DESCRIPTION OF EMBODIMENTS
[013]
Exemplary embodiments are described with reference to the 25 accompanying drawings. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. Wherever convenient, the same reference numbers are used throughout the drawings to refer to the same or like parts. While examples and features of disclosed principles are described herein, modifications, adaptations, and other implementations are 30 possible without departing from the scope of the disclosed embodiments.
11
[014]
In the foregoing description, terms “chatbot”, “chatter robot”, “chatter bot”, “bot”, “virtual agent” and “bot” are used interchangeably, and they refer to a computer program designed to simulate an intelligent conversation with one or more human users via auditory or textual methods and processes the NLP based queries according to the method of the present disclosure. 5
[015] The terms “program”, “software application”, and the like as used herein, are defined as a sequence of instructions designed for execution on an information processing circuit. A program, computer program, or software application may include a subroutine, a function, a procedure, an object method, an object implementation, an executable application, an applet, a servlet, a source 10 code, an object code, a shared library/dynamic load library and/or other sequence of instructions designed for execution on an information processing circuit.
[016]
The term “dialogue system”, or “dialogflow” are interchangeably used through the specification and refers to a dialogue system designed to understand human prompts and queries before providing appropriate responses. 15
[017]
The term “routine input query” refers to an input query to the chatbot which has a previous reference in the dialogflow and is mapped to the nodes of the dialogflow along with the response of the chatbot to the input query.
[018]
The term “atypical input query” refers to an input query to the chatbot which has no previous reference in the dialogflow and is not mapped to any 20 of the nodes of the nodes of the dialogflow.
[019]
The potential applications of NLP-powered chatbots are enormous. Customer service, healthcare, e-commerce, education, etc. can be used for many purposes. Chatbots can perform routine tasks, provide instant answers to frequently asked questions, provide personalized advice, and assist users in complex journeys 25 or processes. They can also improve the user experience, increase productivity, and reduce the burden on human resources.
[020]
However, creating chatbots using NLP techniques presents many challenges. These challenges include addressing ambiguity, properly understanding, and achieving user goals, managing content in ongoing 30 conversations, and creating appropriate content and responses. Overcoming these
12
challenges requires carefully selected and implemented NLP algorithms, robust
training data, and effective speech management strategies.
[021]
Chatbots leverage various algorithms to perform their tasks effectively. Rule-Based Algorithms are a foundational approach where chatbots operate based on predefined rules and patterns. They are suitable for handling 5 structured queries and straightforward tasks. Machine Learning Algorithms, including decision trees, random forests, and support vector machines, are used in chatbots that can learn from data and improve over time. These algorithms enable chatbots to adapt to changing user needs and preferences. Natural Language Processing (NLP) algorithms are at the heart of chatbots that deal with human 10 language. This includes recurrent neural networks (RNNs), LSTM (Long Short-Term Memory) networks, and advanced Transformer models like BERT and GPT-3. Intent Recognition Algorithms are crucial for understanding user intent, helping chatbots route conversations or make decisions based on user queries. Dialog Management Algorithms maintain context in conversations, ensuring that chatbots 15 provide coherent and contextually relevant responses. Sentiment analysis algorithms gauge user emotions based on their language, allowing chatbots to tailor responses or assess customer satisfaction. Reinforcement Learning may also be employed in some chatbots to optimize responses based on user feedback, improving their performance over time. These algorithms collectively empower 20 chatbots to function intelligently and efficiently in a variety of applications, making them a transformative force in modern technology.
[022]
Human conversations often involve ambiguity, context switching, and non-linear dialogue flow. Existing systems may struggle to handle abrupt changes in topic or context effectively. While some systems incorporate machine 25 learning and feedback mechanisms, they may not adapt quickly enough to changing user needs or emerging knowledge. Similarly, understanding and responding to users’ emotional states, such as frustration or satisfaction, is an area where current technology falls short. While conversational AI systems can retrieve information from knowledge bases, they may not always manage these knowledge bases 30 efficiently. Furthermore, current AI systems may struggle when faced with entirely
13
new or unforeseen situations
. This is for the reason that the current AI systems are heavily dependent on their way of training and learning through data. Ensuring that users remain engaged and satisfied throughout a conversation is also a critical and an ongoing challenge for the existing technologies. While leveraging NLP based chatbots, several inadequacies such as (a) ambiguity and context switching, (b) real-5 time learning and adaptation, (c) emotional intelligence, (d) knowledgebase management, (e) handling unforeseen situations, and (f) continuous user engagement are to be addressed.
[023]
Referring now to the drawings, and more particularly to FIG. 1 through FIG. 6, where similar reference characters denote corresponding features 10 consistently throughout the figures, there are shown preferred embodiments, and these embodiments are described in the context of the following exemplary system and/or method.
[024]
FIG. 1 illustrates an exemplary block diagram of a system 100 for context-aware information processing from a chatbot, according to some 15 embodiments of the present disclosure.
[025]
The system 100, for example a cloud server communicating to users via user terminal (end devices), wherein the users intend to seek assistance from a chatbot via a User Interface (UI) for the chatbot. In an embodiment, the system 100 includes one or more processors 104, communication interface device(s) or 20 input/output (I/O) interface(s) 106, and one or more data storage devices or memory 102 operatively coupled to the one or more processors 104. The one or more processors 104 that are hardware processors can be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, graphics controllers, logic circuitries, 25 and/or any devices that manipulate signals based on operational instructions. Among other capabilities, the processor(s) are configured to fetch and execute computer-readable instructions stored in the memory. In the context of the present disclosure, the expressions ‘processors’ and ‘hardware processors’ may be used interchangeably. In an embodiment, the system 100 can be implemented in a variety 30 of computing systems, such as, laptop computers, notebooks, hand-held devices,
14
workstations, mainframe computers, servers, a network
cloud, and the like. The I/O interface (s) 106 may include a variety of software and hardware interfaces, for example, a web interface, a graphical user interface, and the like and can facilitate multiple communications within a wide variety of networks and protocol types, including wired networks, for example, LAN, cable, etc., and wireless networks, 5 such as WLAN, cellular, or satellite. In an embodiment, the I/O interface(s) 106 can include one or more ports for connecting a number of devices such as the user terminals enabling user to communicate with system via the chat bot UI, or enabling devices to connect with one another or to another server. The memory 104 may include any computer-readable medium known in the art including, for example, 10 volatile memory, such as static random-access memory (SRAM) and dynamic random-access memory (DRAM), and/or non-volatile memory, such as read only memory (ROM), erasable programmable ROM, flash memories, hard disks, optical disks, and magnetic tapes. In an embodiment, the memory 102 may include a database or repository. The memory 102 may comprise information pertaining to 15 input(s)/output(s) of each step performed by the processor(s) 104 of the system 100 and methods of the present disclosure. In an embodiment, the database may be external (not shown) to the system 100 and coupled via the I/O interface 106. The memory 102, further include an information processing model 110 which comprises of a dialogflow module 110A and a LLM module 110B. The information 20 processing model 110 is an AI model. The dialogflow module 110A is the AI based algorithm whereas the LLM module 110B utilizes a generative AI based model. The AI based algorithm used in the dialogflow module 110A utilizes fuzzy logic to derive confidence score while finding appropriate match for the query from the dialogflow. Generative AI model used in the LLM module 110B takes context and 25 query to generate context-aware response. In an embodiment of the present disclosure, mistral model™ 7B is used as the generative AI model. The information processing model 110 is based on a neural conversational model, which may take contextual features into consideration. The neural conversational model may be trained end-to-end and, thus, may require significantly fewer handcrafted rules. The 30 disclosed context-aware chatbot method may incorporate contextual information in
15
a neural conversational model, which may enable a chatbot to be aware of context in a communication with the user. A contextual real-valued input vector may be provided in association with each word to simplify the training process. The vector learned from the context may be used to convey the contextual information of the sentences being modeled. The information processing model 110 can employ any 5 suitable machine-learning based techniques, statistical-based techniques and/or probabilistic-based techniques. For example, the information processing model 110 can employ deep learning, expert systems, fuzzy logic, SVMs, Hidden Markov Models (HMMs), greedy search algorithms, rule-based systems, Bayesian models (e.g., Bayesian networks), neural networks, other non-linear training techniques, 10 data fusion, utility-based analytical systems, systems employing Bayesian models, etc. In another aspect, the information processing model 110 can perform a set of machine learning computations associated with learning one or more patterns, one or more inferences, one or more correlations, one or more features and/or information related to the statement data and/or the contextual data. For example, 15 the information processing model 110 can perform a set of clustering machine learning computations, a set of logistic regression machine learning computations, a set of decision tree machine learning computations, a set of random forest machine learning computations, a set of regression tree machine learning computations, a set of least square machine learning computations, a set of instance-20 based machine learning computations, a set of regression machine learning computations, a set of support vector regression machine learning computations, a set of k-means machine learning computations, a set of spectral clustering machine learning computations, a set of rule learning machine learning computations, a set of Bayesian machine learning computations, a set of deep Boltzmann machine 25 computations, a set of deep belief network computations, and/or a set of different machine learning computations to learn one or more patterns, one or more inferences, one or more correlations, one or more features and/or information related to the statement data and/or the contextual data. The dialogflow module 110A includes a machine learning component. The machine learning 30
16
component
can generate a rule-based model. For instance, the machine learning component can generate a rule engine based on the contextual information.
[026]
In an embodiment, fuzzy matching is used to find the similarity between two data elements. Here Fuzzy match is used to find the match for the query. In this algorithm we compare two strings and assign a confidence score to 5 each string based on how similar they are. In boolean system where truth value, 1 represents absolute Truth value and 0 represents absolute False value. But fuzzy logic allows partial truths. So, the confidence score for similarity of the sentences will be mapped with partial truths and partial false instead of just true and false as observed in the boolean system. 10
1. The LLM module 110B is a sub-set of “generative artificial intelligence (GenAI)” models. The LLM module 110B works by utilizing CromaDB for embeddings and Mistral model 7B for response generation by the chatbot. Other examples of generative AI include music generators and image generators. Some models well known in the literature, such as GPT-4, can process both text and 15 images. The LLMs are formed by training a “deep” neural network (machine learning model) on a vast quantity of text data. The CromaDB turns chunks of text in the data into “tokens”. Each token is assigned a floating point by the model. The model learns which tokens to predict text. Recently, the press and other observers have entered into intense scrutiny of AI generally and LLMs specifically. 20 ChatGPT™, multi-modal GPT-4, GPT-3, competitive models by Google LaMDA™, Mistral model 7B and Meta AI LLaMA™. To realize the full potential of Generative AI for Enterprises, the LLMs need to be contextualized with enterprise knowledge captured. There are primarily three approaches to achieve this enterprise contextualization: (1) Prompt Engineering, (2) Fine-tuning, and 25 Reinforcement Learning from Human Feedback (RLHF). Discussed below are the pros, cons, and feasibility of the three approaches in the sequel. GPTs (Generative Pre-training Transformers) belong to a class of foundational models (act as a decoder), and are fine-tuned to accomplish NLP tasks, such as: (a) Question-Answering (QA)/Chatbots (b) Text extraction, (c) summarization, (d) auto-correct, 30
17
(e) translation, and (f) classification. According to an embodiment, the LLM model is pre-trained and optionally fine-tuned on domain-specific data.
[027]
The memory 102 further includes a plurality of modules (not shown here) comprises programs or coded instructions that supplement applications or functions performed by the system 100 for executing different steps involved in the 5 context-aware information processing. The plurality of modules, amongst other things, can include routines, programs, objects, components, and data structures, which perform particular tasks or implement particular abstract data types. The plurality of modules may also be used as, signal processor(s), node machine(s), logic circuitries, and/or any other device or component that manipulates signals 10 based on operational instructions. Further, the plurality of modules can be used by hardware, by computer-readable instructions executed by the one or more hardware processors 104, or by a combination thereof. The plurality of modules can include various sub-modules (not shown).
[028]
FIG. 2 illustrates an exemplary environment 200 for context aware 15 information processing from a chatbot, according to some embodiments of the present disclosure.
[029]
As shown in FIG. 2, the environment 200 may include a user terminal 202, a server 204, a user 206, and a network 208. Other devices may also be included. The user terminal 202 may include any appropriate type of electronic 20 device with computing capabilities, such as a wearable device (e.g., a smart watch, a wristband), a mobile phone, a smartphone, a tablet, a personal computer (PC), a server computer, a laptop computer, and a digital personal assistant (PDA), etc. The server 204 may include any appropriate type of server computer or a plurality of server computers for providing personalized contents to the user 206. For example, 25 the server 204 may be a cloud computing server. The server 204 may also facilitate the communication, data storage, and data processing between the other servers and the user terminal 202. The user terminal 202, and server 204 may communicate with each other through one or more communication networks 208, such as cable network, phone network, and/or satellite network, etc. The user 206 may interact 30 with the user terminal 202 to query and to retrieve various contents and perform
18
other activities of interest, or the user may use voice, hand or body gestures to
control the user terminal 202 if speech recognition engines, motion sensor or depth-camera is used by the user terminal 202. The user terminal 202, and/or server 204 may be implemented on any appropriate computing circuitry platform.
[030]
FIG. 3 is a flow diagram of an illustrative method 300 for context-5 aware information processing from the chatbot, according to some embodiments of the present disclosure.
[031]
The steps of the method 300 of the present disclosure will now be explained with reference to the components or blocks of the system 100 as depicted in FIG. 1 through FIG. 6. Although process steps, method steps, techniques or the 10 like may be described in a sequential order, such processes, methods, and techniques may be configured to work in alternate orders. In other words, any sequence or order of steps that may be described does not necessarily indicate a requirement that the steps be performed in that order. The steps of processes described herein may be performed in any order practical. Further, some steps may 15 be performed simultaneously.
[032]
At step 302 of the method 300, the one or more hardware processors 104 are configured to receive an input query from a user via the UI of the chatbot. This is the first step of the user screen, wherein the input provided by the user is referred to as input query. The information processing model 110 receives the input 20 query from a user wherein processing of the input query is executed by a dialogflow created prior to the input query, and wherein the chatbot generates the plurality of contextually aware response from a pre-processed reference document. The dialogflow is created for the chatbot by scripting a plurality of dialogue elements for the chatbot. Each node of the dialogue element enables forward conversation 25 supporting natural language processing (NLP). The dialogflow is designed to receive the input query as natural language dialog inputs, including text inputs and speech inputs. A natural language understanding (NLU) engine may process the text words to determine corresponding semantic interpretations. An automatic speech recognition (ASR) engine processes the speech inputs to determine 30 corresponding sequences of representative text words. Further, the representative
19
texts are processed to determine corresponding semantic interpretations. The
dialogflow is customizable at the administrator level and can be edited based on respective business process. The dialogflow is integrated with the chatbot for further processing. The chatbot is expected to generate the plurality of contextually aware responses from the reference document pre-processed by the information 5 processing model 110. The reference document is previously mapped to a plurality of nodes of the dialogflow. The dialogflow facilitate an illustrative organizational structure for a task specified by the user. The dialogflow application forms a tree like structure having a root node (also known as parent node) and a plurality of child nodes. The root node may be the topmost node in the task specification layer. 10 The root node may control the execution of the plurality of child nodes that are both connected to the root node in the tree diagram of the application. Each node of the tree is mapped to the document to be processed by the system 100. The reference document which contains information related to the nodes are mapped to respective nodes of the dialogflow. When the chatbot is activated, the input query 15 along with the respective documents are mapped to the current node selected in the conversation and sent to the chatbot. These documents are used as reference by the chatbot to generate contextually aware responses for the input query.
[033]
At step 304 of the method 300, the one or more hardware processors 104 are configured to probe the input query against the dialogflow to derive a 20 confidence score. Once the input query is received it is processed as input to a matching algorithm. This algorithm takes the input query and performs a full search on the nodes present in the dialogflow to derive the confidence score. If a match is found, the matched node is returned as response to the user. Once the information processing model 110 receives input query, the dialogflow scans the input query 25 against the repository mapped to the respective nodes of the dialogflow. The dialogflow nodes are also mapped to a repository. The repository is a centralized database of historical queries maintained in database 108 and the respective response provided by the chatbot. Once the document is mapped in the dialogflow nodes, the information processing model 110 further scans the repository to map 30
20
the input query with the historical query
-response pair already existing in the repository.
[034]
At step 310 of the method 300, the one or more hardware processors 104 are configured to process the input query as (a) routine input query or (b) atypical input query based on the confidence score. Once the input query is 5 received, the dialogflow model 110A sends it to the matching algorithm to get a confidence score against all the nodes present in the dialogflow. Based on the confidence score, if a match is found then the query is categorized as routine input query. If no match is found for the given query it will be categorized as a atypical input query. Therefore, there are two scenarios for the input query. In the first 10 scenario, the information processing model 110 via dialogflow module 110A handles the input query as a routine input query and in the second scenario, the information processing model 110 via LLM module 110B handles the input query as a atypical input query. While processing the routine input query, the dialogflow is scanned to find a suitable response for the input query. Upon fetching the suitable 15 response and by validating the context, the dialogflow model 110A triggers the contextually aware response to the user. This utilization of fetching the response from the repository saves computation time and efforts which might go in obtaining the contextually aware response from the LLM model.
In the second scenario, the information processing model 110 through LLM module 20 110B handles the input query as the atypical input query. The input query along with the reference document mapped to the present node in the conversation are sent as input to the chatbot. This stage acts as a pre-processing step to retrieve relevant context for the given input query before activating the LLM model for answer generation. The atypical input query is processed by tokenizing and further 25 embedding the atypical input query to obtain a query vector. Tokenization may be a breakup of the query string into one or more tokens. A multi-word tokenization strategy may split the query string based on a set of delimiters like common punctuations and marge multi-word expressions into single tokens, using a lexicon of multi-word expressions. The tokens obtained are then transformed into vectors, 30 which are numerical representations of these words. The given query is tokenized
21
using a tokenizer model. During tokenization the query is split word by word into small tokens along with preserving the semantic meaning of the tokens. Here GPTTokenizer is used to tokenize the query. These tokens are sent to an embedding model, where the tokenized query is converted into a N dimensional vector of floating points. This vector of input query is referred to as “query vector”. 5 According to an embodiment of the present invention, Embedding model is used to generate embeddings. A similar process is performed on the given reference document. The reference document is tokenized into chunks to obtain a plurality of context vectors through the embedding model. Data is extracted from the document and is divided into context-chunks of a defined token length using character 10 splitters. These context-chunks are sent to the tokenizer model to get tokenized and then to the embedding model for generation of embedding vectors of the context-chunks. For both query and context the same tokenizer and embedding models are used. These context-chunks are then indexed and stored in a vector database along with their respective embedding vectors. These embedding vectors of the given 15 document are referred to as “context vectors”. Vector database is used to preserve the format of embedding vectors. Here Chroma DB (database) is used to store the vectors. The information processing model 110 generate embeddings. According to an embodiment of the present invention, the dialogflow is integrated to the vector database. The vector database is utilized in storing the embedding vectors. 20 Conventional database stores data in tables of rows and columns, whereas vector database stores data encoded as multi-dimensional numeric vectors. These vectors serve as numeric digital signatures capturing the essence of data. Vector databases can store and update data, handle various types of data sources, perform queries during data import, and provide user-friendly and enterprise-ready features. 25
[035]
The embedding refers to a process of mapping non-vectorized data (i.e. tokens in this case), into a vector space that has meaning for a machine learning model. The token length ranges from 5 to 1,500 tokens in length, depending on the scenario. Each token is then transformed into an embedding and vectorized. The tokens are mapped to dense vectors in the embedding space, which encode the 30 meanings of the words and their relationships to other words.
22
[036]
Further, information processing model 110 scans the vector database to identify a suitable match for the query vector wherein the vector database comprises of a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element. Further, cosine similarity is derived 5 among the query vector and the context vectors stored in the vector database. Cosine similarity is a measure of similarity between two non-zero vectors defined in an inner product space. Cosine similarity is the cosine of the angle between the vectors; that is, it is the dot product of the vectors divided by the product of their lengths. With cosine similarity, a higher score means the vectors have greater 10 similarity. It is a metric that is helpful in determining how similar the data objects are irrespective of their size. In cosine similarity, data objects in a dataset are treated as a vector. The formula to find the cosine similarity between two vectors is: (𝑥,𝑦)= 𝑥.𝑦||𝑥||||𝑦|| Where, x.y is the product (dot) of the vectors; x and y. ||x|| and ||y|| are the length 15 (magnitude) of the two vectors x and y. ||x|| ||y|| is the regular product of te two vectors x and y. The cosine similarity between two vectors is measured in 𝜃. If 𝜃=𝜃0, the x and y vectors overlap, thus proving they are similar. If 𝜃=9𝜃0, the x and y vectors are dissimilar.
[037]
Further, information processing model 110 obtains context of the 20 reference document for the input query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than pre-defined threshold. To retrieve the relevant context for the given input query from the given reference document, cosine similarity is performed between the query vector of the input query and all the context vectors of the document stored 25 in the vector database. In an embodiment of the present disclosure, the pre-defined threshold ranges from 30%-80%, preferably 40-70% and more preferably to 60%.
[038]
Next, the context and the input query are passed to a large language model (LLM). The LLM is a type of machine learning model designed to process and generate natural language text. LLMs are typically based on neural networks, 30
23
a type of artificial intelligence that is inspired by the structure and function of the
human brain. LLMs are used in a wide variety of natural language processing (NLP) tasks, such as language translation, text summarization, and chatbots. Some examples of popular LLMs include OpenAI’s ChatGPTTM, GPT-4TM, GPT-3.5TM, GPT-3TM, GPT-1TM, GPT-2TM, BERTTM, DALL-ETM, LLaMATM, MistralTM model 5 7B, GPT-Neo, Midjourney and the like. These models have achieved remarkable performance on a wide range of NLP tasks and are considered to be some of the most advanced AI systems in existence.
[039]
According to an embodiment of the present disclosure, MistralTM model 7B is utilized as the LLM for context-aware information processing of the 10 document by a chatbot wherein information is in the form of a text. Mistral 7B is a new 7.3 billion parameter language model that represents a major advance in large language model (LLM) capabilities. Mistral 7B uses Grouped-query Attention (GQA), which allows for faster inference times compared to standard full attention. Second, Sliding Window Attention (SWA) gives Mistral 7B the ability to handle 15 longer text sequences at a low cost. Based on the set threshold, context-chunks of all the matches of the cosine similarity, performed between query vector and context vectors, that are above the threshold value are augmented and passed as context to the LLM model along with the input query to generate the answer.
[040]
At step 312 of the method 300, the one or more hardware processors 20 104 are configured to generate a contextually aware response to the input query. Finally, a contextually aware response is generated to the input query from the LLM. Once the LLM receives the input query as question and the augmented context, it searches for the information relevant to the input query from the provided augmented context and generates a contextually aware response. 25
[041]
FIG. 4 is a flow diagram illustrating creation of embedding vectors from a reference document, according to some of the embodiments of the present invention.
[042]
As illustrated in the FIG. 4, the processing of the reference document starts from the admin screen 402. The admin creates a dialogflow 404 for the 30 chatbot by scripting a plurality of dialogue elements for the chatbot, and wherein
24
each node of the dialogue element enables forward conversation supporting natural
language processing (NLP). Further, nodes are added to the dialogflow for mapping the reference document at 406. The reference document is uploaded in the system 100 and processes according to the method described in the present disclosure. The reference document is the subject onto which all the input queries from the user are 5 directed. And the chatbot is expected to generate the plurality of contextually aware responses from the reference document and wherein, the reference document is previously mapped to a plurality of nodes of the dialogflow. The dialogflow with added nodes and the reference document being mapped with the respective nodes is saved by the admin at 408. To process the reference document, it is tokenized to 10 extract the text at 410. Text is extracted from the document and is divided into context-chunks of a defined token length using character splitters at 412. These context-chunks are sent to the tokenizer model to get tokens at 414. The tokens are then sent to the embedding model for generation of embedding vectors of the context-chunks. For both query and context, same tokenizer and embedding models 15 are used. These context-chunks are then indexed and stored in the vector database 416 along with their respective embedding vectors. These embedding vectors of the given document are referred to as “context vectors”. Thus, vector database is used to preserve the format of embedding vectors.
[043]
FIG. 5 is a flow diagram depicting preferential selection of routes to 20 process the input query as a routine query or as a new query, according to some of the embodiments of the present invention.
[044]
As illustrated in FIG. 5, the system 100 performs preferential selection of routes to process the input query. The process begins at user screen 502 wherein the reference document has already been uploaded and mapped to the 25 nodes of the dialogflow through which chatbot is to be traversed to generate the context-aware response. The user screen provides a console to ask the query. The user enters the query 504 into the system 100. The information processing model 110 directs the query to the dialogflow and scans the nodes of the dialogflow at 506 to identify whether the query has a mapped precedence to one of the nodes of the 30 database. Simultaneously, the information processing model 110 also identify the
25
response given by the chatbot to the mapped query.
Once the input query is received, it is sent as input to matching algorithm to get a confidence score 508 against all the nodes present in the dialogflow. Based on the confidence score, if a match is found then the query is categorized as routine input query. The confidence score is derived by fuzzy logic to derive confidence score while finding appropriate 5 match for the query from the dialogflow. If no match is found for the given query it will be categorized as atypical input query. For the query identified as the routine query, the LLM module 110B triggers the context-aware response to the user. For the query identified as the new query, it is taken for tokenization using a tokenizer model at 510. During tokenization the query is split word by word into small tokens 10 along with preserving the semantic meaning of the tokens. These tokens are sent to the embedding model, where the tokenized query is converted into a N dimensional vector of floating points. This vector of input query is referred to as “query vector”. Similarly, data is extracted from the reference document and is divided into context-chunks of a defined token length using character splitters. These context-chunks are 15 sent to the tokenizer model to get tokenized and then to the embedding model for generation of embedding vectors of the context-chunks. For both query and context same tokenizer and embedding models are used. These context-chunks are then indexed and stored in a vector database along with their respective embedding vectors. These embedding vectors of the given document are referred to as “context 20 vectors”. Further, the vector database is scanned to identify a suitable match for the query vector wherein the vector database comprises of a plurality of context vectors obtained by tokenizing the reference document. Based on suitable match, cosine similarity is derived at 512 among the plurality of query vector and the context vectors stored in the vector database. Thus, context of the reference document is 25 obtained for the query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than pre-defined threshold. Based on the pre-defined threshold, context-chunks of all the matches of the cosine similarity, performed between query vector and context vectors, that are above the threshold value are augmented and passed at 514 as context to the LLM 30 model along with the input query to generate the answer. Finally, the information
26
processing model 110
generates contextually aware response to the input query from the LLM. The context length can be controlled to the maximum token limit of the LLM.
[045]
FIG. 6 illustrates end-to-end flow of query-response cycle executed by a chatbot using the LLM model, according to some of the embodiments of the 5 present invention.
[046]
As illustrated in FIG. 6, the system 100 executes end-to-end flow of query-response cycle for context-aware information processing by a chatbot. As the user 602 upload the reference document to be processed by the system 100. The information processing model 110 receives the reference document 604 that is to 10 be processed for context-aware information extraction by a chatbot. The reference document is directed to map against nodes of a dialogflow. The dialogflow is created for the chatbot by scripting a plurality of dialogue elements for the chatbot, and wherein each node of the dialogue element enables forward conversation supporting natural language processing (NLP). The reference document are mapped 15 to respective nodes of the dialogflow. When the chatbot is activated, input query along with the respective documents mapped to the current node selected in the conversation, are sent to the chatbot. These documents are used as reference by the chatbot to generate contextually aware responses for the input query. Now, the user 602 prompts the input query 606 to the information processing model 110. This is 20 the first step of a user screen, wherein the input provided by the user is referred as input query. The input query is then probed against the dialogflow to derive a confidence score. Once the input query is received it is given as input to a matching algorithm. This algorithm takes the input query and performs a full search on the nodes present in the dialogflow to derive a confidence score. While scanning the 25 nodes to identify matching query, the algorithm also scans the context 608. If a match is found, the input query is treated as the routine input query and the dialogflow module 110A returns the response 618 to the user. Hence, the chatbot prompts the output 620 to the user screen. According to an embodiment of the present disclosure, conversation history of the user and the chatbot is utilized in 30 deriving the context of the input query while processing the routine input query. If
27
the algorithm does not find any match, the information processing model 110
categorize the same query 606 as atypical input query. The atypical input query is handled by LLM module 110B to generate the context aware response. Firstly, the atypical input query undergo pre-processing steps which involves tokenizing the atypical input query and further processing the tokens in an embedding model to 5 obtain query vectors. Similarly, the reference document is also tokenized into chunks to obtain a plurality of context vectors through the embedding model. The context vectors are stored in a vector database. The information processing model 110 further derives cosine similarity 610 among the query vector and the plurality of context vectors stored in the vector database. Once the atypical input query is 10 processed, the information processing model 110 derives the context as the LLM requires both the query as well as the context to generate the context-aware response. The context 608 from the reference document for the input query is obtained when the cosine similarity between query vector and the context vectors stored in the vector database is greater than the pre-defined threshold. The atypical 15 input query and the context are given to the prompt_template 612 in a below format:
prompt_template = (LLM instructions + context + input query)
[047]
The prompt_template is then passed to the LLM model 614. Once the LLM 614 receives the atypical input query as question and augmented context 20 as input, it searches for the information relevant to the query from the provided augmented context and generates a contextually aware response 616.
[048]
The written description describes the subject matter herein to enable any person skilled in the art to make and use the embodiments. The scope of the subject matter embodiments is defined by the claims and may include other 25 modifications that occur to those skilled in the art. Such other modifications are intended to be within the scope of the claims if they have similar elements that do not differ from the literal language of the claims or if they include equivalent elements with insubstantial differences from the literal language of the claims.
[049]
The embodiments of present disclosure herein address unresolved 30 problem of efficiently processing the information by a chatbot and prompting the context-aware response. The two-way approach of handling query resulted into
28
computationally efficient process. When the system receives the query it classifies
it either as a routine input query or as a atypical input query and process them accordingly. The routine input query processing is benefitted by a previously mapped reference document to the nodes of the dialog box. This arrangement makes use of already processed queries and the already prompted responses of the chatbot. 5 This type of segregation of the queries prevents computationally expensive processing of the query through the LLM. The dialogflow triggers context-aware response to the user for the routine input query and the LLM generates context-aware response to the user for the atypical input query.
[050]
According to an embodiment of the present invention, the system 10 100 manages conversation history between the chatbot and the user and context to ensure coherent interactions. This includes, keeping a track of the conversation history, including user queries and system responses. According to an embodiment of the present invention, the system 100 further prunes or updates the conversation context to prevent excessive context length. Further, a feedback loop is 15 implemented which is a feedback mechanism where users can rate the quality of responses. And the user feedback is used to fine-tune the LLM and update the knowledge base. The user feedback is also utilized in continuously re-train the LLM on user feedback to improve response quality. The context-aware information processing system developed according to the present disclosure is deployable and 20 can be integrated to a variety of platforms. This could be a web application, mobile app, chatbot platform, or messaging service. This is executed by integrating context-aware information processing system with the existing systems and data sources for seamless access to knowledge and data. According to an embodiment of the present invention, the vector database is updated regularly with new 25 knowledge items and periodically re-embedding existing items.
[051]
Several advantages are associated with the present context-aware information processing system. The context-aware information processing system ensures security and privacy compliance by implementing security measures to protect sensitive information in the knowledge base. It also ensure compliance with 30 privacy regulations, especially when dealing with user data. The context-aware
29
information processing system, depending on the usage and workload, consider
scaling the system to handle increased traffic efficiently. It optimizes the pipeline components for speed and resource efficiency. The context-aware information processing system addresses error handling and failover to ensure system reliability and availability. The context-aware information processing system developed 5 according to the present disclosure ensures that the system complies with relevant industry regulations and standards, especially in cases where it handles sensitive or regulated information.
[052]
It is to be understood that the scope of the protection is extended to such a program and in addition to a computer-readable means having a message 10 therein; such computer-readable storage means contain program-code means for implementation of one or more steps of the method, when the program runs on a server or mobile device or any suitable programmable device. The hardware device can be any kind of device which can be programmed including e.g., any kind of computer like a server or a personal computer, or the like, or any combination 15 thereof. The device may also include means which could be e.g., hardware means like e.g., an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a combination of hardware and software means, e.g., an ASIC and an FPGA, or at least one microprocessor and at least one memory with software processing components located therein. Thus, the means can include both 20 hardware means, and software means. The method embodiments described herein could be implemented in hardware and software. The device may also include software means. Alternatively, the embodiments may be implemented on different hardware devices, e.g., using a plurality of CPUs.
[053]
The embodiments herein can comprise hardware and software 25 elements. The embodiments that are implemented in software include but are not limited to, firmware, resident software, microcode, etc. The functions performed by various components described herein may be implemented in other components or combinations of other components. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can 30
30
comprise, store, communicate, propagate, or transport the program for use by or in
connection with the instruction execution system, apparatus, or device.
[054]
The illustrated steps are set out to explain the exemplary embodiments shown, and it should be anticipated that ongoing technological development will change the manner in which particular functions are performed. 5 These examples are presented herein for purposes of illustration, and not limitation. Further, the boundaries of the functional building blocks have been arbitrarily defined herein for the convenience of the description. Alternative boundaries can be defined so long as the specified functions and relationships thereof are appropriately performed. Alternatives (including equivalents, extensions, 10 variations, deviations, etc., of those described herein) will be apparent to persons skilled in the relevant art(s) based on the teachings contained herein. Such alternatives fall within the scope of the disclosed embodiments. Also, the words “comprising,” “having,” “containing,” and “including,” and other similar forms are intended to be equivalent in meaning and be open ended in that an item or items 15 following any one of these words is not meant to be an exhaustive listing of such item or items or meant to be limited to only the listed item or items. It must also be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural references unless the context clearly dictates otherwise.
[055]
Furthermore, one or more computer-readable storage media may be 20 utilized in implementing embodiments consistent with the present disclosure. A computer-readable storage medium refers to any type of physical memory on which information or data readable by a processor may be stored. Thus, a computer-readable storage medium may store instructions for execution by one or more processors, including instructions for causing the processor(s) to perform steps or 25 stages consistent with the embodiments described herein. The term “computer-readable medium” should be understood to include tangible items and exclude carrier waves and transient signals, i.e., be non-transitory. Examples include random access memory (RAM), read-only memory (ROM), volatile memory, nonvolatile memory, hard drives, CD ROMs, DVDs, flash drives, disks, and any 30 other known physical storage media.
31
[056]
It is intended that the disclosure and examples be considered as exemplary only, with a true scope of disclosed embodiments being indicated by the following claims.We Claim:
1. A processor implemented method of obtaining contextually aware response from a chatbot, the method comprising steps:
receiving (302), via the one or more hardware processors, an input query from a user wherein processing of the input query is executed by a dialogflow created prior to the input query, and wherein the chatbot generates the plurality of contextually aware response from a pre-processed reference document; probing (304), via the one or more hardware processors, the input query against the dialogflow to derive a confidence score;
processing (306), via the one or more hardware processors, the input query as (a) routine input query if the confidence score is above a pre-defined confidence threshold and (b) atypical input query if the confidence score is below the pre-defined confidence threshold, wherein the routine input query is processed by:
scanning the dialogflow nodes to find a suitable response wherein, the nodes are mapped to a previously handled query and previously processed response of the chatbot, triggering the contextually aware response to the input query; the atypical input query is processed by:
tokenizing the atypical input query to obtain a query vector through an embedding model,
tokenizing the reference document into chunks to obtain a plurality of context vectors through the embedding model, scanning a vector database to identify a suitable match for the query vector, wherein the vector database comprises a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element;

deriving cosine similarity among the query vector and the plurality of context vectors stored in the vector database; obtaining context of the reference document for the input query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than a pre-defined similarity threshold;
passing context and the input query to a large language model (LLM); generating (308), via the one or more hardware processors, the contextually aware response to the input query from the LLM.
2. The method as claimed in claim 1, wherein the dialogflow for the chatbot is created by scripting a plurality of dialogue elements for the chatbot, and wherein each node of the dialogue element enables forward conversation supporting natural language processing (NLP).
3. The method as claimed in claim 1, the reference document is in the form of a text editable format and the reference document is processed by mapping the reference document with the plurality of nodes of the dialogflow, and wherein the chatbot is expected to generate the plurality of contextually aware response from the reference document previously mapped to a plurality of nodes of the dialogflow.
4. The method as claimed in claim 1, wherein the input query is in the form of a text or a voice.
5. The method as claimed in claim 1, wherein, the dialogflow is integrated to the vector database.
6. The method as claimed in claim 1, wherein, the confidence score for the input
query is derived by (a) analyzing conversation history to identify a matching query,

(b) response of the chatbot for the matching query, and (c) user feedback against chatbot response for the matching query.
7. The method as claimed in claim 1, wherein the method captures user feedback
and utilizes the user feedback for (a) updation of the dialogflow and (b) updation
of vector database.
8. A system (100), comprising:
a memory (102) storing instructions; one or more communication interfaces (106); and
one or more hardware processors (104) coupled to the memory (102) via the one or more communication interfaces (106), wherein the one or more hardware processors (104) are configured by the instructions to: receive, an input query from a user wherein processing of the input query is executed by a dialogflow created prior to the input query, and wherein the chatbot generates the plurality of contextually aware response from a pre-processed reference document;
probe, the input query against the dialogflow to derive a confidence score; process, the input query as (a) routine input query if the confidence score is above a pre-defined confidence threshold and (b) atypical input query if the confidence score is below the pre-defined confidence threshold, wherein the routine input query is processed by:
scanning the dialogflow nodes to find a suitable response wherein, the nodes are mapped to a previously handled query and previously processed response of the chatbot, triggering the contextually aware response to the input query; the atypical input query is processed by:
tokenizing the atypical input query to obtain a query vector through an embedding model,

tokenizing the reference document into chunks to obtain a plurality of context vectors through the embedding model, scanning a vector database to identify a suitable match for the query vector, wherein the vector database comprises a plurality of context vectors obtained by embedding the reference document, and wherein the reference document is previously mapped to the plurality of nodes of the dialogue element; deriving cosine similarity among the query vector and the plurality of context vectors stored in the vector database; obtaining context of the reference document for the input query wherein the derived cosine similarity between query vector and the context vectors stored in the vector database is greater than a pre-defined similarity threshold;
passing context and the input query to a large language model (LLM); generate, the contextually aware response to the input query from the LLM.
9. The system as claimed in claim 8, wherein the dialogflow for the chatbot is
created by scripting a plurality of dialogue elements for the chatbot, and wherein
each node of the dialogue element enables forward conversation supporting natural
language processing (NLP).
10. The system as claimed in claim 8, the reference document is in the form of a
text editable format and the reference document is processed by mapping the
reference document with the plurality of nodes of the dialogflow, and wherein the
chatbot is expected to generate the plurality of contextually aware response from
the reference document previously mapped to a plurality of nodes of the dialogflow.
11. The system as claimed in claim 8, wherein the input query is in the form of a
text or a voice.

12. The system as claimed in claim 8, wherein, the dialogflow is integrated to the vector database.
13. The system as claimed in claim 8, wherein, the confidence score for the input query is derived by (a) analyzing conversation history to identify a matching query, (b) response of the chatbot for the matching query, and (c) user feedback against chatbot response for the matching query.
14. The system as claimed in claim 8, wherein the method captures user feedback and utilizes the user feedback for (a) updation of the dialogflow and (b) updation of vector database.

Documents

Application Documents

# Name Date
1 202421014669-STATEMENT OF UNDERTAKING (FORM 3) [28-02-2024(online)].pdf 2024-02-28
2 202421014669-REQUEST FOR EXAMINATION (FORM-18) [28-02-2024(online)].pdf 2024-02-28
3 202421014669-FORM 18 [28-02-2024(online)].pdf 2024-02-28
4 202421014669-FORM 1 [28-02-2024(online)].pdf 2024-02-28
5 202421014669-FIGURE OF ABSTRACT [28-02-2024(online)].pdf 2024-02-28
6 202421014669-DRAWINGS [28-02-2024(online)].pdf 2024-02-28
7 202421014669-DECLARATION OF INVENTORSHIP (FORM 5) [28-02-2024(online)].pdf 2024-02-28
8 202421014669-COMPLETE SPECIFICATION [28-02-2024(online)].pdf 2024-02-28
9 202421014669-FORM-26 [16-03-2024(online)].pdf 2024-03-16
10 202421014669-Proof of Right [22-04-2024(online)].pdf 2024-04-22
11 Abstract1.jpg 2024-05-06
12 202421014669-FORM-26 [22-05-2025(online)].pdf 2025-05-22