A legal question-and-answer method and device
By entering the reading comprehension module with a collection of legal questions and legal provisions to generate response information, the existing legal question-and-answer system cannot effectively answer non-specific case questions, and the flexibility of accurate answers to various legal questions and legal updates is achieved.
Patent Information
- Application Number
- CN202210116761.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-07
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-02-07
AI Technical Summary
The existing legal question and answer system cannot effectively answer legal questions under non-specific cases, and it is difficult to reason and update the legal knowledge base, resulting in inaccurate answers and difficulty in maintaining them.
By obtaining a collection of legal questions and legal provisions, enter the reading comprehension module to generate response information from consecutive statements, avoid relying on preset question answering pairs, and allow legal provisions and judicial documents to be updated as knowledge bases.
It realizes accurate answers to various types of legal questions, improves the flexibility and maintenance efficiency of the legal question-and-answer system, and can adapt to legal updates.
Smart Images

Figure CN114579717B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer application technology, and more particularly, to a legal question-and-answer method and device. Background Art
[0002] As the popularization of law progresses, more and more people know and understand the law, and more and more people will seek legal solutions when they encounter problems, which leads to more and more people having the need for legal consultation. However, the current number of legal practitioners is insufficient, which makes it difficult to meet the legal consultation needs of a large number of people.
[0003] There is a legal question-and-answer system in the related art, which can receive legal questions raised by users and give answers. However, the related art generally requires pre-storing question-answer pairs, and the answers given are also the answers given by the legal question-answer pairs. In some cases, the answers given according to the above method are not accurate. Summary of the invention
[0004] In view of this, one or more embodiments of this specification provide a legal question-and-answer method and device.
[0005] According to a first aspect of one or more embodiments of this specification, a legal question-answering method is proposed, the method comprising:
[0006] Obtain a collection of legal issues and legal provisions;
[0007] The legal question and the set of legal provisions are input into a reading comprehension module, and the reading comprehension module outputs response information corresponding to the legal question; the reading comprehension module is used to obtain continuous sentences from the set of legal provisions as the response information based on the input legal question.
[0008] According to a second aspect of one or more embodiments of this specification, a legal question-answering device is provided, the device comprising:
[0009] The acquisition module is used to obtain a collection of legal issues and legal provisions;
[0010] A reading comprehension module is used to input the legal issue and the set of legal provisions into the reading comprehension module, and obtain response information corresponding to the legal issue output by the reading comprehension module; the reading comprehension module is used to obtain continuous sentences from the set of legal provisions as the response information based on the input legal issue.
[0011] According to a third aspect of the embodiments of this specification, there is provided a smart court system, the smart court system comprising at least a legal question and answer module;
[0012] The legal question-answering module performs:
[0013] When it is detected that the judge has selected a factual description in an indictment or complaint in the file reading interface and has input a question regarding the selected factual description, the selected factual description and the input question are combined into a legal question, and answer information is obtained through the legal question-answering method described in any one of claims 1 to 5;
[0014] The response information is displayed in the examination paper interface so that the judge can make a judgment with reference to the response information.
[0015] According to a fourth aspect of the embodiments of this specification, a full-process case handling system is provided, wherein the full-process case handling system at least includes a legal question and answer module;
[0016] The legal question-answering module performs:
[0017] After receiving the complaint or indictment submitted by the user, prompt the user to enter a question;
[0018] The factual description in the complaint or indictment and the input question form a legal question, and the answer information is obtained by the legal question-answering method described in any one of claims 1 to 5;
[0019] The response information is displayed to the user.
[0020] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the above-mentioned legal question and answer method is implemented.
[0021] According to a sixth aspect of the embodiments of this specification, there is provided an electronic device, including:
[0022] processor;
[0023] a memory for storing processor-executable instructions;
[0024] The processor implements the above-mentioned legal question-and-answer method by running the executable instructions.
[0025] This specification provides a method and device for generating answers to legal questions, which obtains a legal question and a set of legal questions and inputs both into a reading comprehension module to output answers to legal questions; the reading comprehension module is used to find continuous sentences from the input set of legal provisions as answers to legal questions based on the input legal question. By finding continuous sentences from the set of legal provisions instead of obtaining answers to legal questions from preset question-answer pairs, various types of legal questions can get corresponding answers, thereby improving the accuracy of the generated answers to legal questions.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0028] Figure 1 It is a schematic diagram of a legal question-and-answer system in the related technology shown in this specification.
[0029] Figure 2 It is a flow chart of a legal question-and-answer method shown in this specification according to an exemplary embodiment.
[0030] Figure 3 It is a schematic diagram of a legal question-and-answer system according to a specific embodiment of this specification.
[0031] Figure 4 It is a block diagram of a legal question-and-answer device according to an exemplary embodiment of the present specification.
[0032] Figure 5 It is a hardware structure diagram of an electronic device in which a legal question-and-answer device is located according to an exemplary embodiment of this specification. DETAILED DESCRIPTION
[0033] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0034] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0035] As more and more people have the need for legal Q&A, in order to meet the need for legal Q&A, there is a legal Q&A system in the related technology, such as Figure 1As shown, the legal question-and-answer system pre-stores a knowledge base, which includes several question-answer pairs, each of which includes a legal question and the answer corresponding to the legal question. The method for obtaining these question-answer pairs can be: for several specific high-frequency cases (such as private lending or marriage and family, etc.), manually sort out several question-answer pairs; or for several specific high-frequency cases, collect several question-answer pairs through web crawlers or other methods. The legal question-and-answer system takes the legal question described by the user in words and text as input. After receiving the input legal question, it searches for legal questions similar to the input question in the question-answer pairs. After finding similar legal questions, it uses the answer corresponding to the legal question as the answer to the input legal question and outputs it to the user.
[0036] This legal question-and-answer system has the following defects: first, it can only answer legal questions under specific causes of action; second, even under specific causes of action, it cannot answer all questions raised by users, such as legal questions that are not included in the knowledge base, or legal questions that require reasoning; third, the cost of building a knowledge base is relatively high; fourth, the constructed knowledge base is difficult to update in a timely manner. For example, when the law is updated, it is difficult to promptly determine which questions in the knowledge base are answered correctly and which questions are not applicable to the updated law.
[0037] It can be seen that compared with the question-answering system in general fields, the construction of the legal question-answering system needs to consider the following issues: first, how to make the legal question-answering system have professional legal knowledge (if the legal question-answering system does not have professional legal knowledge, it cannot answer all the user's questions); second, how to make the legal question-answering system have reasoning ability (because only with reasoning ability can it answer legal questions that require reasoning); third, how to maintain the legal question-answering system, in other words, how to make the legal question-answering system adapt to legal updates.
[0038] In order to solve the above problems, it is considered that the reasoning ability of the legal question-answering system can be realized through artificial neural networks. Specifically, it can be realized through some reading comprehension modules. This module has two types of input information, one is the input related to the legal question, and the other is the input related to the answer to the legal question. This reading comprehension module can find continuous sentences as the input answer to the legal question from the input of the answer to the legal question. In addition, considering that the input of the answer to the legal question must be able to answer the input legal question, and the legal provisions are the basis of all legal question answers, the legal provisions can be used as the input related to the answer to the legal question.
[0039] Therefore, this specification provides a method and device for generating answers to legal questions, which obtains a legal question and a set of legal questions and inputs both into a reading comprehension module to output answers to legal questions; the reading comprehension module is used to find continuous sentences from the input set of legal provisions as answers to legal questions based on the input legal question. By finding continuous sentences from the set of legal provisions instead of obtaining answers to legal questions from preset question-answer pairs, various types of legal questions can get corresponding answers, thereby improving the accuracy of the generated answers to legal questions.
[0040] Next, a legal question-and-answer method provided in this manual will be explained in detail.
[0041] like Figure 2 As shown, Figure 2 This is a flowchart of a legal question-and-answer method according to an exemplary embodiment of the present specification, comprising the following steps:
[0042] Step 201, obtaining a set of legal issues and legal provisions.
[0043] In other words, legal questions are legal questions that need to be answered, and the set of legal provisions is the scope of the answer to the legal question. In other words, in order to complete the legal question and answer, it is necessary to first obtain the input required by the reading comprehension module.
[0044] Next, the nouns involved in step 201 will be described in detail.
[0045] First of all, it should be noted that a legal question-and-answer method in this specification can be applied to a legal question-and-answer system, or can be used in other systems that need to answer input legal questions. A legal question-and-answer system or other system can provide legal question-and-answer services to users through a web page, or can provide legal question-and-answer services to users through a client. This specification does not limit the form of a legal question-and-answer system or other system with legal question-and-answer services.
[0046] Legal issues refer to legal issues described in words and language. For example, a legal issue may be "What should I do if I encounter a traffic accident?" The legal issue may be obtained through user input. Under high processing pressure, if the input legal issue cannot be processed immediately, the legal issue will be stored in a storage medium. The obtained legal issue may also be an unprocessed legal issue obtained from the storage medium.
[0047] As for the meaning of the legal provisions collection, the legal provisions collection refers to a collection of legal provisions and / or official documents related to legal provisions. For example, the legal provisions collection may include all the contents of the Patent Law, the Implementing Rules of the Patent Law, and the Patent Examination Guidelines.
[0048] As for the scope of the legal article set, the legal article set may include all legal articles that can be used to answer legal questions and official documents related to the legal articles. In this case, the legal article set may be pre-set. In addition, in order to make step 203 more efficient and improve the accuracy of the response information, the legal question may be screened in advance, and the legal set related to the legal question may be screened out as the acquired legal set. The specific method of screening the legal article set will be described below and will not be repeated here.
[0049] Step 203: input the legal question and the set of legal provisions into a reading comprehension module, and obtain response information corresponding to the legal question output by the reading comprehension module.
[0050] In other words, through the reading comprehension module, continuous sentences can be found from the set of legal provisions obtained in step 201 as response information to the legal question obtained in step 201 .
[0051] Next, the reading comprehension module will be explained. The reading comprehension module refers to a neural network module with the following functions: according to the input legal question (this input is referred to as query), continuous sentences can be obtained from the legal text set (this input is referred to as passage) as the response information. Specifically, it can be represented by a bidirectional encoder based on a transformer (Bidirectional Encoder Representation from Transformers, BERT). For BERT, the output response information is generally output in the following form: the position of the response information in the legal text set (including the start position and the end position). Of course, the reading comprehension module can also be implemented by other neural network modules with the above functions, and this specification does not limit this.
[0052] In addition, considering that there are different types of legal issues, the types of outputs corresponding to different types of issues are different. For example, if the legal issue is "...what should I do" (the content of the ellipsis is a description of the facts, such as a traffic accident, the same below), then you will need to answer the specific solution corresponding to the legal issue; if the legal issue is a multiple-choice type of question (for example, the legal issue is "..., who should compensate"), you will need to answer the result of the choice; if the legal issue is a yes-or-no question (for example, the legal issue is "..., should I compensate"), then you will need to answer a word that represents affirmation or a word that represents negation.
[0053] Therefore, if the types of legal issues can be pre-classified and the classification of legal issue types is used as an input to the reading comprehension module, the efficiency of the reading comprehension module can be improved and the response information can be more accurate. In other words, the method further includes: inputting the legal issue into a classifier to obtain the issue type corresponding to the legal issue. Step 203 specifically includes: inputting the legal issue, the issue type and the set of legal provisions into the reading comprehension module; through the reading comprehension module, according to the legal issue and the issue type, obtaining continuous sentences from the set of legal provisions as the response information corresponding to the legal issue.
[0054] Among them, the above-mentioned classifier is a single classifier, which is used to classify the types of legal issues. The input is the legal issue, and the output is the type of legal issue, that is, a classification result can be selected from multiple pre-set classification results as the output, which can be specifically implemented by connecting a classifier in series with a feature extraction module. The feature extraction module can be any module that can extract language and text features, such as BERT or a long short-term memory neural network (Long Short Term, LSTM). The classifier can be implemented by any neural network that can be used for classification. This specification does not limit the form of the classifier and feature extraction module.
[0055] It should also be noted that for legal questions asking what to do, it is relatively easy to find the answer directly in the legal text set. For multiple-choice legal questions, you can find words that are closer to the meaning of the multiple-choice subject in the question as output. For example, the question is "...who should be responsible among the driver, passers-by and passengers", if the reading module determines that the answer should be "driver", if the driver is not included in the legal text set, it will find words with similar meanings from the legal text set for output, such as "vehicle driver"; in addition, for multiple-choice legal questions, when it is determined to be a multiple-choice question, the legal question can also be used as a passage, so that the reading module can find continuous sentences from the legal question as output. In addition, the continuous sentence can be one continuous sentence or at least two continuous sentences. This manual does not limit the number of continuous sentences output.
[0056] For legal questions of the yes or no type, the output can be found in the set of legal provisions by using words that represent yes or no (the specific output depends on the question); or when determining whether it is of the yes or no type, words that represent yes and negative meanings can also be used as passages, so that the reading comprehension module can find outputs among the words that represent yes and no.
[0057] In addition to the above method of using the question type as the input of the reading comprehension module, it is also possible to obtain a more appropriate set of legal provisions to achieve the effect of improving the execution efficiency of the reading comprehension module and the accuracy of the response information.
[0058] Specifically, the more the content of the legal text set matches the legal question, the higher the accuracy of the response information; the fewer the content of the legal question set, the higher the execution efficiency of the reading comprehension module. In other words, the legal question set needs to have as little content as possible, and the content it contains needs to be the part of the content that best matches the legal question.
[0059] To achieve the above purpose, the following methods can be used to obtain a collection of legal provisions:
[0060] First, the legal provisions related to the legal issue can be retrieved and set in a legal provision set. The legal provisions related to the legal issue can be retrieved by feature similarity, that is, the vectors converted from each legal provision are compared with the vectors converted from the legal issue for similarity, and a suitable set of returned provisions is retrieved.
[0061] In other words, step 201 includes: obtaining problem features corresponding to the legal issue; obtaining article features of each legal article; determining the legal articles related to the legal issue based on the similarity between the article features corresponding to each legal article and the problem features, and setting the determined legal articles in a legal article set.
[0062] Among them, the problem features and the article features can be obtained by encoding the legal problems and legal articles through an encoder. For the encoder, it can be implemented by Bert, or it can be implemented by other encoders that can be used to encode language texts. This specification does not limit the specific implementation method of the encoder. In addition, considering that the description method of legal problems and the description method of legal articles are generally quite different, in order to make the legal article set more appropriate, the encoders used to extract problem features and the encoders used to extract article features can be different encoders trained separately.
[0063] Among them, the similarity between the article features and the problem features corresponding to each legal article can be identified by cosine similarity or represented by Euclidean distance. Of course, it can also be calculated by other algorithms for characterizing vector similarity, which is not limited in this specification.
[0064] Among them, the legal provisions related to the legal issue may be the legal provisions with a similarity greater than a preset similarity threshold as the legal provisions related to the legal issue, or the legal provisions may be sorted from large to small according to the similarity with the legal issue, and the top N legal provisions may be taken as the legal provisions related to the legal issue. Among them, N is a preset positive integer. Of course, the method for determining the legal provisions related to the legal issue is not limited to the above method, and this application does not limit the method for determining the legal provisions related to the legal issue.
[0065] Secondly, by searching for judgment documents related to legal issues, the legal provisions cited by the retrieved judgment documents related to legal issues can be set in the legal provisions set. To search for judgment documents related to legal issues, the search can be performed by feature similarity, that is, the fact descriptions included in each judgment document are converted into feature vectors (hereinafter referred to as document features), and each document feature is compared with the problem feature corresponding to the legal issue to obtain the judgment documents related to the legal issue.
[0066] In other words, step 201 includes: obtaining problem features corresponding to the legal issue; obtaining document features of the fact description included in each judicial document; determining the judicial document related to the legal issue based on the similarity between the document features corresponding to each judicial document and the problem features, and setting the legal provisions cited by the determined judicial document in a legal provision set.
[0067] Among them, the problem features and document features can be obtained through the encoder. Specifically, through the encoder, the language and text corresponding to the legal issue are encoded as problem features, and the fact description included in the judgment document is encoded as document features. The form of the encoder is described in detail above and will not be repeated here. In addition, for the similarity of each document feature and problem feature, it can also be represented by the various similarity characterization methods listed above, which will not be repeated here. As for how to obtain judgment documents related to legal issues, it can also be achieved through the method of obtaining legal provisions related to legal issues mentioned above, which will not be repeated here.
[0068] The factual description of the judgment document refers to the part of the judgment document that describes the circumstances of the case. For example, for the first-instance judgment, this part of the content is generally followed by sentences such as "After trial, this court has determined the facts as follows" and "After trial, this court has determined the facts as follows", so the content after these words can be used as the factual description of the judgment document. In other words, keywords such as "this court", "determination", "facts", etc. can be used to make the content after these keywords and before "this court believes" as the factual description of the judgment document.
[0069] For the second-instance judgment, if the second-instance court agrees with the facts found by the first-instance court, then it will mention in the judgment document that "this court confirms the facts found in the first instance after trial", "the first-instance judgment finds the facts to be true", etc. If the facts found in the first instance are true, the content after "the first-instance court finds the facts" and "the first-instance court finds the facts" and before "this court believes" in the judgment document can be used as the fact description of the judgment document. If the facts found by the second-instance court and the first-instance court are different, it will be stated in the judgment document that "this court finds the following facts in the second instance" or "this court finds the following facts", etc. Therefore, when the above keywords appear, the content after the above keywords and before "this court believes" can be used as the fact description of the judgment document.
[0070] It should be noted that this specification does not limit the method of extracting problem features, document features and article features. As long as the problem features used to characterize the meaning of legal issues, the document features used to characterize the meaning of the factual description included in the judicial document, and the article features used to characterize the meaning of the legal article can be extracted, then the method of obtaining problem features, document features and article features can be used.
[0071] It should also be noted that judgment documents generally cite the Civil Procedure Law of the People's Republic of China or laws and regulations related to it. When the legal issue is not about litigation procedure, the Civil Procedure Law and its related laws are not suitable to be included in the collection of legal provisions. Generally speaking, if a judgment document cites the Civil Procedure Law of the People's Republic of China, it proves that the main part of the judgment document is not about litigation procedure.
[0072] Therefore, in order to improve the efficiency of the reading comprehension module and the accuracy of the response information, when it is determined that a judicial document cites laws other than the Civil Procedure Law of the People's Republic of China, the legal provisions cited by the determined judicial document shall be set in a legal provision collection, including: setting the legal provisions other than the Civil Procedure Law and its related laws cited in the determined judicial document in a legal provision collection.
[0073] Several methods for obtaining a collection of legal provisions are listed above. Of course, the methods for obtaining a collection of legal provisions are not limited to the above methods. They can also be obtained from official documents related to the legal provisions, or judicial documents similar to legal issues can also be included as part of the collection of legal provisions. This manual does not limit the method for obtaining a collection of legal provisions.
[0074] After explaining the method for obtaining a set of legal provisions, a method for improving the accuracy of response information will be described below.
[0075] Considering that if you need to obtain a suitable set of legal provisions, you need to obtain the problem features corresponding to the legal issues. If the problem features obtained in this process are input into the reading comprehension module to assist the reading comprehension module in understanding the legal issues, the accuracy of the response information can be improved.
[0076] Based on the above considerations, the method further includes: obtaining the problem feature corresponding to the legal question. Step 203 specifically includes: inputting the legal question, the problem feature and the set of legal provisions into a reading comprehension module; and obtaining continuous sentences from the set of legal provisions as response information corresponding to the legal question according to the legal question and the problem feature through the reading comprehension module.
[0077] In addition, it should be noted that generally, only the problem features corresponding to the legal issue and the set of legal provisions will not be used as the input of the reading comprehension module. This is done because the problem features corresponding to the legal issue may only extract part of the features of the legal issue. If the original legal issue is not input into the reading comprehension module, the final response information may be inaccurate.
[0078] After explaining the legal question-and-answer method, the training methods of the various neural network modules involved in this specification will also be explained. This specification mainly involves two neural network models: a reading comprehension module and an encoder for extracting various features. These two modules can be trained separately, or the entire system can be trained as a whole. The samples required for training can be samples that have been manually annotated in advance, or samples obtained through other means, which is not limited in this specification.
[0079] The following technical effects are achieved through the above-mentioned legal question-and-answer method: Compared with the legal question-and-answer system in the related art, the legal provisions on which the legal question-and-answer method provided in this specification is based can be all legal provisions. If the search is based on judicial documents, the judicial documents on which it is based can also be all judicial documents. Therefore, the legal question-and-answer method provided in this specification can answer questions under all causes of action. In addition, the method provided in this specification can parse the input legal questions, and can find answers from the legal provision collection, and can answer all questions. Compared with the legal question-and-answer system in the related art, it is not limited by the question-answer pairs in the knowledge base. These can enhance the user experience, so that all the user's legal questions can be answered.
[0080] In addition, the legal question-and-answer method provided in this manual does not require a manually organized structured knowledge base. It only needs to collect and store all legal provisions, judicial documents, and official documents related to legal provisions. In the event of a legal update, it is only necessary to replace the previously stored law with the updated law to deal with the legal update. There is no need to manually judge whether each question is applicable to the updated law, which improves maintenance efficiency.
[0081] It can be seen that the legal question-and-answer method provided in this manual does not require manual organization and design of a structured knowledge base, but instead uses legal provisions and judicial text documents as a knowledge base for answering questions. According to the legal questions raised by the user, the corresponding documents are automatically retrieved from the knowledge base and read and understood to finally get the answers.
[0082] Next, the legal question-and-answer method provided in this specification will be described through a specific embodiment.
[0083] This method is applied to legal question answering systems, such as Figure 3 The legal question-answering system includes three modules: question analysis module, search module and reading comprehension module. Each module performs the following operations to complete the legal question-answering:
[0084] (1) Problem analysis module:
[0085] The problem analysis module is used to achieve two functions, namely problem classification and scenario analysis. Scenario analysis is to obtain the scenario of the legal problem input by the user by analyzing the problem characteristics of the legal problem. Among them, problem classification is a classification task, and scenario analysis is an information extraction task. In other words, the problem analysis module includes the following sub-modules:
[0086] The question classification submodule is used to perform single-label classification tasks (predicting one of K question types, where K is a preset positive integer). The input of this submodule is a legal question, and the output is the question type corresponding to the legal question. This submodule is the module for classifying legal questions mentioned above.
[0087] The scene analysis submodule is used to perform information extraction tasks and extract event information (traffic accidents, loans, divorce, etc.) that occurred in the scene. The input of this submodule is the legal issue, and the output is the problem features corresponding to the legal issue. This submodule is also the encoder mentioned above.
[0088] (2) Search module:
[0089] The retrieval module uses the problem features output by the problem analysis module as input, searches for content directly related to legal issues in a large number of judicial documents, legal provisions, and official documents related to legal provisions, and sets the retrieved content in the legal provision collection. The retrieval module contains the following two submodules: judicial document retrieval submodule and legal regulations retrieval submodule.
[0090] The judicial document retrieval submodule uses the problem features as input, retrieves the judicial documents in the judicial document database whose factual descriptions are similar to the scenarios in the user's legal issues, and returns the laws and regulations cited in the retrieved judicial documents.
[0091] Legal and regulatory retrieval submodule: Based on the characteristics of the question, directly retrieve relevant content from the laws and regulations and return it.
[0092] These two submodules take question features as input and output a subset of legal provisions. The final output of the retrieval module is the union of the two legal provision subsets returned by the judgment document retrieval submodule and the legal provisions retrieval submodule (the union is the legal provision set mentioned above).
[0093] (3) Reading comprehension module:
[0094] The reading comprehension module takes the user's original expression of the legal question, the characteristics of the question and the type of question as the query, and the search results of the retrieval module (a collection of legal provisions) as the passage. The query and passage are used as the input of the legal and regulatory reading comprehension module, and finally a continuous sentence in the passage is output as the response information to the legal question.
[0095] For example, if the input legal question is "My invention patent application was rejected by the State Intellectual Property Office. I am dissatisfied with the rejection decision. What should I do?", the output response information may be "You may request a review from the Patent Reexamination Board within three months from the date of receipt of the notice" (from Article 41 of the Patent Law).
[0096] In addition, the above legal question-and-answer method can be applied to the legal question-and-answer system so that users can directly retrieve the answer information corresponding to the input legal questions, and can also be applied to the smart court system, the full-process case handling system or the legal consultation system. The following will describe in detail how the above method is applied to these systems.
[0097] First, when the above method is applied to the smart court system, it can assist judges in making judgments. Specifically, when the judge selects the fact description part in the indictment or complaint, or the facts recognized by the court, and enters a question (the question here is a question about the fact description. Since the fact description is generally a declarative sentence, the judge can manually type the question about the fact description), the facts and the question can be combined as a legal question, and the answer information can be obtained through the above legal question-and-answer method, so that the judge can use the answer information to assist in making a judgment and improve processing efficiency.
[0098] In other words, the present specification also provides a smart court system, which includes at least a legal question and answer module; the legal question and answer module performs: when it is detected that the judge selects a factual description in an indictment or complaint in the file reading interface and enters a question regarding the selected factual description, the selected factual description and the input question are combined into a legal question, and response information is obtained through the aforementioned legal question and answer method; the response information is displayed in the file reading interface so that the judge can make a judgment with reference to the response information.
[0099] The file reading interface refers to the interface that the judge sees on the terminal to read files, evidence, etc. Through the above-mentioned smart court system, the judge's processing efficiency can be improved and the judge's user experience can be enhanced.
[0100] Secondly, in addition to providing convenience to judges during the litigation process, the above method can also provide convenience to other users, such as plaintiffs, defendants, or attorneys. For example, in the full-process case handling system, when a user submits a complaint / indictment, response information can be provided to the user so that the user can have an expected result for the case.
[0101] Specifically, this specification also provides a full-process case handling system, which includes at least a legal question and answer module; the legal question and answer module performs: after receiving the complaint or indictment submitted by the user, prompting the user to enter questions; combining the factual description in the complaint or indictment and the input questions into legal questions, and obtaining response information through the aforementioned legal question and answer method; and displaying the response information to the user.
[0102] Finally, the above method can also be applied to the legal consultation system. For example, after the user inputs a legal question, the above legal question-and-answer method can be used to provide the user with answer information to reduce the manual workload; or when the respondent provides an answer to the user, the above method can be used to assist the respondent in answering. For example, after the respondent selects the legal question input by the user, the above legal question-and-answer method can automatically provide the respondent with the corresponding answer information, so that the respondent can answer with reference to the answer information.
[0103] It should also be noted that the legal question-and-answer method in this specification can also be applied to other scenarios that require legal questions and answers. The above examples are only examples and do not constitute a limitation on this specification.
[0104] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of a legal question-and-answer device and an electronic device to which it is applied.
[0105] like Figure 4 As shown, Figure 4 is a block diagram of a legal question-and-answer device according to an exemplary embodiment of the present specification, the device comprising:
[0106] The acquisition module 410 is used to acquire a set of legal issues and legal provisions.
[0107] The reading comprehension module 420 is used to input the legal issue and the set of legal provisions into the reading comprehension module, and obtain the response information corresponding to the legal issue output by the reading comprehension module; the reading comprehension module is used to obtain continuous sentences from the set of legal provisions as the response information based on the input legal issue.
[0108] Among them, the acquisition module 410 is specifically used to: obtain the problem features corresponding to the legal issue; obtain the document features of the fact description included in each judicial document; determine the judicial document related to the legal issue based on the similarity between the document features corresponding to each judicial document and the problem features, and set the legal provisions cited by the determined judicial document in the legal provision set.
[0109] In addition, the acquisition module 410 can also be specifically used to: obtain problem features corresponding to legal issues; obtain article features of each legal article; determine the legal articles related to the legal issue based on the similarity between the article features corresponding to each legal article and the problem features, and set the determined legal articles in a legal article set.
[0110] The device also includes a problem feature acquisition module 430 ( Figure 4 The reading comprehension module 420 is specifically used to: input the legal question, the question feature and the set of legal provisions into the reading comprehension module; and obtain continuous sentences from the set of legal provisions as the response information corresponding to the legal question according to the legal question and the question feature through the reading comprehension module.
[0111] The device also includes: a question classification module 440 ( Figure 4(not shown) is used to input the legal question into a classifier to obtain the question type corresponding to the legal question; the reading comprehension module 420 is specifically used to: input the legal question, the question type and the set of legal provisions into a reading comprehension module; through the reading comprehension module, according to the legal question and the question type, obtain continuous sentences from the set of legal provisions as response information corresponding to the legal question.
[0112] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0113] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0114] like Figure 5 As shown, Figure 5 A hardware structure diagram of an electronic device in which the legal question and answer system of the embodiment is located is shown, and the device may include: a processor 1010, a memory 1020 for storing processor executable instructions, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other in communication within the device through the bus 1050.
[0115] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to run the executable instructions to implement the legal question-and-answer method provided in the embodiments of this specification.
[0116] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0117] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0118] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0119] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0120] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0121] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned legal question-and-answer method is implemented.
[0122] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0123] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0124] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended 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 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.
Claims
1. A legal question-and-answer method, comprising: Obtain a collection of legal issues and legal provisions; Inputting the legal question and the set of legal provisions into a reading comprehension module, and obtaining answer information corresponding to the legal question output by the reading comprehension module; The reading comprehension module is used to obtain continuous sentences from the legal text set as the response information according to the input legal question; The method further includes: obtaining a problem feature corresponding to the legal issue, the problem feature being used to represent a scenario where the legal issue exists; wherein an information extraction operation is performed based on the legal issue to extract event information occurring in the scenario, and the event information occurring in the scenario is used as the problem feature corresponding to the legal issue; The step of inputting the legal issue and the set of legal provisions into a reading comprehension module to obtain response information corresponding to the legal issue output by the reading comprehension module includes: inputting the legal issue, the issue characteristics and the set of legal provisions into a reading comprehension module; and obtaining, through the reading comprehension module, continuous sentences from the set of legal provisions as response information corresponding to the legal issue based on the legal issue and the issue characteristics.
2. According to the method of claim 1, the step of obtaining a set of legal issues and legal provisions comprises: Obtain problem features corresponding to legal issues; Obtain document features of factual descriptions included in each judicial document; According to the similarity between the document features corresponding to each judicial document and the feature of the problem, the judicial document related to the legal issue is determined, and the legal provisions cited by the determined judicial document are set in a legal provision collection.
3. According to the method of claim 1, the step of obtaining a set of legal issues and legal provisions comprises: Obtain problem features corresponding to legal issues; Obtain the textual features of each legal provision; According to the similarity between the feature of each legal provision and the feature of the problem, the legal provisions related to the legal problem are determined, and the determined legal provisions are set in a legal provision set.
4. The method according to claim 1, The method further comprises: Inputting the legal issue into a classifier to obtain a problem type corresponding to the legal issue; The step of inputting the legal question and the set of legal provisions into a reading comprehension module and obtaining response information corresponding to the legal question output by the reading comprehension module includes: Inputting the legal issue, the issue type, and the legal provision set into a reading comprehension module; Through the reading comprehension module, according to the legal question and the question type, continuous sentences are obtained from the legal text set as response information corresponding to the legal question.
5. A legal question-and-answer device, comprising: An acquisition module is used to acquire a legal issue and a set of legal provisions, and acquire a problem feature corresponding to the legal issue, wherein the problem feature is used to represent a scenario where the legal issue exists; wherein an information extraction operation is performed based on the legal issue to extract event information occurring in the scenario, and the event information occurring in the scenario is used as the problem feature corresponding to the legal issue; A reading comprehension module, configured to input the legal question and the set of legal provisions into the reading comprehension module, and obtain answer information corresponding to the legal question output by the reading comprehension module; the reading comprehension module is configured to obtain continuous sentences from the set of legal provisions as the answer information according to the input legal question; Among them, the reading comprehension module is used to input the legal issue, the issue characteristics and the set of legal provisions into the reading comprehension module; through the reading comprehension module, based on the legal issue and the issue characteristics, continuous sentences are obtained from the set of legal provisions as response information corresponding to the legal issue.
6. A smart court system, the smart court system comprising at least a legal question and answer module; The legal question-answering module performs: When it is detected that the judge has selected a factual description in an indictment or complaint in the file reading interface and has input a question regarding the selected factual description, the selected factual description and the input question are combined into a legal question, and answer information is obtained through the legal question-answering method described in any one of claims 1 to 4; The response information is displayed in the examination paper interface so that the judge can make a judgment with reference to the response information.
7. A full-process case handling system, the full-process case handling system at least including a legal question and answer module; The legal question-answering module performs: After receiving the complaint or indictment submitted by the user, prompt the user to enter a question; The factual description in the complaint or indictment and the input question form a legal question, and the answer information is obtained by the legal question-answering method described in any one of claims 1 to 4; The response information is displayed to the user.
8. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the legal question-and-answer method as described in any one of claims 1 to 4 by running the executable instructions.
9. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the legal question-and-answer method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for searching law provisions
CN106815263A
Legal provision recommendation method based on LDA (Latent Dirichlet Allocation) topic model
CN108763484A
Knowledge graph driving type law intelligent consultation system
CN110765257A
Legal instrument reading model and construction method
CN112329441A
Legal question and answer method based on weak supervised learning and joint learning mechanism, and equipment
CN113297360A