Legal document generation method and device, electronic equipment and storage medium
Through semantic analysis and neural machine translation model combined with professional legal knowledge base, the problem of inability to accurately understand and convert professional legal terms and context in the generation of cross-lingual legal documents is solved, and high-quality and compliant legal documents are achieved.
Patent Information
- Application Number
- CN202411983258.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art cannot accurately understand and convert professional legal terms and contexts in the process of generating cross-lingual legal documents, resulting in inaccurate or even non-compliant legal documents.
By receiving case information in the first language and the generation needs of legal documents, using the semantic analyzer corresponding to the first language to analyze case information, obtain case elements, and translate them through the corresponding neural machine translation model to obtain case information in the second language. Then, the target legal knowledge base is queried based on case elements, relevant legal basis and reference cases are obtained, and the target legal documents are finally generated based on this information.
It has achieved high-quality and efficient generation of legal documents among different languages, ensuring that the generated legal documents are professional, accurate and compliant in the target language, and meeting the needs of transnational legal affairs.
Smart Images

Figure CN119886097A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of legal document generation, and in particular to a method and device for generating a legal document, an electronic device, and a storage medium. Background Art
[0002] Currently, cross-language legal document processing has become an increasingly prominent demand, especially in scenarios involving international legal affairs. In traditional technologies, this demand is mainly met through manual translation and writing, but manual methods have significant limitations, mainly reflected in low processing efficiency and uncontrollable translation quality. Due to their complexity and professionalism, legal documents require accurate communication of case details and legal terms, but manual translation often finds it difficult to maintain consistency and professionalism across multiple languages, especially when faced with frequently updated legal provisions and cases. It is difficult for translators to grasp the latest legal developments in all languages in real time, which further increases the risk of translation errors.
[0003] In addition, the high cost of manual translation is also an issue that cannot be ignored. High-quality legal translation services usually require professional and experienced legal translators, and the service fees are high, which is a considerable expense for many small and medium-sized enterprises or individual users. Cost barriers limit the ability of non-English language users to obtain legal services, especially when dealing with cross-border legal affairs, which require legal documents translated into multiple languages, and the cost increases exponentially.
[0004] Furthermore, the adaptability and scalability of existing technologies need to be improved. As the legal environment continues to change and user needs diversify, it is difficult for existing systems 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 difficult to meet the needs of intelligent service expansion, and it is impossible to provide users with more personalized and customized legal document generation services.
[0005] Therefore, existing technologies face many challenges in terms of efficiency, quality, cost, and service scalability when processing cross-language legal documents.
[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a method and device for generating a legal document, an electronic device, and a storage medium, so as to at least solve the technical problem that the related technology cannot accurately understand and convert professional legal terms and contexts during the cross-language generation process of legal documents, resulting in inaccurate or even non-compliant generated legal documents.
[0008] According to one aspect of an embodiment of the present invention, a method for generating a legal document is provided, which includes: receiving case information in a first language and a demand for generating a legal document, wherein the demand for generating a legal document records at least a second language; analyzing the case information in the first language by a semantic analyzer corresponding to the first language to obtain case elements of a target case, and translating the case information in the first language by a translator to obtain case information in a 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 a query result, wherein the target legal knowledge base stores at least legal expertise applicable to the first language and the second language, and the query result records the legal basis and reference cases related to the target case; determining a target document template based on the demand for generating a legal document, 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 result.
[0009] Furthermore, the step of analyzing the case information in the first language by 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 a natural language processing strategy to obtain a basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure analysis; performing keyword extraction on the basic text based on a case analysis strategy to obtain a case keyword set, wherein the case keywords include at least the following types: contract terms, dispute types, and legal text references; performing named entity recognition on the basic text and marking the recognized 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 an analysis result, wherein the analysis result is used to record the legal role and association relationship of each named entity; generating the case elements of the target case based on the case keyword set, all the named entities, and the legal roles and association relationships indicated by the analysis result.
[0010] Furthermore, the step of translating the case information in the first language through a translator to obtain the case information in the second language 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 draft of the target case, wherein the language used in the preliminary translation draft is the second language; based on the case elements output by the semantic analyzer and the legal terminology translation library, performing translation correction on the preliminary translation draft to obtain the case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammar correction and context adaptation.
[0011] Furthermore, after obtaining the case information in the second language, it also includes: inputting the case information in the second language into the translator, and having the translator 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; comparing the translation comparison draft with the case information in the first language to obtain a comparison result, wherein the comparison result records inconsistent text content and text position; and correcting the case information in the second language based on the comparison result.
[0012] Furthermore, the step of querying the target legal knowledge base based on the case elements to obtain the 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 language applied by the search keywords includes at least the first language and the second language; searching the target legal knowledge base based on all the search keywords to obtain search results, wherein the search results record the legal basis and reference cases applicable to the first language and the second language and matching the search keywords of the target case; filtering all the legal basis and reference cases in the search results based on a preset semantic similarity algorithm to obtain a filtering result, wherein the filtering contents recorded in the filtering results are the legal basis and reference cases whose matching degree with the case elements is greater than a preset threshold; generating the query results based on the filtering results and the location information of each of the filtered contents in the target legal knowledge base.
[0013] Furthermore, the step of determining the target document template based on the legal document generation requirement includes: identifying the document type of the target legal document based on the legal document generation requirement, wherein the document types include: complaint, arbitration application and contract draft; selecting the corresponding target document template from a preset multilingual document template library based on the document type and the second language.
[0014] Furthermore, the step of 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 includes: analyzing the target document template to obtain the fields to be filled in the target document template and the filling requirements corresponding to each of the fields to be filled; for each of the fields to be filled, analyzing the case information in the second language, 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 to-be-filled position of the field to be filled in the target document template; when all the fields to be filled are filled, adjusting the grammatical structure of the filled target document template based on the grammatical characteristics corresponding to the second language recorded in the legal document generation requirements to obtain the target legal document.
[0015] According to another aspect of an embodiment of the present invention, a device for generating a legal document is also provided, which includes: a receiving unit, which is used to receive case information in a first language and a demand for generating a legal document, wherein the demand for generating a legal document records at least a second language; an analyzing unit, which is used to analyze the case information in the first language through a semantic analyzer corresponding to the first language to obtain case elements of a target case, and translate the case information in the first language through a translator to obtain case information in a second language, wherein the translator is a neural machine translation model corresponding to the first language and the second language; a query unit, which is used to query a target legal knowledge base based on the case elements to obtain a query result, wherein the target legal knowledge base stores at least legal expertise applicable to the first language and the second language, and the query result records the legal basis and reference cases related to the target case; a determining unit, which is used to determine a target document template based on the demand for generating a legal document, and generate a target legal document based on the target document template, the case information in the second language, the case elements and the query result.
[0016] Furthermore, the analysis unit includes: a first analysis module, which is used to input the case information in the first language into the semantic analyzer, perform text analysis on the case information in the first language based on a natural language processing strategy, and 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 analysis; an extraction module, which is used to extract keywords from the basic text based on a case analysis strategy to obtain a case keyword set, wherein the case keywords include at least the following types: contract terms, dispute types, and legal text references; a marking module, which is used to perform named entity recognition on the basic text and mark the recognized named entities, wherein the named entities include: the parties involved in the target case, time points, and location information; a second analysis module, which is used to perform association analysis on all the case keywords and all the named entities based on a semantic role analysis strategy to obtain an analysis result, wherein the analysis result is used to record the legal role and association relationship of each named entity; a first generation module, which is used to generate the case elements of the target case based on the case keyword set, all the named entities, and the legal roles and association relationships indicated by the analysis result.
[0017] Furthermore, the analysis unit also includes: a calling module, which is 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, which is used to input the case information in the first language into the translator, and the translator performs semantic translation to obtain a preliminary translation draft of the target case, wherein the language used in the preliminary translation draft is the second language; a correction module, which is used to perform translation correction on the preliminary translation draft based on the case elements output by the semantic analyzer and the 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, grammar correction and context adaptation.
[0018] Furthermore, the legal document generation device also includes: a second translation module, which is used to input the second language case information into the translator after obtaining the second language case information, and 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; a comparison module, which is 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 that are inconsistent in the comparison; and a correction module, which is used to correct the second language case information based on the comparison result.
[0019] Furthermore, the query unit includes: a sending module, which is 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 language used by the search keywords at least includes the first language and the second language; a retrieval module, which is used to search the target legal knowledge base based on all the search keywords to obtain search results, wherein the search results record legal bases and reference cases applicable to the first language and the second language that match the search keywords of the target case; a screening module, which is used to screen all legal bases and reference cases in the search results based on a preset semantic similarity algorithm to obtain screening results, wherein the screening content recorded in the screening results is the legal bases and reference cases whose matching degree with the case elements is greater than a preset threshold; a second generation module, which is used to generate the query results based on the screening results and the location information of each of the screening contents in the target legal knowledge base.
[0020] Furthermore, the determination unit includes: an identification module for identifying the document type of the target legal document based on the legal document generation requirements, wherein the document types include: a complaint, an arbitration application, and a draft contract; a selection module for selecting a corresponding target document template from a preset multilingual document template library based on the document type and the second language.
[0021] Furthermore, the determination unit also 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 of the fields to be filled; a fourth analysis module, used to analyze the case information in the second language, the case elements, and the legal basis and reference cases in the query results for each of the fields to be filled based on the filling requirements to obtain the filling content; a filling module, used to fill the filling content into the to-be-filled position of the field to be filled in the target document template; an adjustment module, used to adjust the grammatical structure of the filled target document template based on the grammatical characteristics corresponding to the second language recorded in the legal document generation requirements when all the fields to be filled have been filled, so as to obtain the target legal document.
[0022] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for generating legal documents.
[0023] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is 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 implement any one of the above-mentioned methods for generating legal documents.
[0024] In the present invention, a method for generating a legal document is proposed, which first receives case information in a first language and a demand for generating a legal document, wherein the demand for generating a legal document records at least a second language, then analyzes the case information in the first language through a semantic analyzer corresponding to the first language to obtain case elements of a target case, and translates 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 language and the second language, then queries a target legal knowledge base based on the case elements to obtain a query result, wherein the target legal knowledge base stores at least legal expertise applicable to the first language and the second language, and the query result records the legal basis and reference cases related to the target case, and finally determines a target document template based on the demand for generating a legal document, and generates a target legal document based on the target document template, the case information in the second language, the case elements and the query result.
[0025] In the present invention, a cross-language intelligent legal document generation method is adopted, and the purpose of accurately understanding and converting professional legal terms and contexts is achieved by combining semantic analysis, neural machine translation models and professional legal knowledge bases, thereby achieving the technical effect of high-quality and efficient generation of legal documents between different languages. Specifically, the present invention accurately extracts case elements through in-depth analysis of case information, and uses a customized neural machine translation model for efficient translation. At the same time, it queries the legal basis and reference cases that match the case elements, intelligently selects document templates and automatically fills in key information, and finally generates documents that comply with the legal norms of the target language, thereby solving the technical problem that the related technology cannot accurately understand and convert professional legal terms and contexts in the process of cross-language generation of legal documents, resulting in inaccurate or even non-compliant generated legal documents. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 is a flow chart of an optional method for generating a legal document according to an embodiment of the present invention;
[0028] Figure 2 is a schematic diagram of an optional legal document generation device according to an embodiment of the present invention;
[0029] Figure 3 It is a hardware structure block diagram of an electronic device (or mobile device) for executing a method for generating a legal document according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:
[0033] Neural Machine Translation Model, a deep learning-based artificial intelligence translation technology, realizes automatic translation from one language to another by building a neural network model. It can understand and convert context and is suitable for processing highly complex texts such as legal documents. It can significantly improve the accuracy and fluency of translation.
[0034] Semantic Analyzer is a natural language processing tool used to understand and parse the deep meaning of text, including identifying keywords, named entities, grammatical structures, and semantic roles. For the generation of legal documents, the semantic analyzer can accurately extract key information of the case, such as the parties, time, place, legal terms, etc., to ensure the accuracy of subsequent translation and document generation.
[0035] Semantic Similarity Algorithm is an algorithm used to measure the similarity of meaning between texts, which is particularly important when dealing with the complexity and accuracy of legal language. This algorithm can filter out the most relevant and matching legal basis and reference cases from the legal knowledge base to ensure that the generated legal documents are highly targeted and professional.
[0036] 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, the 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 need to process cross-language legal documents and query multi-language legal knowledge, and can achieve efficient, accurate and automatic generation and translation of legal documents. The present invention uses a neural machine translation model to translate cross-language case information, and then deeply analyzes the translated case information through a semantic analyzer to obtain key case elements, which can better understand and convert professional legal terms and contexts, and ensure that the generated legal documents maintain accuracy and compliance in different languages.
[0038] Specifically, the embodiments of the present invention can be applied to scenarios where multilingual legal documents need to be processed. By receiving case information and legal document generation requirements input in the first language, the implementation system can automatically identify and understand the complex circumstances of the case, and use neural machine translation technology to convert the information into the second language. On this basis, the implementation system queries the target legal knowledge base, obtains the legal basis and reference cases related to the case, and finally generates legal documents in the target language according to the requirements.
[0039] The present invention utilizes a customized neural machine translation model and deep semantic analysis technology, effectively overcoming the limitations of traditional translation methods in dealing with professional legal terms and specific contexts, ensuring the accuracy and professionalism of the translation. At the same time, through efficient interaction with the target legal knowledge base, it can provide legal information that is highly relevant to the case, further improving the compliance and pertinence of legal documents. Therefore, while achieving cross-language generation of legal documents, the present invention also ensures the quality of the documents, thereby greatly improving the efficiency of legal services and the potential for international business cooperation.
[0040] The present invention is described in detail below in conjunction with various embodiments.
[0041] Embodiment 1
[0042] According to an embodiment of the present invention, an embodiment of a method for generating a legal document is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0043] Embodiments of the present invention Figure 1 The method for generating legal documents shown in the figure is implemented by a cross-language intelligent legal document generation system, which combines neural machine translation and deep semantic analysis technology and is used in cross-language legal affairs processing scenarios, especially to solve the problem of accurate generation and translation of legal documents between different languages. Through intelligent analysis, translation and legal knowledge retrieval, specifically receiving case information, semantic analysis to extract case elements, cross-language translation, legal basis query, and document template generation and filling, the comprehensive purpose of improving the efficiency of legal document generation, ensuring translation accuracy and professionalism, meeting cross-language legal needs, and supporting the expansion of intelligent services is achieved.
[0044] Figure 1 is a flow chart of an optional method for generating a legal document according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0045] Step S101, receiving case information in a first language and a legal document generation requirement, wherein the legal document generation requirement is recorded in at least a second language.
[0046] Specifically, the first language and the second language are two languages involved in the present invention. The first language refers to the language in which the case information is originally submitted, and the second language is the target language specified in the legal document generation requirements. In the conversion between any pair of languages, the first language can be any language, and the second language is the language to be converted to in order to adapt to different legal environments and business requirements. For example, in a specific embodiment, the first language may be Chinese, and the second language may be English. The system will process the Chinese case information and generate the corresponding English legal documents.
[0047] In the first step of the implementation of the present invention, the system first receives case information and legal document generation requirements in the first language from the user. This receiving process is the core starting point of the multilingual intelligent legal document generation system. The user may be an individual or organization that needs to handle transnational legal affairs.
[0048] Case information in the first language refers to the details of a specific legal case entered by the user in the original language (i.e., the first language), including but not limited to: the background of the target case, the legal clauses involved, the contractual provisions, the focus of the dispute, the parties involved, the timeline, the location, and other key elements. For example, a user provides a detailed description of a commercial contract dispute in Chinese, including the time and location of the contract signing, the specific terms of the contract, the process of the dispute, and the legal relationship involved.
[0049] The demand for legal document generation is also proposed by the user, who clearly indicates the type of legal document to be generated and the target language. The document type can be a complaint, arbitration application, contract draft, statement, agreement, etc., and the target language is the language in which the user wants the final legal document to be presented, such as English, French, German, Spanish, etc.
[0050] Step S101 of the present invention indicates that the implementation system can flexibly receive and process multilingual case information, and generate documents in the target language according to the specific needs of the user, which reflects the efficiency and practicality of the present invention in handling transnational legal affairs.
[0051] Step S102, analyzing the case information in the first language by 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 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 language and the second language.
[0052] It should be noted that in step S102, the present invention uses a semantic analyzer specific to the first language to deeply analyze the input case information to extract the key elements of the case, which is the basis for the subsequent generation of legal documents in the second language. The implementation system also uses a neural machine translation model to translate the analyzed case information in the first language into the second language to ensure accurate transmission of information.
[0053] Optionally, the step of analyzing case information in the first language by a semantic analyzer corresponding to the first language to obtain 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 a natural language processing strategy to obtain a basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure analysis; extracting keywords from the basic text based on the case analysis strategy to obtain a set of case keywords, wherein the case keywords include at least the following types: contract terms, dispute types, and legal text references; 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 a semantic role analysis strategy to obtain analysis results, wherein the analysis results are used to record the legal role and association relationship of each named entity; generating the case elements of the target case based on the case keyword set, all named entities, and the legal roles and association relationships indicated by the analysis results.
[0054] It should be noted that the semantic analyzer is an advanced natural language processing tool that has the ability to understand and analyze the semantics of legal texts. When a user submits case information, the semantic analyzer will perform multi-level analysis of the text based on advanced natural language processing strategies, including word segmentation, part-of-speech tagging, and basic grammatical structure analysis, laying the foundation for accurate understanding of the text.
[0055] Case elements refer to the key points of a case extracted through semantic analysis, including contract terms, dispute types, legal references, party information, time points, location information, etc. These are information points that must be accurate when generating legal documents to ensure that the content of the document is consistent with the actual situation of the case.
[0056] Another thing that needs to be explained is that the natural language processing strategy covers technologies such as word segmentation, part-of-speech tagging, and basic grammatical structure analysis, which are used to break down the text into smaller units, analyze its grammatical structure, and provide support for subsequent deep semantic understanding and translation.
[0057] The basic text is the case information after preliminary text analysis based on natural language strategies. It includes the results of word segmentation and part-of-speech tagging as well as the analysis of basic grammatical structures, providing structured information for the subsequent extraction of case elements. Among them, word segmentation is to divide continuous natural language text into words or phrases, which is a basic step in natural language processing. When processing legal texts, the accuracy of word segmentation is crucial for understanding legal clauses and professional terms; part-of-speech tagging refers to marking grammatical attributes for words or phrases after word segmentation, such as nouns, verbs, adjectives, etc.; basic grammatical structure analysis refers to analyzing the basic components of a sentence such as subject, predicate, and object, and identifying the logical relationship between sentences, which is the basis for further understanding the semantics of the text.
[0058] The case analysis strategy is to determine the core content of the case mainly through keyword extraction, such as breach of contract, tort liability, litigation requests, etc. The above keywords are the key to constructing the case elements.
[0059] Furthermore, named entity recognition is the identification of entities with specific meanings in the text, such as the time point and location information of the parties to the case (company, individual), which is crucial for recording and understanding the background of the case. The semantic role analysis strategy is used to analyze the role played by each element in the text at the semantic level, such as identifying the role of an entity as Party A or Party B in a contract, which helps to build a legal relationship map of the case and ensure the accuracy and completeness of the case elements.
[0060] In an optional embodiment, suppose a business has a business contract dispute with another party, and the business needs to file a lawsuit in another country, requiring the system to generate a corresponding complaint. The implementation process of this implementation system is as follows.
[0061] The enterprise submits detailed case information in the first language (e.g., a widely used language), including the specific terms of the contract, the points of dispute between the parties, the time and place of contract signing, etc.
[0062] The system first uses a semantic analyzer to conduct an in-depth analysis of the case information, converting the text into structured information through word segmentation, part-of-speech tagging, and basic grammatical structure analysis; then, it extracts a set of keywords based on the case analysis strategy, such as breach of contract, claim for damages, contract termination, etc.; then, it uses named entity recognition technology to mark the parties in the contract, the time and place of the dispute; finally, through the semantic role analysis strategy, it understands the legal role and relationship of each named entity in the case.
[0063] Based on the above analysis, the implementation system generates the case elements of the target case, including the nature of the case, the parties, time and location information, as well as key legal claims and factual descriptions. Using the neural machine translation model, the case information in the first language is translated into the second language (i.e., the language used in the target country) to ensure accurate understanding of professional terms and legal context during the translation process. The translated case information (i.e., the case information in the second language) together with the case elements will be used in the subsequent legal basis query and legal document generation steps.
[0064] The above embodiment demonstrates that the real-time system in step S102 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 a first language through a translator to obtain case information in a second language includes: 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; inputting the case information in the first language into the translator, and having the translator perform semantic translation to obtain a draft translation of the target case, wherein the language used in the draft translation is the second language; based on the case elements output by the semantic analyzer and the legal terminology translation library, performing translation correction on the draft translation to obtain case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammar correction, and context adaptation.
[0066] In step S102 of the present invention, in order to ensure the accuracy and professionalism of the cross-language translation of legal documents, the system performs multi-level translation processing and correction, including calling a neural machine translation model for preliminary translation, using a legal terminology translation library for professional terminology correction, and further adapting the grammar and context of the draft translation.
[0067] It should be noted that the translator is a neural machine translation model that is specially trained to efficiently and accurately translate between a first language and a second language. The translator in the present invention can not only perform basic text translation, but also consider the precise expression of legal professional terms and the grammar and expression habits of different languages during the translation process to ensure that the translated legal documents can accurately convey the original meaning.
[0068] The second language case information refers to the text information converted from the first language case information into the second language after being processed by the translator. In subsequent steps, it will be used to find the corresponding legal basis and generate legal documents in the target language.
[0069] The multilingual neural machine translation framework is one of the key technologies in this invention, which aims to achieve high-quality automatic translation from the first language to the second language through a shared encoder-decoder architecture and deep learning model. The framework uses a large number of multilingual datasets in the pre-training stage to learn the conversion rules between different languages, and then optimizes it for the specific needs of the legal field, which can more accurately process legal terms and professional expressions.
[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, that is, a preliminary second language text, which is the basis of the entire translation process. Although the draft translation may be inaccurate in professional terminology and legal expressions, it provides a basis for language expression for subsequent corrections.
[0071] The legal terminology translation database is a professional database dedicated to storing and managing various legal terms and their corresponding translations. It covers the accurate translation of common legal terms and phrases in different languages, ensuring that the professional terms in the first draft of the translation can be accurately converted. After the first draft of the translation is generated, the legal terminology translation database is used to correct the professional legal terms involved, ensuring the accuracy and professionalism of the legal terms in the first draft of the translation, and avoiding the deviation of meaning caused by improper translation.
[0072] In addition to professional terms, there are many specific expressions in legal texts, which may have different meanings and usages in different legal systems and cultural backgrounds. Legal expression correction aims to adjust the legal expressions in the first draft of the translation to make it conform to the norms and habits of the second language legal system, thereby improving the professionalism and readability of the document. In addition, due to the differences in grammatical structures of different languages, the first draft of the translation may not conform to the norms of the second language in terms of grammar. The grammar correction step corrects the grammatical level of the first draft of the translation, which can ensure that the generated second language case information is grammatically correct and clearly expressed.
[0073] Furthermore, contextual considerations are crucial in legal translation. The translation of some words or phrases may need to be adjusted according to the specific context and case background. Contextual adaptation aims to fine-tune the expressions in the first draft of the translation to ensure that it can accurately convey the original meaning of the case in the target language to avoid ambiguity or misunderstanding.
[0074] In an optional embodiment, assume that 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 a first language in the implementation system of the present invention, including the specific terms of the contract, the actions of both parties, points of dispute, etc.
[0075] The implementation system of the present invention can call a pre-trained and optimized multilingual neural machine translation framework to generate a translator for translation between a first language and a second language. The translator processes case information and outputs a preliminary second language translation draft. The translation draft may be imperfect in professional terms, specific legal expressions and grammatical structure. Next, the translation draft is compared with a legal terminology translation library, and the legal professional terms therein are corrected to ensure accurate translation of terms such as "force majeure" and "damages". The translation draft is further corrected for legal expressions, and common legal expressions such as "in view of" and "in view of this, hereby declare" are adjusted to conform to the legal customs of the target jurisdiction. Grammar correction and context adaptation steps are performed to ensure the grammatical correctness of the translation draft and the appropriateness of the contextual expression, so that the second language case information is not only grammatically correct, but also can accurately reflect the background and details of the case. Finally, the second language case information after deep translation processing and professional correction has a high degree of accuracy and professionalism, providing a solid language foundation for subsequent legal document generation and submission.
[0076] Through the above process, the present invention not only realizes the 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 professional terminology correction, legal expression correction, grammar correction and context adaptation, thus meeting the urgent need for high-quality legal documents in international legal affairs.
[0077] Optionally, after obtaining the case information in the second language, the method further includes: inputting the case information in the second language into a translator, and having the translator 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; comparing the translation comparison draft with the case information in the first language to obtain a comparison result, wherein the comparison result records inconsistent text content and text position; and correcting the case information in the second language based on the comparison result.
[0078] In the technical solution of the embodiment of the present invention, in order to further enhance the translation accuracy and reliability of the second language case information, a translation comparison draft generation and comparison verification process is provided. Through reverse translation and comparison, potential translation errors or expression inconsistencies can be discovered and corrected to ensure that the final second language case information is highly consistent with the original manuscript.
[0079] The translation comparison draft refers to the new text formed by inputting the second language case information into the translator again and translating it back into the first language. It is essentially a reverse translation and is used to verify the accuracy of the translation of the second language information. The comparison draft will be compared in detail with the original first language case information to find any possible translation deviations or differences in expression.
[0080] After completing the preliminary second language translation, the reverse translation function of the translator is called to translate the second language case information back to 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 first language case information. The automatic text comparison technology can quickly identify the inconsistencies between the two texts, including translation errors of professional terms, omissions of key information, and deviations in semantic expression. The text content and text location of these inconsistent comparisons will be recorded in detail in the comparison results.
[0081] The comparison results are directly used to correct the second language case information to ensure that the translated second language case information is consistent with the original information in content and semantics. The correction process involves re-translating erroneous sentences, supplementing missing information, or adjusting inappropriate legal expressions.
[0082] In an optional embodiment, assume a scenario where a company has a contract dispute with another company, and the dispute involves complex interpretation of contract terms and application of legal provisions. The company needs to translate Chinese case information (first language) into English (second language). According to an embodiment of the present invention, the company submits detailed Chinese case information, including contract terms, focus of dispute, 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, which then reverse translates it back into Chinese to generate a translation comparison draft. The translation comparison draft is automatically compared with the original Chinese case information, and any inconsistent text content and location are recorded. For example, it may be found that the term "force majeure" is expressed as "forcemajeure" instead of "force majeure" in the reverse translation, or that a key fact description has detail deviations after reverse translation.
[0084] The English case information is modified based on the comparison results, which may include adjusting the term translation to match the original Chinese meaning, supplementing or modifying the detailed description to ensure completeness and accuracy; the modified English case information ultimately ensures consistency with the original Chinese information in content and semantics, meeting the demand for high-quality legal documents.
[0085] Through the above steps, the present invention not only realizes accurate conversion from the first language to the second language, but also provides a systematic translation quality control solution through the generation and comparison of translation comparison drafts, which greatly enhances the reliability and professionalism of legal document translation. This mechanism is particularly important when dealing with complex legal terms and detailed case descriptions, and provides a strong technical guarantee for efficient and accurate document processing in transnational legal affairs.
[0086] Step S103, querying the target legal knowledge base based on the case elements to obtain query results, wherein the target legal knowledge base stores at least legal expertise 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.
[0087] In step S103 of the present invention, based on the case elements and a series of intelligent retrieval and screening mechanisms, the legal basis and reference cases applicable to the first language and the second language are searched in the target legal knowledge base, ensuring that the generated legal documents can be based on correct legal provisions and judicial practices, thereby improving the compliance and persuasiveness of the documents.
[0088] The target legal knowledge base is a database that integrates legal texts, regulatory interpretations, judicial cases, expert opinions and other resources from around the world. It not only covers a wide range of legal fields, but also specifically includes professional legal data suitable for multilingual environments, ensuring that the system can obtain accurate legal basis when handling cross-language cases. The knowledge base maintains the timeliness and authority of legal information through continuous updates.
[0089] Optionally, step S103 includes: generating a query statement based on the case elements, and sending the query statement to a query interface of a target legal knowledge base, wherein the query interface is used to parse the query statement to obtain search keywords, wherein the language used by the search keywords includes at least a first language and a second language; searching the target legal knowledge base based on all search keywords to obtain search results, wherein the search results record legal bases and reference cases applicable to the first language and the second language that match the search keywords of the target case; screening all legal bases and reference cases in the search results based on a preset semantic similarity algorithm to obtain screening results, wherein the screening contents recorded in the screening results are legal bases and reference cases whose matching degree with the case elements is greater than a preset threshold; and generating query results based on the screening results and the location information of each screening content 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, which receives the query statements sent from the system and parses the search keywords therein, and then searches the knowledge base based on these keywords. The design of the query interface takes multi-language compatibility into consideration, and can understand and parse query statements expressed in different languages to ensure the accuracy and diversity of the search keywords.
[0091] Search keywords are a set of key information extracted from the case elements, which are used to indicate the search direction in the target legal knowledge base. They can include case type, dispute focus, legal provisions, important terms, party roles, time points, etc., expressed in the first language and / or the second language to ensure the comprehensiveness and accuracy of the search. The 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, covering all types of legal information related to the case elements, and providing rich basic data for subsequent screening.
[0092] The semantic similarity algorithm is an advanced text matching and understanding technology that can evaluate the similarity of meaning between different texts using different vocabulary or expressions. In the present invention, the semantic similarity algorithm is used to screen the search results, giving priority to the legal basis and reference cases that have a high degree of match with the case elements, to ensure that the final generated legal document can accurately reflect the legal essence of the case.
[0093] In an optional embodiment, suppose a company has a business contract dispute with its overseas partner, and the company needs to prepare a complaint against a specific jurisdiction to protect its rights and interests. The company submits detailed case information through the system implemented by the present invention, including specific terms of the contract, points of dispute between the two parties, facts of breach of contract, etc., which constitute the case elements expressed in the first language (such as Chinese).
[0094] The implementation system of the present invention first generates a query statement based on the case elements, which includes key information such as the case type, the focus of the dispute, and the legal provisions involved. Since the goal is to generate legal documents in a second language (such as English), the query statement may contain keywords in both the first language and the second language to ensure the comprehensiveness and accuracy of the search.
[0095] The query statement is sent to the target legal knowledge base through the query interface. The query interface parses the search keywords in the query statement, such as "commercial contract disputes", "liability for breach of contract", "international litigation", etc., and searches for the same keywords in English. This step takes advantage of the multilingual compatibility of the knowledge base to ensure that relevant legal basis and cases can be accurately found in the English context. The knowledge base is fully searched based on the search keywords, and a series of legal provisions, judicial interpretations, and reference cases related to the input case information are found. The search results include legal information from different countries and regions, reflecting the breadth and depth of the target legal knowledge base.
[0096] The implementation system of the present invention uses a semantic similarity algorithm to screen the search results and identify those legal bases and reference cases that have a high degree of match with the case elements. This algorithm takes into account the semantic conversion between different languages and can effectively identify and exclude those search results that are superficially related but substantively inconsistent. Finally, based on the screening results and the location information of each screened content in the target legal knowledge base, the query results are generated, which not only include the most relevant legal bases and cases, but also provide exact references in the knowledge base, so that the generated legal documents can be accurately cited and explained.
[0097] Through this series of steps, the present invention ensures that the generated legal documents can be based on precise legal provisions and cases, thereby enhancing their recognition and effectiveness in legal practice, reflecting the professionalism and intelligence of the system in handling cross-border legal affairs, and providing users with high-quality and highly compliant legal document generation services.
[0098] Step S104, determining a target document template based on the legal document generation requirements, and generating a target legal document based on the target document template, second language case information, case elements, and query results.
[0099] In step S104 of the present 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 in combination with the second language case information, case elements and query results. Not only the type and language of the document are taken into consideration, but also the case details and applicable legal basis are deeply analyzed to ensure that the final generated document is accurate in content and compliant in format.
[0100] Optionally, the step of determining a target document template based on the legal document generation requirement includes: identifying the document type of the target legal document based on the legal document generation requirement, wherein the document types include: complaint, arbitration application and contract draft; selecting a corresponding target document template from a preset multilingual document template library based on the document type and the second language.
[0101] It should be noted that the document types specified in the identified user needs include but are not limited to complaints, arbitration applications, contract drafts, etc. The identification process is based on the case background and purpose input by the user to ensure that the subsequently generated documents meet specific legal scenarios and needs.
[0102] The embodiment of the present invention selects the most matching target document template from a preset multilingual document template library according to the identified document type and the specified second language, wherein 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 a variety of cases.
[0103] In an optional embodiment, suppose a multinational company has a business dispute with an overseas partner and needs to prepare an arbitration application to resolve the contract dispute. The company submits detailed case information through the system (the first language is Chinese), and specifies the document type as arbitration application, and the target language is English. The system implemented by the present invention can recognize that the user's demand is an arbitration application, and call the arbitration application template suitable for English in the multilingual document template library.
[0104] Optionally, the step of generating a target legal document based on a target document template, case information in a second language, case elements and query results includes: analyzing 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, analyzing the case information in the second language, 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 to-be-filled position of the field to be filled in the target document template; when all the fields to be filled are filled, adjusting the grammatical structure of the filled target document template based on the grammatical characteristics corresponding to the second language recorded in the legal document generation requirements to obtain the target legal document.
[0105] It should be noted that in-depth analysis of the target document template will reveal all the specific fields that need to be filled in, such as "party information", "case facts", "applicable law", "request matters", etc. These are the key information points that must be filled in when generating legal documents, and each fill-in field has its own specific filling requirements, including format specifications, information type, expression style, etc. For example, the "party information" field requires entry with a formal title and format; the "case facts" field requires a detailed description, while avoiding subjective assumptions.
[0106] After all the fields to be filled are filled, the grammatical structure of the entire document is adjusted based on the grammatical characteristics of the target language, aiming to ensure the language fluency and format standardization of the document in the target language. For example, English legal documents may prefer direct and concise expressions, while Chinese may pay more attention to details and background descriptions. Grammatical structure adjustment can include reorganizing sentence structure, adjusting word order, correcting grammatical errors, and making necessary language polishing to adapt to the writing habits of legal documents in the target language, which is crucial to improving the readability, professionalism and legal effectiveness of the document.
[0107] Continuing with the above-mentioned embodiment, the implementation system of the present invention will fill in the translated and corrected English case information, the extracted case elements (such as contract breach, claim for damages, etc.), and the legal basis and cases retrieved from the target legal knowledge base in accordance with the format of the English arbitration application template, and automatically integrate all key information during the filling process, such as the names of the two parties, the facts of the dispute, the relevant contract terms, the applicable laws and regulations, and case support, to ensure that the content of the document is comprehensive and accurate.
[0108] The implementation system of the present invention will also adjust the language style and expression of the document according to the writing standards of legal documents in the second language (English) to conform to the habits of English legal documents, while ensuring the professionalism and readability of the document, and finally generate a customized English arbitration application. The document 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, and provides a powerful technical means for the efficient handling of transnational legal affairs, so that legal professionals can quickly obtain high-quality legal documents, while reducing the uncertainty and risks caused by language barriers.
[0110] Through the above steps S101 to S104, the case information in the first language and the demand for generating a legal document can be received first, wherein the demand for generating a legal document records at least the second language, and 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, and the case information in the first language is 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 language and the second language, and then the target legal knowledge base is queried based on the case elements to obtain the query results, wherein the target legal knowledge base stores at least legal expertise 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 finally the target document template is determined based on the demand for generating a legal document, 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 the embodiment of the present invention, a cross-language intelligent legal document generation method is adopted, and the purpose of accurately understanding and converting professional legal terms and contexts is achieved by combining semantic analysis, neural machine translation models and professional legal knowledge bases, thereby achieving the technical effect of high-quality and efficient generation of legal documents between different languages. Specifically, the present invention accurately extracts case elements through in-depth analysis of case information, and uses a customized neural machine translation model for efficient translation. At the same time, it queries the legal basis and reference cases that match the case elements, intelligently selects document templates and automatically fills in key information, and finally generates documents that comply with the legal norms of the target language, thereby solving the technical problem that the related technology cannot accurately understand and convert professional legal terms and contexts in the process of cross-language generation of legal documents, resulting in inaccurate or even non-compliant generated legal documents.
[0112] The present invention is described below in conjunction with another optional embodiment.
[0113] Embodiment 2
[0114] A legal document generation device provided in this embodiment includes multiple implementation units, each implementation unit corresponds to each implementation step in the above-mentioned embodiment one.
[0115] Figure 2 is a schematic diagram of an optional legal document generation device according to an embodiment of the present invention, such as Figure 2 As shown, the device may include: a receiving unit 21, an analyzing unit 22, a query unit 23, and a determining unit 24.
[0116] The receiving unit 21 is used to receive case information in a first language and a legal document generation requirement, wherein the legal document generation requirement is recorded in at least a second language.
[0117] The analysis unit 22 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 translate the case information in the first language through a translator to obtain the case information in the second language, wherein 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 case elements to obtain query results, wherein the target legal knowledge base stores at least legal expertise 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.
[0119] The determination unit 24 is used to determine a target document template based on the legal document generation requirements, and to generate a target legal document based on the target document template, the second language case information, case elements and the query results.
[0120] The above-mentioned legal document generation device can first receive the case information in the first language and the legal document generation requirements through the receiving unit 21, wherein the legal document generation requirements at least record the second language, and then call the semantic analyzer corresponding to the first language through the analysis unit 22 to analyze the case information in the first language to obtain the case elements of the target case, and translate the case information in the first language through the translator to obtain the case information in the second language, wherein the translator is a neural machine translation model corresponding to the first language and the second language, and then query the target legal knowledge base based on the case elements through the query unit 23 to obtain the query results, wherein the target legal knowledge base at least stores legal expertise 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 finally determine the target document template based on the legal document generation requirements through the determination unit 24, and generate the target legal document based on the target document template, the case information in the second language, the case elements and the query results.
[0121] In an embodiment of the present invention, a method of cross-language intelligent legal document generation is adopted, and the purpose of accurately understanding and converting professional legal terms and contexts is achieved by combining semantic analysis, neural machine translation models and professional legal knowledge bases, thereby achieving the technical effect of high-quality and efficient generation of legal documents between different languages. Specifically, the present invention accurately extracts case elements through in-depth analysis of case information, and uses a customized neural machine translation model for efficient translation. At the same time, it queries the legal basis and reference cases that match the case elements, intelligently selects document templates and automatically fills in key information, and finally generates documents that comply with the legal norms of the target language, thereby solving the technical problem that the related technology cannot accurately understand and convert professional legal terms and contexts in the process of cross-language generation of legal documents, resulting in inaccurate or even non-compliant generated legal documents.
[0122] Optionally, the analysis unit includes: a first analysis module, which is used to input the case information in the first language into a semantic analyzer, perform text analysis on the case information in the first language based on a natural language processing strategy, and 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, which is 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 terms, dispute types, and legal text references; a marking module, which is used to perform named entity recognition on the basic text and mark the identified named entities, wherein the named entities include: parties involved in the target case, time points, and location information; a second analysis module, which is 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 associations of each named entity; a first generation module, which is used to generate case elements of the target case based on the case keyword set, all named entities, and the legal roles and associations indicated by the analysis results.
[0123] Optionally, the analysis unit also includes: a calling module, which is used to call 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, which is used to input the case information in the first language into the translator, and the translator performs semantic translation to obtain a preliminary translation draft of the target case, wherein the language used in the preliminary translation draft is the second language; a correction module, which is used to perform translation correction on the preliminary translation draft based on the case elements output by the semantic analyzer and the 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, grammar correction and context adaptation.
[0124] Optionally, the legal document generation device also includes: a second translation module, which is used to input the second language case information into a translator after obtaining the second language case information, and 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; a comparison module, which is 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 that are inconsistent in the comparison; and a correction module, which is used to correct the second language case information based on the comparison result.
[0125] Optionally, the query unit includes: a sending module, which is 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 language used by the search keywords includes at least a first language and a second language; a retrieval module, which is used to search the target legal knowledge base based on all search keywords to obtain search results, wherein the search results record legal bases and reference cases applicable to the first language and the second language that match the search keywords of the target case; a screening module, which is used to screen all legal bases and reference cases in the search results based on a preset semantic similarity algorithm to obtain screening results, wherein the screening content recorded in the screening results is the legal bases and reference cases whose matching degree with the case elements is greater than a preset threshold; a second generation module, which is used to generate query results based on the screening results and the location information of each screening content in the target legal knowledge base.
[0126] Optionally, the determination unit includes: an identification module for identifying the document type of the target legal document based on the legal document generation requirements, wherein the document types include: a complaint, an arbitration application, and a draft contract; and a selection module for selecting a corresponding target document template from a preset multilingual document template library based on the document type and the second language.
[0127] Optionally, the determination unit also 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 case information, case elements and legal basis and reference cases in the second language 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 to-be-filled position of the field to be filled in the target document template; an adjustment module, used to adjust the grammatical structure of the filled target document template based on the grammatical characteristics corresponding to the second language recorded in the legal document generation requirements when all fields to be filled have been filled, so as to obtain the target legal document.
[0128] The above-mentioned legal document generation device may also include a processor and a memory. The above-mentioned 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 above-mentioned program units stored in the memory to realize corresponding functions.
[0129] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the target legal knowledge base is queried based on the case elements by adjusting the kernel parameters to obtain the query results, wherein the target legal knowledge base stores at least legal expertise 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 finally 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.
[0130] The above-mentioned memory may include non-permanent memory in a computer-readable medium, 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 storage chip.
[0131] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes 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 by 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 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 language and the second language; querying a target legal knowledge base based on the case elements to obtain a query result, wherein the target legal knowledge base stores at least legal expertise applicable to the first language and the second language, and the query result records 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 result.
[0132] According to another aspect of an embodiment 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, the device where the computer-readable storage medium is located is controlled to execute the method for generating a legal document of any one of the above-mentioned embodiments one.
[0133] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method for generating a legal document of any one of the above-mentioned embodiments one.
[0134] Figure 31 is a hardware structure block diagram of an electronic device (or mobile device) for executing a method for generating a legal document according to an embodiment of the present invention. Figure 3 As shown, the electronic device may include one or more ( Figure 3 302a, 302b, ..., 302n are used to illustrate) processor (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 304 for storing data. In addition, it may also 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. It can be understood by those skilled in the art that Figure 3 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown.
[0135] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0136] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made 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. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0139] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0140] If the integrated unit is implemented in the form of 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0141] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating a legal document, characterized in that: include: Receiving case information in a first language and a demand for generating a legal document, wherein the demand for generating a legal document is recorded in at least a second language; Analyzing the case information in the first language by a semantic analyzer corresponding to the first language to obtain case elements of the target case, and translating the case information in the first language by a translator to obtain case information in a 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 a query result, wherein the target legal knowledge base stores at least legal expertise applicable to a first language and a second language, and the query result records the legal basis and reference cases related to the target case; A target document template is determined based on the legal document generation requirement, and a target legal document is generated based on the target document template, the second language case information, the case elements and the query results.
2. The generation method according to claim 1, characterized in that: The step of analyzing the case information in the first language by a semantic analyzer corresponding to the first language to obtain the case elements of the target case includes: Inputting the first language case information into the semantic analyzer, performing text analysis on the first language case information based on a natural language processing strategy to obtain a basic text of the target case, wherein the text analysis includes the following operations: word segmentation, part-of-speech tagging, and basic grammatical structure analysis; Extracting keywords from the basic text based on the case analysis strategy to obtain a case keyword set, wherein the case keywords include at least the following types: contract terms, dispute types, and legal provisions citations; Performing named entity recognition on the basic text and marking the recognized named entities, wherein the named entities include: parties involved in the target case, time points, and location information; Based on the semantic role analysis strategy, an association analysis is performed on all the case keywords and all the named entities to obtain an analysis result, wherein the analysis result is used to record the legal role and association relationship of each named entity; Based on the case keyword set, all the named entities, the legal roles indicated by the analysis results, and the associated relationships, the case elements of the target case are generated.
3. The generation method according to claim 1, characterized in that: The step of translating the case information in the first language by a translator to obtain the case information in the second language 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 draft of the target case, wherein the language used in the preliminary translation draft is the second language; Based on the case elements output by the semantic analyzer and the legal terminology translation library, the translation draft is corrected to obtain the case information in the second language, wherein the translation correction includes the following operations: professional terminology correction, legal expression correction, grammar correction and context adaptation.
4. The generation method according to claim 3, characterized in that: After obtaining the case information in the second language, it also includes: Inputting the case information in the second language into the translator, and having the translator perform semantic translation to obtain a translation comparison draft of the target case, wherein the translation comparison draft is in 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 of the inconsistent text; The second language case information is modified based on the comparison result.
5. The generation method according to claim 1, characterized in that: The step of querying the target legal knowledge base based on the case elements to obtain the query results includes: Generate a query statement based on the case elements, and send the query statement to a 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 by the search keywords includes at least the first language and the second language; Searching the target legal knowledge base based on all the search keywords to obtain search results, wherein the search results record legal bases and reference cases applicable to the first language and the second language that match the search keywords of the target case; Screening all legal bases and reference cases in the search results based on a preset semantic similarity algorithm to obtain screening results, wherein the screening contents recorded in the screening results are legal bases and reference cases whose matching degree with the case elements is greater than a preset threshold; The query result is generated based on the screening result and the location information of each of the screening contents in the target legal knowledge base.
6. The generation method according to claim 1, characterized in that: The step of determining a target document template based on the legal document generation requirement includes: Identifying the document type of the target legal document based on the legal document generation requirement, wherein the document type includes: a complaint, an arbitration application, and a draft contract; A corresponding target document template is selected from a preset multilingual document template library based on the document type and the second language.
7. The generation method according to claim 1, characterized in that: The step of generating a target legal document based on the target document template, the case information in the second language, the case elements and the query result includes: Analyze the target document template to obtain the fields to be filled in the target document template and the filling requirements corresponding to each of the fields to be filled; For each of the fields to be filled, analyzing the case information in the second language, the case elements, and the legal basis and reference cases in the query results based on the filling requirements to obtain filling content; Fill the filling content into the to-be-filled position of the to-be-filled field in the target document template; When all the fields to be filled are filled, the grammatical structure of the filled target document template is adjusted based on the grammatical characteristics corresponding to the second language recorded in the legal document generation requirements to obtain the target legal document.
8. A device for generating legal documents, characterized in that: include: A receiving unit, configured to receive case information in a first language and a legal document generation requirement, wherein the legal document generation requirement is recorded in at least a second language; an analyzing unit, configured to analyze the case information in the first language by using a semantic analyzer corresponding to the first language to obtain case elements of the target case, and translate the case information in the first language by using a translator to obtain case information in a second language, wherein the translator is a neural machine translation model corresponding to the first language and the second language; A query unit, configured to query a target legal knowledge base based on the case elements to obtain a query result, wherein the target legal knowledge base stores at least legal expertise applicable to a first language and a second language, and the query result records the legal basis and reference cases related to the target case; A determination unit is used to determine a target document template based on the legal document generation requirement, and generate a target legal document based on the target document template, the second language case information, the case elements and the query results.
9. 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, the device where the computer-readable storage medium is located is controlled to execute the method for generating a legal document as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is 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 implement the method for generating a legal document as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Legal trial business processing method and device
CN108009299A
Cross-language regulation retrieval method and device, equipment and storage medium
CN115221282A
Neural machine translation method of fusion translation memory bank in legal field
CN115906880A
Remote notarization document generation method capable of automatically matching business
CN118982013A
The method for providing the speciality translation service platform
KR102244448B1
Cited By
Term alignment enhancement method and device, computer equipment and storage medium
CN120780802A
Cross-domain official document automatic generation method and system, storage medium and program product
CN120975065A
LLM-based cross-border appeal text generation method, apparatus and device, and storage medium
CN120975984A
Intellectual property law fact generation method and system
CN121597841A
A method and system for generating intellectual property legal facts
CN121597841B