Computer-implemented method for processing a request
The method enhances the relevance and accuracy of machine learning model responses by identifying similar data chunks in a custom dataset and processing user requests effectively, addressing the challenge of similar content in datasets.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-04-09
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
Description
COMPUTER- IMPLEMENTED METHOD FOR PROCESSING A REQUESTTECHNICAL FIELD
[0001] The present disclosure relates to request processing, and more particularly to a computer-implemented method for processing a request , a computing device , and a computer program product .BACKGROUND
[0002] Machine learning models , such as large langue models , can be utili zed in, for example , answering questions presented by users . For example , a company can utili ze a large machine learning model to answers questions about their services and to provide technical support to users . In such applications , it can be benefi cial to configure the machine learning model to provide the answers according to a custom dataset , such as technical documentation, instead of generic training information . However, such a custom dataset may comprise multiple pieces of information with similar content , such as instructions for resetting a password for different devices . This can make it difficult to provide relevant and accurate information to the user .SUMMARY
[0003] This summary is provided to introduce a selection of concepts in a s implif ied form that are furtherdescribed below in the detailed description . This summary is not intended to identify key features or essential features of the claimed subj ect matter, nor is it intended to be used to limit the scope of the claimed subj ect matter .
[0004] It is an obj ective to provide a computer-implemented method for grounding a machine learning model , a computing device , and a computer program product . The foregoing and other obj ectives are achieved by the features of the independent claims . Further implementation forms are apparent from the dependent claims , the description and the figures .
[0005] According to a first aspect , a computer-implemented method for processing a request comprises : obtaining a dataset , wherein the dataset comprises a plurality of data chunks ; vectori zing the plurality of data chunks , thus obtaining a plurality of vectors ; identifying at least one set of similar data chunks in the dataset by comparing the plurality of vectors ; obtaining a request from a user ; and processing the request by providing a prompt to a machine learning model , wherein the prompt comprises the request and instructions to the machine learning model to form a response to the request based on the dataset and the identified at least one set of similar data chunks in the dataset .
[0006] In an implementation form of the first aspect , the method further comprises identifying whether the request relates to a set of s imi lar data chunks in the at least one set of similar data chunks in the datasetand the method further comprises , in response to the request relating to the set of similar data chunks : instructing the machine learning model to provide a clarifying question regarding which data chunk in the set of similar data chunks the request relates to ; or providing a clarifying question to the user regarding which data chunk in the set of s imilar data chunks the request relates to , obtaining a clarifying response from the user , and providing the clarifying response to the machine learning model in the prompt .
[0007] In another implementation form of the first aspect , wherein the identifying whether the request relates to the set of similar data chunks in the at least one set of similar data chunks in the dataset compri ses : vectori zing the request , thus obtaining a request vector ; and comparing the request vector and vectors of the set of similar data chunks .
[0008] In another implementation form of the first aspect , the comparing the plurality of vectors comprises comparing the plurality of vectors by calculating a plurality of vector space distances between the plurality of vectors .
[0009] In another implementation form of the first aspect , the calculating the plurality of vector space distances between the plurality of vectors comprises calculating the plurality of vector space distances using cosine similarity .
[0010] In another implementation form of the first aspect , the identifying the at least one set of similardata chunks in the dataset by comparing the plurality of vectors comprises : calculating vector space distances between pairs of vectors in the plurality of vectors ; in response to the vector space distance between a pair of vectors in the plurality of vectors being less than a threshold vector space distance , determining that data chunks corresponding to the pair of vectors are similar .
[0011] In another implementation form of the first aspect , the identifying at least one set of similar data chunks in the dataset by comparing the plurality of vectors compri ses : forming a queue of the plural ity of vectors ; iteratively calculating vector space distances between pairs of vectors in the queue ; and in response to the vector space distance between a set of vectors in the queue being les s than a threshold distance , marking the set of vectors as similar and removing the set of vectors from the queue .
[0012] In another implementation form of the first aspect , the method further comprises storing information about the at least one set of simi lar data chunks in the dataset as metadata and the prompt further comprises the metadata and instructions to the machine learning model to utili ze the metadata when forming the response to the request .
[0013] In another implementation form of the first aspect , the metadata comprises an identifier for each set of similar data chunks in the at least one set of similar data chunks in the dataset and / or a flag foreach data chunk in the at least one set of similar data chunks in the dataset .
[0014] In another implementation form of the first aspect , the method further comprises adding distinguishing data to the dataset for at least one set of similar data chunks in the dataset , wherein the distinguishing data distinguishes the similar data chunks in the at least one set of similar data chunks .
[0015] In another implementation form of the first aspect , the machine learning model comprises a large language model .
[0016] According to a second aspect , a computing device compri ses at least one processor and at least one memory including computer program code , the at least one memory and the computer program code being configured to , with the at least one proces sor, cause the computing device to perform the method according to the first aspect .
[0017] According to a third aspect , a computer program product comprises program code configured to perform the method according to the first aspect when the computer program product is executed on a computer .
[0018] Many of the attendant features wil l be more readily appreciated as they become better understood by reference to the following detailed description considered in connection with the accompanying drawings .DESCRIPTION OF THE DRAWINGS
[0019] In the following, example embodiments are described in more detail with reference to the attached figures and drawings , in which :
[0020] Fig . 1 illustrates a flow chart representation of a method according to an embodiment ;
[0021] Fig . 2 illustrates a schematic representation of a plurality of vectors according to an embodiment ;
[0022] Fig . 3 illustrates a flow chart representation of processing a request according to an embodiment ;
[0023] Fig . 4 illustrates a flow chart representation of processing a request according to another embodiment ;
[0024] Fig . 5 illustrates a flow chart representation of a method according to another embodiment ; and
[0025] Fig . 6 illustrates a schematic representation of a computing device according to an embodiment .
[0026] In the following, like reference numerals are used to des ignate li ke parts in the accompanying drawings .DETAILED DESCRIPTION
[0027] In the following description, reference is made to the accompanying drawings , which form part of the disclosure , and in which are shown, by way of illustration, specific aspects in which the present disclosure may be placed . It is understood that other aspects may be utilised, and structural or logical changes may be made without departing from the scope of the presentdisclosure . The following detailed description, therefore , is not to be taken in a limiting sense , as the scope of the present disclosure is defined by the appended claims .
[0028] For instance , it is understood that a disclosure in connection with a described method may also hold true for a corresponding device or system configured to perform the method and vice versa . For example , if a specific method step is described, a corresponding device may include a unit to perform the described method step, even if such unit is not explicitly described or il lustrated in the f igures . On the other hand, for example , if a specific apparatus is described based on functional units , a corresponding method may include a step performing the described functionality, even if such step is not explicitly described or illustrated in the figures . Further, it is understood that the features of the various example aspects described herein may be combined with each other, unless specifically noted otherwise .
[0029] Fig . 1 illustrates a flow chart representation of a method according to an embodiment .
[0030] According to an embodiment , a computer-implemented method 100 for processing a request comprise obtaining 101 a dataset , wherein the dataset comprises a plurality of data chunks .
[0031] The obtaining 101 the dataset may comprise , for example , obtaining the dataset from a database or any other data storage / memory .
[0032] Each data chunk in the plurality of data chunks may comprise some part of data in the dataset. For example, each data chunk may comprise a paragraph of text, a sentence of text, or any other piece of data.
[0033] Herein, a data chunk may also be referred to as a chunk.
[0034] The dataset may comprise, for example, text data and / or other data. For example, the dataset may comprise documents comprising text and images and / or documents comprising text without any images. The plurality of data chunks may comprise, for example, text, such as text in the documents, text in images, and / or text in images in the documents. The dataset may comprise, for example, technical documentation and / or other documentation .
[0035] In some embodiments, the dataset may be predivided into the data chunks. In other embodiments, the obtaining 101 the dataset may comprise dividing the dataset into the plurality of data chunks.
[0036] The method 100 may further comprise vectorizing 102 the plurality of data chunks, thus obtaining a plurality of vectors.
[0037] Each data chunk in the plurality of data chunks can be vectorized. Each vector in the plurality of vectors can correspond to a data chunk in the plurality of data chunks. The vector space representation of a data chunk can represent the semantic content of the data chunk. Each vector representing a data chunk may comprise a plurality of floating-point numbers. Thus, eachdata chunk can be represented as a vector in a vector space . This may also be referred to as embedding . Each vector representing a data chunk may be referred to as an embedding vector and the vector space comprising the embedding vectors may be referred to as an embedding space .
[0038] For example , in some embodiments , the vectori zing 102 the plurality of data chunks may be performed using a machine learning model , such as a neural network, trained to perform the vectori zation .
[0039] In some embodiments , the vectori zing 102 the plurality of data chunks may be performed using a third party service .
[0040] The method 100 may further comprise identifying103 at least one set of similar data chunks in the dataset by comparing the plurality of vectors .
[0041] Herein, similar data chunks may also be referred to as duplicate data chunks or similar . Simi lar data chunks may not be identical , but the corresponding vectors may, for example , be more similar than a preconfigured threshold .
[0042] The method 100 may further comprise obtaining104 a request from a user .
[0043] The obtaining 104 the request from the user may comprise , for example , obtaining the request from the user via a telecommunications network, such as over the internet . The method 100 may be , for example , running as on a server and be provided as a cloud service to the user . Alternatively, the method 100 may be running on aserver in a local area network (LAN) or locally on a device of the user . In such cases , the obtaining 104 the request from the user may comprise obtaining the request via LAN and / or via a user interface .
[0044] The request may comprise , for example , a question presented by the user . Alternatively or additionally, the request may comprise other information .
[0045] The method 100 may further comprise processing 105 the request by providing a prompt to a machine learning model , wherein the prompt comprises the request and instructions to the machine learning model to form a response to the request based on the dataset and the identified at least one set of simi lar data chunks in the dataset .
[0046] In can be advantageous in various applications to instruct the machine learning model to form a response to the request based on the dataset and the identified at least one set of similar data chunks in the dataset . For example , it can be advantageous that a chatbot answers questions presented by users based on a custom knowledge base of a company, such as the dataset , instead of generic training information from, for example , the internet . This may also be referred to as grounding or retrieval-augmented generation (RAG) . However, the dataset may comprise multiple data chunks with similar content that are all semantically similar to the request . For example , the request may comprise a ques tion about how to reset a pas sword and the dataset may comprise instructions for resetting the password fordifferent devices , systems , software versions , operating systems , etc . By instructing the machine learning model to form the response to the request based on the dataset and the identif ied at least one set of s imi lar data chunks in the dataset , responses provided in such situations can be improved . This can improve the user experience and / or reduce costs .
[0047] The method 100 may, for example , reduce the latency in processing the request by instructing the machine learning model to form the response to the request based on the dataset and the identif ied at least one set of similar data chunks .
[0048] In some embodiments , the prompt may comprise a request section and a data section . The request section of the prompt may comprise , for example , a request to process the data provided in the data section in some manner . The data section may comprise any data to be used by the machine learning model . For example , if the request section comprises a question provided by the user, the data section can comprise the dataset based on which the machine learning model should provide an answer to the question .
[0049] In other embodiments , the prompt may comprise , alternatively or additionally, other sections . For example , the prompt may comprise a system section / part and a user section / part . The user section / part may comprise , for example , a question presented by the user and the system section / part may comprise the instructions to themachine learning model to form a response to the ques tion based on the dataset and the identified at least one set of similar data chunks in the dataset .
[0050] The providing the prompt to the machine learning model may comprise , for example , providing the prompt to the machine learning model via a telecommunications network, such as over the internet . The machine learning model may be , for example, provided as a cloud service . Alternatively, the machine learning model may be running on a server in a local area network (LAN) or locally, for example on a computing device performing the method 100 .
[0051] Herein a machine learning model may also be referred to as an artificial intelligence (Al ) model , a generative artificial intelligence (GAI ) model , or similar .
[0052] According to an embodiment, the machine learning model comprises a large language model (LLM) .
[0053] For example , a chatbot may utili ze an LLM and the dataset to answer questions presented by users .
[0054] It should be appreciated that at least some of the operations of the method 100 may be performed in various orders . For example , obtaining 104 the request may be performed before or after any of the operations 101 - 103 . Further, in some embodiments , operations 101 - 103 may be performed well before operations 104 - 105 . For example , in some embodiments , operations 101 - 103 may be performed only once and optionally performed again if the dataset is updated / changed . The pluralityof vectors and / or information about the at least one set of similar data chunks may then be stored in, for example , a database or any other data storage . Operations 104 - 105 may then be performed any time a user provides a request without needing to perform operations 101 - 103 again, since the stored plurality of vectors and / or information about the at least one set of similar data chunks may be utili zed for performing the operations 104 - 105 .
[0055] Fig . 2 illustrates a schematic representation of a plurality of vectors according to an embodiment .
[0056] According to an embodiment , the comparing the plurality of vectors comprises comparing the plurality of vectors by calculating a plurality of vector space distances between the plurality of vectors .
[0057] Herein, calculating may also be referred to as computing .
[0058] The vector space distance may comprise any metric that can be used to quantify how similar the data chunks in the plurality of data chunks and / or the corresponding vectors are . For example , in some embodiments , the vector space distance may measure and / or correlate with an angle between vectors representing two data chunks . In other embodiments , the vector space distance may measure and / or correlate with a distance between the end points of two vectors when the two vectors are arranged to start from the same point .
[0059] Herein, a vector space distance may also be referred to as a vector space similarity, a similarity, a distance, or similar.
[0060] According to an embodiment, the identifying 103 the at least one set of similar data chunks in the dataset by comparing the plurality of vectors comprises: calculating vector space distances between pairs of vectors in the plurality of vectors; in response to the vector space distance between a pair of vectors in the plurality of vectors being less than a threshold vector space distance, determining that data chunks corresponding to the pair of vectors are similar.
[0061] It should be appreciated that the vector space in which the vectors are represented may comprise, for example, hundreds, thousands, tens of thousands, hundreds of thousands, millions, or more dimensions. Thus, the examples illustrated herein only illustrate simplified representations of the responses in a two-dimensional vector space.
[0062] For example, in the embodiment of Fig. 2, chunk 1 201_l and a threshold vector space distance 202 around chunk 1 201_l are illustrated. Chunk 2 201_2 and chunk 3 201_3 are within the threshold vector space distance 202 from chunk 1 201_l, while chunk 4 201_4 is not within the threshold vector space distance 202 from chunk 1 201_l. Therefore, chunk 2 201_2 and chunk 3 201_3 can be considered to be similar to chunk 1 201 1. Thus, chunk 1 201 1, chunk 2 201 2, and chunk3 201_3 can be considered to form a set of similar data chunks .
[0063] The threshold vector space distance 202 may be preconfigured . Alternatively, the threshold vector space distance 202 may be determined in some other way . For example , the threshold vector space distance 202 may be determined based on statistics of the plurality of vectors .
[0064] According to an embodiment , the identifying 103 the at least one set of similar data chunks in the dataset by comparing the plurality of vectors comprises : calculating vector space similarity between pairs of vectors in the plurality of vectors ; in response to the vector space similarity between a pair of vectors in the plurality of vectors being greater than a threshold vector space similarity, determining that data chunks corresponding to the pair of vectors are similar .
[0065] In some embodiments , a low vector space distance between a pair of vectors may indicate that the vectors are similar . In other embodiments , a high vector space similarity between a pair of vectors may indicate that the vectors are similar .
[0066] In other embodiments , the at least one set of similar data chunks in the dataset may be identified some other way, such as using a clustering algorithm .
[0067] According to an embodiment , the calculating the plurality of vector space distances between the plurality of vectors comprises calculating the plurality of vector space distances using cosine similarity .
[0068] The cosine similarity SC(A, B) between vectors A and B can be calculated aswhereand Btare the components of the vectors A and B, respectively .
[0069] In other embodiments , the vector space distance may be calculated using some other distance metric, such a Euclidian distance or a squared Euclidian distance . The Euclidian distance SE(A B) between vectors A and Band the squared Euclidian distanceSE(A,B) asart representation of processing a request according to an embodiment .
[0071] According to an embodiment , the method 100 further comprises identifying whether the request relates to a set of similar data chunks in the at least one set of similar data chunks in the dataset and the method 100 further comprises , in response to the request relating to the set of similar data chunks : instructing the machine learning model to provide a clarifying question regarding which data chunk in the set of similar data chunks the request relates to .
[0072] According to an embodiment, the identifying whether the request relates to the set of similar data chunks in the at least one set of similar data chunks in the dataset comprises: vectorizing the request, thus obtaining a request vector; and comparing the request vector and vectors of the set of similar data chunks.
[0073] For example, in the embodiment of Fig. 3, a request can be obtained 301, the request can be vectorized 302, and data chunks in the dataset closest to the request can be searched for 303. In operation 304, if there is a set of similar data chunks in the dataset relating to the request, the procedure can move to operation 307. If there is no set of similar data chunks in the dataset relating to the request, the procedure can move to operation 308.
[0074] For example, if only one data chunk similar to the request is found, it can be determined that there is no set of similar data chunks. If a data chunk similar to the request is found and it is determined that the found data chunk belongs to a set of similar data chunks, it can be determined that there is a set of similar data chunks .
[0075] In operation 307, the prompt and / or the set of similar data chunks can be modified.
[0076] According to an embodiment, the method 100 further comprises storing information about the at least one set of similar data chunks in the dataset as metadataand the prompt further comprises the metadata and instructions to the machine learning model to utilize the metadata when forming the response to the request .
[0077] For example , in the embodiment of Fig . 3 , in operation 307 , the prompt can be modified by adding the metadata and instructions to the machine learning model to utili ze the metadata when forming the response to the request . Alternatively, the metadata may have been stored in the dataset beforehand and operation 307 may comprise modifying the prompt to instruct to the machine learning model to utili ze the metadata when forming the response to the request .
[0078] According to an embodiment , the metadata comprises an identifier for each set of similar data chunks in the at least one set of simi lar data chunks in the dataset and / or a flag for each data chunk in the at least one set of similar data chunks in the dataset .
[0079] For example, the prompt can be modified to instruct the machine learning model to uti li ze the identifiers and / or the flags in the metadata in order to identify similar data chunks .
[0080] For example , an identifier can be associated with each data chunk in a set of similar data chunks . Each set of similar data chunks may be associated with a different identifier . Thus , chunks that are similar can be identified based on the identifier .
[0081] The flag can indicate that a data chunk belongs to a set of similar data chunks in the dataset . The flag can be implemented, for example , as a separate field ina data structure or as text in the data chunk . For example , the text "#DUPLICATE#" can be added to the beginning of a data chunk and the machine learning model can be instructed that this flag means that the data chunk belongs to a set of similar data chunks .
[0082] In some embodiments , the identifier can also function as the f lag and the lack of an identifier may indicate that a data chunk does not belong to any set of similar data chunks .
[0083] In some embodiments , the storing the information about the at least one set of similar data chunks in the dataset as metadata may be performed before obtaining 301 the request . For example , after operations 101 - 103 have been performed, the metadata can be stored in the dataset . The metadata may then be utili zed in , for example , operation 304 in order to identify if there is a set of similar data chunks in the dataset .
[0084] According to an embodiment , the method 100 further comprises adding distinguishing data to the dataset for at least one set of similar data chunks in the dataset , wherein the distinguishing data distinguishes the similar data chunks in the at least one set of similar data chunks .
[0085] For example , the dataset may comprise a set of data chunks comprising instructions on how to reset a password but each of the instructions may be for a different device , system, software version, operating system, etc . For example , one data chunk may comprise instructions on how to reset the password of a smartphoneand another data chunk may comprise instructions on how to reset the password of a specific service . These data chunks may be identified as similar . The adding distinguishing data to the dataset may comprise adding or highlighting the system / device / version the instructions are for . By adding such information, the machine learning model may be able to better distinguish the differences between the data chunks .
[0086] For example , in the embodiment of Fig . 3 , operation 307 may comprise adding distinguishing data to the dataset for at least one set of similar data chunks in the dataset .
[0087] In other embodiments , the method further comprises removing at least one data chunk from at least one set of similar data chunks in the dataset . For example , i f the s imi lar data chunks compri se similar instructions for how to perform some action, such as reset a password, and the data chunks comprise the same instructions only formulated differently, one of the similar data chunks may be removed .
[0088] For example , in the embodiment of Fig . 3 , operation 307 may comprise removing at least one data chunk from at least one set of similar data chunks in the dataset .
[0089] In operation 308 , a prompt can be formed . The prompt can be provided 309 to the machine learning model , and a response can be obtained 310 from the machine learning model .
[0090] The response obtained from the machine learning model can be provided to the user . In some embodiments , the response can be further processed in some manner and the processed response can be provided to the user .
[0091] Fig . 4 illustrates a flow chart representation of processing a request according to another embodiment .
[0092] According to an embodiment , the method 100 further comprises identifying whether the request relates to a set of similar data chunks in the at least one set of similar data chunks in the dataset and the method 100 further comprises , in response to the request relating to the set of similar data chunks : providing a clarifying question to the user regarding which data chunk in the set of similar data chunks the request relates to , obtaining a clarifying response from the user, and providing the clarifying response to the machine learning model in the prompt .
[0093] For example , in the embodiment of Fig . 4 , a request can be obtained 301 , the request can be vectori zed 302 , and data chunks in the dataset closest to the request can be searched for 303 .
[0094] In operation 304 , if there is a set of similar data chunks in the dataset relating to the request , the procedure can move to operation 401 . I f there is no set of similar data chunks in the dataset relating to the request , the procedure can move to operation 308 .
[0095] In operation 401 , a clarifying question can be provided to the user . A clari fying response can be obtained 402 from the user and the request and the clarifying response can be combined 403 .
[0096] In some embodiments , the clarifying question may be formulated us ing a machine learning model , such as an LLM . For example , a prompt compri sing the request , instructions to formulate the clarifying question using the dataset , and the set of similar data chunks may be provided to the LLM . In other embodiments , a plural ity of clarifying questions may be preconfigured and an appropriate clarifying question can be selected based on the set of s imilar data chunks in the dataset relating to the request . For example , if the set of similar data chunks relates to instructions for resetting a password, a preconfigured clarifying question asking the user to specify which service the request relates to can be obtained . Similarly, i f the set of s imilar data chunks relates to ordering a phone case , a preconfigured clarifying question asking the user to specify the model of the phone can be obtained . What the set of similar data chunks relates can be identified based on, for example, information comprised in the dataset, such as identifiers , tags , etc . The preconfigured clarifying questions may be stored in, for example , an array or any other data storage .
[0097] For example , the request may comprise a question about how to reset a password . In operation 304 , it can be identified that there is a set of similar datachunks relating to the request . For example , the set of similar data chunks may comprise instructions for resetting a password for different devices , systems , software versions , operating systems , etc . The providing 401 the clarifying question may comprise a question about what password the user wants to reset . Based on the clarifying response provided by the user, the request and the clarifying response can be combined in operation 403 to , for example , a clarified question that better indicates what password the user wants to reset .
[0098] The response obtained from the machine learning model can be provided to the user . In some embodiments , the response can be further processed in some manner and the processed response can be provided to the user .
[0099] Any disclosure regarding operations 301 - 304 and 308 - 310 with respect to the embodiment of Fig . 3 may also apply to the embodiment of Fig . 4 .
[0100] Fig . 5 illustrates a flow chart representation of a method according to another embodiment .
[0101] According to an embodiment , the identifying 103 at least one set of similar data chunks in the dataset by comparing the plurality of vectors comprises : forming a queue of the plurality of vectors ; iteratively calculating vector space distances between pairs of vectors in the queue ; and in response to the vector space di stance between a set of vectors in the queue being less than a threshold distance , marking the set of vectors as similar and removing the set of vectors from the queue .
[0102] For example , in the embodiment of Fig . 5 , a queue can be formed in operation 501 . In operation 502 , a vector can be obtained from the queue . In operation 503 , a distance between the vector obtained from the queue and other vectors in the queue can be computed . For example , a distance between the vector obtained from the queue and each vector in the queue can be computed .
[0103] In operation 504 , if the vector space distance between the vector obtained from the queue and at least one other vector in the queue is smaller than the threshold vectors space distance , the procedure can move to operation 505 . I f the vector space distance between the vector obtained from the queue and any other vector in the queue is not smaller than the threshold vectors space distance , the procedure can move to operation 507 . In operation 505 , the vector obtained from the queue and vectors similar to the vector obtained from the queue can be marked as similar .
[0104] Operation 505 may comprise , for example , adding an identifier and / or a flag to the dataset for the vector obtained from the queue and vectors similar to the vector obtained from the queue and / or adding the identifier and / or the flag to the dataset for the corresponding data chunks .
[0105] In operation 506 , the vector obtained from the queue and vectors similar to the vector obtained from the queue can be removed from the queue and the procedure can move to operation 507 .
[0106] In operation 507 , if there are more vectors in the queue , the procedure can move to operation 502 and operations 502 - 507 can be performed for the next iteration . If there are no more vectors in the queue, the procedure can move to operation 508 and the procedure can end . When the procedure ends , similar data chunks may have been identified and the method 100 can move to operation 104 .
[0107] The number of vector space distance calculations needed to compare each vector in the plurality of vectors to other vectors in the plurality of vectors can be large . For example , if there are N data chunks in the dataset , there are N vectors in the plurality of vectors . I f each vector is compared to every other vector, (TV - 1)! comparisons may need to be computed . By removing 506 the vector obtained from the queue and vectors similar to the vector obtained from the queue , the number of needed comparisons can be reduced . Since the vector obtained from the queue and vectors similar to the vector obtained from the queue are s imilar to each other, they may not be similar to other vectors and can thus be removed from the queue .
[0108] In some embodiments , operation 506 may not be performed . For example , in some cases , the vectors similar to the vector obtained from the queue may also be similar to other vectors in the queue that can be obtained in later iterations . In such cases , a chunk may belong to more than one set of s imilar data chunks and a data chunk may have more than one identifier .
[0109] Fig. 6 illustrates a schematic representation of a computing device according to an embodiment.
[0110] According to an embodiment, a computing device 600 comprises at least one processor 601 and at least one memory 602 including computer program code, the at least one memory 602 and the computer program code configured to, with the at least one processor 601, cause the computing device 600 to perform the method 100.
[0111] The computing device 600 may comprise at least one processor 601. The at least one processor 601 may comprise, for example, one or more of various processing devices, such as a co-processor, a microprocessor, a digital signal processor (DSP) , a processing circuitry with or without an accompanying DSP, or various other processing devices including integrated circuits such as, for example, an application specific integrated circuit (ASIC) , a field programmable gate array (FPGA) , a microprocessor unit (MCU) , a hardware accelerator, a special-purpose computer chip, or the like.
[0112] The computing device 600 may further comprise a memory 602. The memory 602 may be configured to store, for example, computer programs and the like. The memory 602 may comprise one or more volatile memory devices, one or more non-volatile memory devices, and / or a combination of one or more volatile memory devices and nonvolatile memory devices. For example, the memory 602 may be embodied as magnetic storage devices (such as hard disk drives, magnetic tapes, etc.) , optical magnetic storage devices, and semiconductor memories (such asmask ROM, PROM (programmable ROM) , EPROM (erasable PROM) , flash ROM, RAM ( random access memory) , etc . ) .[01 1 3] The computing device 600 may further comprise other components not illustrated in the embodiment of Fig . 6 . The computing device 600 may comprise , for example , an input / output bus for connecting the computing device 600 to other devices . Further, a user may control the computing device 600 via the input / output bus .
[0114] When the computing device 600 is configured to implement some functionality, some component and / or components of the computing device 600 , such as the at least one processor 601 and / or the memory 602 , may be configured to implement this functionality . Furthermore , when the at least one processor 601 is configured to implement some functionality, this functionality may be implemented using program code comprised, for example , in the memory 602 .[01 1 5] The computing device 600 may be implemented at least partially using, for example , a computer, some other computing device , or similar .
[0116] The method 100 and / or the computing device 600 may be utilised in, for example , chatbot applications . For example , a chatbot may be configured to answer questions presented by users via a chat interface . The chatbot may be configured to utili ze a machine learning model , such as an LLM, to answer the questions . The method 100 can be used to improve responses provided by the chatbot .[01 1 7] The method 100 and / or the computing device 600 may be utilised in, for example , voicebot applications . A voicebot may be configured to obtain information from users by, for example , phone and convert the voice information into text information using automatic speech recognition (ASR) . Thus , the voicebot can function similarly to a chatbot as disclosed above but us ing audio instead of a chat interface .
[0118] Any range or device value given herein may be extended or altered without losing the effect sought . Also any embodiment may be combined with another embodiment unless explicitly disallowed .
[0119] Although the subj ect matter has been described in language specific to structural features and / or acts , it is to be understood that the subj ect matter defined in the appended claims is not necessarily limited to the specific features or acts described above . Rather, the specific features and acts described above are disclosed as examples of implementing the claims and other equivalent features and acts are intended to be within the scope of the claims .
[0120] It will be understood that the benefits and advantages described above may relate to one embodiment or may relate to several embodiments . The embodiments are not limited to those that solve any or all of the stated problems or those that have any or all of the stated benefits and advantages . It wil l further be understood that reference to ' an ' item may refer to one or more of those items .
[0121] The steps of the methods described herein may be carried out in any suitable order, or simultaneously where appropriate . Additionally, individual blocks may be deleted from any of the methods without departing from the spirit and scope of the subj ect matter described herein . Aspects of any of the embodiments described above may be combined with aspects of any of the other embodiments described to form further embodiments without losing the effect sought .
[0122] The term ' comprising ' is used herein to mean including the method, blocks or elements identified, but that such blocks or elements do not comprise an exclusive list and a method or apparatus may contain additional blocks or elements .
[0123] It will be understood that the above description is given by way of example only and that various modif ications may be made by those ski lled in the art . The above specification, examples and data provide a complete description of the structure and use of exemplary embodiments . Although various embodiments have been described above with a certain degree of particularity, or with reference to one or more individual embodiments , those skilled in the art could make numerous alterations to the disclosed embodiments without departing from the spirit or scope of this specification .
Claims
CLAIMS :
1. A computer-implemented method (100) for processing a request, the method comprising: obtaining (101) a dataset, wherein the dataset comprises a plurality of data chunks; vectorizing (102) the plurality of data chunks, thus obtaining a plurality of vectors; identifying (103) at least one set of similar data chunks in the dataset by comparing the plurality of vectors; obtaining (104) a request from a user; and processing (105) the request by providing a prompt to a machine learning model, wherein the prompt comprises the request and instructions to the machine learning model to form a response to the request based on the dataset and the identified at least one set of similar data chunks in the dataset.
2. The computer-implemented method (100) according to claim 1, wherein the method further comprises identifying whether the request relates to a set of similar data chunks in the at least one set of similar data chunks in the dataset and the method further comprises, in response to the request relating to the set of similar data chunks: instructing the machine learning model to provide a clarifying question regarding which data chunk in the set of similar data chunks the request relates to; orproviding a clarifying question to the user regarding which data chunk in the set of similar data chunks the request relates to , obtaining a clarifying response from the user, and providing the clarifying response to the machine learning model in the prompt .3 . The computer-implemented method ( 100 ) according to claim 2 , wherein the identifying whether the request relates to the set of similar data chunks in the at least one set of similar data chunks in the dataset comprises : vectori zing the request , thus obtaining a request vector ; and comparing the request vector and vectors of the set of similar data chunks .4 . The computer-implemented method ( 100 ) according to any preceding claim, wherein the comparing the plurality of vectors comprises comparing the plural ity of vectors by calculating a plural ity of vector space distances between the plurality of vectors .5 . The computer-implemented method ( 100 ) according to claim 4 , wherein the calculating the plurality of vector space distances between the plural ity of vectors comprises calculating the plurality of vector space distances using cosine similarity .6 . The computer-implemented method ( 100 ) according to any preceding claim, wherein the identifyingthe at least one set of similar data chunks in the dataset by comparing the plurality of vectors comprises : calculating vector space distances between pairs of vectors in the plurality of vectors ; in response to the vector space distance between a pair of vectors in the plurality of vectors being less than a threshold vector space di stance , determining that data chunks corresponding to the pair of vectors are similar .7 . The computer-implemented method ( 100 ) according to any preceding claim, wherein the identifying at least one set of similar data chunks in the dataset by comparing the plurality of vectors comprises : forming a queue of the plurality of vectors ; iteratively calculating vector space distances between pairs of vectors in the queue ; and in response to the vector space distance between a set of vectors in the queue being less than a threshold distance , marking the set of vectors as similar and removing the set of vectors from the queue .8 . The computer-implemented method ( 100 ) according to any preceding claim, wherein the method further comprises storing information about the at least one set of similar data chunks in the dataset as metadata and the prompt further comprises the metadata and instructions to the machine learning model to utilize the metadata when forming the response to the request .
9. The computer-implemented method (100) according to claim 8, wherein the metadata comprises an identifier for each set of similar data chunks in the at least one set of similar data chunks in the dataset and / or a flag for each data chunk in the at least one set of similar data chunks in the dataset.
10. The computer-implemented method (100) according to any preceding claim, wherein the method further comprises adding distinguishing data to the dataset for at least one set of similar data chunks in the dataset, wherein the distinguishing data distinguishes the similar data chunks in the at least one set of similar data chunks.
11. The computer-implemented method (100) according to any preceding claim, wherein the machine learning model comprises a large language model.
12. A computing device (600) , comprising at least one processor (601) and at least one memory (602) including computer program code, the at least one memory (602) and the computer program code configured to, with the at least one processor (601) , cause the computing device (600) to perform the method (100) according to any preceding claim.
13. A computer program product comprising program code configured to perform the method according toany of claims 1 - 11 when the computer program product is executed on a computer.