Legal document generation method and device, electronic equipment and storage medium

By combining semantic analysis and neural machine translation with a target legal knowledge base, the efficiency, quality, and adaptability issues in cross-language legal document generation are resolved, achieving efficient, accurate, and personalized legal document generation and meeting the multilingual needs of transnational legal affairs.

CN119886097BActive Publication Date: 2026-06-26CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
Filing Date
2024-12-30
Publication Date
2026-06-26

Smart Images

  • Figure CN119886097B_ABST
    Figure CN119886097B_ABST
Patent Text Reader

Abstract

The application discloses a kind of legal document generation method and device, electronic equipment, storage medium, it is related to legal document generation technical field or other related fields, wherein, the method comprises: receiving first language case information and legal document generation demand;First language case information is analyzed by the semantic analyzer corresponding to first language, and the case elements of target case are obtained, and first language case information is translated by translator, and second language case information is obtained;Case elements are based on inquiring target legal knowledge base, and the query result is obtained;Target document template is determined based on legal document generation demand, and target legal document is generated based on target document template, second language case information, case elements and query result.The present application solves the technical problems that related art cannot accurately understand and convert professional legal terms and context in the process of cross-language generation of legal documents, leading to inaccurate or even non-compliant legal documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of legal document generation technology, and more specifically, to a method and apparatus for generating legal documents, an electronic device, and a storage medium. Background Technology

[0002] The processing of cross-language legal documents has become an increasingly prominent need, especially in scenarios involving international legal affairs. Traditionally, this need has been met primarily through human translation and drafting. However, manual methods have significant limitations, mainly in low processing efficiency and uncontrollable translation quality. Due to their complexity and specialization, legal documents require the accurate transmission of case details and legal terminology. Human translation often struggles to maintain consistency and professionalism across multiple languages, especially when faced with frequently updated legal provisions and cases. Translators find it difficult to keep abreast of the latest legal developments in all languages, further increasing the risk of translation errors.

[0003] Furthermore, the high cost of human translation is a significant issue. High-quality legal translation services typically require professional and experienced legal translators, resulting in substantial fees that can be a considerable expense for many small and medium-sized enterprises or individual users. This cost barrier limits the access to legal services for non-English speaking users, especially when dealing with cross-border legal matters, where legal documents need to be translated into multiple languages, exponentially increasing the cost.

[0004] Furthermore, existing technologies need improvement in terms of adaptability and scalability. As the legal environment continues to change and user needs diversify, existing systems struggle to quickly respond to and adapt to new legal provisions, judicial interpretations, and user feedback, limiting their application in different legal environments and business scenarios. The static design of system functions and services is insufficient to meet the demands of intelligent service expansion, failing to provide users with more personalized and customized legal document generation services.

[0005] Therefore, existing technologies face challenges in processing cross-language legal documents in terms of efficiency, quality, cost, and service scalability.

[0006] There is currently no effective solution to the above problems. Summary of the Invention

[0007] This invention provides a method, apparatus, electronic device, and storage medium for generating legal documents, at least to solve the technical problem that related technologies cannot accurately understand and translate professional legal terms and contexts during the cross-language generation of legal documents, resulting in inaccurate or even non-compliant legal documents.

[0008] According to one aspect of the present invention, a method for generating legal documents is provided, comprising: receiving case information in a first language and a legal document generation requirement, wherein the legal document generation requirement at least records a second language; analyzing the case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and translating the case information in the first language using a translator to obtain case information in the second language, wherein the translator is a neural machine translation model corresponding to the first language and the second language; querying a target legal knowledge base based on the case elements to obtain query results, wherein the target legal knowledge base stores at least legal professional knowledge applicable to the first language and the second language, and the query results record the legal basis and reference cases related to the target case; determining a target document template based on the legal document generation requirement, and generating a target legal document based on the target document template, the case information in the second language, the case elements, and the query results.

[0009] Further, the step of analyzing the case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case includes: inputting the case information in the first language into the semantic analyzer, performing text analysis on the case information in the first language based on natural language processing strategies to obtain the basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure parsing; extracting keywords from the basic text based on case analysis strategies to obtain a set of case keywords, wherein the case keywords include at least the following types: contract clauses, dispute types, and legal citations; performing named entity recognition on the basic text and marking the identified named entities, wherein the named entities include: parties involved in the target case, time points, and location information; performing association analysis on all the case keywords and all the named entities based on a semantic role analysis strategy to obtain analysis results, wherein the analysis results are used to record the legal roles and relationships of each named entity; and generating the case elements of the target case based on the set of case keywords, all the named entities, the legal roles indicated by the analysis results, and the relationships.

[0010] Further, the step of translating the case information in the first language to obtain the case information in the second language through a translator includes: calling a neural machine translation model that matches the first language and the second language to obtain the translator, wherein the neural machine translation model is pre-trained and optimized based on a multilingual neural machine translation framework; inputting the case information in the first language into the translator, and having the translator perform semantic translation to obtain a preliminary translation of the target case, wherein the language used in the preliminary translation is the second language; and performing translation correction on the preliminary translation based on the case elements output by the semantic analyzer and a legal terminology translation library to obtain the case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammatical correction, and context adaptation.

[0011] Furthermore, after obtaining the case information in the second language, the method further includes: inputting the case information in the second language into the translator, whereby the translator performs semantic translation to obtain a translation comparison draft of the target case, wherein the language used in the translation comparison draft is the first language; comparing the translation comparison draft with the case information in the first language to obtain a comparison result, wherein the comparison result records the text content and text position where the comparison is inconsistent; and correcting the case information in the second language based on the comparison result.

[0012] Further, the step of querying the target legal knowledge base based on the case elements to obtain query results includes: generating a query statement based on the case elements and sending the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the languages ​​used by the search keywords include at least the first language and the second language; performing a search in the target legal knowledge base based on all the search keywords to obtain search results, wherein the search results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; filtering all legal basis and reference cases in the search results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record filtering content that has a matching degree with the case elements greater than a preset threshold for legal basis and reference cases; generating the query results based on the filtering results and the location information of each filtering content in the target legal knowledge base.

[0013] Furthermore, the step of determining the target document template based on the legal document generation requirements includes: identifying the document type of the target legal document based on the legal document generation requirements, wherein the document type includes: complaint, arbitration application, and contract draft; and selecting the corresponding target document template from a preset multilingual document template library based on the document type and the second language.

[0014] Further, the step of generating a target legal document based on the target document template, the second language case information, the case elements, and the query results includes: analyzing the target document template to obtain the fields to be filled and the filling requirements corresponding to each field; for each field to be filled, analyzing the second language case information, the case elements, and the legal basis and reference cases in the query results based on the filling requirements to obtain the filling content; filling the filling content into the field to be filled in the target document template; and, after all the fields to be filled have been filled, adjusting the grammatical structure of the filled target document template based on the grammatical characteristics of the second language recorded in the legal document generation requirements to obtain the target legal document.

[0015] According to another aspect of the present invention, a legal document generation apparatus is also provided, comprising: a receiving unit for receiving case information in a first language and a legal document generation requirement, wherein the legal document generation requirement records at least a second language; an analysis unit for analyzing the case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and translating the case information in the first language using a translator to obtain case information in the second language, wherein the translator is a neural machine translation model corresponding to the first language and the second language; a query unit for querying a target legal knowledge base based on the case elements to obtain query results, wherein the target legal knowledge base stores at least legal professional knowledge applicable to the first language and the second language, and the query results record the legal basis and reference cases related to the target case; and a determining unit for determining a target document template based on the legal document generation requirement, and generating a target legal document based on the target document template, the case information in the second language, the case elements, and the query results.

[0016] Further, the analysis unit includes: a first analysis module, used to input the case information in the first language into the semantic analyzer, and perform text analysis on the case information in the first language based on a natural language processing strategy to obtain the basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure parsing; an extraction module, used to extract keywords from the basic text based on a case analysis strategy to obtain a set of case keywords, wherein the case keywords include at least the following types: contract clauses, dispute types, and legal citations; a tagging module, used to perform named entity recognition on the basic text and tag the identified named entities, wherein the named entities include: parties involved in the target case, time points, and location information; a second analysis module, used to perform association analysis on all the case keywords and all the named entities based on a semantic role analysis strategy to obtain analysis results, wherein the analysis results are used to record the legal roles and relationships of each named entity; and a first generation module, used to generate the case elements of the target case based on the set of case keywords, all the named entities, the legal roles indicated by the analysis results, and the relationships.

[0017] Furthermore, the analysis unit further includes: a calling module, used to call the neural machine translation model matching the first language and the second language to obtain the translator, wherein the neural machine translation model is pre-trained and optimized based on a multilingual neural machine translation framework; a first translation module, used to input the case information in the first language into the translator, and the translator performs semantic translation to obtain a preliminary translation of the target case, wherein the language used in the preliminary translation is the second language; and a correction module, used to perform translation correction on the preliminary translation based on the case elements output by the semantic analyzer and a legal terminology translation library to obtain the case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammatical correction, and context adaptation.

[0018] Furthermore, the legal document generation device further includes: a second translation module, used to input the second language case information into the translator after obtaining the second language case information, and for the translator to perform semantic translation to obtain a translation comparison draft of the target case, wherein the language used in the translation comparison draft is the first language; a comparison module, used to compare the translation comparison draft with the first language case information to obtain a comparison result, wherein the comparison result records the text content and text position of inconsistencies; and a correction module, used to correct the second language case information based on the comparison result.

[0019] Further, the query unit includes: a sending module, used to generate a query statement based on the case elements and send the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the languages ​​used for the search keywords include at least the first language and the second language; a retrieval module, used to perform a retrieval in the target legal knowledge base based on all the search keywords to obtain retrieval results, wherein the retrieval results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; a filtering module, used to filter all legal basis and reference cases in the retrieval results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record filtering content that has a matching degree with the case elements greater than a preset threshold for legal basis and reference cases; and a second generation module, used to generate the query results based on the filtering results and the location information of each filtering content in the target legal knowledge base.

[0020] Furthermore, the determining unit includes: an identification module, used to identify the document type of the target legal document based on the legal document generation requirements, wherein the document type includes: a complaint, an arbitration application, and a contract draft; and a selection module, used to select a corresponding target document template from a preset multilingual document template library based on the document type and the second language.

[0021] Furthermore, the determining unit further includes: a third analysis module, used to analyze the target document template to obtain the fields to be filled in the target document template and the filling requirements corresponding to each field to be filled; a fourth analysis module, used to analyze the second language case information, the case elements, and the legal basis and reference cases in the query results for each field to be filled based on the filling requirements to obtain the filling content; a filling module, used to fill the filling content into the fields to be filled in the target document template; and an adjustment module, used to adjust the grammatical structure of the filled target document template based on the grammatical characteristics of the second language recorded in the legal document generation requirements after all fields to be filled have been filled, to obtain the target legal document.

[0022] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute any of the above-described methods for generating legal documents.

[0023] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described methods for generating legal documents.

[0024] This invention proposes a method for generating legal documents. First, it receives case information in a first language and a legal document generation requirement, wherein the legal document generation requirement records at least a second language. Then, it analyzes the first-language case information using a semantic analyzer corresponding to the first language to obtain the case elements of the target case. Next, it translates the first-language case information using a translator, which is a neural machine translation model corresponding to both the first and second languages, to obtain the second-language case information. Then, it queries a target legal knowledge base based on the case elements to obtain query results. The target legal knowledge base stores at least legal expertise applicable to both the first and second languages. The query results record relevant legal basis and reference cases for the target case. Finally, it determines a target document template based on the legal document generation requirement, and generates the target legal document based on the target document template, the second-language case information, the case elements, and the query results.

[0025] This invention employs a cross-language intelligent legal document generation method. By combining semantic analysis, neural machine translation models, and a professional legal knowledge base, it achieves the goal of accurately understanding and translating professional legal terminology and context. This enables the high-quality and efficient generation of legal documents across different languages. Specifically, this invention accurately extracts case elements through in-depth analysis of case information and uses a customized neural machine translation model for efficient translation. Simultaneously, it queries legal bases and reference cases that match the case elements, intelligently selects document templates, and automatically fills in key information, ultimately generating documents that conform to the legal norms of the target language. This solves the technical problem of related technologies failing to accurately understand and translate professional legal terminology and context during cross-language legal document generation, leading to inaccurate or even non-compliant legal documents. Attached Figure Description

[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0027] Figure 1 This is a flowchart of an optional method for generating legal documents according to an embodiment of the present invention;

[0028] Figure 2 This is a schematic diagram of an optional legal document generation apparatus according to an embodiment of the present invention;

[0029] Figure 3 This is a hardware structure block diagram of an electronic device (or mobile device) that performs a method for generating legal documents according to an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0033] Neural Machine Translation Model (NNTM) is an artificial intelligence translation technology based on deep learning. It achieves automatic translation from one language to another by building a neural network model. It can understand and transform context and is suitable for processing highly complex texts, such as legal documents, and can significantly improve the accuracy and fluency of translation.

[0034] A semantic analyzer is a natural language processing tool used to understand and parse the deeper meaning of text, including identifying keywords, named entities, grammatical structures, and semantic roles. For generating legal documents, a semantic analyzer can accurately extract key case information, such as parties involved, time, location, and legal clauses, ensuring the accuracy of subsequent translation and document generation.

[0035] The Semantic Similarity Algorithm is an algorithm used to measure the degree of semantic similarity between texts, which is particularly important when dealing with the complexity and accuracy of legal language. This algorithm can filter the most relevant and matching legal basis and reference cases from legal knowledge bases, ensuring that the generated legal documents are highly targeted and professional.

[0036] The Smart Service Expansion Engine is responsible for intelligently expanding and optimizing the system's functions and services based on user needs, changes in the legal environment, and system feedback. Through machine learning and data analysis, this engine can continuously learn and improve to support more languages, more complex legal scenarios, and more personalized user needs, ensuring that the system always remains advanced and practical.

[0037] The following embodiments of the present invention can be applied to various systems / applications / devices that require cross-language legal document processing and multilingual legal knowledge retrieval, enabling efficient, accurate, and automated generation and translation of legal documents. The present invention uses a neural machine translation model to translate cross-language case information, and then uses a semantic analyzer to deeply analyze the translated case information to obtain key case elements. This allows for a better understanding and conversion of professional legal terminology and context, ensuring that the generated legal documents maintain accuracy and compliance across different languages.

[0038] Specifically, embodiments of the present invention can be applied to scenarios requiring the processing of multilingual legal documents. By receiving case information and legal document generation requirements input in a first language, the implementation system can automatically identify and understand the complexities of the case, and simultaneously utilize neural machine translation technology to convert the information into a second language. Based on this, the implementation system queries a target legal knowledge base to obtain relevant legal grounds and reference cases, and finally generates legal documents in the target language according to the requirements.

[0039] This invention utilizes a customized neural machine translation model and deep semantic analysis technology to effectively overcome the limitations of traditional translation methods in handling specialized legal terminology and specific contexts, ensuring the accuracy and professionalism of the translation. Simultaneously, efficient interaction with the target legal knowledge base provides highly relevant legal information for the case, further enhancing the compliance and relevance of legal documents. Therefore, this invention achieves cross-language generation of legal documents while guaranteeing document quality, thereby significantly improving the efficiency of legal services and the potential for international business cooperation.

[0040] The present invention will now be described in detail with reference to various embodiments.

[0041] Example 1

[0042] According to an embodiment of the present invention, a method for generating legal documents is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0043] Examples of embodiments of the present invention Figure 1 The method for generating legal documents shown is implemented by a cross-language intelligent legal document generation system. This system combines neural machine translation and deep semantic analysis technologies for use in cross-border legal affairs, particularly addressing the accurate generation and translation of legal documents across different languages. Through intelligent analysis, translation, and legal knowledge retrieval, specifically through steps such as receiving case information, extracting case elements through semantic analysis, cross-language translation, legal basis retrieval, and document template generation and filling, the system aims to improve the efficiency of legal document generation, ensure translation accuracy and professionalism, meet cross-language legal needs, and support the expansion of intelligent services.

[0044] Figure 1 This is a flowchart of an optional method for generating legal documents according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0045] Step S101: Receive case information in the first language and legal document generation requirements, wherein the legal document generation requirements shall at least record the second language.

[0046] Specifically, the first language and the second language are the two languages ​​involved in this invention. The first language refers to the language in which the case information was originally submitted, while the second language is the target language specified in the legal document generation requirements. In any language pair conversion, the first language can be any language, while the second language is the language to be converted to adapt to different legal environments and business needs. For example, in a specific embodiment, the first language might be Chinese, and the second language might be English. The system will process the Chinese case information and generate the corresponding English legal documents.

[0047] In the first step of implementing this invention, the system first receives case information and legal document generation requests in the user's first language. This receiving process is the core starting point of the multilingual intelligent legal document generation system. The user can be an individual or organization that needs to handle transnational legal affairs.

[0048] First-language case information refers to detailed information about a specific legal case entered by the user in their original language (i.e., first language), including but not limited to: the background of the target case, relevant legal clauses, contractual agreements, points of contention, party information, timeline, location, and other key elements. For example, a user might provide a detailed description of a commercial contract dispute in Chinese, including the time and place of contract signing, the specific terms of the contract, the course of the dispute, and the legal relationships involved.

[0049] The user also submits the request for legal document generation, specifying the type of legal document to be generated and the target language. The document type can be a complaint, arbitration application, draft contract, statement, agreement, etc., while the target language is the language the user wants the final legal document to be presented in, such as English, French, German, Spanish, etc.

[0050] Step S101 of the present invention demonstrates that the implementation system can flexibly receive and process multilingual case information, and generate documents in the target language according to the user's specific needs, reflecting the efficiency and practicality of the present invention in handling transnational legal affairs.

[0051] Step S102: Analyze the case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and translate the case information in the first language using a translator to obtain the case information in the second language. The translator is a neural machine translation model corresponding to the first language and the second language.

[0052] It should be noted that in step S102, this invention uses a semantic analyzer specific to the first language to deeply analyze the input case information and extract the key elements of the case, which forms the basis for the subsequent generation of legal documents in the second language. The implementation system also utilizes a neural machine translation model to translate the analyzed case information in the first language into the second language, ensuring accurate information transmission.

[0053] Optionally, the step of analyzing case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case includes: inputting the case information in the first language into the semantic analyzer, performing text analysis on the case information in the first language based on natural language processing strategies to obtain the basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure parsing; extracting keywords from the basic text based on case analysis strategies to obtain a set of case keywords, wherein the case keywords include at least the following types: contract clauses, dispute types, and legal citations; performing named entity recognition on the basic text and marking the identified named entities, wherein the named entities include: parties involved in the target case, time points, and location information; performing association analysis on all case keywords and all named entities based on semantic role analysis strategies to obtain analysis results, wherein the analysis results are used to record the legal roles and relationships of each named entity; and generating the case elements of the target case based on the set of case keywords, all named entities, the legal roles indicated by the analysis results, and the relationships.

[0054] It should be noted that a semantic analyzer is an advanced natural language processing tool with specialized capabilities for semantic understanding and analysis of legal texts. When a user submits case information, the semantic analyzer uses advanced natural language processing strategies to perform multi-level analysis of the text, including word segmentation, part-of-speech tagging, and basic grammatical structure parsing, laying the foundation for accurate text understanding.

[0055] Case elements refer to the key points of a case extracted through semantic analysis, including contract terms, dispute types, legal citations, party information, time points, and location information. These are information points that must be accurate and error-free when generating legal documents to ensure that the content of the documents matches the actual situation of the case.

[0056] Another point to note is that natural language processing strategies encompass techniques such as word segmentation, part-of-speech tagging, and basic grammatical structure parsing, which are used to break down text into smaller units, analyze its grammatical structure, and provide support for subsequent deep semantic understanding and translation.

[0057] The base text is case information processed using natural language strategies, including the results of word segmentation and part-of-speech tagging, as well as the parsing of basic grammatical structures. This provides structured information for subsequent extraction of case elements. Word segmentation, which divides continuous natural language text into words or phrases, is a fundamental step in natural language processing. In legal text processing, the accuracy of word segmentation is crucial for understanding legal clauses and terminology. Part-of-speech tagging assigns grammatical attributes, such as nouns, verbs, and adjectives, to the segmented words or phrases. Basic grammatical structure parsing analyzes the basic components of sentences, such as subject, verb, and object, and identifies the logical relationships between sentences, forming the basis for further semantic understanding of the text.

[0058] The case analysis strategy mainly involves extracting keywords to determine the core content of the case, such as breach of contract, tort liability, and litigation claims. These keywords are key to constructing the elements of the case.

[0059] Furthermore, named entity recognition identifies entities with specific meanings within text, such as the time and location information of parties involved in a case (company, individual), which is crucial for recording and understanding the case background. Semantic role analysis strategies are used to analyze the semantic roles of various elements in text, such as identifying the role of an entity as Party A or Party B in a contract, which helps construct a legal relationship graph of the case and ensures the accuracy and completeness of case elements.

[0060] In one optional embodiment, suppose a company has a business contract dispute with another party and needs to file a lawsuit in another country, requesting the system to generate the corresponding complaint. The implementation process of this system is as follows.

[0061] Companies submit detailed case information in their first language (e.g., a widely used language), including the specific terms of the contract, the points of contention between the parties, and the time and place of the contract signing.

[0062] The system first uses a semantic analyzer to perform in-depth analysis of case information, transforming the text into structured information through word segmentation, part-of-speech tagging, and basic grammatical structure parsing. Next, it extracts a set of keywords based on case analysis strategies, such as breach of contract, claims for damages, and contract termination. Then, it applies named entity recognition technology to mark the parties involved in the contract, as well as the time and place of the dispute. Finally, through semantic role analysis strategies, it understands the legal roles and relationships of each named entity in the case.

[0063] Based on the above analysis, the system generates case elements for the target case, including the nature of the case, the parties involved, time and location information, as well as key legal claims and factual descriptions. A neural machine translation model is used to translate the case information from the first language into the second language (i.e., the language used in the target country), ensuring accurate understanding of technical terminology and legal context during the translation process. The translated case information (i.e., the second language case information), along with the case elements, will be used in subsequent legal basis searches and legal document generation steps.

[0064] The above embodiments demonstrate that in step S102, the real-time system can accurately extract key case information through natural language processing technology and semantic analysis, and accurately translate the information into the target language through a professional neural machine translation model, laying a solid foundation for the subsequent generation of accurate and compliant legal documents.

[0065] Optionally, the step of translating case information in the first language to obtain case information in the second language using a translator includes: calling a neural machine translation model that matches the first and second languages ​​to obtain a translator, wherein the neural machine translation model is pre-trained and optimized based on a multilingual neural machine translation framework; inputting the case information in the first language into the translator, which performs semantic translation to obtain a preliminary translation of the target case, wherein the language used in the preliminary translation is the second language; and performing translation correction on the preliminary translation based on the case elements output by the semantic analyzer and a legal terminology translation library to obtain case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammatical correction, and context adaptation.

[0066] In step S102 of the present invention, in order to ensure the accuracy and professionalism of cross-language translation of legal documents, the system performs multi-level translation processing and correction, specifically including calling a neural machine translation model for preliminary translation, using a legal terminology translation library for professional terminology correction, and further adapting the initial translation draft to the grammar and context.

[0067] It should be noted that the translator is a neural machine translation model, which, after specialized training, can efficiently and accurately translate between the first and second languages. The translator in this invention can not only perform basic text translation, but also consider the precise expression of legal terminology and the grammar and expression habits of different languages ​​during the translation process, ensuring that the translated legal documents accurately convey the original meaning.

[0068] Second language case information refers to text information in the second language that has been processed by a translator and converted from first language case information. This text will be used in subsequent steps to find the corresponding legal basis and generate legal documents in the target language.

[0069] A multilingual neural machine translation framework is one of the key technologies in this invention. It aims to achieve high-quality automatic translation from a first language to a second language through a shared encoder-decoder architecture and a deep learning model. The framework utilizes a large multilingual dataset during the pre-training phase to learn the conversion rules between different languages. It is then optimized for specific needs in the legal field, enabling it to handle legal terminology and professional expressions more accurately.

[0070] Specifically, when the case information in the first language is input into the translator, the neural machine translation model first generates a draft translation, which is the initial second language text. This is the foundation of the entire translation process. Although the draft translation may be inaccurate in terms of professional terminology and legal expressions, it provides a linguistic basis for subsequent corrections.

[0071] The Legal Terminology Translation Database is a specialized database for storing and managing various legal terms and their corresponding translations. It covers accurate translations of common legal terms and phrases in different languages, ensuring that professional terminology in the initial translation draft is accurately converted. After generating the initial translation draft, the database is used to correct the professional legal terminology involved, ensuring the accuracy and professionalism of the legal terminology in the initial translation draft and avoiding semantic deviations caused by improper translation.

[0072] Besides technical terminology, legal texts contain many specific expressions that may have different meanings and usages in different legal systems and cultural contexts. Legal expression correction aims to adjust the legal expressions in the initial translation draft to conform to the norms and conventions of the second language legal system, thereby improving the professionalism and readability of the document. Furthermore, due to differences in grammatical structures between languages, the initial translation draft may not conform to the grammatical norms of the second language. The grammatical correction step refines the initial translation draft at the grammatical level, ensuring that the generated second-language case information is grammatically correct and clearly expressed.

[0073] Furthermore, contextual consideration is crucial in legal translation. The translation of some words or phrases may need to be adjusted according to the specific context and case background. Context adaptation aims to fine-tune the expression in the initial translation draft to ensure that it can accurately convey the original meaning of the case in the target language and avoid ambiguity or misunderstanding.

[0074] In one alternative embodiment, suppose a company is dealing with a business dispute with another company involving breach of contract and damages. The company needs to generate a legal document for a specific jurisdiction, which needs to be presented in a second language used in that jurisdiction. The company submits detailed case information in the first language in the system of this invention, including the specific terms of the contract, the actions of both parties, the points of contention, etc.

[0075] The system implemented in this invention can invoke a pre-trained and optimized multilingual neural machine translation framework to generate a translator for translation between the first and second languages. This translator processes case information and outputs an initial draft of the second language translation. The initial draft may have imperfections in terms of professional terminology, specific legal expressions, and grammatical structures. Next, the initial draft is compared with a legal terminology translation database, and the legal professional terms are corrected to ensure accurate translation of terms such as "force majeure" and "damages." Further legal expression correction is performed on the initial draft, adjusting commonly used legal expressions such as "whereas" and "therefore, this is hereby declared" to conform to the legal customs of the target jurisdiction. Grammatical correction and context adaptation steps are performed to ensure the grammatical correctness and contextual appropriateness of the initial draft, so that the second language case information is not only grammatically correct but also accurately reflects the background and details of the case. Finally, the second language case information, after in-depth translation processing and professional correction, possesses a high degree of accuracy and professionalism, providing a solid linguistic foundation for the subsequent generation and submission of legal documents.

[0076] Through the above process, this invention not only achieves efficient translation of case information from the first language to the second language, but also ensures that the translated legal documents are professional, accurate, and compliant in the target language through steps such as professional terminology correction, legal expression correction, grammatical correction, and context adaptation, thus meeting the urgent need for high-quality legal documents in international legal affairs.

[0077] Optionally, after obtaining the second language case information, the method further includes: inputting the second language case information into a translator, which performs semantic translation to obtain a translation comparison draft of the target case, wherein the language used in the translation comparison draft is the first language; comparing the translation comparison draft with the first language case information to obtain a comparison result, wherein the comparison result records the text content and text position where the comparison is inconsistent; and correcting the second language case information based on the comparison result.

[0078] In the technical solution of this invention, in order to further enhance the accuracy and reliability of the translation of second language case information, a process for generating and comparing translation comparison drafts is provided. Through reverse translation and comparison, potential translation errors or inconsistencies in expression can be discovered and corrected, ensuring that the final second language case information is highly consistent with the original draft.

[0079] A translation comparison draft refers to inputting case information in a second language back into a translator to create a new text in the first language. Essentially, it's reverse translation, used to verify the accuracy of the second language translation. The comparison draft is compared in detail with the original first language case information to identify any possible translation errors or discrepancies in expression.

[0080] After completing the initial translation into the second language, the reverse translation function of the translator is invoked to translate the case information in the second language back into the first language to generate a translation comparison draft for checking the coherence and semantic matching of the translation. The generated translation comparison draft is carefully compared with the original case information in the first language. Through automatic text comparison technology, inconsistencies between the two texts can be quickly identified, including translation errors of professional terms, omission of key information, and deviation of semantic expressions. The inconsistent text content and positions will be detailedly recorded in the comparison results.

[0081] The comparison results are directly used for the correction of the case information in the second language to ensure that the translated case information in the second language is consistent with the original information in terms of content and semantics. The correction process involves re-translating the sentences with errors, supplementing the omitted information, or adjusting inappropriate legal expressions.

[0082] In an optional embodiment, assume a scenario where a company has a contract dispute with another company. The dispute involves the interpretation of complex contract terms and the application of legal provisions. The company needs to translate the Chinese case information (the first language) into English (the second language). According to the embodiment of the present invention, the company submits detailed Chinese case information, including contract terms, dispute focuses, damage assessment, etc. The implementation system can convert this information into English case information through a neural machine translation model.

[0083] To ensure the accuracy of the translation, the English case information is input into the translator again, and the translator reversely translates it back into Chinese to generate a translation comparison draft. Automatically compare the translation comparison draft with the original Chinese case information, and record any inconsistent text content and positions. For example, it may be found that the term "force majeure" is expressed as "forcemajeure" instead of "不可抗力" in the reverse translation, or there are detail deviations in the description of a certain key fact after reverse translation.

[0084] Based on the comparison results, the English case information can be corrected, which may include adjusting the term translation to match the original Chinese meaning, supplementing or modifying the detail description to ensure integrity and accuracy. The corrected English case information ultimately ensures consistency with the original Chinese information in terms of content and semantics, meeting the requirements for high-quality legal documents.

[0085] Through the above steps, the present invention not only achieves accurate conversion from the first language to the second language, but also provides a systematic translation quality control scheme through the generation and comparison of the translation comparison draft, greatly enhancing the reliability and professionalism of legal document translation. This mechanism is particularly important when dealing with complex legal terms and delicate case descriptions, providing a strong technical guarantee for efficient and accurate document processing in cross-border legal affairs.

[0086] Step S103: Based on the case elements, query the target legal knowledge base to obtain the query results. The target legal knowledge base stores at least legal professional knowledge applicable to the first and second languages. The query results record the legal basis and reference cases related to the target case.

[0087] In step S103 of this invention, based on case elements and a series of intelligent retrieval and filtering mechanisms, legal basis and reference cases applicable to the first and second languages ​​are searched in the target legal knowledge base, ensuring that the generated legal documents are based on correct legal provisions and judicial practice, thereby improving the compliance and persuasiveness of the documents.

[0088] The Target Legal Knowledge Base is a database that integrates legal provisions, legal interpretations, judicial cases, expert opinions, and other resources from around the world. It not only covers a wide range of legal fields but also includes specialized legal data applicable to multilingual environments, ensuring that the system can obtain accurate legal basis when handling cross-language cases. The knowledge base is continuously updated to maintain the timeliness and authority of legal information.

[0089] Optionally, step S103 includes: generating a query statement based on case elements and sending the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the language used for the search keywords includes at least a first language and a second language; performing a search in the target legal knowledge base based on all search keywords to obtain search results, wherein the search results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; filtering all legal basis and reference cases in the search results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record legal basis and reference cases whose matching degree with the case elements is greater than a preset threshold; generating query results based on the filtering results and the location information of each filtered item in the target legal knowledge base.

[0090] It should be noted that the query interface is the front end of the target legal knowledge base. It receives query statements sent from the system, parses the search keywords within them, and then performs a search within the knowledge base based on these keywords. The query interface is designed with multilingual compatibility in mind, capable of understanding and parsing query statements expressed in different languages, ensuring the accuracy and diversity of search keywords.

[0091] Search keywords are a set of key information extracted from the elements of a case, used to guide the search direction within the target legal knowledge base. These keywords may include case type, points of contention, legal provisions, important terminology, roles of parties, and time points. They should be expressed in a first and / or second language to ensure the comprehensiveness and accuracy of the search. Search results refer to the collection of all relevant legal bases and reference cases found in the target legal knowledge base based on the search keywords. These results cover various types of legal information related to the elements of the case, providing rich foundational data for subsequent filtering.

[0092] Semantic similarity algorithms are advanced text matching and understanding techniques that can assess the semantic similarity between different texts using different words or expressions. In this invention, semantic similarity algorithms are used to filter the search results, prioritizing legal basis and reference cases with high matching degree with case elements, to ensure that the final legal documents can accurately reflect the legal substance of the case.

[0093] In one alternative embodiment, suppose a company has a business contract dispute with its overseas partner and needs to prepare a complaint against a specific jurisdiction to protect its rights. The company submits detailed case information through the system implemented in this invention, including the specific terms of the contract, the points of contention between the parties, and the facts of the breach, which constitute the elements of the case expressed in a first language (such as Chinese).

[0094] The system of this invention first generates a query statement based on case elements. This query statement includes key information such as case type, points of contention, and relevant legal provisions. Since the goal is to generate legal documents in a second language (such as English), the query statement may simultaneously contain keywords from both the first and second languages, ensuring the comprehensiveness and accuracy of the retrieval.

[0095] The query statement is sent to the target legal knowledge base via a query interface. The interface parses the search keywords in the query statement, such as "commercial contract dispute," "breach of contract liability," and "international litigation," and then searches for the same keywords in English. This step leverages the knowledge base's multilingual compatibility to ensure that relevant legal basis and cases can be accurately found even in an English context. A comprehensive search is performed on the knowledge base based on the search keywords, finding a series of legal provisions, judicial interpretations, and reference cases related to the input case information. The search results include legal information from different countries and regions, demonstrating the breadth and depth of the target legal knowledge base.

[0096] The system implemented in this invention uses a semantic similarity algorithm to filter search results, identifying legal bases and reference cases that have a high degree of matching with the elements of the case. This algorithm takes into account the semantic conversion between different languages, and can effectively identify and exclude search results that are superficially related but do not match the substantive meaning. Finally, based on the filtering results and the location information of each filtered content in the target legal knowledge base, the system generates query results, which not only include the most relevant legal bases and cases, but also provide the exact citations in the knowledge base, so that the generated legal documents can accurately cite and explain them.

[0097] Through this series of steps, the present invention ensures that the generated legal documents are based on precise legal provisions and cases, thereby enhancing their recognition and effectiveness in legal practice. It demonstrates the system's professionalism and intelligence in handling transnational legal affairs and provides users with high-quality, highly compliant legal document generation services.

[0098] Step S104: Determine the target document template based on the legal document generation requirements, and generate the target legal document based on the target document template, second language case information, case elements, and query results.

[0099] In step S104 of this invention, a matching document template is intelligently selected based on the user's legal document generation needs, and the target legal document is automatically generated by combining case information in the second language, case elements and query results. This not only takes into account the type and language of the document, but also deeply analyzes the case details and applicable legal basis to ensure that the content of the final generated document is accurate and the format is compliant.

[0100] Optionally, the step of determining the target document template based on the legal document generation requirements includes: identifying the document type of the target legal document based on the legal document generation requirements, wherein the document type includes: complaint, arbitration application and contract draft; and selecting the corresponding target document template from a preset multilingual document template library based on the document type and second language.

[0101] It should be noted that the document types specified in the user's requirements are including, but are not limited to, complaints, arbitration applications, and contract drafts. The identification process is based on the case background and purpose input by the user to ensure that the documents generated subsequently conform to specific legal scenarios and requirements.

[0102] In this embodiment of the invention, the system selects the most matching target document template from a preset multilingual document template library based on the identified document type and the specified second language. The multilingual document template library contains a wide range of professional templates, covering various languages ​​and different types of legal documents, ensuring that the system can handle diverse cases.

[0103] In one optional embodiment, suppose a multinational company has a business dispute with an overseas partner and needs to prepare an arbitration application to resolve the contractual dispute. The company submits detailed case information (first language is Chinese) through the system, specifies the document type as an arbitration application, and the target language as English. The system of this invention can recognize that the user's requirement is an arbitration application and call the arbitration application template suitable for English from the multilingual document template library.

[0104] Optionally, the step of generating a target legal document based on the target document template, second language case information, case elements, and query results includes: analyzing the target document template to obtain the fields to be filled and the filling requirements for each field; for each field to be filled, analyzing the second language case information, case elements, legal basis, and reference cases in the query results based on the filling requirements to obtain the filling content; filling the content into the field to be filled in the target document template; and, after all fields to be filled have been filled, adjusting the grammatical structure of the filled target document template based on the grammatical characteristics of the second language recorded in the legal document generation requirements to obtain the target legal document.

[0105] It should be noted that a deep analysis of the target document template reveals all the specific fields that need to be filled in, such as "Party Information," "Case Facts," "Applicable Law," and "Requests." These are key information points that must be filled in when generating legal documents, and each field has its specific filling requirements, including format specifications, information types, and expression styles. For example, the "Party Information" field requires a formal title and format; the "Case Facts" field requires a detailed description while avoiding subjective assumptions.

[0106] After all fields have been filled, the entire document undergoes grammatical restructuring based on the target language's characteristics. This aims to ensure fluency and formatting accuracy in the target language. For example, English legal documents may prefer direct and concise expressions, while Chinese may emphasize details and background descriptions. Grammatical restructuring can include reorganizing sentence structures, adjusting word order, correcting grammatical errors, and polishing the language to suit the writing habits of legal documents in the target language. This is crucial for improving the document's readability, professionalism, and legal validity.

[0107] Continuing with the above embodiments, the system of the present invention will fill in the translated and corrected English case information, extracted case elements (such as breach of contract, claims for damages, etc.), and legal basis and cases retrieved from the target legal knowledge base, according to the format of the English arbitration application template. During the filling process, all key information, such as the names of both parties, the facts of the dispute, relevant contract terms, applicable laws and regulations, and case support, will be automatically integrated to ensure that the document content is comprehensive and accurate.

[0108] The system of this invention also adjusts the language style and expression of the document according to the drafting norms of the second language (English) to conform to the habits of English legal documents, while ensuring the professionalism and readability of the document. Finally, it generates a customized English arbitration application, which not only describes the case background in detail, but also accurately cites the applicable legal basis and cases, providing strong legal support.

[0109] Through the above process, step S104 of the present invention realizes the customized generation of legal documents, which not only meets the needs of specific legal scenarios, but also ensures the accuracy and compliance of the documents in the target language. It provides a powerful technical means for the efficient handling of cross-border legal affairs, enabling legal professionals to quickly obtain high-quality legal documents, while reducing the uncertainty and risks caused by language barriers.

[0110] Through steps S101 to S104, the process first receives case information in the first language and a legal document generation request, where the legal document generation request at least records the second language. Then, the case information in the first language is analyzed by a semantic analyzer corresponding to the first language to obtain the case elements of the target case. The case information in the first language is then translated by a translator to obtain case information in the second language. The translator is a neural machine translation model corresponding to the first and second languages. Then, the target legal knowledge base is queried based on the case elements to obtain the query results. The target legal knowledge base stores legal expertise applicable to both the first and second languages. The query results record the legal basis and reference cases related to the target case. Finally, the target document template is determined based on the legal document generation request, and the target legal document is generated based on the target document template, the case information in the second language, the case elements, and the query results.

[0111] In this embodiment of the invention, a cross-language intelligent legal document generation method is adopted. By combining semantic analysis, neural machine translation models, and professional legal knowledge bases, the method achieves the goal of accurately understanding and translating professional legal terminology and context. This enables the high-quality and efficient generation of legal documents across different languages. Specifically, the invention accurately extracts case elements through in-depth analysis of case information and uses a customized neural machine translation model for efficient translation. Simultaneously, it queries legal basis and reference cases that match the case elements, intelligently selects document templates, and automatically fills in key information. Finally, it generates documents that conform to the legal norms of the target language. This solves the technical problem that related technologies cannot accurately understand and translate professional legal terminology and context during the cross-language generation of legal documents, resulting in inaccurate or even non-compliant legal documents.

[0112] The invention will now be described in conjunction with another alternative embodiment.

[0113] Example 2

[0114] The legal document generation device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.

[0115] Figure 2 This is a schematic diagram of an optional legal document generation apparatus according to an embodiment of the present invention, such as... Figure 2 As shown, the device may include: a receiving unit 21, an analysis unit 22, a query unit 23, and a determination unit 24.

[0116] The receiving unit 21 is used to receive case information in the first language and legal document generation requirements, wherein the legal document generation requirements record at least the second language.

[0117] Analysis unit 22 is used to analyze case information in the first language through a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and to translate the case information in the first language through a translator to obtain case information in the second language. The translator is a neural machine translation model corresponding to the first language and the second language.

[0118] The query unit 23 is used to query the target legal knowledge base based on the elements of the case and obtain the query results. The target legal knowledge base stores at least legal professional knowledge applicable to the first language and the second language. The query results record the legal basis and reference cases related to the target case.

[0119] Unit 24 is used to determine the target document template based on the legal document generation requirements, and to generate the target legal document based on the target document template, second language case information, case elements and query results.

[0120] The aforementioned legal document generation device can first receive case information in a first language and a legal document generation requirement through receiving unit 21, wherein the legal document generation requirement records at least a second language. Then, the analysis unit 22 calls the semantic analyzer corresponding to the first language to analyze the case information in the first language to obtain the case elements of the target case. The first language case information is then translated by a translator to obtain the case information in the second language, wherein the translator is a neural machine translation model corresponding to the first and second languages. Then, the query unit 23 queries the target legal knowledge base based on the case elements to obtain the query results, wherein the target legal knowledge base stores at least legal professional knowledge applicable to the first and second languages. The query results record the legal basis and reference cases related to the target case. Finally, the determination unit 24 determines the target document template based on the legal document generation requirement, and generates the target legal document based on the target document template, the second language case information, the case elements, and the query results.

[0121] In this embodiment of the invention, a cross-language intelligent legal document generation method is adopted. By combining semantic analysis, neural machine translation models, and professional legal knowledge bases, the method achieves the goal of accurately understanding and translating professional legal terms and contexts. This enables the high-quality and efficient generation of legal documents across different languages. Specifically, the invention accurately extracts case elements through in-depth analysis of case information and uses a customized neural machine translation model for efficient translation. Simultaneously, it queries legal bases and reference cases that match the case elements, intelligently selects document templates, and automatically fills in key information. Finally, it generates documents that conform to the legal norms of the target language. This solves the technical problem that related technologies cannot accurately understand and translate professional legal terms and contexts during the cross-language generation of legal documents, resulting in inaccurate or even non-compliant legal documents.

[0122] Optionally, the analysis unit includes: a first analysis module, used to input case information in the first language into a semantic analyzer, and perform text analysis on the case information in the first language based on natural language processing strategies to obtain the basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure parsing; an extraction module, used to extract keywords from the basic text based on case analysis strategies to obtain a set of case keywords, wherein the case keywords include at least the following types: contract clauses, dispute types, and legal citations; a tagging module, used to perform named entity recognition on the basic text and tag the identified named entities, wherein the named entities include: parties involved in the target case, time points, and location information; a second analysis module, used to perform association analysis on all case keywords and all named entities based on a semantic role analysis strategy to obtain analysis results, wherein the analysis results are used to record the legal roles and relationships of each named entity; and a first generation module, used to generate case elements of the target case based on the set of case keywords, all named entities, the legal roles indicated by the analysis results, and the relationships.

[0123] Optionally, the analysis unit further includes: a calling module for calling a neural machine translation model that matches the first language and the second language to obtain a translator, wherein the neural machine translation model is pre-trained and optimized based on a multilingual neural machine translation framework; a first translation module for inputting the case information in the first language into the translator, which performs semantic translation to obtain a preliminary translation of the target case, wherein the language used in the preliminary translation is the second language; and a correction module for correcting the preliminary translation based on the case elements output by the semantic analyzer and a legal terminology translation library to obtain the case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammatical correction, and context adaptation.

[0124] Optionally, the legal document generation device further includes: a second translation module, used to input the second language case information into a translator after obtaining the second language case information, and for the translator to perform semantic translation to obtain a translation comparison draft of the target case, wherein the language used in the translation comparison draft is the first language; a comparison module, used to compare the translation comparison draft with the first language case information to obtain a comparison result, wherein the comparison result records the text content and text position of inconsistencies in the comparison; and a correction module, used to correct the second language case information based on the comparison result.

[0125] Optionally, the query unit includes: a sending module, used to generate a query statement based on case elements and send the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the language used for the search keywords includes at least a first language and a second language; a retrieval module, used to perform a search in the target legal knowledge base based on all search keywords to obtain search results, wherein the search results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; a filtering module, used to filter all legal basis and reference cases in the search results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record the filtering content as legal basis and reference cases with a matching degree greater than a preset threshold of case elements; and a second generation module, used to generate query results based on the filtering results and the location information of each filtering content in the target legal knowledge base.

[0126] Optionally, the determining unit includes: an identification module, used to identify the document type of the target legal document based on the legal document generation requirements, wherein the document type includes: complaint, arbitration application and contract draft; and a selection module, used to select the corresponding target document template from a preset multilingual document template library based on the document type and second language.

[0127] Optionally, the determining unit further includes: a third analysis module, used to analyze the target document template to obtain the fields to be filled in the target document template and the filling requirements corresponding to each field; a fourth analysis module, used to analyze the second language case information, case elements, and legal basis and reference cases in the query results for each field to be filled based on the filling requirements to obtain the filling content; a filling module, used to fill the filling content into the fields to be filled in the target document template; and an adjustment module, used to adjust the grammatical structure of the filled target document template based on the grammatical characteristics of the second language recorded in the legal document generation requirements after all fields to be filled have been filled, to obtain the target legal document.

[0128] The aforementioned legal document generation device may also include a processor and a memory. The aforementioned receiving unit 21, analysis unit 22, query unit 23, determination unit 24, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0129] The aforementioned processor contains a kernel that retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, the target legal knowledge base can be queried based on case elements to obtain query results. This target legal knowledge base stores at least legal expertise applicable to both the first and second languages. The query results record the relevant legal basis and reference cases for the target case. Finally, a target document template is determined based on the legal document generation requirements, and the target legal document is generated based on the target document template, second-language case information, case elements, and query results.

[0130] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0131] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: receiving case information in a first language and a legal document generation requirement, wherein the legal document generation requirement records at least a second language; analyzing the case information in the first language through a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and translating the case information in the first language through a translator to obtain case information in the second language, wherein the translator is a neural machine translation model corresponding to the first and second languages; querying a target legal knowledge base based on the case elements to obtain query results, wherein the target legal knowledge base stores at least legal professional knowledge applicable to the first and second languages, and the query results record the legal basis and reference cases related to the target case; determining a target document template based on the legal document generation requirement, and generating a target legal document based on the target document template, the case information in the second language, the case elements, and the query results.

[0132] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the method for generating legal documents according to any one of the above embodiments.

[0133] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for generating legal documents according to any one of the above embodiments.

[0134] Figure 3This is a hardware structure block diagram of an electronic device (or mobile device) for executing a method for generating legal documents according to an embodiment of the present invention. Figure 3 As shown, an electronic device may include one or more ( Figure 3 The processor (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and memory 304 for storing data are illustrated using 302a, 302b, ..., 302n. In addition, it may include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 3 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown.

[0135] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0136] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0139] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0140] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0141] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating legal documents, characterized in that, include: Receive case information and legal document generation requests in the first language, wherein the legal document generation requests record at least the second language; The case information in the first language is analyzed by a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and the case information in the first language is translated by a translator to obtain the case information in the second language. The translator is a neural machine translation model corresponding to the first language and the second language. Based on the aforementioned case elements, a query is performed on the target legal knowledge base to obtain query results. The target legal knowledge base stores at least legal professional knowledge applicable to the first and second languages. The query results record the legal basis and reference cases related to the target case. The step of querying a target legal knowledge base based on the case elements to obtain query results includes: generating a query statement based on the case elements and sending the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the languages ​​used by the search keywords include at least the first language and the second language; performing a search in the target legal knowledge base based on all the search keywords to obtain search results, wherein the search results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; filtering all legal basis and reference cases in the search results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record filtering content that has a matching degree with the case elements greater than a preset threshold for legal basis and reference cases; generating the query results based on the filtering results and the location information of each filtering content in the target legal knowledge base; Based on the legal document generation requirements, a target document template is determined, and based on the target document template, the case information in the second language, the case elements, and the query results, the target legal document is generated.

2. The generation method according to claim 1, characterized in that, The steps of analyzing case information in the first language using a semantic analyzer corresponding to the first language to obtain the case elements of the target case include: The case information in the first language is input into the semantic analyzer, and the text analysis of the case information in the first language is performed based on the natural language processing strategy to obtain the basic text of the target case. The text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure parsing. Based on the case analysis strategy, keywords are extracted from the basic text to obtain a set of case keywords, which include at least the following types: contract clauses, dispute types, and legal citations; Named entity recognition is performed on the basic text, and the identified named entities are marked, wherein the named entities include: the parties involved, time points, and location information in the target case; Based on the semantic role analysis strategy, association analysis is performed on all the case keywords and all the named entities to obtain the analysis results, wherein the analysis results are used to record the legal roles and association relationships of each named entity; Based on the set of case keywords, all the named entities, the legal roles indicated by the analysis results, and the relationships, the case elements of the target case are generated.

3. The generation method according to claim 1, characterized in that, The steps of translating case information in the first language using a translator to obtain case information in the second language include: The translator is obtained by calling the neural machine translation model that matches the first language and the second language, wherein the neural machine translation model is pre-trained and optimized based on a multilingual neural machine translation framework; The case information in the first language is input into the translator, which performs semantic translation to obtain a first draft of the translation of the target case, wherein the language used in the first draft of the translation is a second language; Based on the case elements output by the semantic analyzer and the legal terminology translation database, the initial translation draft is corrected to obtain case information in the second language. The translation correction includes the following operations: professional terminology correction, legal expression correction, grammatical correction, and context adaptation.

4. The generation method according to claim 3, characterized in that, After obtaining the case information in the second language, the following is also included: The case information in the second language is input into the translator, which performs semantic translation to obtain a translation comparison draft of the target case, wherein the language used in the translation comparison draft is the first language; The translated comparison draft is compared with the case information in the first language to obtain the comparison result, wherein the comparison result records the text content and text position where the comparison is inconsistent; The case information in the second language is corrected based on the comparison results.

5. The generation method according to claim 1, characterized in that, The steps for determining the target document template based on the aforementioned legal document generation requirements include: Based on the legal document generation requirements, the document types of the target legal documents are identified, including: complaints, arbitration applications, and contract drafts; Based on the document type and the second language, select the corresponding target document template from the preset multilingual document template library.

6. The generation method according to claim 1, characterized in that, The steps for generating the target legal document based on the target document template, the second language case information, the case elements, and the query results include: Analyze the target document template to obtain the fields to be filled in the target document template and the filling requirements corresponding to each field to be filled. For each field to be filled, the second language case information, the case elements, and the legal basis and reference cases in the query results are analyzed based on the filling requirements to obtain the filling content; Fill the content into the position of the field to be filled in the target document template; Once all fields to be filled have been filled, the target document template is grammatically adjusted based on the grammatical characteristics of the second language recorded in the legal document generation requirements to obtain the target legal document.

7. A device for generating legal documents, characterized in that, include: A receiving unit is used to receive case information in a first language and legal document generation requirements, wherein the legal document generation requirements record at least a second language; The analysis unit is used to analyze the case information in the first language through a semantic analyzer corresponding to the first language to obtain the case elements of the target case, and to translate the case information in the first language through a translator to obtain the case information in the second language. The translator is a neural machine translation model corresponding to the first language and the second language. The query unit is used to query the target legal knowledge base based on the case elements and obtain query results. The target legal knowledge base stores at least legal professional knowledge applicable to the first language and the second language. The query results record the legal basis and reference cases related to the target case. The query unit includes: a sending module, used to generate a query statement based on the case elements and send the query statement to the query interface of the target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the languages ​​used by the search keywords include at least the first language and the second language; a retrieval module, used to perform a retrieval in the target legal knowledge base based on all the search keywords to obtain retrieval results, wherein the retrieval results record legal basis and reference cases applicable to the first language and the second language that match the search keywords of the target case; a filtering module, used to filter all legal basis and reference cases in the retrieval results based on a preset semantic similarity algorithm to obtain filtering results, wherein the filtering results record filtering content that has a matching degree with the case elements greater than a preset threshold for legal basis and reference cases; and a second generation module, used to generate the query results based on the filtering results and the location information of each filtering content in the target legal knowledge base. The determining unit is used to determine the target document template based on the legal document generation requirements, and generate the target legal document based on the target document template, the second language case information, the case elements, and the query results.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method for generating legal documents as described in any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for generating legal documents as described in any one of claims 1 to 6.