Method, device, computer equipment and medium for generating judgment

By generating fact determination vectors and legal auxiliary vectors, combined with text generation models, the problems of low automation and lack of targeted content in the existing technology of automatic generation of court opinions are solved, and a more accurate and targeted generation of court opinions is achieved. .

CN113807053BActive Publication Date: 2025-02-14ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010544257.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-15
Publication Date
2025-02-14
Estimated Expiration
2040-06-15

AI Technical Summary

Technical Problem

In the prior art, the method of automatically generating the court view part from the fact determination part has the shortcomings of low degree of automation, lack of targetedness in the generated content, and legal concepts.

Method used

By obtaining the fact determination part, the corresponding fact determination vector is generated, and the text generation model is used to generate the court opinion part with the pre-obtained legal auxiliary vector (including the correlation law vector and the legal consequence vector).

Benefits of technology

The degree of automation of generating judgments has been improved, and the generated court viewpoints are more accurate and targeted, and can more closely link the laws and legal consequences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807053B_ABST
    Figure CN113807053B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, computer device and medium for generating a judgment. The method includes: obtaining the fact finding part; generating a fact finding vector corresponding to the fact finding part; and generating the court opinion part according to the pre-acquired legal auxiliary vector and the fact finding vector. The embodiment of the present disclosure improves the automation degree of generating the court opinion part from the fact finding part, and improves the accuracy of the generated court opinion part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, and more specifically, to a method, apparatus, computer device, and medium for generating a judgment. Background Art

[0002] There are two very important parts in a court case judgment: the fact finding part and the court opinion part. The fact finding part is the case facts found by the judge after the trial. The court opinion part is the judge's opinion on the case written according to the found facts and legal consequences (such as charges) and relevant legal provisions. The court opinion part is a very important part of a judgment, which explains why the judge made the final judgment. With the development of artificial intelligence, there has been an exploration of automatically giving the court opinion part from the fact finding part by machines.

[0003] In the prior art, there are two main solutions for automatically giving the court opinion part from the fact finding part by a machine to generate a judgment. The first solution is a template-based auxiliary judgment generation tool. Different templates are manually written for different types of cases, and the templates leave several blank spaces for filling in key information. The judgment auxiliary generation tool only needs to supplement the key information in the template. Therefore, this solution is not a fully automatic solution. Different templates need to be manually written for different types of cases, which is time-consuming and labor-intensive, and the judgment is too rigid and cannot take all case situations into consideration. The second solution is to use a standard text generation model to generate the court opinion part from the fact finding part. It only generates the court opinion part based on the fact finding part. The generated court opinion part lacks pertinence, is not closely related to the relevant laws, and the argumentative sentences lack legal concepts.

[0004] Public Content

[0005] In view of this, the present disclosure aims to further improve the degree of automation in generating judgments and improve the accuracy of the court's opinion part in the generated judgments.

[0006] To achieve this objective, according to one aspect of the present disclosure, a method for generating a judgment is provided, wherein the judgment includes a fact finding part and a court opinion part, and the method includes:

[0007] Obtaining the fact finding portion;

[0008] Generating a fact finding vector corresponding to the fact finding part;

[0009] The court opinion part is generated according to the pre-acquired legal auxiliary vector and the fact finding vector.

[0010] Optionally, the legal auxiliary vector includes at least one of an associated law provision vector and a legal consequence vector.

[0011] Optionally, the associated legal provision vector is a composite vector of multiple associated legal provisions, which is obtained by:

[0012] Get the text description of each related legal provision;

[0013] Generate a legal article vector according to the text description of each associated legal article;

[0014] A composite vector is generated based on the legal article vector of each associated legal article.

[0015] Optionally, generating a synthetic vector according to the legal article vector of each associated legal article includes:

[0016] The law article vector of each associated law article is averaged to obtain the associated law article vector.

[0017] Optionally, generating the court opinion part according to the pre-acquired legal auxiliary vector and the fact finding vector includes:

[0018] Input the pre-obtained legal auxiliary vector and the fact finding vector into each layer of a multi-layer decoder of a text generation model, wherein the Nth layer of the multi-layer decoder receives the output of the N-1th layer and serves as the input of the N+1th layer;

[0019] Inputting the pre-obtained legal auxiliary vector into the maximization layer of the text generation model;

[0020] The output of the last layer of the multi-layer decoder is input into the maximization layer through the linear connection layer of the text generation model, and the maximization layer outputs the court opinion part.

[0021] Optionally, the first layer of the multi-layer decoder receives the court opinion portion of the training data, and the multi-layer decoder decodes the legal auxiliary vector and the fact finding vector according to the court opinion portion of the training data.

[0022] According to one aspect of the present disclosure, a device for generating a judgment is provided, wherein the judgment includes a fact finding part and a court opinion part, including:

[0023] A fact finding part acquisition unit, used for acquiring the fact finding part;

[0024] A fact finding vector generating unit, used to generate a fact finding vector corresponding to the fact finding part;

[0025] The court opinion part generating unit is used to generate the court opinion part according to the pre-acquired legal auxiliary vector and the fact finding vector.

[0026] Optionally, the legal auxiliary vector includes at least one of an associated law provision vector and a legal consequence vector.

[0027] Optionally, the associated legal provision vector is a composite vector of multiple associated legal provisions, which is obtained by:

[0028] Get the text description of each related legal provision;

[0029] Generate a legal article vector according to the text description of each associated legal article;

[0030] A composite vector is generated based on the legal article vector of each associated legal article.

[0031] Optionally, generating a synthetic vector based on the article vector of each associated article of law includes: averaging the article vector of each associated article of law to obtain the associated article vector of law.

[0032] Optionally, the court opinion part generating unit is further used for:

[0033] Input the pre-obtained legal auxiliary vector and the fact finding vector into each layer of a multi-layer decoder of a text generation model, wherein the Nth layer of the multi-layer decoder receives the output of the N-1th layer and serves as the input of the N+1th layer;

[0034] Inputting the pre-obtained legal auxiliary vector into the maximization layer of the text generation model;

[0035] The output of the last layer of the multi-layer decoder is input into the maximization layer through the linear connection layer of the text generation model, and the maximization layer outputs the court opinion part.

[0036] Optionally, the first layer of the multi-layer decoder receives the court opinion portion of the training data, and the multi-layer decoder decodes the legal auxiliary vector and the fact finding vector according to the court opinion portion of the training data.

[0037] According to one aspect of the present disclosure, a computer device is provided, including: a memory for storing computer executable codes; and a processor for executing the computer executable codes to implement the method described above.

[0038] According to one aspect of the present disclosure, a computer-readable medium is provided, comprising a computer-executable code, wherein the computer-executable code implements the method described above when executed by a processor.

[0039] In the disclosed embodiment, the fact finding part is obtained, a fact finding vector corresponding to the fact finding part is generated, and then the court opinion part is generated based on the pre-acquired legal auxiliary vector and the fact finding vector. In this process, it does not rely on manually written templates, which improves the degree of automation. Since the court opinion part is generated not only by relying on the fact finding vector, but also by relying on the legal auxiliary vector corresponding to the legal auxiliary project, the generated court opinion part is more closely connected with the legal auxiliary projects such as legal provisions and legal consequences, and is more targeted, thereby improving the accuracy of the generated court opinion part. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The above and other objects, features and advantages of the present disclosure will become more apparent through the description of the embodiments of the present disclosure with reference to the following drawings, in which:

[0041] Figure 1A -F shows an interface state diagram when the method for generating a judgment according to an embodiment of the present disclosure is applied;

[0042] Figure 2 A flowchart of a method for generating a judgment according to an embodiment of the present disclosure is shown;

[0043] Figure 3 The figure shows the overall model architecture diagram used for generating a judgment according to an embodiment of the present disclosure.

[0044] Figure 4 A model framework diagram for generating an associated law clause vector according to an embodiment of the present disclosure is shown.

[0045] Figure 5 A block diagram of an apparatus for generating a decision according to an embodiment of the present disclosure is shown;

[0046] Figure 6 A structural diagram of a computer device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0047] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, well-known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.

[0048] The disclosed embodiment can be used to automatically generate a judgment. Specifically, it can be embodied as an automated office system installed inside an institution such as a court. The software of the automated office system is installed inside the local area network of an institution such as a court. When a judgment needs to be generated, the automated office system is logged in. In addition, it can also be embodied as an application (APP) for generating court judgments, which is downloaded and installed in a general-purpose computer (such as a desktop computer, a laptop computer, etc.) to run, and it can execute the function of generating a judgment when it is running.

[0049] Figure 1A -F shows the interface status change when the method for generating a judgment according to an embodiment of the present disclosure is applied.

[0050] The fact finding part and the court opinion part are the two most important parts of the judgment. The fact finding part is the facts of the case determined by the judge after the trial. Since the facts of each case are different, the fact finding part is also different, and it is difficult to generate it through automation. Therefore, for this part, the user (judge) needs to input the automated office system or application through the interface. Figure 1A As shown in the figure, the interface is displayed, prompting the user to enter the fact finding part. Then, the user Figure 1A Enter the fact finding part of the interface.

[0051] The automated office system or application identifies the legal provisions used to generate the court opinion part based on the fact finding part input by the user, such as Figure 1B As shown. The interface lists the relevant legal provisions used in the judgment in detail for the user to confirm. If the user believes that there is something wrong with the legal provision, he can modify it by selecting the "Manual Edit" button on the interface. If the user believes that the application of the legal provision is completely correct, he can select "Confirm" on the interface to confirm and enter the subsequent procedures.

[0052] Next, the automated office system or application automatically determines the legal consequences of the user (the charge in the case of guilt, the determination of innocence or the court's handling measures in the case of innocence) based on the fact-finding part input by the user, and asks the user to confirm. Figure 1C If the user believes that the legal consequences are inappropriate, he / she can modify them by selecting the "Manual Change" button on the interface. If the user believes that the legal consequences are completely correct, he / she can select "Confirm" on the interface to enter the subsequent procedures.

[0053] Next, the automated office system or application determines the part based on the facts input by the user, such as Figure 1B The relevant laws used in the judgment, such as Figure 1C The legal consequences determined in the judgment are automatically generated into the court opinion section, such as Figure 1DAs shown. Unlike the prior art that automatically generates the court opinion part based only on the fact finding part, the embodiment of the present disclosure also takes into account the applicable laws, legal consequences and other legal auxiliary items, so that the generated court opinion part is more closely related to the laws, legal consequences, etc. and is more accurate. Figure 1D If the user believes that the generated court opinion has defects, he / she can still modify it by clicking the "Manual Edit" button. If the user believes that there are no defects, he / she can enter the subsequent procedures by selecting the "OK" button on the interface.

[0054] Figure 1E The judgment automatically generated by the automated office system or application is shown, which includes a fact finding part and a court opinion part, wherein the court opinion part is obtained by Figure 1A -D interface is generated. When the user Figure 1E Drag the scroll bar down on the interface to see the latter part of the judgment. Figure 1F As shown in the figure, after the user drags the scroll bar downward, the interface displays the court opinion section. Figure 1E -F interface, select "Manual Edit" to modify the contents of the judgment, or select "Output" to output (e.g., print) the judgment displayed on the interface.

[0055] Combine the following Figure 2 A method for generating a judgment according to an embodiment of the present disclosure is described in detail, which can be executed by the above-mentioned automated office system or a general-purpose computer installed with the above-mentioned application.

[0056] like Figure 2 As shown, the method for automatically generating the court opinion part of the judgment according to one embodiment of the present disclosure includes:

[0057] Step 110, obtaining the fact finding part of the judgment;

[0058] Step 120, generating a fact determination vector corresponding to the fact determination part;

[0059] Step 130: Generate the court opinion part based on the pre-acquired legal auxiliary vector and the fact finding vector.

[0060] The above steps are described in detail below.

[0061] In step 110, the fact finding part of the judgment can be obtained by Figure 1AAs shown, the interface for inputting the fact finding part is displayed to the user (judge) and the user's input is received to achieve this. It can also be achieved by scanning the paper fact finding part and then converting it into an electronic document through OCR (optical character recognition), etc. The formation of the fact finding part often requires the court to receive the indictment, the judge to investigate the facts of the case, and make a decision after the trial. This process is difficult to complete automatically by a machine. Therefore, the fact finding part is generally completed by a real judge, and the part of obtaining the court's opinion from the fact finding part is expected to be completed by a machine.

[0062] In one embodiment, step 120 is implemented by inputting the fact finding part into a fact finding vector BERT model. The BERT model is introduced below. The full name of the BERT model is Transformer Bidirectional Encoder Representation Model.

[0063] The transformer is a text generation model. It is based on the encoding-decoding model. The encoding model encodes the input text, and then the decoding model decodes it to generate another text, but the text before encoding and the text after decoding may not be the same text. For example, the text before encoding is a news article, and the text after decoding is the generated news summary. In the disclosed embodiment, the text before encoding is the fact finding part of the judgment, and the text after decoding is the generated court opinion part. The model can encode and decode what type of text and what type of text it becomes, which is achieved by training the encoding and decoding models.

[0064] The encoder representation refers to the code encoded in the transformer's encoding model. Bidirectional means that the encoding takes into account both the left-to-right context of the characters in the text before encoding and the right-to-left context. This encoding can better reflect the meaning of the context in the language and has a good prediction effect in the field of language prediction. The transformer bidirectional encoder representation model, namely the BERT model, refers to the transformer's encoding model, which fully considers the left-to-right context and the right-to-left context of the characters in the text before encoding, thus fully reflecting the meaning of the context. It is a known neural network speech model released in 2019.

[0065] Before the BERT model, traditional language transformers or encoder-decoder models used unidirectional language models to learn conventional language representations. As a result of learning, the encoded code, namely the encoder representation, was obtained, which limited the encoding effect of the model. For example, in OpenAI GPT, a left-to-right language model was used. The model can only learn the context of the text before encoding from left to right, and reflect the context from left to right during encoding. In this way, when applied to downstream tasks (that is, the decoder produces another expected text), the text predicted by the downstream task can only reflect the context of the previously predicted text. These limitations are not good for sentence-level prediction tasks, and in some cases may have disastrous consequences. In these cases, it is crucial to combine context in both directions.

[0066] The BERT model is inspired by the cloze task. When training the BERT model, the decoding model needs to combine the left-to-right context of the text before encoding and the right-to-left context of the text before encoding when decoding each word. This model improves the contextual accuracy of the generated code and is often used in scenarios such as text prediction and language dialogue.

[0067] The output of the BERT model is not a general code, but a vector that represents the semantics of the input pre-encoded text. This vector reflects the left-to-right context and the right-to-left context of the encoder text. Pre-encoded texts with different semantics will get different semantic vectors. The closer the meaning of the pre-encoded text, the smaller the distance between the semantic vectors obtained after the BERT model. The farther the meaning of the pre-encoded text, the greater the distance between the semantic vectors obtained after the BERT model.

[0068] The fact finding vector is a vector representing the part of the fact finding. Different fact finding parts correspond to different fact finding vectors. The closer the meanings of the fact finding parts are, the smaller the distance between the corresponding fact finding vectors. The farther the meanings of the fact finding parts are, the larger the distance between the corresponding fact finding vectors. Figure 3 As shown, the text of the fact determination part 105 is input into the fact determination vector BERT model 110, and the fact determination vector 115 is obtained by the fact determination vector BERT model 110.

[0069] Next, in step 130, based on the fact finding vector obtained in step 120 and the pre-obtained legal auxiliary vector (such as Figure 3-4 In one embodiment, the court opinion part is generated by inputting the fact finding vector obtained in step 120 and the pre-obtained legal auxiliary vector into the following example: Figure 3 The text generation model 120 shown is implemented.

[0070] The text generation model is the decoding part included in the transformer mentioned above, which can convert a code encoded into one type of pre-encoded text into another type of decoded text. Specifically, in the embodiment disclosed herein, it can decode the fact determination vector 115 encoded into the fact determination part 105 into the court opinion part 125.

[0071] Legal auxiliary items refer to other items that will affect the court's opinion in the judgment in addition to the fact finding part. They cannot be directly reflected in the fact finding part, but will greatly affect the court's substantive opinion and expression, such as related legal article 195 and legal consequence 175. Legal consequence 175 refers to the result of the court's verdict. For criminal cases, it may be a charge or a declaration of innocence. For civil, administrative and other cases, it may be the handling results of civil, administrative and other cases. The judgment is made based on facts and laws. The court's opinion should be based not only on the facts of the case, but also on the provisions of relevant laws. Therefore, related legal article 195 is a legal auxiliary item. In addition, the court's opinion should be developed around legal consequence 175. Different legal consequences 175 have different elements and different ways of expression. There are great differences in the writing of the court's opinion, but legal consequence 175 is not included in the fact finding part. Therefore, related legal article 195 and legal consequence 175 are both legal auxiliary items.

[0072] The legal assistance vector is a vector encoded by the legal assistance items. For example, the associated legal article vector 185 is a vector encoded by the associated legal article 195, and the legal consequence vector 165 is a vector encoded by the legal consequence 175.

[0073] In the disclosed embodiment, when obtaining the court opinion part, not only the fact finding vector is input into the text generation model, but also the legal assistance vector is input into the text generation model. Since the court opinion part is generated not only by relying on the fact finding vector, but also by relying on the legal assistance vector corresponding to the legal assistance project, the generated court opinion part is more closely connected with the legal assistance projects such as legal provisions and legal consequences, and more targeted, thereby improving the accuracy of the generated court opinion part. In addition, the method that does not rely on manually written templates improves the degree of automation.

[0074] In one embodiment, the fact determination vector BERT model 110 can be pre-trained in the following manner: construct a fact determination part sample set consisting of a large number of fact determination part samples, each fact determination part sample has a fact determination vector label pre-determined by an expert, and the label reflects the context from left to right and the context from right to left of the fact determination part sample; input each fact determination part sample in the fact determination part sample set into the BERT model 110, and the BERT model 110 gives the corresponding fact determination vector determined; compare the determined fact determination vector with the fact determination vector label corresponding to the fact determination part sample; if the ratio of the consistency between the determined fact determination vector in the fact determination part sample set and the corresponding fact determination vector label exceeds a predetermined ratio (for example, 95%), it is considered that the fact determination vector BERT model 110 has been trained; if the consistent ratio does not exceed the predetermined ratio, adjust the weights in the BERT model 110 so that the consistent ratio exceeds the predetermined ratio.

[0075] The present disclosure embodiment adopts the fact-verification vector BERT model 110. Compared with the standard transformer-based text generation model, it can obtain better semantic and grammatical knowledge of vocabulary because it can combine bidirectional context. In the encoding part of the standard transformer structure, it uses multiple layers of encoding layers, similar to Figure 3 The present disclosure adopts the fact-verification vector BERT model 110 to replace the multi-layer encoding layer, which can achieve a better understanding of the semantic context.

[0076] As described above, the legal auxiliary vector includes at least one of the associated law vector 185 and the legal consequence vector 165. Figure 3-4 The generation process of these two vectors in one embodiment is described in detail.

[0077] like Figure 4 As shown, when there are multiple associated legal provisions 195, the associated legal provision vector is a composite vector of multiple associated legal provisions, which is obtained in the following manner: obtaining a text description of each associated legal provision; generating a legal provision vector based on the text description of each associated legal provision; and generating a composite vector based on the legal provision vector of each associated legal provision.

[0078] like Figure 4As shown, in one embodiment, obtaining the text description of each associated legal provision can be achieved by inputting the fact finding part 105 into the associated legal provision identification model 190. The associated legal provision 195 identified by the model is often more than one, such as legal provisions related to conviction, legal provisions related to sentencing, legal provisions related to court jurisdiction, and legal provisions related to litigation procedures. The identification of the associated legal provision 195 by the associated legal provision identification model 190 can refer to the identification of the associated legal provision serial number. Afterwards, it is relatively easy to find the text description of the legal provision corresponding to the serial number in the legal database according to the serial number.

[0079] The above-mentioned associated law article identification model 190 can adopt a general deep learning model, etc., which can be pre-trained in the following training method: construct a fact-finding part sample set composed of a large number of fact-finding part samples, each fact-finding part sample has an associated law article serial number label pre-determined by an expert; each fact-finding part sample in the fact-finding part sample set is input into the associated law article identification model 190, and the associated law article identification model 190 gives the identified associated law article serial number; compare the determined associated law article serial number with the associated law article serial number label corresponding to the fact-finding part sample; if the ratio of the associated law article serial number determined in the fact-finding part sample set and the corresponding associated law article serial number label is consistent with a predetermined ratio (for example, 95%), it is considered that the training of the associated law article identification model 190 is completed; if the consistent ratio does not exceed the predetermined ratio, the weight in the associated law article identification model 190 is adjusted so that the consistent ratio exceeds the predetermined ratio.

[0080] After the serial number of the associated legal provision is identified by the associated legal provision identification model 190 , the text description of the associated legal provision can be searched according to the serial number.

[0081] In addition, the text description of the related legal provision 195 may not be identified by the related legal provision identification model 190, but may be directly input by the user (judge) on the interface. However, the identification by the related legal provision identification model 190 can further improve the automation level of generating the court opinion part 125 in the judgment.

[0082] In one embodiment, after obtaining the text description of the associated legal provision 195, the following can be done: Figure 1B That is, the text description of the identified related legal article 195 is displayed to the user, and the user's correction of the displayed text description of the related legal article 195 is received. The user can Figure 1B to make corrections.

[0083] Next, a legal article vector is generated according to the text description of each associated legal article. In one embodiment, it can be achieved by inputting the text description of each associated legal article into the corresponding legal article vector BERT model 180.

[0084] The legal provision vector BERT model 180 is similar to the fact determination vector BERT model 110 mentioned above, except that the fact determination vector BERT model 110 inputs the fact determination part 105 and outputs the fact determination vector 115; the legal provision vector BERT model 180 inputs the text description of the associated legal provision 195 and outputs the legal provision vector 182.

[0085] The legal article vector 182 output by the legal article vector BERT model 180 is a vector representing a single associated legal article 195. Different associated legal articles 195 have different corresponding legal article vectors 182. The closer the meanings of the associated legal articles 195 are, the smaller the distance between the corresponding legal article vectors 182. The farther the meanings of the associated legal articles 195 are, the larger the distance between the corresponding legal article vectors 182.

[0086] In one embodiment, the legal article vector BERT model 180 can be pre-trained in the following manner: construct a legal article sample set consisting of legal article samples, each legal article sample has a legal article vector label pre-determined by an expert, and the label reflects the context from left to right and the context from right to left of the legal article sample; input each legal article sample in the legal article sample set into the BERT model 180, and the BERT model 180 gives the corresponding legal article vector determined; compare the determined legal article vector with the legal article vector label corresponding to the legal article sample; if the ratio of consistency between the legal article vector determined in the legal article sample set and the corresponding legal article vector label exceeds a predetermined ratio (for example, 95%), it is considered that the legal article vector BERT model 180 has been trained; if the consistent ratio does not exceed the predetermined ratio, adjust the weights in the BERT model 180 so that the consistent ratio exceeds the predetermined ratio.

[0087] After the article vector BERT model 180 obtains each article vector 182, it can generate a synthetic vector, namely, an associated article vector 185, based on the article vector 182 of each associated article. The associated article vector 185 is a vector that comprehensively reflects all associated articles 195. The article vector 182 is a vector that reflects an associated article 195. The article vector 182 of each associated article 195 is first determined, and then the overall associated article vector 185 is determined based on each article vector 182. The associated article vector 185 uses a vector to represent the content of all associated articles. In the subsequent decoding process, the processing overhead is reduced and the processing efficiency is improved without affecting the decoding accuracy.

[0088] In one embodiment, the legal article vectors of each associated legal article are averaged to obtain the associated legal article vector. In other embodiments, the associated legal article vector may be obtained by cascading the legal article vectors of the multiple associated legal articles, and so on. However, compared with the cascading method, the method of averaging the vectors can reduce the dimension of the vector without affecting the processing accuracy, thereby improving the subsequent decoding efficiency.

[0089] In addition, when there is only one associated legal provision 195 identified by the associated legal provision identification model 190, the legal provision vector 182 and the associated legal provision vector 185 can be combined into one, that is, the legal provision vector 182 is obtained by the legal provision vector BERT model 182 based on the unique associated legal provision 195, and the legal provision vector 182 is the associated legal provision vector 185.

[0090] The legal consequence vector 165 is generated based on the legal consequence 175, so the legal consequence 175 must be obtained first. Figure 3 As shown, in one embodiment, the fact finding part 105 can be input into the legal consequence identification model 170, and the legal consequence identification model 170 identifies the legal consequence 175.

[0091] The above-mentioned legal consequence identification model 170 can adopt a general deep learning model, etc., which can be pre-trained in the following training method: construct a fact-finding part sample set composed of a large number of fact-finding part samples, each fact-finding part sample has a legal consequence label predicted by an expert in advance; each fact-finding part sample in the fact-finding part sample set is input into the legal consequence identification model 170, and the legal consequence identification model 170 gives the identified legal consequences; the identified legal consequences are compared with the legal consequence labels corresponding to the fact-finding part samples; if the ratio of the legal consequences identified in the fact-finding part sample set and the corresponding legal consequence labels is consistent with a predetermined ratio (for example, 95%), the legal consequence identification model 170 is considered to have been trained; if the consistent ratio does not exceed the predetermined ratio, the weights in the legal consequence identification model 170 are adjusted so that the consistent ratio exceeds the predetermined ratio.

[0092] In addition, the legal consequence 175 may not be identified by the legal consequence identification model 170, but may be directly input by the user (judge) on the interface. However, the identification by the legal consequence identification model 170 can further improve the automation of generating the court opinion part 125 in the judgment.

[0093] In one embodiment, after the legal consequence identification model 170 identifies the legal consequence 175, the following can be done: Figure 1CThat is, the identified legal consequences 175 are displayed to the user, and the user's amendment to the displayed legal consequences 175 is received. The user can Figure 1C to make corrections.

[0094] The legal consequence vector BERT model 160 is similar to the fact determination vector BERT model 110 mentioned above, except that the fact determination vector BERT model 110 inputs the fact determination part 105 and outputs the fact determination vector 115; the legal consequence vector BERT model 160 inputs the legal consequence 175 and outputs the legal consequence vector 165.

[0095] Legal consequence vector 165 is a vector representing legal consequence 175. Different legal consequences 175 correspond to different legal consequence vectors 165. The closer the legal consequences 175 are, the smaller the distance between the corresponding legal consequence vectors 165. The more distant the meaning of legal consequences 175 is, the larger the distance between the corresponding legal consequence vectors 165 is.

[0096] In one embodiment, the legal consequence vector BERT model 160 can be pre-trained in the following manner: construct a legal consequence sample set consisting of legal consequence samples, each legal consequence sample has a legal consequence vector label pre-determined by an expert; input each legal consequence sample in the legal consequence sample set into the BERT model 160, and the BERT model 160 gives a corresponding legal consequence vector of the judgment; compare the judged legal consequence vector with the legal consequence vector label corresponding to the legal consequence sample; if the ratio of consistency between the judged legal consequence vector in the legal consequence sample set and the corresponding legal consequence vector label exceeds a predetermined ratio (for example, 95%), the legal consequence vector BERT model 160 is considered to have been trained; if the consistency ratio does not exceed the predetermined ratio, adjust the weights in the BERT model 160 so that the consistency ratio exceeds the predetermined ratio.

[0097] After the legal consequence vector BERT model 160 is trained, the legal consequence 175 identified by the legal consequence identification model 170 can be input into the legal consequence vector BERT model 160, and the legal consequence vector BERT model 160 outputs the legal consequence vector 165.

[0098] like Figure 3As shown, in one embodiment, the text generation model 120 includes a court opinion vector generation part 130, a linear connection layer 140, and a maximization layer 150. The court opinion vector generation part 130 generates ideas for forming the legal article opinion part 125, and the ideas are input to the maximization layer 150 through the linear connection layer 140, and the maximization layer 150 specifically expresses the ideas. This solution separates the process of forming ideas and the process of expressing ideas. Compared with the solution of directly forming court opinions without forming ideas, the implementation process is refined, so that the formed court opinion part 125 is more accurate.

[0099] In one embodiment, when the court opinion thinking vector generation part 130 forms a thinking, it is necessary to know the facts of the case, and also to know the relevant laws and legal consequences, because the thinking is the whole process of how to derive the legal consequences from the facts of the case, and the relevant laws are an important basis for how to derive the legal consequences from the facts of the case. Therefore, the fact finding vector 115 and the legal auxiliary vector (including the legal consequence vector 165 and the related law vector 185) are input into the court opinion thinking vector generation part 130, and the court opinion thinking vector is generated by the court opinion thinking vector generation part 130.

[0100] In one embodiment, when the maximum value layer 150 forms the expression of the court opinion part 125, it is necessary to first know the idea of ​​the court opinion part 125 and how to combine the relevant legal provisions and legal consequences to generate a specific expression, so that the generated expression can be closely linked to the legal provisions and legal consequences to achieve a good reasoning effect. Therefore, the court opinion idea vector and the legal auxiliary vector (including the legal consequence vector 165 and the associated legal provision vector 185) are input into the maximum value layer 150, and the maximum value layer 150 generates the court opinion part 125 based on the court opinion idea vector 115 and the legal auxiliary vector.

[0101] In one embodiment, Figure 3 As shown, step 130 includes:

[0102] The pre-obtained legal auxiliary vector and the fact-finding vector are input into each layer of the multi-layer decoder 135 of the court opinion vector generation part 130, and the Nth layer of the multi-layer decoder 135 receives the output of the N-1th layer and serves as the input of the N+1th layer; the pre-obtained legal auxiliary vector is input into the maximization layer 150 of the text generation model 120; the output of the last layer of the multi-layer decoder 135 is input into the maximization layer 150 through the linear connection layer 140 of the text generation model 120, and the court opinion part 125 is output by the maximization layer 150.

[0103] In this embodiment, the court opinion vector generation part 130 adopts a multi-layer decoder 135 structure. Each layer of decoder 135 generates a vector of the upper layer of decoder 135 passed to the layer of decoder 135 based on the vector output by the next layer of decoder 135 of the layer of decoder 135, the fact finding vector 115 and the legal auxiliary vector (including the legal consequence vector 165 and the associated legal article vector 185). The bottom layer of decoder 135, that is, the first layer of decoder, receives the court opinion part of the training data, and then the multi-layer decoder 135 decodes the legal auxiliary vector and the fact finding vector 115 according to the court opinion part of the training data. The top layer of decoder 135 outputs the court opinion vector. Each decoder 135 of the multi-layer decoder 135 structure can extract features from the fact finding vector 115 and the legal auxiliary vector for different aspects, and continuously pass them upward. The more layers there are, the more accurate the learned features are, but the greater the overhead is. In one embodiment, 6 layers of decoders 135 can be set.

[0104] like Figure 3 As shown, in one embodiment, the linear connection layer 140 serves to connect different parts of the input data to each other in some way, for example, by vector crossover. In this way, the input data may contain multiple vectors, the first elements of the multiple vectors are extracted and concatenated, and then the second elements of the multiple vectors are extracted and concatenated behind the concatenated first element string, and so on. Figure 3 In the example, decoder 1 can output the first vector to decoder 2. Decoder 2 generates the second vector and transmits the first and second vectors to decoder 3. Decoder 3 generates the third vector and transmits the first, second and third vectors to decoder 4. The same process is repeated. Finally, the first, second, ... nth vectors output by decoder n are connected into a vector, i.e., the court opinion vector after linear connection, through the linear connection layer 140, and output to the maximum value layer 150. Since the court opinion vector and the legal auxiliary vector (including the legal consequence vector 165 and the associated legal article vector 185) after linear connection are both input to the maximum value layer 150, the court opinion part 125 can be generated by the maximum value layer 150 based on the court opinion vector after linear connection and the legal auxiliary vector.

[0105] After the court opinion portion 125 is generated, it can be Figure 1D As shown, the generated court opinion part 125 is displayed to the user (judge) to receive the user's correction. The user can Figure 1D to make corrections.

[0106] After receiving the user's corrections and confirmations, the fact finding part 105 and the court opinion part 125 can be automatically combined into a judgment.

[0107] The disclosed embodiment adopts a method of fully automatically generating the court opinion part 125 by relying on a model, based on a large amount of data training, without the need for manual template writing, and solves the problems of time-consuming and labor-intensive solutions that rely on templates, too rigid texts, and limited applicable case types. In addition, in the disclosed embodiment, when generating the court opinion part 125, the legal consequences of the case and the applicable legal provisions are taken into consideration, and the relevant information is encoded as a legal auxiliary item in the generation process of the court opinion part 125, thereby increasing the pertinence of the court opinion part 125 to the relevant legal consequences and the close connection with the legal provisions, making up for the deficiency of generating the court opinion part 125 only for the facts of the case.

[0108] Through the test of judgments collected from the China Judgments Online, according to the common ROUGH evaluation standard, the performance of the disclosed embodiment far exceeds other solutions for automatically generating court opinions disclosed in the current literature, and has a good market prospect. The disclosed embodiment can provide moot court capabilities for law-related departments such as procuratorates and law firms.

[0109] According to one embodiment of the present disclosure, Figure 5 As shown, a device 500 for generating a judgment is provided, wherein the judgment includes a fact finding part and a court opinion part, and the device 500 includes:

[0110] A fact finding part acquisition unit 510, used to acquire the fact finding part;

[0111] A fact determination vector generating unit 520, configured to generate a fact determination vector corresponding to the fact determination part;

[0112] The court opinion part generating unit 530 is used to generate the court opinion part according to the pre-acquired legal auxiliary vector and the fact finding vector.

[0113] Optionally, the legal auxiliary vector includes at least one of an associated law provision vector and a legal consequence vector.

[0114] Optionally, the associated legal provision vector is a composite vector of multiple associated legal provisions, which is obtained by:

[0115] Get the text description of each related law;

[0116] Generate a legal article vector according to the text description of each associated legal article;

[0117] A composite vector is generated based on the legal article vector of each associated legal article.

[0118] Optionally, generating a synthetic vector based on the article vector of each associated article of law includes: averaging the article vector of each associated article of law to obtain the associated article vector of law.

[0119] Optionally, the court opinion part generating unit 530 is further used to:

[0120] Input the pre-obtained legal auxiliary vector and the fact finding vector into each layer of a multi-layer decoder of a text generation model, wherein the Nth layer of the multi-layer decoder receives the output of the N-1th layer and serves as the input of the N+1th layer;

[0121] Inputting the pre-obtained legal auxiliary vector into the maximization layer of the text generation model;

[0122] The output of the last layer of the multi-layer decoder is input into the maximization layer through the linear connection layer of the text generation model, and the maximization layer outputs the court opinion part.

[0123] Optionally, the first layer of the multi-layer decoder receives the court opinion portion of the training data, and the multi-layer decoder decodes the legal auxiliary vector and the fact finding vector according to the court opinion portion of the training data.

[0124] Since the implementation details of the above device have been described in the detailed introduction of the method embodiment above, they will not be repeated here for the sake of saving space.

[0125] According to an embodiment of the present disclosure, a method for automatically generating a court opinion portion in a judgment may be performed by Figure 6 The computer device 800 is implemented. Figure 6 800 according to an embodiment of the present disclosure is described below. Figure 6 The computer device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0126] like Figure 6 As shown, the computer device 800 is in the form of a general computing device. The components of the computer device 800 may include but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).

[0127] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 executes the steps of various exemplary embodiments of the present disclosure described in the description of the exemplary method above. For example, the processing unit 810 can execute the following steps: Figure 2 The steps shown in .

[0128] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0129] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0130] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0131] The computer device 800 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 800, and / or communicate with any device that enables the computer device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the computer device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the computer device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0132] It should be understood that the above is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, there are many variations of the embodiments of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0133] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0134] It should be understood that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0135] It should be understood that an element described in singular form herein or shown in the drawings as only one does not limit the number of the element to one. In addition, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be split into multiple modules or elements.

[0136] It should also be understood that the terms and expressions used herein are for description only, and one or more embodiments of this specification should not be limited to these terms and expressions. The use of these terms and expressions does not mean to exclude any equivalent features of the illustrations and descriptions (or parts thereof), and it should be recognized that various modifications that may exist should also be included in the scope of the claims. Other modifications, changes and substitutions may also exist. Accordingly, the claims should be deemed to cover all such equivalents.

Claims

1. A method for generating a judgment, wherein the judgment includes a fact finding part and a court opinion part, characterized in that: include: Obtaining the fact finding portion; Generate a fact finding vector corresponding to the fact finding part, wherein the fact finding vector is a semantic vector corresponding to the fact finding part generated based on the BERT model; The court opinion part is generated according to the pre-obtained legal auxiliary vector and the fact finding vector, wherein the legal auxiliary vector includes an associated legal provision vector and a legal consequence vector.

2. The method according to claim 1, wherein: The associated legal article vector is a composite vector of multiple associated legal articles, which is obtained by: Get the text description of each related law; Generate a legal article vector according to the text description of each associated legal article; A composite vector is generated based on the legal article vector of each associated legal article.

3. The method according to claim 2, wherein: The step of generating a synthetic vector according to the legal article vector of each associated legal article includes: The law article vector of each associated law article is averaged to obtain the associated law article vector.

4. The method according to claim 1, wherein: The generating of the court opinion part according to the pre-obtained legal auxiliary vector and the fact finding vector comprises: Input the pre-obtained legal auxiliary vector and the fact finding vector into each layer of a multi-layer decoder of a text generation model, wherein the Nth layer of the multi-layer decoder receives the output of the N-1th layer and serves as the input of the N+1th layer; Inputting the pre-obtained legal auxiliary vector into the maximization layer of the text generation model; The output of the last layer of the multi-layer decoder is input into the maximization layer through the linear connection layer of the text generation model, and the maximization layer outputs the court opinion part.

5. The method according to claim 4, wherein: The first layer of the multi-layer decoder receives the court opinion portion of the training data, and the multi-layer decoder decodes the legal auxiliary vector and the fact finding vector according to the court opinion portion of the training data.

6. A device for generating a judgment, the judgment comprising a fact finding part and a court opinion part, characterized in that: include: A fact finding part acquisition unit, used for acquiring the fact finding part; A fact determination vector generating unit, used to generate a fact determination vector corresponding to the fact determination part, wherein the fact determination vector is a semantic vector corresponding to the fact determination part generated based on a BERT model; The court opinion part generating unit is used to generate the court opinion part according to the pre-acquired legal auxiliary vector and the fact finding vector, wherein the legal auxiliary vector includes an associated legal provision vector and a legal consequence vector.

7. The device according to claim 6, wherein: The associated legal article vector is a composite vector of multiple associated legal articles, which is obtained by: Get the text description of each related law; Generate a legal article vector according to the text description of each associated legal article; A composite vector is generated based on the legal article vector of each associated legal article.

8. The device according to claim 7, wherein: The step of generating a synthetic vector according to the legal article vector of each associated legal article includes: The law article vector of each associated law article is averaged to obtain the associated law article vector.

9. The device according to claim 6, wherein: The court opinion part generating unit is further used for: Input the pre-obtained legal auxiliary vector and the fact finding vector into each layer of a multi-layer decoder of a text generation model, wherein the Nth layer of the multi-layer decoder receives the output of the N-1th layer and serves as the input of the N+1th layer; Inputting the pre-obtained legal auxiliary vector into the maximization layer of the text generation model; The output of the last layer of the multi-layer decoder is input into the maximization layer through the linear connection layer of the text generation model, and the maximization layer outputs the court opinion part.

10. The device according to claim 9, wherein: The first layer of the multi-layer decoder receives the court opinion portion of the training data, and the multi-layer decoder decodes the legal auxiliary vector and the fact finding vector according to the court opinion portion of the training data.

11. A computer device comprising: A memory for storing computer executable code; A processor, configured to execute the computer executable code to implement the method according to any one of claims 1 to 5.

12. A computer-readable medium, characterized in that The method comprises computer executable codes, which implement the method according to any one of claims 1 to 5 when being executed by a processor.

Citation Information

Patent Citations

  • A method of automatically generating a court opinion based on a description of criminal fact

    CN109408630A