Method for automatically processing a document in accordance with a natural-language command

The method allows LLMs to process stored documents efficiently by using a structured text query with user commands and document content, addressing the challenge of accessing and analyzing complex formatted documents like patent applications.

WO2025172595A1PCT designated stage Publication Date: 2025-08-21CABINET GERMAIN & MAUREAU
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2025/054128
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-16
Filing Date
2025-02-14
Publication Date
2025-08-21

AI Technical Summary

Technical Problem

Large Language Models (LLMs) struggle to access and process complex formatted documents like PDFs, particularly patent applications, due to their training data not including these documents and their online access being insufficient for identifying content, leading to poor results.

Method used

A method and system that utilizes a generative language model to process documents stored on a second server by obtaining a user command in natural language, extracting document identifiers, and transmitting a text file request to a third server for processing, using a structured text query that includes user commands and document content, ensuring efficient and accurate document analysis without internet access.

Benefits of technology

Enables efficient and accurate processing of document content directly from stored documents, improving the quality of analysis by avoiding complex formatting issues and reducing processing time and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2025054128_21082025_PF_FP_ABST
    Figure EP2025054128_21082025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to a method for automatically processing a document stored by a second server (2), in accordance with at least one natural-language user command describing the expected processing of the document, the method comprising the implementation of the following steps by a first server (1): (a) obtaining the at least one natural-language user command and an identifier of the document; (b) transmitting, to the second server (2), a request for at least part of the document in the form of a text file, the request comprising the obtained identifier, and receiving the text file in return, (c) implementing a textual request to process the document, referred to as the main textual request, by way of a generative language model, the main textual request comprising: - the user command; - the content of the text file; (d) outputting a textual response to the main textual request.
Need to check novelty before this filing date? Find Prior Art

Description

Description Title of the invention: Method for automatically processing a document in accordance with a natural language command. GENERAL TECHNICAL FIELD The present invention relates to the field of artificial intelligence. More specifically, it relates to a method for automatically processing a document in accordance with a natural language command. STATE OF THE ART Artificial intelligence, and in particular generative language models of the Large Language Model (LLM) type, now makes it possible to process textual data in just a few seconds, including answers to questions. One application targeted is in particular the automated analysis of prior art documents such as scientific publications or published patent applications, for example to determine whether these documents disclose a given characteristic. The main problem is that of LLMs' access to these documents, since the data on which the LLMs were trained does not include them, and therefore their content is unknown. Some servers implementing LLMs allow internet access, but in practice this is insufficient for the LLM to find the document and identify its content even if it is published online (for example on Espacenet). For example, if I ask ChatGPT to analyze a patent application, it recognizes that the document in question is a patent application but invites me to "consult the European patent database or other similar online sources." Some LLMs are capable of accepting a PDF as input (on which they will implement an optical character recognition technique, known as OCR). Therefore, if you want to analyze a prior art document, you can manually download its PDF and upload it to the server implementing an LLM of this type in order to ask questions. Apart from the fact that such a manipulation is tedious, we note that documents in PDF format, and in particular patent application publications, have complex formatting (multiple columns, header pages), figures, etc., which disrupt an LLM, so that the result is poor. The invention improves the situation. PRESENTATION OF THE INVENTION The present invention therefore relates, according to a first aspect, to a method for automatically processing a document stored by a second server, in accordance with at least one user command in natural language, describing said expected processing of the document, the method being characterized in that it comprises the implementation, by data processing means of a first server connected to the second server by a communication network, of steps of: (a) Obtaining said at least one user command in natural language and an identifier of said document, from a user interface; (b) Transmission to said second server of a request for at least part of said document in the form of a text file, said request comprising said obtained identifier, and receipt in return of said text file; (c) Implementation of a textual query for processing the document, called the main textual query, by a generative language model, said main textual query comprising: - The user command; - The contents of said text file; (d) Rendering, by said user interface, a text response to said main text query. According to advantageous and non-limiting characteristics: Said generative language model is implemented by a third server connected to the first server by said communication network, step (c) comprising the transmission of said textual request to the third server, and the reception in return of said textual response. Said main text query further comprises a sentence defining that the desired action of the generative language model is the processing in accordance with the user command of the content of the text file, the user command being designated by a first identifier, the content of said text file being designated by a second identifier, and the first and second identifiers being repeated in said sentence. The said text query is of the form: "P(I1 ; I2) 11: CU 12: DOC » Where 11 and I2 are the first identifiers; P(I1; I2) the said sentence defining the desired action of the generative language model and taking the identifiers 11 and I2; DOC the text contained in the text file, and CU the user command. Step (a) comprises the user entering on the one hand said identifier and on the other hand said user command in natural language. Said user command contains said identifier, step (a) comprising extracting the identifier from the document in said user command. Step (a) comprises implementing a textual query for preprocessing said textual user command, called a preliminary textual query, by said generative language model, so as to extract said identifier. Said preliminary request is a request for transcription of said textual user command, by said generative language model, into a structured file containing: - said document identifier; - a generic version of said user command no longer containing said identifier; - Optionally, a designation of a target part of the document to be processed; Said main text query implemented in step (c) comprises said generic version rather than the original user command containing said identifier. If said structured file contains the designation of a target part of the document to be processed, said request transmitted in step (b) is a request for said target part of said document. The said preliminary textual request includes: - the user command; - either a model of the structured file; or a pair of a reference command in natural language, and a reference structured file in said predefined markup language, corresponding to the expected transcription of said reference command by said generative language model. The Generative Language Model is a large language model, LLM, specifically a pre-trained Generative Transformer type model, GPT. The method comprises implementing steps (a) to (d) for a first user command so as to obtain a first textual response; then implementing, for a second user command, step (a), a step (c') of implementing a second main textual query, by the generative language model, comprising the second user command but not the content of said text file, and step (d). According to a second aspect, the invention proposes a server for automatic processing of a document in accordance with at least one user command in natural language, connected to a second server storing said document by a communication network, characterized in that it comprises data processing means configured to: - Obtain from a user interface the user command in natural language, describing the said expected processing of the document, and an identifier of the said document; - Transmitting to said second server a request for at least part of said document in the form of a text file, said request including said identifier obtained, and receiving in return said text file, - Implement a textual query for processing the document, called the main textual query, by a generative language model, said main textual query comprising: o The user command; o The content of said text file; - Restore, by said user interface, a textual response to said main textual query. According to a third aspect, the invention proposes a system comprising said first server 1, as well as the second server 2, and a possible third server 3, connected via the communication network 20. According to a fourth and a fifth aspect, the invention provides a computer program product comprising code instructions for executing a method according to the first aspect of automatic processing of a document stored by a second server, in accordance with at least one user command in natural language, describing said expected processing of the document; 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 automatic processing of a document stored by a second server, in accordance with at least one user command in natural language, describing said expected processing of the document. PRESENTATION OF FIGURES 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: [Fig. 1]Figure 1 is a diagram of a system for implementing the method according to the invention; [Fig. 2]Figure 2 is a flowchart illustrating the steps of an embodiment of the method according to the invention; [Fig. 3]Figure 3 schematically represents the implementation of a preferred embodiment of the method according to the invention. DETAILED DESCRIPTION Architecture The present invention relates according to a first aspect to a method for automatically processing a document in accordance with at least one user command in natural language, in a system as represented by figure 1. A user "command" refers to any input data that forms an input from the user and describes the expected processing of the document. Typically, this processing is an analysis of the document in order to extract information from it. The command is then typically a question about the content of the document, to which the user wants the answer. Alternatively, any processing on the document may be required, including summarization, translation, rewriting, or even more formal processing. The command(s) are natural language, that is, the "normal" language spoken by a human being and not a structured computer language. Natural language is written without prior learning, unlike all computer languages. There may be a plurality of user commands, possibly successive, describing in practice each of the successive processing operations expected of said document, but it is entirely possible to have a second user command which specifies the first user command. As shown in Figure 1, there is a first server 1 for executing said method, and advantageously a client terminal 10 such as a workstation or a smartphone, having a user interface 13 and via which the user will be able to interact. Note that there may not be a terminal 10 separate from the first server (or even the first server 1 may be directly a client terminal such as a smartphone - in other words these devices are merged), i.e. the interface 13 may be that of the first server 1. There is also at least one second server 2 for storing said document. Preferably, said document is not stored by the first server 1, i.e. it is only available online. The document may be of any nature, in particular an article, a scientific publication, a patent document, etc. According to a preferred embodiment, the document is a patent document (application or patent) and the second server 2 is a server for publishing patent documents, for example the server of a Patent Office. There is one (or more) possible third server(s) 3 for the implementation of artificial intelligence model(s) described later. It is understood that the first server 1 is connected at least to the second server 2, and where appropriate to the possible client terminal 10 and / or to the third server(s) 3, for example via a communication network 20 such as the internet network. The first / second / third servers 1, 2, 3 comprise data processing means 11, 21, 31 such as a processor of any kind, and data storage means 12, 22, 32, i.e. a memory. It is therefore the data storage means 22 of the second terminal 2 which store said document. Process With reference to Figure 2, the present method is implemented by the data processing means 11 of the first server, and begins with a step (a) of obtaining said at least one user command in natural language and an identifier of said document, from a user interface 13 (potentially from the client terminal 10 if it is the client terminal which includes said user interface 13). Document identifier means a reference that allows the second server 2 to uniquely identify the document. The identifier is generally an alphanumeric code, for example a publication number for a patent application. It is important to understand that it is sufficient for the identifier to be interpretable by the data processing means 21 of the second server 2, but it may not have any meaning for a human. According to a first unclaimed embodiment, said identifier and said user command can each be entered separately by the user on the interface 13, the user having in mind the processing he wishes, for example in two separate fields. Step (a) then comprises the reception (by the first server 1) of the identifier and the user command as two independent digital objects (the voice command in the form of a text file). For example, the user might enter the publication number of a patent application as an identifier and the phrase "Does the document disclose a GPT-like AI model?" as a user command. According to a second embodiment in accordance with the invention, which is much more natural and much more ergonomic, said user command in natural language directly contains said identifier, step (a) comprises the user entering this single user command (i.e. without separate entry of the identifier, but there may be several user commands entered), and the extraction of the identifier in said command. For example, the user can directly enter the user command "Does the document EPXXXXXXXX disclose a GPT-type AI model?". This extraction may be done by any known technique, but preferably, according to an embodiment which will be described later, this extraction already involves the use of a generative language model. It will be understood that by "user command in natural language comprising a document identifier", we mean that the identifier is itself a fragment of the query itself in natural language, and not for example data attached in another form or metadata, and even less the document itself. To reformulate further, the user command both describes the said expected processing of the document and identifies the document. Note that in all cases, said user command (and where appropriate the identifier) ​​could alternatively simply be spoken by the user, and recorded by a microphone (for example of the terminal 10). Step (a) would then comprise the written transcription of said voice audio signal into the user command. In other words, the means 11 obtain the user command by implementing a written transcription of said voice audio signal. This transcription can be done via any known voice recognition technique, in particular artificial intelligence models, for example the Whisper model. The method then comprises a step (b) of transmitting to said second server 2 a request for at least a part of said document (called the target part) in the form of a text file, said request comprising said identifier obtained, and receiving in return said text file. More precisely, the request is generated by the data processing means 11 of the first server as a function of at least said identifier, and potentially also said user command. Here, a query formalism defined by said second server 2 is used, generally in accordance with published APIs, for example Open Patent Services if the second server 2 is an Espacenet server. In other words In other words, this is a classic computer query and not a textual (natural language) query for an LLM. Said request comprises at least said identifier so that the server 2 can identify the desired document, as well as possible attributes relating for example to the desired language (if there are several languages ​​in which the document is available - note that the language can be predefined or be that of the user command), to said target part (if it is defined), etc. The said target part of the document is the part to be processed. Generally, the said target part may be the complete textual content of the document, as is, called full text, made available by the server 2, with the exception of any purely biographical or appendix parts, as well as non-textual content. For example, the full text of a patent application generally contains the description, the claims and the abstract, but not the figures (which are graphic content). Alternatively, the target part can be more restricted, for example only the description of a patent application. This can be predefined, or determined from the user command, as we will see later. According to a preferred embodiment, the full text is required by default unless the user command determines a target portion. For example : - following the command “Does document EPXXXXXXXX disclose a GPT-type AI model?”, then there is no precision as to the part of the document which is to be processed, and therefore a text query (EPXXXXXXXX, French) can be transmitted to server 2; - following the command “Does the description of document EPXXXXXXXX disclose a GPT-type AI model?”, then the part of the document that is to be processed is specifically the description, and therefore a text query (EPXXXXXXXX, French, description) can be transmitted to server 2. In response, server 2 processes said request in a known manner and provides a text file containing said part (named document_text_file.txt as an example later), if possible in the desired language if the request designated the language and if this language is available (otherwise the text is retrieved in the available language for lack of a better one). We recall that a text file is a file whose content represents only a sequence of characters, for example in .txt or .rtf format. We note that the user command is itself typically provided in the form of a text file (named user_command.txt as an example later). The method then comprises a main step (c) of implementing a textual query for processing the document, by a generative language model. This query will be called “main” in the remainder of the description. The said text query is generally called a "prompt", it is an input text to the generative language model, defining what is requested from it. Said generative language model is an artificial intelligence model, capable of generating an output text from a prompt. The generative language model generally is typically a large language model (LLM), in particular a pre-trained generative transformer (GPT) type model, for example GPT-4, LaMDA, LLaMA, BLOOM, etc. Preferably, the LLM is implemented by a third server 3 so that this request is transmitted to it. More precisely, step (c) comprises transmitting said main textual request to the third server 3, and receiving in return a textual response. Very cleverly, we choose a text query (the prompt) including: - The user command; - The content of said text file received in step (b), i.e. the full text of at least part of the document on which processing in accordance with said user command is expected; In other words, the prompt directly includes the text of the document to be processed, so that the LLM directly has all the data necessary to implement the processing without having to access the internet. To rephrase, the main text query is defined as a text query for processing the document, but in practice the LLM does not even know that the text provided is that of an existing document, published on the internet. In addition, the content provided is of excellent quality because it is directly provided by the second server 2 (it is the official text if server 2 is a publication server of a patent office) and not obtained for example by OCR. Note that the embodiment in which we retrieve, if possible, only the text of a part of the document is advantageous because we limit the size of the prompt, and therefore the number of "tokens", i.e. units of information used by the LLM, and therefore the time / cost to obtain a response to the textual request. Furthermore, in order to obtain a response in the same language as the text user command, the text query (the prompt) must be constructed in the said language of the user command. If one wishes to be able to process several different languages ​​of user commands, preferably one has several alternative query models in each of the languages, chosen according to the language of the user command (see below). As for the structure of the text query, it is sufficient that the generative language model is able to understand that we want to implement said user command on said text of the document. Thus, in a particularly preferred manner, said main text query further comprises a sentence defining that the desired action of the generative language model is the processing in accordance with the user command of the content of the text file (i.e. the inserted text which is recalled to be from said part of the document retrieved from the second server 2), the user command being designated by a first identifier, and the content said text file being designated by a second identifier, and the first and second identifiers being included in said sentence. As explained, we can have several models corresponding to several languages, each having said sentence (or even the identifiers) in this language. There may also be other optional parameters such as a desired level of detail in the response, a tone, etc., which will be transcribed by the sentence. The said text query is in particular for example of the form: "P(I1 ; I2) 11: CU 12: DOC » Where 11 and I2 are the first identifiers; P(I1; I2) is the sentence defining the desired action of the generative language model and taking the identifiers 11 and I2; DOC is the text contained in the text file, and CU is the user command. The phase itself can depend on the language or other parameters as explained. Thus, assuming that the skeleton of the expected structured text file of the DOC document is in the file file_text_document.txt (i.e. the file returned by the second server 2), we can for example use the following text query (prompt), with comments and explanations in bold that are not part of this query: Answer the Question about the Document. [Phrase P defining the desired action, “Question” is the first identifier 11 and “Document” is the second identifier I2] Question: user command.txt [ID 11 + CU to be incorporated] Document: text file document.txt [I2 identifier + DOC to embed] Step (c) typically comprises generating the main text query by the first server 1 , and in the preferred embodiment where the generative language model is implemented by a third server 3 connected to the first server 1 , step (c) advantageously further comprises transmitting said main text query to the third server 3, and receiving in return a text response to said main text query. For example, if the user command was "Does the document disclose a GPT-like AI model", the text response to the query containing this command and the full text of the EPXXXXXXXX request might be "Yes, in paragraph

[0127] ". Finally, in a step (d) said text response is returned by said interface 13, intended for the user (for example display if the interface is the screen of a smartphone type terminal). In this respect, the response may, if necessary, be transferred from the first server 1 to the possible terminal 10. Preliminary textual request As explained, according to a preferred and much more ergonomic embodiment, there is a user command directly containing said identifier, and step (a) comprises extracting the identifier of the document in said user command. To do this, in a particularly preferred manner, step (a) comprises the implementation of a textual query for pre-processing said textual user command, called a preliminary textual query, by said generative language model, so as to extract said identifier. In other words, we also use an LLM (preferably the same as for the main text query, but not necessarily) to preprocess the user command, without executing it, to obtain the identifier. For example, if user command is "Does document EPXXXXXXXX disclose a GPT-like AI model?" the prompt What is the document number mentioned in: usercommand.txt? returns the text response EPXXXXXXXX, which can be used in step (b). Again, step (c) advantageously comprises the transmission of said preliminary textual request to a third server 3 (the same or another), and the receipt in return of a textual response. The user command can be used as is in step (c), but note that it can create confusion since it still contains the identifier. Alternatively, one can cleverly use the preliminary text query to, at the same time as extracting the identifier, rewrite the user command. More precisely, one can generate from the user command, a generic version of this user command no longer containing said identifier. Note that said generic version can be "normalized" in particular so as to present a predetermined formalism, for example always in the form of a question, so as to facilitate the writing of the main text query. So starting from the original user command "Determine whether the document EPXXXXXXXX discloses a GPT-type AI model", we can obtain the generic version "Does the document disclose a GPT-type AI model?". Very advantageously, we can even take advantage of this pre-processing to try to obtain other parameters either from the textual user command (language, level of detail of the desired response) or from the document request sent in step (b), such as a designation of the target part or even the desired language of the document if several are possible. What is very powerful here is that the said target part does not need to be explicitly mentioned, LLMs can in some cases understand that a part is sufficient even if it is not explicitly stated. For example, if the user command is "Does document EPXXXXXXXX claim a GPT-type AI model?", then preprocessing allows us to realize that we can be satisfied with the claims as the target part. The language can be used as explained so that the text query is in the same language as the text user command, and thus the response is obtained in this same language. As for the desired language of the document, it is possible to provide that by default it is that of the user command (unless for example the user specifically requires another language, such as document in English in a command formulated in French). We understand that we have several outputs to obtain (identifier, generic version, language, target part, etc.), so we can sequentially execute as many preliminary queries on the user command as different actions desired (extraction of the identifier, language identification, rewriting, determination of the target part, etc.). Much more efficiently, we can have a single output in the form of a structured file describing the user command (i.e. containing all its information), called a user structured file, by implementing a single preliminary text query. By structured file we mean a file formatted according to an expected model, i.e. an "empty" or skeleton file, as opposed to the user command which is unstructured, notably in a predefined markup language such as XML. Thus, it will be very easy for the first server 1 to read this structured file. For example, we can describe a user command with the following structure <commande identifiant="..." langue="..." partie="...">XXX< / commande> , where XXX is the generic version of the user command, and language and part of the optional attributes. So, if we take as input the user command "Determine if the document EPXXXXXXXX claims a GPT-type AI model", we can obtain the user-structured file<commande identifiant="EPXXXXXXXX" langue="FR" partie="REV"> “Does the paper claim a GPT-like AI model?”< / commande> . Indeed, a structured file is not in natural language but its code (in said markup language) remains a sequence of characters, and an LLM is capable of automatically and efficiently constructing such a file. Thus, in this embodiment, said preliminary request is advantageously a request for transcription of said textual user command, by said generative language model, into a structured file (in other words the construction, from said textual user command, of the structured file) containing: - said document identifier; - a generic version of said user command no longer containing said identifier; - Optionally, a language of the text user command; - optionally, a designation of a target part of the document to be processed (note that it is possible that the LLM may not be able to determine a target part, so we will typically recover all the textual content of the document); - Even more optionally, the desired language of the document (which can be the default language of the user command). Note that the language of this preliminary text query does not matter (it can, for example, arbitrarily be in English), because its response will not be visible to the user. Said structured file can be used by the data processing means 11 of the first server 1 in steps (b) and (c). Said main text query implemented in step (c) then comprises, as explained where appropriate, said generic version (extracted from the user structured file) rather than the original user command containing said identifier. And, if said structured file contains the designation of a target part of the document to be processed, said request transmitted in step (b) is a request for said target part of said document. As regards the format of the preliminary text query, according to a first variant, it contains - the user command; - a model of the structured file Then, similarly to the main text query, said preliminary text query may further comprise a sentence defining that the desired action of the generative language model is the transcription of the user command into said structured file in accordance with said skeleton, the user command being designated by a first identifier, and the skeleton of the user structured file being designated by a second identifier, and the first and second identifiers being repeated in said sentence. Note that the said model of the structured file could be a skeleton or a descriptive document of the expected structure of the structured file, for example a DTD file (document type document) if the structured file is an XML file. So, assuming the user command is in a user_command.txt file to be incorporated and the structured file template is in the user_command.dtd file, we can use the following preliminary text query (prompt): Transcribe the Order into a structured file conforming to the Model, the generic version of the Order mentioned in the Model being a reformulation of the Order in the form of a question not mentioning a document identifier. Command: usercommand.txt Template: user command.tdt According to a second variant, the preliminary text query contains - the user command; - at least one pair of a reference command in natural language, and a structured reference file in said predefined markup language, corresponding to the expected transcription of said reference command by said generative language model. By command and reference file we mean predetermined examples. Said pair (called reference pair) implicitly corresponds to a training pair, equivalent to including a full model (and often simpler to generate). Then, similarly to the proposed in the first variant, said preliminary text query may further comprise a sentence defining that the desired action of the generative language model is the transcription of the user command into said structured file, but this time the user command and the reference command are designated by a first identifier, the expected structured file and the reference structured file are designated by a second identifier, and the first and second identifiers are repeated in said sentence. So, assuming the user command is in a user_command.txt file, the reference command is in a reference_command.txt file to be incorporated, and the reference structured file is, we can use the following preliminary text query (prompt): Transcribe the Command into an XML structured file. Command: command reference.txt XML: reference file. XML Command: usercommand.txt XML: Thanks to this structure, the LLM understands that it must generate the XML which is to the user command what the reference structured file is to the reference command. Note that there is not even a need to describe what we want by "generic version" of the user command because the LLM understands it all by itself thanks to the reference pair. Note that it is entirely possible to use several reference pairs to improve performance. In any case, the size of the preliminary text query is negligible compared to that of the main text query so that its cost and processing time are negligible. With reference to Figure 3, a preferred embodiment of the method is summarized as follows: (1) The first server 1 obtains a user command including a document identifier (2) The first server 1 transmits to a third server 3 a textual request (called preliminary) for transcription, by a generative language model, of the user command into a structured file; (3) It receives in response the structured file containing at least the document identifier and the generic version of said user command no longer containing said identifier; (4) The first server 1 transmits to a second server 2 a request for at least part of said document in the form of a text file, comprising said identifier provided in the structured file, and the designation of said target part if it is present in the structured file; (5) He receives in response the said text file (6) The first server 1 transmits to the third server 3 a new textual request (called main) for processing the document, by the generative language model, in particular in the language of the user textual command, said main textual request comprising: - The generic version of the user command provided in the structured file; - The contents of said text file; (7) He receives the text response (8) It restores the latter on interface 13 (1) to (3) correspond to step (a), (4) and (5) to step (b), (6) and (7) to step (c) and (8) to step (d). Command chaining According to one embodiment, there may be several user commands. Obviously, if the user wishes to process a new document, the process must be repeated. Alternatively, the user can request a new processing of the same document (if he asks a new question), and the process can be simplified. More specifically, the method advantageously comprises the implementation of steps (a) to (d) for a first user command so as to obtain a first textual response (i.e. first normal execution of the method), then the implementation, for a second user command, of step (a); of a step (c') of implementing a second main textual request, by the generative language model, comprising the second user command but not the content of said text file; and of step (d) (i.e. second simplified execution). Indeed, there is normally no need to repeat step (b), unless step (a) concludes that the part of the document to be processed is not the same or at least is not included in the available part (and then it is necessary to start again). More precisely, either the second user command does not contain a document identifier, and it can be assumed that the same document is targeted, or the second user command contains a document identifier, extracted using the preliminary text query, and it is sufficient to compare it with the identifier obtained for the first user command. Step (c) can be repeated as is, but remember that this would involve transmitting the contents of the document again, which is massive. However, LLMs generally have a memory of the current discussion, so that in practice there is no need for the second main text query to still include the contents of said text file, hence step (c') instead of step (c), implementing a second "simplified" main text query, by the generative language model, since it only includes the second user command but not the contents of said text file. Like the preliminary query(s), such a second simplified text query has a size that is negligible compared to that of the main text query so that its token cost and processing time are negligible. To reformulate only the first user command is expensive, then the user can chain the questions on the document without any restrictions. Alternatively, if the LLM has no memory, we can return not only the contents of said text file, but also the entire conversation history (i.e. all previous user command / corresponding response pairs - for example, in the case of a second text user command, we will have second text user command + contents of the text file + first text user command + first text response), so that the response to the current user command takes into account everything that was said before, which is important if the user asks for clarification, for example. A lot of tokens will be used, but tokens in a memory-less LLM are usually very cheap. Server According to a second aspect, the invention relates to the first server 1 for implementing the method according to the first aspect. Thus, this first server 1 comprises, as explained, at least data processing means 11 and a memory 12. It comprises a user interface 13 or is connected to a terminal 10 having such an interface. It is typically an automatic document processing server. The data processing means 11 are configured to implement, for a document, steps consisting of: - Obtain from the user interface 13 the user command in natural language, describing said expected processing of the document, and an identifier of said document; - Transmitting to said second server 2 a request for at least part of said document in the form of a text file, said request comprising said identifier obtained, and receiving in return said text file, - Implement a textual query for processing the document, called the main textual query, by a generative language model, said main textual query comprising: o The user command; o The content of said text file; - Restore, by said user interface 13, a textual response to said main textual request. According to a third aspect, the invention proposes a system comprising said first server 1, as well as the second server 2, and a possible third server 3, connected (via the network 20). Computer program product 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 11 of the first server 1) of a method according to the first aspect of the method for automatic processing of a document stored by a second server 2, in accordance with at least one user command in natural language, describing said expected processing of the document; as well as storage means readable by computer equipment (for example the data storage means 12 of the first server 1) on which this computer program product is found.

Claims

CLAIMS 1. Method for automatically processing a document stored by a second server (2), in accordance with at least one user command in natural language, describing said expected processing of the document and containing an identifier of said document, the method being characterized in that it comprises the implementation, by data processing means (11) of a first server (1) connected to the second server (2) by a communication network (20), of steps of: (a) Obtaining said at least one user command in natural language, from a user interface (13); and extracting the document identifier in said user command; (b) Transmission to said second server (2) of a request for at least part of said document in the form of a text file, said request comprising said obtained identifier, and receipt in return of said text file, (c) Implementation of a textual query for processing the document, called the main textual query, by a generative language model, said main textual query comprising: - The user command; - The contents of said text file; (d) Rendering, by said user interface (13), a text response to said main text query.

2. Method according to claim 1, wherein said generative language model is implemented by a third server (3) connected to the first server (1) by said communication network (20), step (c) comprising the transmission of said textual request to the third server (3), and the reception in return of said textual response.

3. Method according to one of claims 1 and 2, wherein said main text query further comprises a sentence defining that the desired action of the generative language model is the processing in accordance with the user command of the contents of the text file, the user command being designated by a first identifier, the contents of said text file being designated by a second identifier, and the first and second identifiers being repeated in said sentence.

4. Method according to claim 3, wherein said text query is of the form: "P(I1 ; I2) 11: CU 12: DOC » Where 11 and I2 are the first identifiers; P(I1; I2) the said sentence defining the desired action of the generative language model and taking the identifiers 11 and I2; DOC the text contained in the text file, and CU the user command.

5. Method according to one of claims 1 to 4, in which step (a) comprises the implementation of a textual query for pre-processing said textual user command, called preliminary textual query, by said generative language model, so as to extract said identifier.

6. Method according to claim 5, in which said preliminary request is a request for transcription of said textual user command, by said generative language model, into a structured file containing: - said document identifier; - a generic version of said user command no longer containing said identifier; - Optionally, a designation of a target part of the document to be processed; Said main text query implemented in step (c) comprising said generic version rather than the original user command containing said identifier.

7. Method according to claim 6, wherein, if said structured file contains the designation of a target part of the document to be processed, said request transmitted in step (b) is a request for said target part of said document.

8. Method according to one of claims 6 and 7, in which said preliminary text query comprises: - the user command; - either a model of the structured file; or a pair of a reference command in natural language, and a reference structured file in said predefined markup language, corresponding to the expected transcription of said reference command by said generative language model.

9. Method according to one of claims 1 to 8, in which the generative language model is a large language model, LLM, in particular a pre-trained generative transformer type model, GPT.

10. Method according to one of claims 1 to 9, comprising the implementation of steps (a) to (d) for a first user command so as to obtain a first textual response, then the implementation, for a second user command, of step (a); of a step (c') of implementing a second main textual request, by the generative language model, comprising the second user command but not the content of said text file; and of step (d).

11. Server (1) for automatic processing of a document in accordance with at least one user command in natural language, connected to a second server (2) storing said document by a communication network (20), characterized in that it comprises data processing means (11) configured to: - Obtain from a user interface (13) the user command in natural language, describing the said expected processing of the document, and an identifier of said document, said user command containing said identifier; comprising extracting the identifier of the document from said user command; - Transmitting to said second server (2) a request for at least part of said document in the form of a text file, said request comprising said obtained identifier, and receiving in return said text file, - Implement a textual query for processing the document, called the main textual query, by a generative language model, said main textual query comprising: o The user command; o The content of said text file; - Restore, by said user interface (13), a textual response to said main textual request.

12. Computer program product comprising code instructions for executing a method according to one of claims 1 to 10 for automatic processing of a document stored by a second server (2), in accordance with at least one user command in natural language, describing said expected processing of the document, when said program is executed on a computer.

13. 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 for automatic processing of a document stored by a second server (2), in accordance with at least one user command in natural language, describing said expected processing of the document.

Citation Information

Patent Citations

  • Natural language database generation and query system

    US11860914B1