Sign In to Follow Application
View All Documents & Correspondence

Method And System For Generating A Contextual Response To A User Prompt

Abstract: A method (300) and a system (100) for generating a contextual response to a user prompt is disclosed. The method (300) includes receiving, via an input/output module (122), the user prompt as a user input. The user prompt includes at least one of a text prompt, an audio prompt, and a visual prompt. Further, the method (300) includes generating, via a prompt module (126), a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile. The user-adaptive prompt indicates a personalized prompt for the user. Furthermore, the method (300) includes generating, via a large language model (LLM) (128), a pre-response to the user prompt based on the user-adaptive prompt. Moreover, the method (300) includes generating, via the prompt module, the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile.

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
18 March 2024
Publication Number
38/2025
Publication Type
INA
Invention Field
PHYSICS
Status
Email
Parent Application

Applicants

Bharat Electronics Limited
Corporate Office, Outer Ring Road, Nagavara, Bangalore - 560045, Karnataka, India.

Inventors

1. SINGH, Ganesh Bahadur
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.
2. SHARMA, Nitin
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.
3. KUMAR, Rajdeep
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.
4. GHOSH, Rudra Chandra
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.
5. GAUR, Satyavrat
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.
6. SHAILENDRA, Pasi
Central Research Laboratory, Bharat Electronics Ltd, Sahibabad, Industrial Area Site IV, Ghaziabad - 201010, Uttar Pradesh, India.

Specification

DESC:TECHNICAL FIELD
[0001] The present disclosure relates to generating responses, and more particularly, to a method and a system for generating a contextual response to a user prompt.
BACKGROUND
[0002] The information in this section merely provides background information related to the present disclosure and may not constitute prior art(s) for the present disclosure.
[0003] A mental and emotional well-being of a person needs to be taken care of as much as the person’s bodily well-being. Mental health problems can have a substantial impact on the person’s everyday life, relationships, and general functioning. These problems may include anxiety, sadness, stress, and more severe diseases such as bipolar disorder or schizophrenia. To better understand and control the emotions, the person can examine his ideas, feelings, and experiences in a safe and controlled setting by seeking mental health care.
[0004] Mental health support is very essential as it fosters open communication and lessens the stigma associated with mental health issues. A common reason why people put off asking for assistance is fear of being misunderstood or judged. The person seeking counselling and treatment can voice their issues in a non-judgemental and empathic environment provided by mental health specialists.
[0005] Furthermore, prompt intervention can stop mental health problems from getting worse and having more severe repercussions. The prompt intervention can give people resilience, coping mechanisms, and empowerment, thereby promoting a happier and more satisfying existence.
[0006] Various innovative solutions have emerged in mental health support to empower individuals and enhance their well-being. A patent document JP2015122017A entitled, “Mental Support System and Method” describes the mental health management support system includes a portable terminal 1 on which a subject person of health management inputs a desire level of each of plural desires and a desire satisfied level of the respective desires. The system includes a management terminal 2 that receives the desired level and satisfied level of the desires from the portable terminal 1. Further, management terminal 2 can be configured to display the desired level and the satisfied level of the desires transmitted via portable terminal 1. The system pioneers self-expression through portable terminals, enabling users to articulate their desires and satisfaction levels. The self-monitoring approach can allow the users to actively participate in managing their mental health.
[0007] Another patent document JP2014085846A describes a mental health support system capable of supporting a returner to smoothly exercise his/her own workforce and to continuously maintain the willingness to work. The mental health support system presents a comprehensive approach, tracking facets of an individual’s life for a more holistic mental well-being. The data collected is shared with healthcare providers, thereby facilitating tailored support based on the individual data and fostering improved mental health outcomes.
[0008] Another patent document entitled, “Mental health care support device, system, method, and program” employs statistical models to estimate emotional states by analyzing automatic thoughts and feelings. This approach can significantly impact remote mental health support, bridging gaps for individuals with limited access to in-person services. In contrast, another Patent document entitled, “Service System Based on an Open Framework for Mental Healthcare” prioritizes real-time, two-way online communication between psychological support experts and clients. A multi-faceted system simplifies scheduling, counselling, and psychological tests, making mental health support accessible and convenient.
[0009] Yet another patent document entitled, “System and method for virtual mental health system infrastructure” leverages eLearning principles, introducing visual learning methods and avatars to simplify complex technical terms. Another patent document US20220093253A1 entitled, “Mental health platform” describes a mental health platform for clinicians and patients. A computing system generates a plurality of sets of training data. The plurality of sets of training data includes portions of journals and inputs to mental health questionnaires corresponding to a plurality of patients. The computing system generates a prediction model to generate a health score of a patient, the health score indicative of the current mental health of the patient. The computing system receives input from a target patient. The input includes target responses to mental health questionnaires and target journal entries. The computing system analyzes the journal entries using natural language processing to tag portions of the journal entry with semantic tone and sentiment indicators. The computing system generates, via the prediction model, a target health score for the target patient based on the target responses and the target journal entries.
[0010] However, the aforementioned documents mainly rely on probabilistic and transformation-based models. The existing prior arts primarily focus on mental health support through text-based interactions. Traditionally, the methods heavily rely on fine-tuning models using specific domain datasets.
[0011] Therefore, there is a need in the art to provide an improved method and a system for generating a contextual response to a user prompt that prioritizes personalization, adjusting recommendations, and interventions to each user’s unique needs and situations to promote successful and customized mental health therapy.
[0012] The drawbacks/difficulties/disadvantages/limitations of the conventional techniques explained in the background section are just for exemplary purposes and the disclosure would never limit its scope only such limitations. A person skilled in the art would understand that this disclosure and below mentioned description may also solve other problems or overcome the other drawbacks/disadvantages.
SUMMARY
[0013] This summary is provided to introduce a selection of concepts, in a simplified format, that are further described in the detailed description of the invention. This summary is neither intended to identify essential inventive concepts of the invention nor is it intended for determining the scope of the invention.
[0014] According to an aspect of the present disclosure, a method for generating a contextual response to a user prompt is disclosed. The method includes receiving, via an input/output module, the user prompt as a user input. The user prompt includes at least one of a text prompt, an audio prompt, and a visual prompt. Further, the method includes generating, via a prompt module, a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile. The user-adaptive prompt indicates a personalized prompt for the user. Furthermore, the method includes generating, via a large language model (LLM), a pre-response to the user prompt based on the user-adaptive prompt. Moreover, the method includes generating, via the prompt module, the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile.
[0015] According to another aspect of the present disclosure, a system for generating a contextual response to a user prompt is disclosed. The system includes a memory, and at least one processor in communication with the memory. The at least one processor is configured to receive, via an input/output module, the user prompt as a user input. The user prompt comprises at least one of a text prompt, an audio prompt, and a visual prompt. Further, the at least one processor is adapted to generate, via a prompt module, a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile. The user-adaptive prompt indicates a personalized prompt for the user. Furthermore, the at least one processor is configured to generate, via a via a large language model (LLM), a pre-response to the user prompt based on the user-adaptive prompt. Moreover, the at least one processor is configured to generate, via the prompt module, the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile.
[0016] To further clarify the advantages and features of the present invention, a more particular description of the invention will be rendered by reference to specific embodiments thereof, which are illustrated in the appended drawings. It is appreciated that these drawings depict only typical embodiments of the invention and are therefore not to be considered limiting of its scope. The invention will be described and explained with additional specificity and detail in the accompanying drawings.
BRIEF DESCRIPTION OF THE FIGURES
[0017] These and other features, aspects, and advantages of the present invention will become better understood when the following detailed description is read with reference to the accompanying drawings in which like characters represent like parts throughout the drawings, wherein:
[0018] Figure 1 illustrates a schematic block diagram depicting an environment for the implementation of a system for generating a contextual response to a user prompt, in accordance with an embodiment of the present disclosure;
[0019] Figure 2 illustrates a schematic block diagram of the system for generating the contextual response to the user prompt, in accordance with an embodiment of the present disclosure;
[0020] Figure 3 illustrates a flowchart depicting an exemplary method for generating the contextual response, in accordance with an embodiment of the present disclosure;
[0021] Figure 4 illustrates a schematic flow diagram for generating the contextual response, in accordance with an embodiment of the present disclosure;
[0022] Figure 5A illustrates a block diagram representing an audio-text processing module, in accordance with an embodiment of the present disclosure;
[0023] Figure 5B illustrates a flowchart of operating an audio-to-text module of the audio-text processing module, in accordance with an embodiment of the present disclosure;
[0024] Figure 5C illustrates a flowchart of operating of a text-to-audio module of the audio-text processing module, in accordance with an embodiment of the present disclosure;
[0025] Figure 6 illustrates a flowchart depicting sub-steps for generating a user-adaptive prompt, in accordance with an embodiment of the present disclosure;
[0026] Figure 7 illustrates a block diagram depicting functional components of a prompt module, in accordance with an embodiment of the present disclosure;
[0027] Figure 8 illustrates a flowchart depicting sub-steps for generating a pre-response, in accordance with an embodiment of the present disclosure;
[0028] Figure 9 illustrates a block diagram representing a machine learning (ML) model and information flow through a model decision classifier, in accordance with an embodiment of the present disclosure;
[0029] Figure 10 illustrates a flowchart depicting of steps of a named entity recognition (NER) sub-module, in accordance with an embodiment of the present disclosure;
[0030] Figure 11 illustrates a flowchart depicting steps of a classifier sub-module, in accordance with an embodiment of the present disclosure;
[0031] Figure 12 illustrates a flowchart depicting steps of a question-answer (QA) sub-module, in accordance with an embodiment of the present disclosure;
[0032] Figure 13 illustrates a block diagram representing a database of the system, in accordance with an embodiment of the present disclosure; and
[0033] Figure 14 illustrates a flowchart of example operations of the prompt module, in accordance with an embodiment of the present disclosure.
[0034] Further, skilled artisans will appreciate that elements in the drawings are illustrated for simplicity and may not have necessarily been drawn to scale. For example, the flow charts illustrate the method in terms of the most prominent steps involved to help improve understanding of aspects of the present invention. Furthermore, in terms of the construction of the device, one or more components of the device may have been represented in the drawings by conventional symbols, and the drawings may show only those specific details that are pertinent to understanding the embodiments of the present invention so as not to obscure the drawings with details that will be readily apparent to those of ordinary skill in the art having the benefit of the description herein.
DETAILED DESCRIPTION OF THE FIGURES
[0035] For the purpose of promoting an understanding of the principles of the invention, reference will now be made to the various embodiments and specific language will be used to describe the same. It should be understood at the outset that although illustrative implementations of the embodiments of the present disclosure are illustrated below, the present invention may be implemented using any number of techniques, whether currently known or in existence. The present disclosure is not necessarily limited to the illustrative implementations, drawings, and techniques illustrated below, including the exemplary design and implementation illustrated and described herein, but may be modified within the scope of the present disclosure.
[0036] It will be understood by those skilled in the art that the foregoing general description and the following detailed description are explanatory of the invention and are not intended to be restrictive thereof.
[0037] Reference throughout this specification to “an aspect”, “another aspect” or similar language means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrase “in an embodiment”, “in another embodiment” and similar language throughout this specification may, but do not necessarily, all refer to the same embodiment.
[0038] It is to be understood that as used herein, terms such as, “includes,” “comprises,” “has,” etc. are intended to mean that the one or more features or elements listed are within the element being defined, but the element is not necessarily limited to the listed features and elements, and that additional features and elements may be within the meaning of the element being defined. In contrast, terms such as, “consisting of” are intended to exclude features and elements that have not been listed.
[0039] The embodiments herein and the various features and advantageous details thereof are explained more fully with reference to the non-limiting embodiments that are illustrated in the accompanying drawings and detailed in the following description. Descriptions of well-known components and processing techniques are omitted to not unnecessarily obscure the embodiments herein. Also, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments can be combined with one or more other embodiments to form new embodiments. The term “or” as used herein, refers to a non-exclusive or unless otherwise indicated. The examples used herein are intended merely to facilitate an understanding of ways in which the embodiments herein can be practiced and to further enable those skilled in the art to practice the embodiments herein. Accordingly, the examples should not be construed as limiting the scope of the embodiments herein.
[0040] As is traditional in the field, embodiments may be described and illustrated in terms of blocks that carry out a described function or functions. These blocks, which may be referred to herein as units or modules or the like, are physically implemented by analog or digital circuits such as logic gates, integrated circuits, microprocessors, microcontrollers, memory circuits, passive electronic components, active electronic components, optical components, hardwired circuits, or the like, and may optionally be driven by firmware and software. The circuits may, for example, be embodied in one or more semiconductor chips, or on substrate supports such as printed circuit boards and the like. The circuits constituting a block may be implemented by dedicated hardware, by a processor (e.g., one or more programmed microprocessors and associated circuitry), or by a combination of dedicated hardware to perform some functions of the block and a processor to perform other functions of the block. Each block of the embodiments may be physically separated into two or more interacting and discrete blocks without departing from the scope of the invention. Likewise, the blocks of the embodiments may be physically combined into more complex blocks without departing from the scope of the invention.
[0041] The accompanying drawings are used to help easily understand various technical features and it should be understood that the embodiments presented herein are not limited by the accompanying drawings. As such, the present disclosure should be construed to extend to any alterations, equivalents, and substitutes in addition to those which are particularly set out in the accompanying drawings. Although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are generally only used to distinguish one element from another.
[0042] Figure 1 illustrates a schematic block diagram depicting an environment 1000 for the implementation of a system 100 for generating a contextual response to a user prompt, in accordance with an embodiment of the present disclosure. In an embodiment, the present disclosure may be explained in reference to providing a mental health support to the user. In another embodiment, the present disclosure may also be utilized for other applications. In an embodiment, the user prompt may be provided by a user. In an exemplary scenario, the user may herein to a person who may be a patient or a mental health expert. In another example scenario, the user also may be the person other than the patient or the mental health expert. In one embodiment, the user prompt may herein alternatively refer to question(s) related to the mental health or any other topics.
[0043] In an embodiment, the environment 1000 may include but is not limited to the system 100 that may receive the user prompt from the user as a user input. In an embodiment. the user prompt may be in a form of a text prompt, an audio prompt, and/or a visual prompt. Further, the system 100 may be configured to generate a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile. In an embodiment, the user-adaptive prompt may indicate a personalized prompt for the user. Further, the system 100 may be configured to generate a pre-response to the user based on the user-adaptive prompt. Furthermore, the system 100 may be configured to generate the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored profile. Thereafter, the system 100 may transmit the contextual response to the user. In various embodiments, the user prompt or prompt may herein to question(s) within the scope of the present disclosure. In various embodiments, the contextual response may herein to answer(s) within the scope of the present disclosure.
[0044] Preferably, the generation of the contextual response is explained in detail in the forthcoming paragraphs in conjunction with Figures 2-14.
[0045] Figure 2 illustrates a schematic block diagram of the system 100 for generating the contextual response to the user prompt, in accordance with an embodiment of the present disclosure. In an embodiment, the system 100 may include a memory 102 including a database 104, a processor 106 communicatively coupled with the memory 102, and a plurality of modules 120. In an embodiment, the database 104 may include a knowledge base 708 and a user profile manager 710. The database 104 of the present disclosure is explained in detail in the forthcoming paragraphs in conjunction with Figure 13. In an embodiment, the system 100 may be implemented by a User Equipment (UE). In a non-limiting example, the UE may be a smartphone, a laptop computer, a desktop computer, a Personal Computer (PC), a notebook, a tablet or a smartwatch.
[0046] In another embodiment, the system 100 may be implemented by a cloud-based system, that may include the server, specifically a cloud server. In yet another embodiment, the system 100 may be implemented by a combination of the UE and the server. More specifically, one or more steps may be performed in the UE and remaining steps may be performed by the server.
[0047] In one embodiment, the memory 102 is configured to store instructions executable by the processor 106. In one embodiment, the memory 102 communicates via a bus within the system 100. The memory 102 includes but is not limited to, a non-transitory computer-readable storage media, such as various types of volatile and non-volatile storage media including, but not limited to, random access memory, read-only memory, programmable read-only memory, electrically programmable read-only memory, electrically erasable read-only memory, flash memory, magnetic tape or disk, optical media and the like. In one example, the memory includes a cache or random-access memory (RAM) for the processor 106. In alternative examples, the memory 102 is separate from the processor 106 such as a cache memory of a processor, the system memory, or other memory. The memory 102 is an external storage device or the memory 102 is for storing data. The memory 102 is operable to store instructions executable by the processor 106. The functions, acts, or tasks illustrated in the figures or described are performed by the programmed processor for executing the instructions stored in the memory 102. The functions, acts, or tasks are independent of the particular type of instruction set, storage media, processor, or processing strategy and may be performed by software, hardware, integrated circuits, firmware, micro-code, and the like, operating alone or in combination. Likewise, processing strategies include multiprocessing, multitasking, parallel processing, and the like.
[0048] As a non-limiting example, the processor 106 may be a single processing unit or a set of units each including multiple computing units. The processor 106 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuitries, and/or any devices that manipulate signals based on operational instructions (computer-readable instructions) stored in the memory 102. Among other capabilities, the processor 106 may be configured to fetch and execute computer-readable instructions and data stored in the memory 102. The processor 106 includes one or a plurality of processors. The plurality of processors is further implemented as a general-purpose processor, such as a central processing unit (CPU), an application processor (AP), or the like, a graphics-only processing unit, such as a graphics processing unit (GPU), a visual processing unit (VPU), and/or an AI-dedicated processor such as a neural processing unit (NPU). The plurality of processors controls the processing of the input data in accordance with a predefined operating rule or an artificial intelligence (AI) model stored in the memory 102. The predefined operating rule or the AI model is provided through training or learning.
[0049] In an embodiment, the system 100 may further include plurality of modules 120 may include the one or more instructions that may be executed to cause the system 100, in particular, the processor 106 of the system 100, to execute the one or more instructions. The plurality of modules 120 may include an input/output module 122, an audio-text processing module 124, a prompt module 126, and a large language model (LLM) 128 that may be part of a machine learning (ML) model 701. In an embodiment, the input/output module 122, the audio-text processing module 124, the prompt module 126, and the LLM 128 may be in communication with each other. Preferably, a detailed explanation of various functions of the processor 106, and/or the plurality of modules 120 may be explained in view of Figures 3-14.
[0050] Figure 3 illustrates a flowchart depicting an exemplary method 300 for generating the contextual response, in accordance with an embodiment of the present disclosure. In an embodiment, the method 300 is a computer-implemented method 300 which is explained in detail in the forthcoming paragraphs. Figure 4 illustrates a schematic flow diagram 400 for generating the contextual response, in accordance with an embodiment of the present disclosure.
[0051] Referring to Figure 3, the method 300 may begin with step 302 which may include receiving, via the input/output module 122, the user prompt as the user input. Referring to Figure 4, the audio prompt may be transmitted to the audio-text processing module 124.
[0052] In one embodiment, the method 300 may include determining whether the user prompt is the audio prompt. In a case, when the user prompt may be determined as the audio prompt, then at block 402, the input/output module 122 may be configured to receive the audio prompt and transmit the audio prompt to the audio-text processing module 124. Further, at block 404, the audio-text processing module 124 may be configured to determine a sample rate of the audio prompt and convert the audio prompt to the determined sample rate. The audio prompt converted in the determined sample rate may be then converted into a textual format prompt. Further, the audio-text processing module 124 may be configured to transmit the textual format prompt to the prompt module 126. In an embodiment, the audio-text processing module 124 may be discussed in conjunction with Figures 5A-5C.
[0053] Figure 5A illustrates a block diagram 500A representing the audio-text processing module 124, in accordance with an embodiment of the present disclosure. In an embodiment, the audio-text processing module 124 may include an audio-to text module and a text-to-audio module. In an embodiment, audio-to-text, or a speech-to-text, is a transformative technology that may convert spoken language into written text. The transformative technology aids in accessibility, transcription services, and content creation by enabling the extraction of valuable information from audio recordings. The transformation technology may employ advanced algorithms and machine learning (ML) model(s) 701 to recognize and transcribe spoken words accurately. In an embodiment text-to-speech (TTS) conversion is a technology that may synthesize written text into spoken words. This innovation process may facilitate accessibility, aid the visually impaired, and enhance the user’s experience in various applications. By leveraging the natural language processing and artificial intelligence, the TTS may generate human-like voices, thereby providing more immersive interaction with digital content. In an embodiment, the audio-to-text module may convert the speech audio that may be captured by the mic device or sent over the web socket. The audio-to-text module may record the audio by the mic device. In an embodiment, the sample rate of the recorded audio may be detected and converted to the sample rate of a converting model. The audio converted in a particular sample rate is then converted into text with the ML model(s) 701. In an embodiment, the text-to-audio module may synthesize the audio signal from the text input. The text-to-audio module may convert the text into speech using a concatenative synthesis, in which audio from the database 104 of pre-recorded sounds are pieced together to form words and sentences. The text-to audio module may analyze the received text and extract n-gram features. The n-gram features may be matched to the audio database to find the respective audio. The text-to-audio module may extract the largest matching n-gram audio file. In an embodiment, the audio files may be concatenated to generate a single audio file.
[0054] Figure 5B illustrates a flowchart 500B of operating the audio-to-text module of the audio-text processing module 124, in accordance with an embodiment of the present disclosure. At step 502, the audio-to-text module starts receiving audio or speech as input from a user. At step 504, a record audio block of the audio-to text module may handle audio input devices such as microphone. Apart from the microphone, the audio may be sent to the audio-to-text module by uploading the audio file such as .wav files or .mp3 files or .ogg file. For example, when the user is using the microphone, the record audio block may start recording the audio of the speech and save the audio speech primarily on the .wav file. The saved audio is then sent to a resampling module. At step 506, resampling of the saved file starts. The audio-to-text module may include an automated speech recognition (ASR) system that may have a trained module that is trained on data of audio samples on a particular sampling rate with corresponding words. The sample rate is the number of samples per second taken of a waveform to create a discrete digital signal. The higher the sample rate, the more snapshots may be captured of the audio signal. The audio sample rate is measured in kilohertz (kHz) and the audio sample rate may determine a range of frequencies captured in the digital audio.
[0055] In an embodiment, resampling of the audio file module may convert the sampling rate of the audio file to the one that matches the trained model input, in case the sample rate of the audio file does not match the trained model. For instance, the user has music sampled at 44.1kHz and wants to convert the music to a sample rate of 88.2Khz.i.e. a factor of precisely 2x the original sample rate. This may be a straightforward case as the user may take the 44.1 kHz samples and insert one additional sample exactly halfway between each one. The process of inserting the additional samples is called interpolation. The sampled output file is then sent to the ASR system at step 508. The ASR system with the trained model such as but not limited to a Vosk, a whisper, and an open artificial intelligence (AI) model covert the audio sampled file to the text in the audio. At step 510, the ASR system may determine whether some text is present. In case some text is present, then the ASR system may produce output at step 512, otherwise, the ASR system may produce an error at step 514. In an embodiment, the audio-to-text module may be run in devices such as but not limited to raspberry pi devices, thin clients, and low-power devices having microphone capabilities.
[0056] Figure 5C illustrates a flowchart 500C of operating the text-to-audio module of the audio-text processing module 124, in accordance with an embodiment of the present disclosure. The system 100 may generate the output that need to be sent to the user. The response of the system 100 that has to be intimated to the user may be in the form of the text or the natural language signal like audio being recited to the user. The audio may either be in the mp3 file, the .ogg file, or the Wav file. The audio may be played on a speaker, which may be installed at a frequency that is audible to the user. The system 100 may produce the output in the form of answers like “The fact regarding mental health is independent on the environment” or “The advice for a person having bad mental health is having enough sleep”. The system 100 may ask the user question(s) such as “In which context?” or “May you please elaborate”. At step 516, the text-to-audio module receives output in the text form from the prompt module 126. At step 518, a text-processing of the received text may be performed. At the said step, the text-to-audio module may correct spelling, subsume sentences, tokenization, remove the stop sentences, lower casing, stemming to reduce to base words, and lemmatization grouping inflected forms together as a single base form.
[0057] Further, at steps 520-524, the processed text is then sent to a linguistic module. The linguistic module may include a phasing module, an intonation module, and a duration module. At step 520, the phasing module may insert natural and reasonable breaks into long sentences. Further, at step 522, the intonation module may change pitch of the output corresponding to the sentence such that the sentence may match the natural language. Furthermore, at step 524, the duration module may make length of the audio duration so that the audio may match the natural speaking of the sentences. Finally, all the information received from the linguistic module may be passed to a waveform generation module. At step 526, the waveform generation module may take the token of the sentences, and from the database 104 of the spoken words, the waveform generation module may add up to make the audio of the spoken with correct pause, break, the pitch of the words, and the duration of the pitch of the words to produce the final output. At step 528, the process of converting the text output to the audio stops. The final output is sent to the user in the .wav file, the .mp3 file, the .ogg file or played directly on the speaker installed on the small devices.
[0058] Again, referring to Figure 4, at block 406, the prompt module 126 may be configured to receive the textual format prompt corresponding to the audio prompt. In an embodiment, the prompt module 126 may be configured to generate the user-adaptive prompt using the user prompt as the textual format prompt.
[0059] More specifically, referring to Figure 3, at step 304, the method 300 may include generating, via the prompt module 126, the user-adaptive prompt based on correlating the user prompt with the set of predefined rules and the pre-stored user profile. In an embodiment, the set of predefined rules may be based on one or more keywords and one or more patterns associated with the user prompt.
[0060] In an embodiment, the generation of the user-adaptive prompt is explained in the forthcoming paragraphs in conjunction with Figures 6 and 7.
[0061] Figure 6 illustrates a flowchart depicting sub-steps for generating the user-adaptive prompt, in accordance with an embodiment of the present disclosure. Figure 7 illustrates a block diagram 700 depicting functional components of the prompt module 126, in accordance with an embodiment of the present disclosure.
[0062] At sub-step 602, the step 304 may include extracting the pre-stored user profile from the database 104. Further, at sub-step 604, a continuity analyzer 702 may identify the user prompt as one of a first prompt or a second prompt. In an embodiment, the second prompt may indicate a recurring prompt subsequent to the first prompt. More particularly, the continuity analyzer 702 may identify connections between subsequent question(s) during an interaction between the user and the system 100 during the conversation. In case the new question(s) continues with the previous question(s), then the prompt for the new question(s) may consider the previous question-answer or the first prompt.
[0063] Furthermore, at sub-step 606a, the step 304 may include performing transmitting the first prompt to the LLM 128 in response to determining the user prompt as the first prompt. In an embodiment, the LLM 128 may be a part of the ML model 701. In another embodiment, a sub-step 606b is followed. At sub-step 606b, the step 304 may include transmitting the second prompt, the first prompt, and the intent associated with the first prompt to the LLM 128 in response to determining the user prompt as the second prompt. In an embodiment, the intent may indicate a purpose associated with the first prompt.
[0064] Further, at sub-step 608, the step 304 may include receiving, from the LLM 128, a final intent associated with the transmitted prompt based on the set of predefined intents. More specifically, the new question(s) and the previous question(s) with the final intent are given to a classifier sub-module 904. The classifier sub-module 904 may return true or false values and the final intent for the new question(s) from the set of predefined intents. Each question-answer pair and the final intent associated with the each question-answer pair may be saved in the knowledge base 708 for future use.
[0065] Thereafter, at sub-step 610, the step 304 may include generating the user-adaptive prompt based on modifying the user prompt based on one or more of the received final intent, the set of predefined rules, and the pre-stored user profile. In an embodiment, the set of predefined rules may be aligned with the received final intent. More particularly, a user adaptive prompt generator 704 may provide personalization touch to the conversation. In an embodiment, parameters of every user may be present in the user profile manager 710. The active user’s profile may be completed by fetching the parameter values from the database 104. The generation of the prompt may consider information of the user, the question(s) asked, and the intent of the question(s). The prompt generation may rely on the predefined rules for the system 100.
[0066] Again, referring to Figure 3, at step 306, the method 300 may include generating, via the LLM 128, the pre-response to the user prompt based on the user-adaptive prompt. In an embodiment, the generation of the pre-response is explained in the forthcoming paragraphs in conjunction with Figure 8 and Figure 9.
[0067] Figure 8 illustrates a flowchart depicting sub-steps for generating the pre-response, in accordance with an embodiment of the present disclosure. Figure 9 illustrates a block diagram 900 representing the ML model 701 and information flow through a model decision classifier 901, in accordance with an embodiment of the present disclosure. Un an embodiment, In an embodiment. The ML model 701 may alternatively be termed a hybrid-multi-role pre-trained model and may utilize a named entity recognition (NER) sub-module 902, a classifier sub-module 904, and a question-answer (QA) sub-module 906.
[0068] Referring to Figure 8, at sub-step 802 may include receiving, from the prompt module 126, the user-adaptive prompt at the LLM 128. Specifically, at block 408, the LLM 128 may be configured to receive the user-adaptive prompt from the prompt module 126. Further, at sub-step 804, the step 306 may include converting the user-adaptive prompt into one or more first vector embeddings. In an embodiment, the one or more first vector embeddings may alternatively be termed as the first vector embedding(s) within the scope of the present disclosure.
[0069] Furthermore, at sub-step 806, the step 306 may include comparing the one or more first vector embeddings with one or more second vector embeddings alternatively termed as the second vector embedding(s) within the scope of the present disclosure. In an embodiment, the second vector embeddings may be stored in a vector database of the LLM 128. At sub-step 808, the step 406 may include retrieving one or more relevant responses from among a plurality of answers available in the LLM 128 based on the comparison. In an embodiment, the one or more relevant responses may alternatively be termed as the relevant response(s) within the scope of the present disclosure.
[0070] In one embodiment, the NER sub-module 902 may be configured to determine whether a context associated with a conversation has changed. In an embodiment, the conversation may include at least the first prompt and the second prompt, and the context may indicate one or more of a topic of the conversation and the intent of the conversation. In one embodiment, the operation of the NER sub-module 902 is discussed in detail in the forthcoming paragraphs.
[0071] In an embodiment, the NER sub-module 902 is a subtask of information extraction in natural language processing (NLP) that may identify and classify named entities mentioned in unstructured text into predefined strategies such as but not limited to person names, organizations, locations, dates, times, amounts, percentages, and the like. The NER sub-module 902 is a crucial step in many NLP applications, such as but not limited to question-answering, machine translation, and text summarization. The NER sub-module 902 may identify nouns in the given prompt, which is used to recognize whether the context associated with a conversation may be changed or not. In an embodiment, steps performed involved in the NER sub-module 902 are explained in conjunction with Figure 10.
[0072] Figure 10 illustrates a flowchart 1001 depicting steps of the NER sub-module 902, in accordance with an embodiment of the present disclosure. At step 1002, the NER sub-module 902 starts receiving a prompt text associated with the user prompt. At step 1004, a process of dividing a continuous stream of the prompt text into meaningful chunks is referred to as segmentation. The NER sub-module 902 focuses on individual entities rather than the entire text at once. After receiving the user prompt from the prompt module 126, the segmentation divides the user prompt into meaningful chunks.
[0073] At step 1006, a tokenization is performed on the segmented prompt to identify the named entity in the prompt. The tokenization identifies and classifies named entities in text. The tokenization involves breaking down a piece of text into individual tokens, which are typically words or sub-words. The choice of tokenization method can significantly impact performance of the NER sub-module 902.
[0074] At step 1008, a morphological and syntactic analysis is performed on the identified name entity. The morphological and syntactic analysis may involve breaking down words into constituent morphemes, the most minor meaningful language units. The morphological and syntactic analysis may identify a word’s root form or lemma, which is crucial for recognizing entities in different grammatical forms. For instance, in the sentence “The United States of America is a country”, morphological analysis reveals that “United States” is composed of two separate entities, “United” and “States”, and that “America” is a proper noun. The morphological and syntactic analysis is performed on the prompt to improve the identification accuracy of the named entity.
[0075] At step 1010, a part-of-speech (POS) tagging is performed to identify and classify named entities in text. The POS tags indicate a grammatical function of each word in a sentence, such as but not limited to a noun, a verb, an adjective, an adverb, a proposition, and the like. Information related to the grammatical function can help the NER sub-module 902 to better understand the relationships between words and identify patterns that are indicative of named entities. After the morphological and syntactic analysis, the POS tagging is performed to identify the named entity.
[0076] At step 1012, after identifying the POS in the given prompt, errors or any inconsistencies are removed by a post-processing module. The post-processing module may refine the output of the NER sub-module 902 to improve the accuracy and consistency of the given prompt. The post-processing module may involve various techniques to address errors, inconsistencies, and ambiguities in the initial NER predictions. At step 1014, the process of the NER sub-module 902 is completed.
[0077] In one embodiment, the classifier sub-module 904 may classify the user prompt as one of an unknown prompt or a known prompt based on the determination of the context associated with a conversation has changed. In one embodiment, the operation of the classifier sub-module 904 is discussed in detail in the forthcoming paragraphs.
[0078] More particularly, the classifier sub-module 904 may categorize or classify input data into one or more predefined classes or categories. The process of building a classifier involves training the ML model 701 on a labelled dataset, where each example in the dataset may be associated with a class label. Once trained, the classifier sub-module 904 may be used to predict the class label of new, unseen data. After receiving, the user prompt, the classifier sub-module 904 may be used to differentiate whether the user prompt is the known prompt or the unknown prompt based on the determination that the context associated with the conversation may be changed. In an embodiment, the known prompt is alternatively termed previous or old question(s), and the unknown prompt is alternatively termed new question(s) which is not related to previous question(s). In an embodiment, the steps involved in the classifier sub-module 904 are discussed in conjunction with Figure 11.
[0079] Figure 11 illustrates a flowchart 1100 depicting steps of the classifier sub-module 904, in accordance with an embodiment of the present disclosure. At step 1102, a classification task is initiated by the classifier sub-module 904. At step 1104, nouns of the new question(s) may be extracted using a flair model of hugging face. At step 1106, the classifier sub-module 904 may check whether the nouns are present in the new question. If NO, at step 1108, return 1, else proceed to step 1110. At step 1110, extract the nouns of the previous or old question(s).
[0080] At step 1112, the classifier sub-module 904 may compare between the old question and the new question to check whether the nouns of the new question are similar to primary nouns of the old questions. If nouns are similar, then return to step 1114, else return 0.
[0081] In an embodiment, the question-answer (QA) sub-module 906 may be configured to generate the relevant response(s) for the unknown prompt. In an embodiment, the unknown prompt may alternatively be termed as new question(s) which are not related to the old question(s) within the scope of the present disclosure. In an embodiment, the operation of the QA sub-module 906 is discussed in detail in the forthcoming paragraphs.
[0082] Again, referring to Figure 8, at sub-step 808, the step 306 may include retrieving one or more existing responses from among a plurality of responses or answers available at the LLM 128 for the known prompt.
[0083] Further, at sub-step 810, the step 306 may include generating the pre-response from the relevant response(s). In an embodiment, the generated pre-response may be based on ranking the relevant response(s) based on a similarity between the first vector embeddings and the second vector embedding(s) which is explained in detail with reference to Figure 12. In an embodiment, an adaptive response formatter 706 of the LLM 128 may be responsible for generating a final enhanced text of the pre-response or response received from the QA sub-module 906 as illustrated in Figure 7. A user-specific information or any other instruction based on the predefined rules may be added to the response to give a personalized feel to the answer. Furthermore, at sub-step 812, the step 306 may include filtering the relevant response(s) based on the final intent.
[0084] In an embodiment, the QA sub-module 906 is a type of artificial intelligence (AI) that may be trained to answer in a comprehensive and informative way, even if the user prompt is open-ended, challenging, or strange. The QA sub-module 906 may be trained by accessing and processing information from a variety of sources, including text documents, codes, and databases. The QA sub-module 906 may be designed for various domains, including but not limited to general knowledge, reading comprehension, customer support, and the like. In an embodiment, steps involved in the QA sub-module 906 is discussed with reference to Figure 12.
[0085] Figure 12 illustrates a flowchart 1200 depicting steps of the QA sub-module 906, in accordance with an embodiment of the present disclosure. At step 1202, a response generation process starts. At step 1204, a vector embedding is performed. The vector embedding plays a crucial role in the QA sub-module 906 and is one of a phase of the QA sub-module 906, thereby enabling effective processes and understanding a semantic relationships between words and phrases. The QA sub-module 906 may efficiently capture the context and meaning of the questions by representing words as low-dimensional vectors, thereby improving question-answer performance. In various embodiments, the vector(s) may herein to the first vector embedding(s) and/or the second vector embedding (s) within the scope of the present disclosure.
[0086] At step 1206, another phase of the QA sub-module 906 is performed. Another phase of the QA sub-module 906 is the similarity and the ranking. A similarity may measure degree to which two pieces of text are alike while a ranking may determine order in which the relevant response is presented to the user. In an embodiment, both phases are vital in ensuring that QA sub-module 906 may provide accurate and the relevant response(s). At step 1208, a document on which the question answer may be performed is inputted. At step 1210, the document is split into chunks to convert into vectors. At step 1212, the converted vectors may be stored in the vector database. The vectors are then transmitted to the similarity and ranking phase. After receiving a question, the vector may be performed on the received question and after embedding, the similarity may be matched from the vector database of the document and ranking may be performed, based on the similarity.
[0087] At step 1214, the LLM 128 may read the documents and generate the answer (pre-response) to the question based on an understanding of the text. The LLM 128 is an artificial intelligence trained on a massive amount of text data. The text data may include but is not limited to books, articles, websites, and social media posts. The LLM 128 may learn patterns and relationships between words in the text data that allow the LLM 128 to generate text that is like human language. A question answer (QA) is the task of automatically answering questions posed in the natural language. The LLM 128 be used for the QA sub-module 906 by retrieving relevant documents from a text corpus. Then, the LLM 128 may read the documents and generate the answer (pre-response) to the question based on understanding of the text.
[0088] At step 1216, the QA sub-module may perform an intent filtering may to improve the accuracy and efficiency by focusing on the questions relevant to the knowledge base 708. An intent filtering technique may be done by first classifying the question into one or more intents, and then only retrieving answers from the knowledge base 708 that are relevant to the identified intents. Once the questions have been classified into intents, the QA sub-module 906 may retrieve answers from the knowledge base 708. The QA sub-module 906 may either use a traditional keyword search approach or a more sophisticated approach that considers the semantic meaning of the questions and the answers. At step 1218, the QA sub-module 906 may generate the answer/output/pre-response and transmit to the prompt module 126.
[0089] Again, referring to Figure 3, at step 308, the method 300 may include generating, via the prompt module 126, the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile. Again, referring to Figure 4, at block 406, the prompt module 126 may be configured to receive the generated pre-response from the LLM 128. In an embodiment, the prompt module 126 may be configured to generate the contextual response based on modifying the pre-response. Further, at block 406, prompt module 126 may be configured to transfer the contextual response in the textual format response to the audio-text processing module 124. Further, at block 404, the audio-text processing module 124 may be configured to convert the textual format response to the audio format response and deliver the audio format response to the input/output model 122 for the user.
[0090] Figure 13 illustrates a block diagram 1300 representing the database 104 of the system 100, in accordance with an embodiment of the present disclosure. The database 104 is a data storage medium for storing a profile information of the user and having intent noun storage with the conversation for a current session with the user. The database 104 includes the knowledge base 708 and the user profile manager 710. The knowledge base 708 may be a repository of a chat history of active sessions. The knowledge base 708 may empower the system 100 to provide human-like conversations by acknowledging the known prompt alternatively termed as previous questions and intent for a continuity analyser phase. The user profile manager 710 is a database that may capture the user features and parameters responsible for enhancing the personalization of the system 100. The database 104 may employ dynamic updating mechanisms to integrate new information seamlessly, thereby ensuring that the user profiles remain current and reflect evolving preferences.
[0091] In an exemplary scenario, the operation the operation of the prompt module is explained in conjunction with Figure 14.
[0092] Figure 14 illustrates a flowchart 1400 of example operations of the prompt module 126, in accordance with an embodiment of the present disclosure. At step 1402, the prompt module 126 starts receiving the textual format prompt from the audio-text processing module 124. At step 1404, the prompt module 126 may identify the user. The prompt module 126 may facilitate user identification within a product by utilizing a combination of login credentials. The prompt module 126 may verify entered data against the stored information, thereby ensuring secure access. Each user has a unique identification information (ID). At step 1406, after successful identification of the user, the user profile is fetched by retrieving personal details of the user from the user profile manager 710. In an embodiment, parameters related to the fetched user profile may facilitate the personalized feature.
[0093] At step 1408, the intent and continuity of the user prompt may be checked. The prompt module 126 at this step checks whether the current question is in continuity with the previously asked questions. The continuity check may help in maintaining the conversation flow, essential for a personalized system 100. In a user QA session, when the user enters the 1st question, the intent of the 1st question may be set to null, and the question may be given to the Large Language Models (LLMs) 128, which, on further processing, returns the intent. Based on the interaction, the intent of the current question may be updated. In one embodiment, the LLM 128 is part of the prompt module 126. In another embodiment, the LLM 128 may be independent of the prompt module 126.
[0094] In another embodiment, in a user QA session, when the user enters a second or more questions, the intent of the question is to be assigned. The previous question, the intent of the previous question, and the latest question are given to the LLM 128. In case the question is relevant to the previous question, then the intent of the last question may be assigned to the current question. In case, when the question is irrelevant to the previous question, then the intent of the current question may be updated to a new one.
[0095] At step 1410, the prompt module 126 may finalize/define intent for the current question. Based on the intent of the question, specific part in a prompt template may be filed. The intent may help in getting more relevant answers. At step 1412, the prompt module 126 may generate the user-adaptive prompt.
[0096] Once all the information about the user and the conversation is gathered, the final prompt may be generated based on the prompt template. The final prompt may be responsible for getting the most relevant answer from the LLM 128. At step 1414, the prompt module 126 may modify the response. Based on the predefined rules, advisory, if necessary, for the generated response, is then added. The generated response is once again verified as per the information of the user and the history of the conversation. At step 1416, the question, the intent of the question, the generated response, and the final modified answer (pre-response) may be stored in the knowledge base 708 for future use. At step 1418, the final text (contextual response) may be transmitted to the audio-text processing module 124 for responding to the user. At step 1420, the prompt module 126 stops the process.
[0097] In various embodiments, the present disclosure at least provides the following advantages:
? The present disclosure enables implementation of a controlled question-answer framework for the mental health support.
? The present disclosure allows integration of the user-personalized information for the generation of the contextual response.
? The present disclosure enables the incorporation knowledge of the ML model(s) or trained language models.
? The present disclosure allows an integration of prompt methods to instruct pre-trained language to generate the pre-response.
? The present disclosure allows the incorporation of rule-guided methods to improve prompt.
[0098] The embodiments disclosed herein can be implemented through at least one software program running on at least one hardware device and performing network management functions to control the elements. The elements can be at least one of a hardware device or a combination of hardware devices and software modules.
[0099] It is understood that terms including “unit” or “module” at the end may refer to the unit for processing at least one function or operation and may be implemented in hardware, software, or a combination of hardware and software.
[00100] While specific language has been used to describe the disclosure, any limitations arising on account of the same are not intended. As would be apparent to a person in the art, various working modifications may be made to the method in order to implement the inventive concept as taught herein.
[00101] The drawings and the forgoing description give examples of embodiments. Those skilled in the art will appreciate that one or more of the described elements may well be combined into a single functional element. Alternatively, certain elements may be split into multiple functional elements. Elements from one embodiment may be added to another embodiment. For example, orders of processes described herein may be changed and are not limited to the manner described herein.
[00102] Moreover, the actions of any flow diagram need not be implemented in the order shown; nor do all of the acts necessarily need to be performed. Also, those acts that are not dependent on other acts may be performed in parallel with the other acts. The scope of embodiments is by no means limited by these specific examples. Numerous variations, whether explicitly given in the specification or not, such as differences in structure, dimension, and use of material, are possible. The scope of embodiments is at least as broad as given by the following claims.
[00103] Benefits, other advantages, and solutions to problems have been described above with regard to specific embodiments. However, the benefits, advantages, solutions to problems, and any component(s) that may cause any benefit, advantage, or solution to occur or become more pronounced are not to be construed as a critical, required, or essential feature or component of any or all the claims.
[00104] The foregoing description of the specific embodiments will so fully reveal the general nature of the embodiments herein that others can, by applying current knowledge, readily modify and adapt for various applications such specific embodiments without departing from the generic concept, and, therefore, such adaptations and modifications should and are intended to be comprehended within the meaning and range of equivalents of the disclosed embodiments. It is to be understood that the phraseology or terminology employed herein is for the purpose of description and not of limitation. Therefore, while the embodiments herein have been described in terms of at least one embodiment, those skilled in the art will recognize that the embodiments herein can be practiced with modification within the spirit and scope of the embodiments as described herein. ,CLAIMS:1. A method (300) for generating a contextual response to a user prompt, the method (300) comprising:
receiving, via an input/output module (122), the user prompt as a user input, wherein the user prompt comprises at least one of a text prompt, an audio prompt, or a visual prompt;
generating, via a prompt module (126), a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile, wherein the user-adaptive prompt indicates a personalized prompt for the user;
generating, via a large language model (LLM) (128), a pre-response to the user prompt based on the user-adaptive prompt; and
generating, via the prompt module (126), the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile.

2. The method (300) as claimed in claim 1, comprising delivering, via the input/output module (122), the contextual response to the user.

3. The method (300) as claimed in claim 1, prior to generating the user-adaptive prompt, the method (300) comprises:
determining whether the user prompt is the audio prompt;
in response to determining that the user prompt is the audio prompt:
converting, via an audio-text processing module (124), the audio prompt into a textual format prompt; and
transmitting the textual format prompt to the prompt module (126).

4. The method (300) as claimed in claim 1, wherein when the user prompt is the audio prompt, prior to delivering the contextual response to the user, the method (300) comprises:
receiving, from the prompt module (126), a textual format response corresponding to the audio prompt; and
converting the textual format response into an audio format response.

5. The method (300) as claimed in claim 1, wherein generating the user-adaptive prompt comprises:
extracting the pre-stored user profile from a database (104);
identifying the user prompt as one of a first prompt or a second prompt, wherein the second prompt indicates a recurring prompt subsequent to the first prompt;
performing one of:
in response to determining the user prompt as the first prompt, transmitting the first prompt to the LLM (128); or
in response to determining the user prompt as the second prompt, transmitting the second prompt, the first prompt, and an intent associated with the first prompt to the LLM (128), wherein the intent indicates a purpose associated with the first prompt;
receiving, from the LLM (128), a final intent associated with the transmitted prompt based on a set of predefined intents; and
generating the user-adaptive prompt based on modifying the user prompt based on one or more of the received final intent, the set of predefined rules, and the pre-stored user profile, wherein the set of predefined rules is aligned with the final intent.

6. The method (300) as claimed in claim 1, wherein prior to generating the pre-response, the method (300) comprises:
determining, by a named entity recognition (NER) sub-module (902), whether a context associated with a conversation has changed, wherein the conversation includes at least the first prompt and the second prompt, and wherein the context indicates one or more of a topic of the conversation and the intent of the conversation;
classifying, by a classifier sub-module (904), the user prompt as one of an unknown prompt or a known prompt based on the determination.

7. The method (300) as claimed in claim 1, wherein generating the pre-response comprises:
receiving, from the prompt module (126), the user-adaptive prompt;
converting the user-adaptive prompt into one or more first vector embeddings;
comparing the one or more first vector embeddings with one or more second vector embeddings stored in a vector database of the LLM (128);
retrieving one or more relevant responses from among a plurality of answers available in the LLM (128) based on the comparison;
generating the pre-response from the one or more relevant responses based on:
ranking the one or more relevant responses based on a similarity between the one or more first vector embeddings and the one or more second vector embeddings; and
filtering the one or more relevant responses based on the final intent.

8. The method (300) as claimed in claim 7, wherein retrieving the one or more relevant responses comprises one of:
generating, by a question-answer (QA) sub-module (906), one or more relevant responses for the unknown prompt; or
retrieving one or more existing responses from among a plurality of responses available at the LLM (128) for the known prompt.

9. The method (300) as claimed in claim 1, wherein the set of predefined rules is based on one or more keywords and one or more patterns associated with the user prompt.

10. A system (100) for generating a contextual response to a user prompt, the system (100) comprising:
a memory (102); and
at least one processor (106) in communication with the memory (102), the at least one processor (106) configured to:
receive, via an input/output module (122), the user prompt as a user input, wherein the user prompt comprises at least one of a text prompt, an audio prompt, or a visual prompt;
generate, via a prompt module (126), a user-adaptive prompt based on correlating the user prompt with a set of predefined rules and a pre-stored user profile, wherein the user-adaptive prompt indicates a personalized prompt for the user;
generate, via a large language model (LLM) (128), a pre-response to the user prompt based on the user-adaptive prompt; and
generate, via the prompt module (126), the contextual response based on modifying the generated pre-response based on the set of predefined rules and the pre-stored user profile.

11. The system (100) as claimed in claim 10, wherein the at least one processor (106) is configured to deliver, via the input/output module (122), the contextual response to the user.

12. The system (100) as claimed in claim 10, prior to generating the user-adaptive prompt, the at least one processor (106) is configured to:
determine whether the user prompt is the audio prompt;
in response to determining that the user prompt is the audio prompt:
convert, via an audio-text processing module (124), the audio prompt into a textual format prompt; and
transmit the textual format prompt to the prompt module (126).

13. The system (100) as claimed in claim 10, wherein when the user prompt is the audio prompt, prior to delivering the contextual response to the user, the at least one processor (106) is configured to:
receive, from the prompt module (126), a textual format response corresponding to the audio prompt; and
convert the textual format response into an audio format response.

14. The system (100) as claimed in claim 10, wherein to generate the user-adaptive prompt, the at least one processor (106) is configured to:
extract the pre-stored user profile from a database (104);
identify the user prompt as one of a first prompt or a second prompt, wherein the second prompt indicates a recurring prompt subsequent to the first prompt;
perform one of:
in response to determining the user prompt as the first prompt, transmit the first prompt to the LLM (128); or
in response to determining the user prompt as the second prompt, transmit the second prompt, the first prompt, and an intent associated with the first prompt to the LLM (128), wherein the intent indicates a purpose associated with the first prompt;
receive, from the LLM (128), a final intent associated with the transmitted prompt based on a set of predefined intents; and
generate the user-adaptive prompt based on modifying the user prompt based on one or more of the received final intent, the set of predefined rules, and the pre-stored user profile, wherein the set of predefined rules is aligned with the final intent.

15. The system (100) as claimed in claim 10, wherein prior to generating the pre-response, the at least one processor (106) is configured to:
determine, by a named entity recognition (NER) sub-module (902), whether a context associated with a conversation has changed, wherein the conversation includes at least the first prompt and the second prompt, and wherein the context indicates one or more of a topic of the conversation and the intent of the conversation;
classify, by a classifier sub-module (904), the user prompt as one of an unknown prompt or a known prompt based on the determination.

16. The system (100) as claimed in claim 10, wherein to generate the pre-response, the at least one processor (106) is configured to:
receive, from the prompt module (126), the user-adaptive prompt;
convert the user-adaptive prompt into one or more first vector embeddings;
compare the one or more first vector embeddings with one or more second vector embeddings stored in a vector database of the LLM (128);
retrieve one or more relevant responses from among a plurality of answers available in the LLM (128) based on the comparison;
generate the pre-response from the one or more relevant responses based on:
rank the one or more relevant responses based on a similarity between the one or more first vector embeddings and the one or more second vector embeddings; and
filter the one or more relevant responses based on the final intent.

17. The system (100) as claimed in claim 16, wherein to retrieve the one or more relevant responses, the at least one processor (106) is configured to perform one of:
generate, by a question-answer (QA) sub-module (906)(128), one or more relevant responses for the unknown prompt; or
retrieve one or more existing responses from among a plurality of responses available at the LLM (128) for the known prompt.

18. The system (100) as claimed in claim 10, wherein the set of predefined rules is based on one or more keywords and one or more patterns associated with the user prompt.

Documents

Application Documents

# Name Date
1 202441019990-STATEMENT OF UNDERTAKING (FORM 3) [18-03-2024(online)].pdf 2024-03-18
2 202441019990-PROVISIONAL SPECIFICATION [18-03-2024(online)].pdf 2024-03-18
3 202441019990-POWER OF AUTHORITY [18-03-2024(online)].pdf 2024-03-18
4 202441019990-FORM 1 [18-03-2024(online)].pdf 2024-03-18
5 202441019990-DRAWINGS [18-03-2024(online)].pdf 2024-03-18
6 202441019990-DECLARATION OF INVENTORSHIP (FORM 5) [18-03-2024(online)].pdf 2024-03-18
7 202441019990-Proof of Right [20-09-2024(online)].pdf 2024-09-20
8 202441019990-RELEVANT DOCUMENTS [04-10-2024(online)].pdf 2024-10-04
9 202441019990-POA [04-10-2024(online)].pdf 2024-10-04
10 202441019990-FORM 13 [04-10-2024(online)].pdf 2024-10-04
11 202441019990-Response to office action [01-11-2024(online)].pdf 2024-11-01
12 202441019990-DRAWING [17-03-2025(online)].pdf 2025-03-17
13 202441019990-CORRESPONDENCE-OTHERS [17-03-2025(online)].pdf 2025-03-17
14 202441019990-COMPLETE SPECIFICATION [17-03-2025(online)].pdf 2025-03-17