Method and system for querying a database

EP4771506A1Pending Publication Date: 2026-07-08ORANGE SA

Patent Information

Authority / Receiving Office
EP · EP
Patent Type
Applications
Current Assignee / Owner
ORANGE SA
Filing Date
2024-08-28
Publication Date
2026-07-08

Smart Images

  • Figure EP2024073982_06032025_PF_FP_ABST
    Figure EP2024073982_06032025_PF_FP_ABST
Patent Text Reader

Abstract

The invention proposes a method for carrying out natural-language querying of a database storing a descriptive datum relating to an entity, the method comprising: obtaining a response to a request comprising a natural-language question via a processing interface that is supplied with a text resulting from a transformation carried out by a natural-language generator of the descriptive datum relating to the entity and with the question, the processing interface being configured, depending on a result obtained by the processing interface in a first mode, to invoke a language model by supplying it with the text and with the question asked in a second mode, the first and second modes being distinct. The invention also proposes a corresponding computer program, recording medium and querying system.
Need to check novelty before this filing date? Find Prior Art

Description

Method and system for querying a database

[0001] The present disclosure relates to the field of database querying. More specifically, the present disclosure relates to a method for querying a database containing descriptive data relating to various entities in natural language. The present disclosure also relates to a corresponding system, computer program and recording medium.

[0002] Traditional database query methods often require a deep understanding of Structured Query Language (SQL) or other programming languages. This technical barrier prevents many non-technical users from effectively extracting information from databases.

[0003] Attempts to circumvent this problem have been made by incorporating natural language understanding rules, hoping to make querying more intuitive.

[0004] A disadvantage of this approach is the large number of rules that must be defined to account for the different formulations of questions that may be asked. An additional difficulty arises from the fact that while the system correctly answers the questions intended for most formulations, the anthropomorphic illusion pushes the user to also ask questions outside the intended scope, which can lead to confusion.

[0005] There is therefore a need for a solution capable of handling a wide range of question formulations as well as managing user expectations for anthropomorphic interactions without requiring a multitude of pre-established rules. Summary

[0006] This disclosure improves the situation.

[0007] According to one aspect, a method for querying in natural language a database storing descriptive data relating to an entity is proposed, the method comprising: obtaining a response to a query comprising a question in natural language via a processing interface to which a text resulting from a transformation by a natural language generator of the descriptive data relating to the entity and the question is provided, the processing interface being configured to request, depending on a result obtained by the processing interface in a first mode, a language model by providing it with the text and the question asked in a second mode, the first and second modes being distinct.

[0008] The proposed method provides a robust mechanism for querying the database in natural language, without the need to define a multitude of pre-established rules corresponding to a vast number of possible formulations of expected questions.

[0009] It also offers query flexibility due to the dynamic interface that can switch between different processing modes, allowing greater adaptability to various types of natural language questions.

[0010] The use of the language model in the second mode makes it possible in particular to answer unexpected questions which may or may not relate to the content of the database.

[0011] In one example, the method also includes receiving the request via a human-machine interface.

[0012] The incorporation of a human-machine interface increases the accessibility and efficiency of interaction, providing a more intuitive user experience.

[0013] In one example, the method also includes triggering the transformation of the descriptive data after receiving the request.

[0014] Post-query data transformation provides the ability to prepare the most relevant data in response to a specific request, optimizing the relevance of responses.

[0015] In one example, the method also includes updating the descriptive data between receiving the request and triggering the transformation of the descriptive data.

[0016] The ability to update descriptive data before transformation allows for the evolving nature of the database. This ensures that the most up-to-date information is used, thus increasing the accuracy and reliability of responses.

[0017] In one example, the method also includes obtaining by the natural language generator the text resulting from the transformation of the descriptive data.

[0018] Using the natural language generator to transform data ensures consistent human interpretation of the data, making the answers more understandable to the user.

[0019] In one example, the method also includes use by the natural language generator of a predetermined rule when transforming the descriptive data.

[0020] Using predetermined rules during transformation ensures consistency in how data is interpreted, improving the predictability of responses.

[0021] In one example, the descriptive data is in the form of predicates with any number of arguments.

[0022] Support for predicates with variable number of arguments allows for great flexibility in data representation, thus providing a wide range of query possibilities.

[0023] In one example, the descriptive data is filtered and / or part of the descriptive data is masked before the descriptive data is transformed.

[0024] In one example, the text is filtered and / or part of the text is masked before providing the text to the language model.

[0025] The ability to filter or mask certain portions of descriptive data or text provides security and privacy options, ensuring that only relevant and approved information is exposed.

[0026] In one example, the processing interface is configured to perform, in the first mode, processing of the question by a query mechanism having a natural language understanding rule.

[0027] In one example, the result obtained by the processing interface in the first mode is indicative of obtaining the response or not obtaining the response in the first mode, and the processing interface is configured to invoke the language model in the second mode when the result is indicative of not obtaining the response in the first mode.

[0028] In one example, the result obtained by the processing interface in the first mode comprises a response proposal and an evaluative data of the response proposal, and the processing interface is configured to provide the response proposal as a response when the evaluative data is favorable and to request the language model in the second mode when the evaluative data is unfavorable.

[0029] According to another aspect, there is provided a computer program comprising instructions for implementing the above method when this program is executed by a processor.

[0030] According to another aspect, there is provided a non-transitory recording medium readable by a computer on which the above computer program is recorded.

[0031] According to another aspect, a system is proposed for querying a database storing descriptive data relating to an entity, the system comprising: a processing interface being capable of obtaining a response to a query comprising a question in natural language as a function of a text resulting from a transformation by a natural language generator of the descriptive data relating to the entity and of the question, the processing interface being configured to request, as a function of a result obtained by the processing interface in a first mode, a language model by providing it with the text and the question in a second mode, the first and second modes being distinct.

[0032] In one example, the system also includes a human-machine interface capable of obtaining a query comprising a question in natural language.

[0033] In one example, the system also includes a natural language generator capable of obtaining the text resulting from the transformation of the descriptive data.

[0034] Other features, details and advantages will become apparent upon reading the detailed description below, and upon analyzing the attached drawings, in which: Fig. 1

[0035] represents a natural language query system for a database in an exemplary embodiment. Fig. 2

[0036] represents a processing circuit adapted to implement a natural language query method of a database in an exemplary embodiment. Fig. 3

[0037] illustrates an operation of a processing interface for providing an answer to a question expressed in natural language according to a first mode, in an exemplary embodiment. Fig. 4

[0038] illustrates an operation of a processing interface for providing an answer to a question expressed in natural language according to a second mode, in the exemplary embodiment of. Fig. 5

[0039] illustrates an operation of a processing interface for providing an answer to a question expressed in natural language according to a first mode, in another exemplary embodiment. Fig. 6

[0040] illustrates an operation of a processing interface for providing an answer to a question expressed in natural language according to a second mode, in the exemplary embodiment of. Fig. 7

[0041] illustrates an operation of a processing interface to provide an answer to a question expressed in natural language, in another exemplary embodiment.

[0042] In the following description, like reference numerals designate identical elements or elements having similar functions.

[0043] represents the main elements of a system (100) suitable for querying a database in natural language.

[0044] A human-machine interface (102) is used to collect a query containing a question formulated by a user and expressed in natural language, for example in the form of one or more sentences. The human-machine interface may comprise, for example, a text-based graphical interface or a sound sensor coupled to a voice recognition interface.

[0045] A processing interface (104) is configured to process the question contained in the query. Upon completion of this processing, the answer may be provided to the user via a suitable interface, for example a display device or a voice rendering device.

[0046] A database (106) stores descriptive data relating to an entity which may be, for example, a dwelling, a site, a business, a community or an organization. This descriptive data may belong to one or more fields of application. Examples of fields of application include, for example, the management of a connected home, assistance for industrial operators or assistance for technicians in the tertiary sector to, for example, carry out maintenance operations. The descriptive data may be of any nature and have varying levels of confidentiality. The descriptive data may be stored in any format.

[0047] For example, descriptive data can take the form of predicates. Predicates can have as many arguments as necessary, for example, zero, one, two, or more. Such a format is particularly suitable for querying and modifying a database with simple queries expressed in standard programming languages.

[0048] For example: (age robert 57) stores the fact that Robert's age is 57 years old, (occupation robert "developer at Orange Business") stores knowledge about Robert's job, (state living-room-lamp on) stores the fact that the living room lamp, whose local identifier is "living-room-lamp" is on.

[0049] In an example of application to a home automation system, the descriptive data may include, among other things, personal data of a resident of the dwelling as a user of the query system, such as usage preferences, as well as any data useful for the management of communicating devices placed in the dwelling and / or the provision of home automation services to the user.

[0050] At the latest during the processing of the query, at least part of the descriptive data contained in the database is transmitted to a natural language generator (108) which transforms it into text, for example in the form of one or more sentences. The natural language generator can be configured to implement one or more predetermined rules in order to transform a received descriptive data into a corresponding text or a corresponding text part.

[0051] This transmission can be controlled by the processing interface and in particular triggered by the processing interface following the receipt of the request. The descriptive data may or may not pass through the processing interface. The processing interface may also require an update of the descriptive data before their transmission.

[0052] Alternatively, the database may be designed to automatically transmit all or part of the descriptive data to the natural language generator without requiring prior request by the processing interface. This transmission may, for example, be periodic or follow an update of the database content.

[0053] For the purpose of preserving the confidentiality of certain descriptive data, a masking component may be provided to mask this data before providing it to the natural language generator. A filtering component may also be provided for a similar purpose by preventing the transmission of certain descriptive data to the natural language generator.

[0054] The processing interface also has a data link with a language model (110) capable of interpreting a question in natural language and providing an answer to the question by relying, when the question requires it, on descriptive data which are also provided to it in natural language. The use of the language model also makes it possible to answer possible questions beyond a possible predefined scope of application by relying on general knowledge, external to the database, on which it has previously been trained.

[0055] The processing interface is configured to obtain one or more descriptive data from the database in the form of a text resulting from the transformation of this or these descriptive data by the natural language generator. In this text, the descriptive data can optionally be masked.

[0056] The processing interface has two distinct modes of request processing.

[0057] First, according to a first mode, the processing interface attempts to provide an answer to the question without calling on the language model. To do this, the processing interface relies on a query mechanism which may or may not be integrated into the processing interface and which may, for example, be equipped with one or more natural language understanding rules.

[0058] The result obtained by the processing interface according to the first mode directs the rest of the query processing process. The result is based on at least one criterion. An example of a criterion is whether or not a response is obtained according to the first mode, so that if there is no response, the result obtained is interpreted as a failure.

[0059] Another example of a criterion involves obtaining a response proposal according to the first mode and evaluating this response proposal, for example, in terms of its quality or relevance. Thus, the result may include not only the response proposal but also at least one favorable or unfavorable evaluative data item, so that if the evaluative data item is unfavorable, the result obtained is interpreted as a failure.

[0060] When the result obtained according to the first mode is successful, it is not necessary to implement processing according to the second mode and the response obtained according to the first mode can be provided to the user.

[0061] When the result obtained according to the first mode is a failure, the processing interface triggers the second mode and then requests the language model by providing it with the question as well as the text. The question and the text can be provided together or successively. It is useful for the text to be provided to the language model first and even, possibly, in anticipation of the triggering of the processing according to the second mode. Indeed, the pre-processing of the text by the language model generally makes it possible to minimize the delay between the triggering of the second mode and obtaining the answer.

[0062] A masking component can be provided at this stage to mask certain parts of text before providing them to the language model. A filtering component can also be provided to filter the text by preventing certain parts of text from being passed to the language model.

[0063] This mechanism ensures that an adequate answer to the question is obtained while avoiding unnecessary use of the language model. It also ensures the confidentiality of stored and processed data.

[0064] represents a processing circuit (200) adapted to implement the steps of a method for querying the database (106). It comprises a processor (202), a memory (204) storing computer program instructions and a communication interface (206) with all or part of the elements of a system (100) for querying the database.

[0065] More generally, the database query process can be implemented by many types of centralized and / or distributed hardware and / or software computing arrangements. For example, the processing circuit can represent a database manager or a search engine.

[0066] and illustrate an example of a query processing process across two distinct scenarios.

[0067] The difference between the two scenarios lies in the nature of the question contained in the query to be processed.

[0068] In the first scenario, which corresponds to the example of, the question asked is such that the processing interface manages to process the request by implementing only the first mode.

[0069] In the second scenario, which corresponds to the example of, the question asked is such that the processing interface implements both modes to process the request.

[0070] In the example considered, the first steps of the treatment process are common to both scenarios.

[0071] This involves obtaining (302) by the human-machine interface a question expressed in natural language, obtaining (304) descriptive data from a database linked to an entity and implementing (312) the first mode of processing the question.

[0072] In the first scenario, it is considered that the first mode is sufficient to determine the answer to the question by extracting the relevant data from the descriptive data and formulating a natural language response indicating the relevant data.

[0073] The extraction of the relevant data and the formulation of the response may result, in a manner known per se, from the application of a predetermined rule associated with the question when this question and its formulation had been anticipated when designing the rule.

[0074] After verification (314) that the response is obtained, the process ends with a transmission (328) of the response for its return to the user.

[0075] In the second scenario, it is considered that the first mode does not allow determining an answer to the question asked.

[0076] After checking (314) that the answer has not been obtained, the process continues by implementing (322) the second mode of processing the question.

[0077] The process includes transmitting (308) the descriptive data to a natural language generator responsible for transforming them into text and, subsequently, obtaining (310) the text by the generator.

[0078] The process then includes a request (324) from the language model which receives the text and the question and a provision (328) by the language model of an answer to the question.

[0079] This example processing process has the advantage of simplicity, implementing a minimum of steps in scenarios where only the first mode is implemented and reserving the solicitation of the natural language generator only in cases where this solicitation is made necessary due to a lack of response obtained in the first mode.

[0080] and illustrate another example of query processing, still in two distinct scenarios corresponding to the same queries as before.

[0081] In this new example, the obtaining (304) of the descriptive data, their transmission (308) to the natural language generator and the obtaining (310) of the text by the natural language generator are carried out systematically and before obtaining the question and implementing (312) the first processing mode.

[0082] The implementation of these steps (304, 308, 310) is fundamentally independent of the nature of the question asked. Thus, they can be carried out at any time before the possible request of the language model. In particular, it may be judicious to trigger them at an early stage of the query processing process so as to facilitate the management of the resources used by the process and minimize its total duration, in particular in scenarios where the answer is finally obtained through the second processing mode.

[0083] In the example considered, the database query system is designed so that the natural language generator, the first-mode query mechanism, and the language model do not have access to certain sensitive information. This makes it possible, for example, to protect sensitive data contained in the database from the risk of interception during its transmission between the different elements of the database query system.

[0084] For this purpose, a processing (306) of the obtained descriptive data is implemented in the form of masking. Generally, masking may be, for example, a substitution of specific predicates or arguments by unique codes that are not affected by the subsequent transformation (308) of the descriptive data into text. The unique codes may be associated with the predicates or arguments that they substitute in a lookup table for the purpose of subsequent unmasking (326) by inverse substitution. Thus, the masking concerns the data extracted from the database, so that any sensitive information extracted from the database, in this case a Wi-Fi security key, is substituted by a code before transformation by the generator into natural language.

[0085] To provide additional security, the query mechanism according to the first mode is configured, in the example considered, not to have direct access to the database but only to receive the text obtained by the natural language generator.

[0086] Thus, in the scenario of, a code appears in the response obtained according to the first mode and the associated sensitive information is substituted for the code by unmasking (326) only just before the provision (328) of the response to the user. In the scenario of, the response is obtained in the second mode, the code does not appear there and the unmasking of the response has no effect.

[0087] Another specificity of the example lies in the nature of the result obtained according to the first processing mode. In addition to the verification (314) that a proposed response is obtained, an additional verification (316) is provided that the proposed response has been the subject of a favorable evaluation. When one of these two verifications is unfavorable, the automatic triggering (322) of the second processing mode can be provided. This approach makes it possible, depending on the nature of the evaluation, to increase the relevance and / or the quality of the response obtained and provided to the user.

[0088] Different mechanisms for evaluating the response proposal may be envisaged, for example by relying on an explicit or implicit evaluation of the response proposal by the user or on a determination of a level of satisfaction of the user with respect to the response proposal, this determination being able for example to be implemented by inference using a machine learning module.

[0089] illustrates another example of a query processing process, in a scenario corresponding to a query whose processing requires the successive use of both modes.

[0090] In this example, obtaining (304) the descriptive data is implemented after receiving (302) the question asked but before implementing (312) the processing according to the first mode.

[0091] In a context where the content of the database evolves over time, this approach ensures that an up-to-date response to the question asked is obtained.

[0092] Furthermore, text processing (320) is performed before providing the text to the language model. In the example under consideration, this processing involves masking as in the deet example, and also involves filtering by removing specific parts of the text relating to specific predicates or arguments.

[0093] This approach is particularly useful in cases where the database query system is primarily managed by the organization that owns the database, with the notable exception of the language model, which is managed by a third-party organization.

[0094] Thus, the various elements of the database query system managed by the organization that owns the database have extensive access to the database content, which increases the possibilities of answering the question posed according to the first mode. Conversely, for security reasons, the language model only has access to a restricted set of data, possibly in hidden form, with a limited impact on obtaining relevant answers to the questions provided to it.

Claims

Method, implemented by at least one processing circuit, for querying in natural language a database (106) storing descriptive data relating to an entity, the method comprising: obtaining a response to a query comprising a question in natural language via a processing interface (104) to which a text resulting from a transformation by a natural language generator (108) of the descriptive data relating to the entity and the question is provided, the processing interface being configured to request (324), as a function of a result obtained by the processing interface in a first mode, a language model (110) by providing it with the text and the question asked in a second mode, the first and second modes being distinct. The method of claim 1, comprising receiving the request via a human-machine interface. Method according to claim 2, comprising triggering the transformation of the descriptive data after receiving the request. Method according to claim 3, comprising an update of the descriptive data between the reception of the request and the triggering of the transformation of the descriptive data. Method according to any one of claims 1 to 4, comprising obtaining by the natural language generator the text resulting from the transformation of the descriptive data. Method according to any one of claims 1 to 5, comprising use by the natural language generator of a predetermined rule when transforming the descriptive data. A method according to any one of claims 1 to 6, wherein the descriptive data is in the form of predicates with any number of arguments. A method according to any one of claims 1 to 7, wherein the descriptive data is filtered and / or a portion of the descriptive data is masked before the transformation of the descriptive data. A method according to any one of claims 1 to 8, wherein the text is filtered and / or part of the text is masked before providing the text to the language model. Method according to any one of claims 1 to 9, wherein the processing interface is configured to perform, in the first mode, processing of the question by a query mechanism provided with a natural language understanding rule. The method of any one of claims 1 to 10, wherein:the result obtained by the processing interface in the first mode is indicative of obtaining the response or not obtaining the response in the first mode, andthe processing interface is configured to request the language model in the second mode when the result is indicative of not obtaining the response in the first mode. Method according to any one of claims 1 to 11, in which the result obtained by the processing interface in the first mode comprises a response proposal and an evaluative data item of the response proposal, and the processing interface is configured to provide the response proposal as a response when the evaluative data item is favorable and to request the language model in the second mode when the evaluative data item is unfavorable. Computer program comprising instructions for implementing the method according to one of claims 1 to 12 when this program is executed by a processor. A non-transitory computer-readable recording medium (204) having recorded thereon the computer program of claim 13. System (100) for querying a database (106) storing descriptive data relating to an entity, the system comprising: a processing interface (104) being capable of obtaining a response to a query comprising a question in natural language as a function of a text resulting from a transformation by a natural language generator (108) of the descriptive data relating to the entity and of the question, the processing interface being configured to request (324), as a function of a result obtained by the processing interface in a first mode, a language model (110) by providing it with the text and the question in a second mode, the first and second modes being distinct. System according to claim 15, the system comprising: a human-machine interface capable of obtaining a request comprising a question in natural language. System according to claim 15 or 16, the system comprising: a natural language generator capable of obtaining the text resulting from the transformation of the descriptive data.