Method for executing first natural language instructions relating to desired analytical processing of data in a database
The process translates natural language instructions into object-oriented programming language instructions within a virtual machine, addressing the accessibility and scalability issues of existing database exploitation tools by enabling users to perform complex analytical processing without requiring programming expertise.
Patent Information
- Application Number
- PCT/EP2024/070925
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-24
- Filing Date
- 2024-07-23
- Publication Date
- 2025-01-30
AI Technical Summary
Current database exploitation tools, such as specific programming languages and ERP software, are either inaccessible to neophytes or expensive and not scalable, limiting the ability to perform analytical processing of data for strategic decision-making.
A process that translates first instructions in natural language into abstract syntactic trees, then generates and executes second instructions in an object-oriented programming language within a virtual machine, allowing for analytical processing of database data without requiring expertise in formal programming languages or expensive software.
Facilitates accessible and scalable analytical processing of database data, enabling users to perform complex operations like data summarization and selection without needing to understand the underlying syntax, while ensuring the accuracy and validity of the generated instructions.
Smart Images

Figure EP2024070925_30012025_PF_FP_ABST
Abstract
Description
[0001] Description
[0002] Title of the invention: Method for executing first instructions in natural language relating to a desired analytical processing of data in a database
[0003] GENERAL TECHNICAL FIELD
[0004] The present invention relates to the field of database exploitation. More specifically, it relates to the execution of first instructions in natural language relating to a desired analytical processing of the data in a database.
[0005] STATE OF THE ART
[0006] Many companies today work around a massive database containing all the information useful to the company such as bills of materials, ranges, raw materials, production capacities, quantities, orders, sales, etc.
[0007] It is necessary to have the tools to effectively manipulate such a database (data integration and maintenance), and above all to implement analytical processing of the data contained in the database on which strategic decisions can be taken or feeding into subsequent processing: dashboards, machine learning, production of new data, etc.
[0008] To do this we have:
[0009] - Either specific programming languages (called database operating languages) such as SAS (Statistical Analysis System), SQL or the Pandas module of Python® which are very powerful but not very accessible to beginners - Or dedicated business software called software packages (often called ERP for enterprise resource planning), which are then expensive and not always scalable.
[0010] More recently, a solution for generating code fragments by AI that "encapsulate" instructions in a database operating language, based on code comments, has been proposed in the document Lyra: A Benchmark for Turducken-Style Code Generation Qingyuan Liang, Zeyu Sun, Qihao Zhu, Wenjie Zhang, Lian u, Yingfei Xiong, Lu Zhang. This solution facilitates the implementation of analytical processing but remains limited (it cannot go beyond the examples in its learning base) and still inaccessible to beginners (expressing the processing in the form of comments is a specific formalism that implies having already accomplished most of the work).
[0011] It would be desirable to have another database operating solution that has the functionality and power of languages usually reserved for data professionals, but which is more accessible and scalable.
[0012] PRESENTATION OF THE INVENTION
[0013] The present invention therefore relates, according to a first aspect, to a method for executing first instructions in natural language relating to a desired analytical processing of the data of a database stored on data storage means of a first server, characterized in that it comprises the implementation by data processing means of a second server:
[0014] (a) Obtaining said first instructions from a client terminal;
[0015] (b) Translation of said first instructions into an abstract syntax tree; (c) Generation, from said abstract syntax tree, of second instructions in an object-oriented programming language distinct from a language for operating said database;
[0016] (d) Executing said second instructions in a virtual machine implemented by the data processing means so as to carry out said desired analytical processing, comprising triggering queries on said database in said database operating language, said virtual machine using an object kernel for interfacing with said database.
[0017] According to advantageous and non-limiting characteristics:
[0018] Said second instructions are a transcription of the first instructions in said object-oriented programming language.
[0019] Step (b) is implemented by a non-deterministic parser.
[0020] The said non-deterministic parser uses the Earley algorithm, the CYK algorithm or the GLR algorithm.
[0021] Step (b) comprises, if the parser raises an ambiguity of the first instructions, the generation of a plurality of abstract syntax trees, each being a possible translation of said first instructions, step (c) comprises the generation, from each abstract syntax tree, of a set of second instructions in said object-oriented programming language; and step (d) comprises a verification of the validity of each set of second instructions, and the execution of the only valid set of second instructions in said virtual machine.
[0022] The first instructions are translated in step (b) into a first abstract syntax tree, step (c) comprising transforming the first abstract syntax tree into a second abstract syntax tree, said second abstract syntax tree being an object tree of said object-oriented programming language, expressing said second instructions. Said object-oriented programming language is derived from Python® or C++, and said database operating language is selected from Python®, Lisp, SQL or PowerQuery.
[0023] Step (d) comprises the prior resolution of the identifiers and / or types of the data of said database concerned by the second instructions, to generate said queries on the database.
[0024] Step (d) comprises providing said client terminal with output data relating to the result of said desired analytical processing.
[0025] The method further comprises a prior step (aO) of configuring the virtual machine and / or a syntactic analyzer for the implementation of step (b) by an external integration module.
[0026] According to a second aspect, the invention relates to a server, called a second server, characterized in that it comprises data processing means configured to:
[0027] - Obtaining from a client terminal initial instructions in natural language relating to a desired analytical processing of data from a database stored on data storage means of a first server;
[0028] - Translate the said first instructions into an abstract syntax tree;
[0029] - Generate, from said abstract syntax tree, second instructions in an object-oriented programming language distinct from an operating language of said database;
[0030] - Execute said second instructions in a virtual machine implemented by the data processing means so as to carry out said desired analytical processing, comprising the triggering of queries in said operating language of said database, said virtual machine using an object kernel for interfacing with said database. According to a third aspect, the invention relates to a system comprising the second server according to the second aspect, said first server and the terminal connected.
[0031] According to a fourth and a fifth aspect, the invention relates to a computer program product comprising code instructions for executing a method according to the first aspect of executing first natural language instructions relating to a desired analytical processing of data in a database stored on data storage means of a first server; and a storage means readable by computer equipment on which is recorded a computer program product comprising code instructions for executing a method according to the first aspect of executing first natural language instructions relating to a desired analytical processing of data in a database stored on data storage means of a first server.
[0032] PRESENTATION OF FIGURES
[0033] Other characteristics and advantages of the present invention will appear on reading the following description of a preferred embodiment. This description will be given with reference to the appended drawings in which:
[0034] [Fig. 1]Figure 1 is a diagram of a system for implementing the method according to the invention;
[0035] [Fig. 2]Figure 2 schematically represents the general architecture of the blocks in an embodiment of the method according to the invention;
[0036] [Fig. 3]Figure 3 is a flowchart illustrating the steps of an embodiment of the method according to the invention;
[0037] [Fig. 4a]Figure 4a represents an example of a first AST;
[0038] [Fig. 4b]Figure 4b represents an example of a second AST obtained from the first AST of Figure 4a; [Fig. 5a]Figure 5a schematically represents a KN IL translator block in an embodiment of the method according to the invention;
[0039] [Fig. 5b]Figure 5b schematically represents a KINL retro-translator block in one embodiment of the method according to the invention;
[0040] [Fig. 6]Figure 6 schematically represents a KVM machine block in one embodiment of the method according to the invention;
[0041] [Fig. 7]Figure 7 schematically represents a KOK core block in an embodiment of the method according to the invention;
[0042] [Fig. 8]Figure 8 schematically represents a KEMI integrator block in an embodiment of the method according to the invention;
[0043] DETAILED DESCRIPTION
[0044] Architecture
[0045] The present invention relates to a method for executing first instructions in natural language relating to processing of data in a database, implemented in an environment as represented by Figure 1.
[0046] Said database may be any structured database stored on data storage means 12 of a first server 1, typically a business database stored on a server 1 of a company. It may consist of character strings, numbers, dates, durations, booleans, tables, lists, dictionaries, etc.
[0047] Analytical processing of database data means any operation on information from the database for analysis purposes, typically joins and / or calculations, which can be complex. For example, we may want the total number of orders for a particular customer, and the processing then consists of identifying all the orders for said customer in the database, extracting the corresponding amounts, and summing them. In the remainder of this description, we will take the following more complex example: "Select the 10% of order lines with the largest quantity, among those whose price is greater than 100." This analytical processing will be distinguished from simple database management (reading / writing), although analytical data processing obviously involves accessing this data. To rephrase, this analytical processing relates to the data itself, not the database.
[0048] It is assumed that there is an operating language for said database, i.e. a language executable by data processing means 11 of said first server 1 to natively implement processing of the data of said database, for example Python® in the remainder of this description, or SQL, Lisp, PowerQuery, etc.
[0049] The present method is specific in that the first instructions relating to a desired analytical processing of the data in a database (i.e. describing this desired processing), are in natural language, noted KNL, that is to say the “normal” language spoken by a human being and not a structured programming language, a fortiori not the said database operating language or the object-oriented programming language which will be mentioned later. Natural language is thus opposed to formal language, and we will exclude, for example, instructions in the form of code comments which certainly use words from natural language, but on the one hand require a particular formalism, dependent on the programming language (one comment per line of code), and on the other hand are generally short formulas which are grammatically incorrect.
[0050] Natural language can be written with virtually no prior learning, unlike all computer languages, and is "self-documenting." As will be explained later, for the present to work, the first instructions only need to:
[0051] - use common words or expressions that have a clear and unique meaning for the user:
[0052] 1 A verb for an action
[0053] 2 An adjective for a changed value 3 A noun for a new value obtained by transforming an existing value
[0054] 4 The behavior of verbs is specified by complements, in accordance with standard grammar.
[0055] - Conversely, a user concept corresponds to a single word or expression (with synonyms) to avoid any ambiguity, but the syntax is as flexible as possible (the circumstantial complements can appear in any order)
[0056] - No need for business rules, we can simply use "if... then... else", if necessary in a nested manner
[0057] - No type declarations, types are determined and checked automatically.
[0058] We will see later how this is accomplished.
[0059] As shown in Figure 1, there is also a second server 2 for executing said method, and a client terminal 10 such as a workstation or a smartphone, having an interface and via which the user will be able to interact. It is understood that the second server 2 is connected to the client terminal 10 and to the first server 1, for example via a network 20 such as the Internet network.
[0060] The second server 2 also comprises data processing means 21 such as a processor of any kind, and data storage means 22, i.e. a memory.
[0061] Note that the second server 2 can be confused with the client terminal 10 or with the first server 1.
[0062] Principle
[0063] With reference to Figure 2, the present method cleverly uses the passage through an “internal” object-oriented programming language, distinct from the operating language of said database, and executed by a virtual machine implementing a kernel making the link with said operating language of said database.
[0064] It is called internal because it is not visible to the user or the database and works in an agnostic way, and the user therefore does not need to know its syntax.
[0065] This object-oriented language, denoted KIL, is an executable and syntactically verified mirror of natural language. Like any language, it implements if-then-else rules, addressing systems, explicit or implicit loops, etc. As explained, it does not need to be understood by the user.
[0066] It is preferably a fully object-oriented language, which means that everything is an object, both data and functions. Each object can contain objects, and all these objects inherit from fundamental classes. It is this aspect that will easily and guaranteedly allow obtaining second instructions for all first instructions that are semantically correct (i.e. meaningful and unambiguous), while interfacing with an existing (and therefore predefined) database operating language. This object-oriented language is high-level, and can be derived from existing object-oriented languages such as Python® or C++ (i.e. present the same style of expression), the person skilled in the art will be able to define such a language starting from said fundamental classes and using existing libraries.
[0067] Fundamental classes designate the elementary concepts of data processing, a small number is enough, and the person skilled in the art will be able to define a set of fundamental cases allowing to express all instructions representative of an analytical processing of data from a database. For example, a main fundamental class "expression" designates all the objects which constitute mathematical expressions in the broad sense, and we can have the subclasses "constant" (predefined operand), "binary operator" (operation with 2 operands), "unary operator" (operation with 1 operand), "function" (any applicable function), with "constant" having the subclasses "boolean", "string", "Number", "missing" (if the type is missing), etc. In a schematic way, we can have for example the following inheritance tree of the fundamental class "expression", the subclasses being intuitively understood:
[0068] • Expression of Constant
[0069] ■ Booléen
[0070] ■ Chaine
[0071] ■ Number
[0072] ■ Manquant o _OperatorBinary
[0073] ■ On Addition
[0074] ■ OpSoustraction
[0075] ■ OpMultiplication
[0076] ■ OpSuperieurA
[0077] ■ OpEgalA o _Operateurllnaire
[0078] ■ OpMoins
[0079] ■ OpNon
[0080] ■ OpAucun o _Fn
[0081] ■ _FnListee
[0082] • AppelFnSansArg (*1 )
[0083] • AppelArgFn
[0084] • AppelFnArg(*3)
[0085] ■ _FnComposeeListee
[0086] • AppelFnComposeeSansArg (*2)
[0087] • AppelArgFnComposee
[0088] • AppelFnComposeeArg (*4)
[0089] ■ _FnSansArg
[0090] • AppelFnSansArg (*1 )
[0091] • CallFnComposeeWithoutArg (*2) ■ _FnArg
[0092] • CallFnArg (*3)
[0093] • CallFnComposeeArg (*4)
[0094] (*1): AppelFnSansArg is at the same time a subclass of _Fnl_istee and of > FnSansArg. It benefits from a multiple inheritance mechanism.
[0095] (*2) (*3) and (*4) follow the same logic.
[0096] Similarly, in a schematic way, we can have for example the following inheritance tree of the fundamental class "sentence" (which designates all the objects which constitute textual parts of the query which are not expressions), the subclasses being intuitively understood:
[0097] • _Phrase o DefinitionFn o Rule o Assignment
[0098] ■ AssignmentDToG
[0099] ■ AssignmentGversD o Loop o _CallProcedureSeche
[0100] ■ TStop
[0101] ■ TChrono
[0102] ■ TReset o CallProcedureCods
[0103] Process
[0104] A number of blocks of the said process, or components, are seen in Figure 2, which will be described in more detail.
[0105] With reference to Figure 3, the present method begins with a step (a) of obtaining said first instructions (in natural language) from the client terminal 10. Said first instructions can be directly entered by the user on an interface of the terminal 10, the user having in mind the processing that he wishes to accomplish and content to write it (the natural language makes the prototype = the specification, so that the first instructions are “executable in production”), or it will be possible to reuse first instructions already written for the same desired analytical processing, the user content to reuse them (for example for a processing that would be requested each month). In the example mentioned previously, it is sufficient to enter “Select the 10% of order lines whose quantity is the largest, among those whose price is greater than 100”, i.e. to literally describe the desired processing.We see that such first instructions are semantically correct, i.e. they have meaning and are not ambiguous.
[0106] The method then comprises a step (b) of translating said instructions into an abstract syntax tree. An abstract syntax tree, or AST, is a tree (directed acyclic graph) whose internal nodes are marked by operators and whose leaves (or external nodes) represent the operands of these operators. In other words, generally, a leaf is a variable or a constant.
[0107] An AST is the internal intermediate representation of the first instructions.
[0108] Then, in a step (c), the method comprises generating, from said abstract syntax tree, second instructions in said object-oriented programming language distinct from the operating language of said database. In particular, this involves transforming the tree structure of the AST into KIL expressions, the whole constituting said second instructions. To reformulate, the second instructions correspond to the first instructions transcribed in said object-oriented programming language (i.e. the second instructions relate to the same processing of the database as the first instructions).
[0109] Preferably, said second instructions do not include code in said operating language of said database, and in particular they only include code in said object-oriented programming language. To reformulate, said desired database processing is indeed expressed directly in said object-oriented programming language, and not by instructions in said operating language of said encapsulated database, i.e. turducken-style is excluded.
[0110] Indeed, we recall that the said object-oriented language is chosen so as to be an executable and syntactically verified mirror of natural language, which allows a direct translation of the first instructions into the second instructions (i.e. a semantic equivalence).
[0111] We understand that steps (b) and (c) are algorithmic, that is to say constrained by fixed rules and that the AST then the second instructions are therefore completely defined by the first instructions (it is an exact representation of these), and not a simple probabilistic estimation of second instructions which could correspond to the AST / to the first instructions.
[0112] In practice, we advantageously have two successive ASTs: the first AST (called AST KNL), obtained at the end of step (b), by syntactic analysis, then a second AST (called AST KIL), corresponding to the transformation of the first AST into a tree of objects of said object-oriented programming language (i.e. the leaves and nodes of the second AST are objects of said object-oriented programming language), constituting in practice said second instructions. This is made possible by the entirely object-oriented nature of the language. In other words, the second instructions can be expressed in the form of a second AST specific to said object-oriented programming language.
[0113] Both ASTs have the same overall structure, it is just a translation according to simple rules. We consider that the second AST can constitute the second instructions, because the KIL AST is a direct representation of the object calls of said object-oriented programming language. We thus clearly understand the interest of going through said programming language even in a completely internal way. Preferably, there is no other intermediate state than the
[0114] ASTs.
[0115] In the example of the first instructions "Select the 10% of order lines with the largest quantity, among those with a price greater than 100.", we obtain a first AST as represented by Figure 4a. We note that the leaves designate the semantic units of the first instructions, and therefore the operands (10, %, orders, quantity, price, 100). We then transform this first AST into the second AST visible in Figure 4b, and thus:
[0116] - SelectnerNtac_1 is an object of class SelectnerNtac
[0117] - SelectNtac_1 contains other objects (Number_1, ld_1, WithPlus_1, OpSuperieurA_1) whose classes are obtained by removing the rightmost order number. Similarly, WithPlus_1 contains ID_2 and OpSuperieurA_1 contains ld_3 and Number_2
[0118] As explained, the obtained KIL AST is the exact representation of the KIL object calls, and can therefore be executed, see below.
[0119] Steps (b) and (c) are implemented within the “KNIL Translator” (for Natural to Internai) block visible in figure 2.
[0120] It is understood that ASTs and automatic code generation from ASTs are known to those skilled in the art. However, the translation of natural language into ASTs is much more unusual.
[0121] In this respect, and with reference to Figure 5a (which shows the KNIL Translator block in more detail), step (b) is advantageously implemented by a non-deterministic parser. The AST is then a tree-like description of the syntax elements recognized by the parser.
[0122] Indeed, in the context of first instructions in natural language, the role of certain words can only be determined by reading the following words and not statically by a state machine, hence the non-deterministic nature of the parser. As non-deterministic analysis methods (in the parser) we can use the Earley algorithm, the CYK (Cocke-Younger-Kasami) algorithm or the GLR (Generalized Left-to-right Rightmost derivation) algorithm, which can analyze any context-free grammar in a reasonable (polynomial) time rather than, for example, LALR (Look-Ahead Left-to-right Rightmost derivation) usually used in known parsers because it is sufficient for computer languages less complex than natural language and faster.
[0123] An example of a grammar not recognized by a LALR(1) algorithm and recognized by Earley is the following grammar:
[0124] • S -> b A c | bda
[0125] • A -> d
[0126] This grammar is not understandable by LALR because there is a reduction / shift conflict when reading the sentence "bda". Indeed, once the beginning of the sentence "b" is read, it must read "d".
[0127] LALR is in a state where it doesn't know whether to reduce "A -> d" or whether it's in the middle of "s -> bda." In contrast, Earley's algorithm can handle this conflict by exploring all possibilities. It will realize that only "S -> bda" is possible by looking further into the sentence.
[0128] The non-deterministic parser can be pre-built, learned using artificial intelligence algorithms, and / or using language-specific grammar / vocabulary libraries (to take into account agreements, tenses, idioms, etc.), but also grammar common to all or part of the languages (a certain number of syntactic descriptions are factored: addressing tables, writing of integers, character strings, punctuation elements, etc.)
[0129] If syntactic analysis (and construction of the AST) is impossible because the first instructions do not make grammatical sense ("syntax error") an error message is returned to the user.
[0130] Furthermore, there may be several (first) ASTs, i.e. a "forest" of ASTs, in the case of ambiguous first instructions. To reformulate, in the case where an ambiguity of the first instructions cannot be resolved statically, we advantageously generate the set of possible ASTs (forest), and for each AST we implement step (c) so as to generate for each AST a "set" of second instructions, and we will see later how the execution of such a forest of ASTs takes place. In the preferred case of second instructions in the form of KIL ASTs, each first AST is translated into a second AST.
[0131] Preferably, there is a symmetrical block of the KNIL translator called "KINL back-translator" (for Internai to Natural) which optionally allows to regenerate third instructions in natural language from the second instructions in the object-oriented language. To reformulate, the third instructions correspond to the second instructions transcribed in natural language (i.e. the third instructions are relative to the same processing of the database as the second instructions). It is understood that the third instructions are a reformulation of the first instructions. The advantage is that the third instructions are generally optimized (simpler) compared to the first instructions, and potentially in another language, which allows to share the first instructions, for the repeated implementation of the same processing including in an international environment.
[0132] More specifically, with reference to Figure 5b (which shows the KINL Back-Translator block in more detail), the instructions of a KIL program are typically objects that inherit methods from a back-translation object module. These methods produce the natural language text from the properties of the KIL instructions and syntactic descriptions, either language-specific (note the vocabulary block may be common with the KNIL Translator), or common to all languages.
[0133] The final formatting (pretty-printer) makes it possible to obtain an easily readable text (indentations, spaces, punctuations, articles, etc.). In a main step (d), said second instructions are executed in a virtual machine implemented by the data processing means 21, noted KVM Machine.
[0134] The virtual machine makes it possible to interpret the KIL language of the second instructions in a manner that is completely transparent to the user, independently of the hardware. Indeed, since this language is internal, it is not natively executable by the operating system of the second server 1 . Communication with the hardware (including the first server 1 and its components) is simply carried out by a kernel object interface with said database, or Kernel, noted KOK Kernel. More precisely, said kernel makes the link between the virtual machine and the operating language, and in practice allows the processing of the database. It should be remembered that the second instructions do not include instructions in the operating language of the database, and that it is therefore the kernel which directly triggers commands in said operating language of said database in accordance with said second instructions (see below).
[0135] With reference to Figure 6, which represents the virtual machine, step (d) advantageously comprises a verification of the validity of the second instructions, in particular in the case of an AST forest (and therefore the verification of the validity of each set of second instructions). Step (d) comprises the execution of the only valid instruction set in said virtual machine. More precisely, there is execution if and only if a single set of second instructions is valid:
[0136] - If none are valid, there is nothing to execute and an error message is returned;
[0137] - If there are several valid games, it means that there are several correct ASTs and therefore an insurmountable problem of ambiguity, and an error message is returned.
[0138] - On the contrary, if there is only one valid set of second instructions, it is because the ambiguity has been resolved, and the second instructions of the only valid set are executed. In this respect, step (d) preferably includes the prior resolution of the identifiers and / or types of the data of said database concerned by the second instructions, that is to say the data of said database involved in the processing to which the first instructions relate. If this is achieved, then the set of second instructions is valid, and if not, it is invalid.
[0139] Identifiers are either variable names, column names, or function names. Identifiers also allow indirection: a variable name that contains an identifier.
[0140] This resolution is called dynamic since it is on the fly: the identifiers do not need to be declared. For this, we can use a block for managing the lexical scopes of variables which allows the dynamic definition of functions (including recursive functions).
[0141] Data types are also determined dynamically, in a known manner. Note that the consistency of the determined identifiers / types can be dynamically checked:
[0142] - If everything is consistent (validity confirmed) we move on to the execution itself (if there is indeed only one set of second valid instructions)
[0143] - If not, either we try to resolve again, or we return an error message (in particular if there are no other possible identifiers / types), aimed at guiding the user.
[0144] The execution of the second instructions includes triggering queries in said operating language of said database in accordance with said second instructions, and generally operations on the data obtained through said queries, so as to accomplish said desired processing. It is understood that such queries are known since said operating language of said database is known. In addition, these queries are “low level” as opposed to the second instructions which are “high level”.Said execution advantageously uses on the one hand external function interfaces (dynamic or static) in particular for a collaborative purpose, and on the other hand a control block defining in practice an order of triggering of said requests, possibly on the basis of management rules (itself for example triggered for each line of a table) and / or an inference engine (in particular in forward chaining) makes it possible to dynamically decide on the order of triggering.
[0145] Particularly preferably, in the case of a second AST expressing the second instructions, the execution of the second instructions is in practice the call of the “eval” method of the root object (SelectNtax_1 in figure 4b), and recursively, the call of the eval method of an object:
[0146] 1 calls (if needed) the eval methods of the contained objects.
[0147] 2 checks the type of the contained objects and possibly sends an error message.
[0148] 3 checks the consistency of the request (for example the existence of a column in a table. Here: price in the orders table) and possibly sends a warning or error message.
[0149] 4 performs the desired processing (here: a selection whose parameters are the results of the evaluations of the contained objects or the contained objects themselves depending on the case).
[0150] 5 returns the result.
[0151] In the case of an AST forest, the eval method is called for each AST but only performs steps 1 to 3 (dynamic verification of the validity of the AST).
[0152] If no AST is valid, an error is returned.
[0153] If only one AST is valid, we continue executing the eval method on this AST (steps 4 and 5).
[0154] If more than one AST is valid, an error is returned. The result of the execution of the second instructions in step (d), i.e. the data returned as output, the so-called execution trace, is provided in response, for example displayed by terminal 10.
[0155] It is understood that said output data relates to the result of said database processing. Thus, this makes it possible to formalize the result of the desired database processing, for example in the form of a report.
[0156] It is noted that the execution may also include the emission of informative messages representative of possible anomalies in the database.
[0157] In addition, Figure 7 represents the KOK Kernel. Like any kernel, it provides hardware abstraction mechanisms and facilitates communication between processes. Starting from standardized architectural elements (Definition of the object architecture of the entire code: base classes and common behaviors), the kernel defines:
[0158] - The data structures of the said database, as well as the elementary manipulations;
[0159] - Connectors with the said database + the different file formats as well as the character string encodings for reading and writing data files;
[0160] - Printing routines (terminal, text file, etc. in particular to HTML manager to produce said reports);
[0161] - A translation utility
[0162] - All the basic features that are useful from time to time: sending emails, web scraping, accessing the internal clock, etc.
[0163] - in the upper layer of said kernel, the fundamental classes of evaluable objects: all the objects used in the code implementing said method, including the instructions of the virtual machine, are objects whose class inherits from fundamental classes defined in this component. According to a preferred embodiment, the method comprises a preliminary step (aO) of configuring the virtual machine and / or the syntactic analyzer by an external integration module, called KEMI Integrator. The idea is to be able to enrich said method very easily, without modifying the central code. The module is typically connected to other terminals.
[0164] With reference to Figure 8, the said KEMI Integrator is able to integrate the functions of external modules by modifying / adding respectively the syntactic description / vocabulary blocks specific to the language of the KNIL translator and the static interface of the virtual machine (The functions are integrated into the virtual machine thanks to dynamic typing and a standardized interface for calling and passing parameters). Note that one can start from prototypes of external modules, allowing the rapid and homogeneous integration of isolated functions or entire modules of functions
[0165] Server
[0166] According to a second aspect, the invention relates to the second server 2 for implementing the method according to the first aspect.
[0167] It comprises data processing means 21, data storage means 22 and is connected to the first server 1 and to the terminal 10.
[0168] The data processing means 21 are configured to:
[0169] - Obtaining from the client terminal 10 first instructions in natural language relating to a desired analytical processing of the data from a database stored on data storage means 12 of the first server 1;
[0170] - Translate the said first instructions into an abstract syntax tree;
[0171] - Generating, from said abstract syntax tree, second instructions in an object-oriented programming language distinct from an operating language of said database; - Executing said second instructions in a virtual machine implemented by the data processing means 21 so as to carry out said desired analytical processing, comprising the triggering of queries in said operating language of said database, said virtual machine using an object kernel for interface with said database.
[0172] The means 21 may further be configured to
[0173] - generate natural language output data relating to the result of said desired analytical processing; and / or
[0174] - configure the virtual machine and / or a parser for the implementation of step (b) via an external integration module (potentially connected to other terminals).
[0175] According to a third aspect, the invention proposes a system comprising the second server 2, the first server 1, and the terminal 10, connected (in particular via a network 20 such as the Internet, the different equipment being able to be combined).
[0176] Computer program product
[0177] According to a fourth and a fifth aspect, the invention relates to a computer program product comprising code instructions for the execution (on the data processing means 21 of the second server 2) of a method according to the first aspect of executing first instructions in natural language relating to a desired analytical processing of the data of a database stored on data storage means 12 of a first server (1), as well as storage means readable by computer equipment (for example the data storage means 22 of the second server 2) on which this computer program product is found.
Claims
CLAIMS 1. Method for executing first instructions in natural language relating to a desired analytical processing of the data of a database stored on data storage means (12) of a first server (1), characterized in that it comprises the implementation by data processing means (21) of a second server (2): (a) Obtaining said first instructions from a client terminal (10); (b) Translating said first instructions into an abstract syntax tree; (c) Generation, from said abstract syntax tree, of second instructions in an object-oriented programming language distinct from a language for operating said database; (d) Executing said second instructions in a virtual machine implemented by the data processing means (21) so as to carry out said desired analytical processing, comprising triggering queries on said database in said database operating language, said virtual machine using an object kernel for interfacing with said database.
2. The method of claim 1, wherein said second instructions are a transcription of the first instructions in said object-oriented programming language.
3. Method according to one of claims 1 and 2, in which step (b) is implemented by a non-deterministic syntactic analyzer.
4. The method of claim 3, wherein said non-deterministic parser uses the Earley algorithm, the CYK algorithm or the GLR algorithm.
5. Method according to one of claims 3 and 4, in which step (b) comprises, if the syntactic analyzer raises an ambiguity of the first instructions, the generation of a plurality of abstract syntax trees, each being a possible translation of said first instructions, step (c) comprises the generation, from each abstract syntax tree, of a set of second instructions in said object-oriented programming language; and step (d) comprises a verification of the validity of each set of second instructions, and the execution of the only valid set of second instructions in said virtual machine.
6. Method according to one of claims 1 to 5, wherein the first instructions are translated in step (b) into a first abstract syntax tree, step (c) comprising the transformation of the first abstract syntax tree into a second abstract syntax tree, said second abstract syntax tree being an object tree of said object-oriented programming language, expressing said second instructions.
7. Method according to one of claims 1 to 6, in which said object-oriented programming language is derived from Python® or C++, and said database operating language is chosen from Python®, Lisp, SQL or PowerQuery.
8. Method according to one of claims 1 to 7, in which step (d) comprises the prior resolution of the identifiers and / or types of the data of said database concerned by the second instructions, to generate said queries on the database.
9. Method according to one of claims 1 to 8, wherein step (d) comprises providing said client terminal (10) with output data relating to the result of said desired analytical processing.
10. Method according to one of claims 1 to 9, further comprising a prior step (aO) of configuring the virtual machine and / or of a parser for the implementation of step (b) by an external integration module.
11. Server (2), called second server, characterized in that it comprises data processing means (21) configured to: - Obtaining from a client terminal (10) first instructions in natural language relating to a desired analytical processing of the data of a database stored on data storage means (12) of a first server (1); - Translate the said first instructions into an abstract syntax tree; - Generate, from said abstract syntax tree, second instructions in an object-oriented programming language distinct from an operating language of said database; - Executing said second instructions in a virtual machine implemented by the data processing means (21) so as to carry out said desired analytical processing, comprising the triggering of queries in said operating language of said database, said virtual machine using an object kernel for interface with said database.
12. System comprising the second server (2) according to claim 11, said first server (1) and the terminal (10) connected.
13. Computer program product comprising code instructions for executing a method according to one of claims 1 to 10 for executing first instructions in natural language relating to a desired analytical processing of data from a database stored on data storage means (12) of a first server (1), when said program is executed on a computer.
14. Storage means readable by computer equipment on which is recorded a computer program product comprising code instructions for the execution of a method according to one of claims 1 to 10 of execution of first instructions in natural language relating to a desired analytical processing of the data of a database stored on data storage means (12) of a first server (1).
Citation Information
Cited By
Cross-knowledge-point combined examination question generation method and system, electronic equipment and storage medium
CN121786100A
A method, system, electronic device, and storage medium for generating test questions that combine multiple knowledge points.
CN121786100B