A method and device for generating a legal consulting report

By constructing a consulting matrix and legal type identification model and generating a legal consulting report, the problem of limited scope of consulting in the existing technology is solved, and effective handling and efficiency improvement of multiple types of legal issues is achieved.

CN110717009BActive Publication Date: 2024-12-13PINGAN ZHITONG CONSULT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910935837.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-29
Publication Date
2024-12-13
Estimated Expiration
2039-09-29

AI Technical Summary

Technical Problem

The existing legal consulting report generation technology can only answer a single type of consulting content, and the scope of consultation is limited and cannot meet the diverse needs of users, resulting in inefficient consultation.

Method used

By receiving legal consultation requests, extracting consulting keywords to build a consulting matrix, importing legal type identification model to determine the consulting type, selecting corresponding report templates and querying standard segments, generating legal consultation reports, and realizing automated output.

Benefits of technology

The scope of application of legal consulting reports has been expanded, users' consulting efficiency in the legal field has been improved, and they can meet the consulting needs of multiple types of legal issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110717009B_ABST
    Figure CN110717009B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of data processing technology, and provides a method and device for generating a legal consultation report, including: receiving a legal consultation request; extracting consultation keywords from the consultation content, and constructing a consultation matrix of the legal consultation request through the consultation keywords; importing the consultation matrix into a preset legal type recognition model to determine the consultation type corresponding to the legal consultation request; selecting a consultation report template associated with the consultation type, and generating a legal consultation report based on the consultation report template and the consultation content. The present invention can automatically generate a legal consultation report corresponding to a user's legal consultation request, improve the accuracy of the legal consultation report, and the above operations can all be completed online, reducing the difficulty for users to obtain legal consultation reports and improving the efficiency of legal consultation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and in particular, relates to a method and device for generating a legal consulting report. Background Art

[0002] With the popularization of legal knowledge, the general public has a certain understanding of civil law, criminal law, etc. When users encounter legal problems in daily life, they often need legal consultation to obtain professional legal advice. Due to the numerous legal clauses, different clauses have corresponding legal procedures, with numerous steps and complex classifications. The procedures required for different case types will also change accordingly. The existing legal consultation report generation technology can often only answer a single type of consultation content, such as querying specific legal clauses or historical legal documents, etc. The consultation scope of the legal consultation report is relatively small and cannot meet the consultation needs of users, thereby reducing the scope of application of the legal consultation report and the consultation efficiency of users. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a method and device for generating a legal consultation report to solve the problem that the existing legal consultation report generation technology can often only answer a single type of consultation content, the consultation scope of the legal consultation report is relatively small, and it cannot meet the user's consultation needs, thereby reducing the scope of application of the legal consultation report and the user's consultation efficiency.

[0004] A first aspect of an embodiment of the present invention provides a method for generating a legal consulting report, comprising:

[0005] Receiving a request for legal advice; the request for legal advice includes advice content;

[0006] Extract consulting keywords from the consulting content, and construct a consulting matrix of the legal consulting request through the consulting keywords;

[0007] Importing the consultation matrix into a preset legal type recognition model to determine the consultation type corresponding to the legal consultation request;

[0008] Selecting a consulting report template associated with the consulting type, and searching for standard paragraphs corresponding to each consulting keyword in the consulting content;

[0009] The standard paragraph is imported into the consulting report template to generate a legal consulting report.

[0010] A second aspect of an embodiment of the present invention provides a device for generating a legal consulting report, including:

[0011] A legal consultation request receiving unit, used to receive a legal consultation request; the legal consultation request includes consultation content;

[0012] A consultation matrix construction unit, used to extract consultation keywords from the consultation content and construct a consultation matrix of the legal consultation request through the consultation keywords;

[0013] A consultation type identification unit, used for importing the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request;

[0014] A legal consultation template selection unit, used to select a consultation report template associated with the consultation type, and query the standard paragraphs corresponding to each of the consultation keywords in the consultation content;

[0015] The legal consulting report generating unit is used to import the standard paragraph into the consulting report template to generate a legal consulting report.

[0016] A third aspect of an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the first aspect when executing the computer program.

[0017] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the first aspect are implemented.

[0018] The method and device for generating a legal consulting report provided by the embodiment of the present invention have the following beneficial effects:

[0019] In an embodiment of the present invention, a user can send a legal consultation request to a device for generating a legal consultation report, and extract consultation keywords contained in the consultation content from the legal consultation request, and construct a consultation matrix corresponding to the legal consultation request based on the consultation keywords. The consultation matrix can represent the characteristic content of the legal consultation request, reduce the interference of invalid characters on the characteristic content, and reduce the amount of calculation of the device while ensuring recognition accuracy; then import the consultation matrix into the legal type recognition model, obtain the consultation type corresponding to the legal consultation request, extract the consultation report template of the consultation type from the database, thereby determining the consultation result in the consultation report template according to the consultation content, importing the consultation result into the legal consultation template, and generating a legal consultation report, thereby achieving the purpose of automatically outputting the legal consultation report. Compared with the existing legal consultation report generation technology, the present invention can parse the user's consultation content, output a consultation matrix that can represent the characteristic information of the consultation content, and identify the consultation type of the consultation content through the consultation matrix. Since different consultation types involve different legal clauses and legal process steps, after determining the consultation type, the corresponding consultation report template can be selected, and the legal consultation report required by the user can be generated according to the consultation report template and the consultation content. The legal consultation template and the type of consultation content can be adaptively adjusted, which can meet the consultation of multiple types of legal issues, expand the scope of application of the legal consultation report, and effectively improve the user's consultation efficiency in the legal field. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0021] Figure 1 This is a flow chart of a method for generating a legal consulting report provided by the first embodiment of the present invention;

[0022] Figure 2 This is a specific implementation flow chart of a method for generating a legal consulting report provided by the second embodiment of the present invention;

[0023] Figure 3 This is a specific implementation flow chart of a method S201 for generating a legal consulting report provided by the third embodiment of the present invention;

[0024] Figure 4 This is a specific implementation flow chart of a method S103 for generating a legal consulting report provided by the fourth embodiment of the present invention;

[0025] Figure 5This is a specific implementation flow chart of a method for generating a legal consulting report provided by the fifth embodiment of the present invention;

[0026] Figure 6 This is a specific implementation flow chart of a method S102 for generating a legal consulting report provided by the sixth embodiment of the present invention;

[0027] Figure 7 This is a specific implementation flow chart of a method S102 for generating a legal consulting report provided by the seventh embodiment of the present invention;

[0028] Figure 8 It is a structural block diagram of a device for generating a legal consulting report provided by an embodiment of the present invention;

[0029] Fig. 9 It is a schematic diagram of a terminal device provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0031] In an embodiment of the present invention, a user can send a legal consultation request to a device for generating a legal consultation report, and extract consultation keywords contained in the consultation content from the legal consultation request, and construct a consultation matrix corresponding to the legal consultation request based on the consultation keywords. The consultation matrix can represent the characteristic content of the legal consultation request, reduce the interference of invalid characters on the characteristic content, and reduce the amount of calculation of the device while ensuring recognition accuracy; then import the consultation matrix into a legal type recognition model, obtain the consultation type corresponding to the legal consultation request, extract a consultation report template of the consultation type from a database, and determine the consultation result in the consultation report template according to the consultation content, import the consultation result into the legal consultation template, and generate a legal consultation report, thereby achieving the purpose of automatically outputting the legal consultation report, and solving the problem that the existing legal consultation report generation technology can often only answer a single type of consultation content, and the consultation scope of the legal consultation report is relatively small, which cannot meet the consultation needs of the user, thereby reducing the scope of application of the legal consultation report and the consultation efficiency of the user.

[0032] In the embodiment of the present invention, the execution subject of the process is a terminal device, which includes but is not limited to: a server, a computer, a smart phone, a tablet computer, and other devices capable of executing the generation operation of a legal consulting report. Figure 1 The following is a flowchart of the method for generating a legal consulting report provided by the first embodiment of the present invention, which is described in detail as follows:

[0033] In S101, a legal consultation request is received; the legal consultation request includes consultation content.

[0034] In this embodiment, if the terminal device is a server, that is, it can receive legal consultation requests sent by other devices at a remote end. In this case, the user can create a legal consultation request on the user terminal and send the legal consultation request to the device for generating the legal consultation report. Preferably, the user can install a client matching the server on the local user terminal. Before the user wants to send a legal consultation request to the server, the user needs to log in on the client. If the server detects that the user account logged in by the user is a legal account, a communication link is established between the client and the user terminal through the client. When the user terminal sends a legal consultation request to the server, it can call the client to encrypt the legal consultation request through a preset authorization code. After the server receives the encrypted legal consultation request, it can decrypt the legal consultation request through the matching authorization code. If the decryption is successful, the legal consultation request is identified as a legal request, and the operations of S102 and S104 are performed on the legal consultation request; otherwise, if the decryption is unsuccessful, the legal consultation request is identified as an invalid request and is not responded to. The device for generating the legal consultation report can add each received legal consultation request to the response queue and determine the response order according to the response priority of each legal consultation request. The response priority can be determined based on the receiving time, or based on the user level of the requesting user corresponding to the legal consultation request, or can be calculated based on multiple parameters. The legal consultation report generation device can create at least one response thread to extract the legal consultation request from the response queue to perform the report generation operation.

[0035] In this embodiment, the terminal device can also be a self-service consultation terminal, which is configured with an interactive interface, such as a touch screen or a display including a numeric keyboard, etc. In this case, the user can input the required consultation content in the self-service consultation terminal, and by clicking the consultation confirmation button configured on the interactive interface, the self-service consultation terminal will create a corresponding legal consultation request based on the consultation content input by the user, and then execute subsequent response operations.

[0036] In this embodiment, the legal consultation request includes consultation content, which can be a character string of the user's natural language description of the required consultation content, or can be generated based on the selected option by checking the option associated with the consultation content in the preset consultation interface. Optionally, the legal consultation request also includes a report type, and the terminal device can output different types of legal consultation reports, such as flow charts, legal documents, legal maps, etc. The user can select the report type of this request from the output candidate report types of the terminal device according to their own needs, and add the report type to the legal consultation request. In S104, the terminal device can select the associated legal report template according to the consultation type and report type.

[0037] In S102, consulting keywords are extracted from the consulting content, and a consulting matrix of the legal consulting request is constructed using the consulting keywords.

[0038] In this embodiment, after receiving a legal consultation request, the legal consultation request can be parsed to obtain the consultation content carried by the legal consultation request, and the consultation keywords of the consultation content can be extracted through a preset semantic analysis algorithm, and a consultation matrix of the legal consultation request can be constructed through multiple consultation keywords.

[0039] Optionally, in this embodiment, the way to construct the consultation matrix can be: the terminal device is provided with a key dictionary, the key dictionary contains multiple candidate keywords, and corresponding word vectors are configured for different candidate keywords. The terminal device can identify whether the consultation content contains candidate keywords pre-defined in the key dictionary. If it does, the candidate keywords contained are identified as consultation keywords, and the word vectors corresponding to each consultation keyword are encapsulated to generate a consultation matrix. Preferably, the terminal device can set the weight of the word vector according to the order in which each consultation keyword appears in the consultation content. In this case, the terminal device can create a dimension in the consultation matrix to record the weight of the corresponding word vector in the consultation content. For example, if the word vector is an n-dimensional word vector, and the consultation content contains m consultation keywords, without adding weights, the constructed consultation matrix is ​​an n*m matrix. If it is necessary to add a dimension according to the weight value of each consultation keyword in the consultation content, each word vector needs to add a dimension, that is, adjust to an n+1-dimensional word vector, so that the constructed consultation matrix is ​​a (n+1)*m matrix. Of course, if in addition to increasing the weight value corresponding to the number of occurrences, you also need to add corresponding weight values ​​according to the occurrence position, then you can expand the word vector according to actual needs and expand the word vector to an n+p-dimensional word vector, where n is the number of dimensions originally contained in the word vector, and p is the number of weight values ​​that need to be added.

[0040] In S103, the consultation matrix is ​​imported into a preset legal type recognition model to determine the consultation type corresponding to the legal consultation request.

[0041] In this embodiment, after the terminal device outputs the consultation matrix, it can import the consultation matrix into a legal type recognition model. The legal type recognition model can be a neural network in which a plurality of different type labels are arranged. After the terminal device imports the consultation matrix into the neural network, it can output the matching probability corresponding to each type label, and then select a type label with the highest matching probability as the consultation type that matches the legal consultation request.

[0042] In this embodiment, since legal business includes multiple fields, and different legal stages in different fields also correspond to different legal processes, in order to select a suitable legal report template, the terminal device needs to accurately identify the consultation type of the legal consultation request. Specifically, the consultation type includes but is not limited to: pre-litigation consultation type, in-litigation consultation type, post-litigation consultation type, evidence validity consultation type, evidence invalidation consultation type, judgment pre-judgment consultation type, etc. It should be noted that the consultation type can be divided based on the litigation stage. In this case, the consultation type can cover various application scenarios and links such as pre-litigation consultation services for parties, in-litigation judges’ judgments, and post-litigation auxiliary execution; of course, the consultation type can also be divided according to the fields involved in the litigation, for example, divided into: civil litigation type and criminal litigation type, etc.

[0043] Optionally, in this embodiment, before the terminal device imports the consultation matrix into the legal type recognition model, it can pre-process the consultation matrix according to the standard input template of the legal type recognition model, that is, the legal type recognition model stipulates the matrix size of the input consultation matrix. If it is detected that the consultation matrix is ​​smaller than the standard matrix size, invalid characters can be filled into the consultation matrix, and a character shielding matrix can be generated according to the position of the invalid characters filled in. When the loss rate is subsequently calculated, the loss value corresponding to the invalid characters can be filtered through the character shielding matrix to avoid the influence of invalid characters on the final output result; if it is detected that the consultation matrix is ​​larger than the standard matrix size, the consultation matrix can be reduced in dimension through the preset pooling matrix, thereby ensuring that the consultation matrix after dimension reduction is consistent with the standard matrix size. By standardizing the consultation matrix, the recognition efficiency of the legal type recognition model can be improved.

[0044] In S104, a consulting report template associated with the consulting type is selected, and the standard paragraphs corresponding to the consulting keywords in the consulting content are searched.

[0045] In this embodiment, the terminal device may create a standard segment library, which may include segment templates. The terminal extracts related segment templates from the segment templates according to consulting keywords, and adjusts the segment templates according to the consulting keywords to obtain various standard segments.

[0046] In this embodiment, the terminal device can store consultation report templates of various consultation types in the template database. After determining the consultation type of the current legal consultation request, the associated consultation report template is extracted from the template database, and the corresponding consultation results are queried according to the consultation content, and each consultation result is imported into the legal consultation template to generate a legal consultation report. The terminal device can output the legal consultation report through the local display interface. Of course, the terminal device can identify the user account carried in the legal consultation request, and send the legal consultation report to the user terminal or the mailbox of the user account associated with the user account. Since the terminal device can receive legal consultation requests initiated by each user, in this case, it takes a certain response time for the terminal device to process the legal consultation request. At this time, the user can perform other operations after sending the legal consultation request. After the terminal device outputs the corresponding legal consultation report, it will be sent to the user terminal or the mailbox of the user account, which reduces the waiting time of the user.

[0047] In S105, the standard paragraph is imported into the consulting report template to generate a legal consulting report.

[0048] In this embodiment, the terminal device can identify the consulting project corresponding to each standard paragraph and fill it into the display area of ​​the consulting project in the legal report template. After importing each standard paragraph, a legal consulting report is generated.

[0049] Optionally, after S105, it may also include: the terminal device may receive the report evaluation information returned by the user terminal based on the legal consultation report. If the evaluation score of the report evaluation information is greater than the preset effective score, the legal consultation report is identified as a valid consultation report, that is, the consultation result is consistent with the user's actual consultation needs. The terminal device may perform a posteriori training and learning on the above-mentioned legal type recognition model through the effective consultation report, and optimize the learning parameters in the model, thereby improving the recognition accuracy of the legal type recognition model. Of course, if the model that outputs the consultation results based on the consultation content is also a neural network, the consultation results and consultation content contained in the effective consultation report can also be used as training samples to optimize the learning parameters of the consultation result recognition model.

[0050] In this embodiment, it can be seen from the above that in a method for generating a legal consultation report provided by an embodiment of the present invention, a user can send a legal consultation request to a device for generating a legal consultation report, and extract consultation keywords contained in the consultation content from the legal consultation request, and construct a consultation matrix corresponding to the legal consultation request based on the consultation keywords. The consultation matrix can represent the characteristic content of the legal consultation request, reduce the interference of invalid characters on the characteristic content, and reduce the amount of calculation of the device while ensuring recognition accuracy; then import the consultation matrix into the legal type recognition model, obtain the consultation type corresponding to the legal consultation request, extract the consultation report template of the consultation type from the database, thereby determining the consultation result in the consultation report template according to the consultation content, importing the consultation result into the legal consultation template, generating a legal consultation report, and achieving the purpose of automatically outputting the legal consultation report. Compared with the existing legal consultation report generation technology, the present invention can parse the user's consultation content, output a consultation matrix that can represent the characteristic information of the consultation content, and identify the consultation type of the consultation content through the consultation matrix. Since different consultation types involve different legal clauses and legal process steps, after determining the consultation type, the corresponding consultation report template can be selected, and the legal consultation report required by the user can be generated according to the consultation report template and the consultation content. The legal consultation template and the type of consultation content can be adaptively adjusted, which can meet the consultation of multiple types of legal issues, expand the scope of application of the legal consultation report, and effectively improve the user's consultation efficiency in the legal field.

[0051] Figure 2 The following is a flowchart showing a specific implementation of a method for generating a legal consulting report provided by the second embodiment of the present invention. Figure 2 , relative to Figure 1 The embodiment, a method for generating a legal consulting report provided by the embodiment, further includes: S201 to S204, which are described in detail as follows:

[0052] Furthermore, before importing the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request, the method further includes:

[0053] In S201, a plurality of historical legal texts are obtained, and training matrices of the respective historical legal texts are output respectively.

[0054] In this embodiment, the terminal device can train and learn the classification model network to be trained by acquiring multiple different historical legal texts, so that the classification model network can be matched with the current application scenario. Based on this, the terminal device can extract multiple historical legal texts from the legal text library. The legal text library contains different types of historical legal texts, and the text types include but are not limited to: historical consulting reports, judgment reports, legal clause texts, legal interpretation texts, legal field articles and other legal-related texts. Preferably, the terminal device can build an expert knowledge base, and through legal experts inputting the legal knowledge standard system and framework corresponding to each civil and criminal case, solve the problem of knowledge authority in the legal knowledge map from the root, such as filling in the judgment report of a representative legal case. It should be noted that each historical legal text is provided with a legal label, which is used to limit the text type of the historical legal text.

[0055] Optionally, after receiving the historical legal text, the terminal device can judge its legality and train the classification model network through the legal historical legal text. For example, for the legal clause text, if the same legal clause is revised during use, the terminal device can identify the revision time of the legal clause and select the latest revision version of the legal clause text as the legal historical legal text, while other versions of the legal clause text are identified as invalid historical legal texts. For the litigation judgment text, if there is a successful review judgment on the litigation judgment text, the litigation judgment text is identified as an invalid historical legal text.

[0056] In this embodiment, after acquiring the historical legal text, the terminal device can also extract the legal keywords contained in the historical legal text and construct a legal matrix based on the legal keywords. The specific method of generating the legal matrix can refer to the relevant description of S102, which will not be repeated here.

[0057] In S202, each of the training matrices is classified based on the text type corresponding to the historical legal text, and divided into a plurality of sample training groups; all the training matrices in the sample training group correspond to the same text type.

[0058] In this embodiment, after generating the training matrices for each historical legal text, the terminal device can determine the sample training group corresponding to the training matrix according to the text type of the historical legal text to which the training matrix belongs, thereby being able to divide the training matrices belonging to the same text type into the same sample training group, thereby being able to adjust the training parameters of each sample training group according to the characteristics of different text types, thereby improving the accuracy of subsequent training operations.

[0059] In S203, the training efficiency associated with the text type is queried, and the preset classification model network is trained and learned with the training matrix in each of the sample training groups at the training efficiency of the sample training group until the loss function of the classification model network is less than a preset loss threshold.

[0060] In this embodiment, the terminal device can pre-configure corresponding training efficiencies for different text types. The larger the value of the training efficiency, the smaller the corresponding number of training times. Although the training efficiency is improved, the corresponding traversal effect is lower; conversely, if the value of the training efficiency is smaller, the corresponding number of training times is greater, and the corresponding traversal effect is higher. The terminal device can configure matching training efficiencies according to the characteristics of different text types. For example, for legal clause texts, the reliability and stability are higher, and the corresponding training efficiency value is smaller; while for legal consulting texts, since they are related to the knowledge level of the consultant, their reliability is lower and the occasionality is also higher, a higher training efficiency can be configured.

[0061] Optionally, in addition to configuring the corresponding training efficiency according to the text type, the terminal device can also configure the training order of each sample training group. Since the classification model network needs to first build a legal clause library, the sample training group of the legal clause text type can be used as the first training group, and the training order of each sample training group can be determined in turn based on the reliability of the legal status within the text type, and the classification model network can be trained and learned based on the training order.

[0062] In this embodiment, the terminal device trains and learns the classification model network with the training efficiency corresponding to the sample training group, and obtains the loss rate of the output labels corresponding to all training matrices in the training sample group. If the loss rate is less than the preset loss threshold, it is recognized that the training for the training sample group has been completed, and the next training sample group is trained and learned, and the above operation is repeated until the training operation is performed on all training sample groups, and it is recognized that the classification model network has been adjusted.

[0063] In S204, the trained classification model network is identified as the legal type identification model.

[0064] In this embodiment, if the classification model network has completed the training and learning operations for all training sample groups, the trained classification model network can be identified as the above-mentioned legal type recognition model.

[0065] In an embodiment of the present invention, by acquiring historical legal texts and dividing them into different training sample groups based on the text types associated with the historical legal texts, and configuring different learning efficiencies, it is possible to reduce the number of training times while ensuring the accuracy of the training operation. For training sample groups with higher reliability, multiple training times are performed, while for training samples with lower reliability, fewer training times are performed.

[0066] Figure 3 The flowchart of S201 of the method for generating a legal consulting report provided by the third embodiment of the present invention is shown. Figure 3 , relative to Figure 2 In the embodiment described, a method S201 for generating a legal consulting report provided in this embodiment includes: S2011 to S2015, which are described in detail as follows:

[0067] Furthermore, the step of acquiring a plurality of historical legal texts and outputting training matrices of the respective historical legal texts includes:

[0068] In S2011, candidate keywords are extracted from a target historical legal text by using a semantic recognition algorithm; the target historical legal text is any one of a plurality of historical legal texts.

[0069] In this embodiment, the terminal device is provided with a semantic parsing algorithm, which can identify the correlation between each character in the target historical legal text. If the correlation between any two or more characters is greater than a preset correlation threshold, the above-mentioned multiple characters are identified as the same phrase, so that the target historical legal text can be divided into multiple candidate keywords. The terminal device can extract candidate keywords from the keywords based on the part of speech of each keyword. For example, noun keywords can be selected as candidate keywords.

[0070] Optionally, the terminal device can pre-process each candidate keyword. The terminal device can obtain the part-of-speech field to which each candidate keyword belongs, and determine the weight value of the candidate keyword based on the relevance of the part-of-speech field with the legal field. When selecting sample keywords, the terminal device can select candidate keywords with a higher correlation with the legal field as sample keywords and construct a training matrix.

[0071] In S2012, the first occurrence number of the candidate keyword in the target historical legal text is counted, and the word frequency parameter of the candidate keyword is determined according to the first occurrence number.

[0072] In this embodiment, the terminal device can count the number of times the candidate keyword appears in the target historical legal text, that is, the first number of occurrences mentioned above. The terminal device can calculate the word frequency parameter of the candidate keyword based on the first number of occurrences, specifically, the value of the first number of occurrences can be directly used as the word frequency parameter, or the ratio between the total number of characters contained in the target historical legal text and the first number of occurrences can be used as the word frequency parameter.

[0073] In S2013, the second number of occurrences of the candidate keyword in all the historical legal texts is identified, and the inverse text parameter of the candidate keyword is determined according to the second number of occurrences.

[0074] In this embodiment, in addition to identifying the first number of occurrences of the candidate keyword in the target historical legal text, the terminal device can also identify the second number of occurrences in all historical legal texts. If the candidate keyword has a higher number of occurrences in the text to which it belongs and a lower number of occurrences in other historical legal texts, it means that the candidate keyword is a characteristic keyword in the target historical legal text, and can better express the text content of the target historical legal text. Therefore, it is necessary to count the second number of occurrences in the historical legal text and use the second number of occurrences as an inverse text parameter.

[0075] In S2014, the text feature value of the candidate keyword is calculated based on the word frequency parameter and the inverse text parameter.

[0076] In this embodiment, after calculating the word frequency parameter and the inverse text parameter, the terminal device can calculate the text feature value of the candidate keyword. Specifically, the ratio between the word frequency parameter and the inverse text parameter can be calculated. If the numerical value of the ratio is larger, it means that the frequency of appearance in the target historical legal text is higher, and the frequency of appearance in other historical legal texts is lower, then the representativeness of the text characteristic corresponding to the candidate keyword is stronger, and the text feature value is calculated based on the above two parameters.

[0077] In S2015, candidate keywords whose text feature values ​​are greater than a feature threshold are selected as sample keywords, and the training matrix of the target historical legal text is constructed through the sample keywords.

[0078] In this embodiment, after calculating the text feature value of each candidate keyword, the terminal device may select the candidate keyword whose text feature value is greater than the feature threshold as the sample keyword, and generate a training matrix according to the sample keywords.

[0079] In the embodiment of the present invention, by identifying the word frequency parameters and inverse text parameters of each candidate keyword, candidate keywords with higher text feature values ​​can be selected as sample keywords, thereby improving the representativeness of the training matrix for the content features of historical legal texts.

[0080] Figure 4 The specific implementation flow chart of the method S103 for generating a legal consulting report provided by the fourth embodiment of the present invention is shown. Figure 4 , relative to Figure 1 In the embodiment, S103 of a method for generating a legal consulting report provided in this embodiment includes: S1031 to S1034, which are described in detail as follows:

[0081] Furthermore, the step of importing the consultation matrix into a preset legal type recognition model to determine the consultation type corresponding to the legal consultation request includes:

[0082] In S1031, the consultation matrix is ​​imported into the legal field submodule in the legal type identification model to identify the consultation field of the legal consultation request.

[0083] In this embodiment, the legal type recognition model includes three levels, namely, the legal field submodule, the associated clause recognition submodule and the fully connected layer. The optional range of the consultation type is narrowed down in turn through the three levels, so as to accurately identify the consultation type of the legal consultation request.

[0084] In this embodiment, the terminal device can import the consulting matrix constructed by multiple consulting keywords into the legal field sub-model, identify the matching factors between each consulting keyword and each candidate field, and calculate the matching degree corresponding to the candidate field based on the matching factors of all consulting keywords for the same candidate field, and select the candidate field with the highest matching degree as the consulting field of the legal consulting request. Specifically, the terminal device is provided with a consulting field dictionary, which contains multiple identifiable consulting fields and is associated with corresponding field keywords for each consulting field. The terminal device can determine whether the consulting keyword is within the field keyword associated with the consulting field, thereby identifying the matching degree between the legal consulting request and the consulting field based on the number of consulting keywords included.

[0085] In S1032, a standard legal text associated with the consulting field is selected, and the standard legal text is used as a sample library of the associated clause identification submodule in the legal type identification model.

[0086] In this embodiment, different consulting fields correspond to different legal clauses, and different legal clauses are provided with corresponding standard legal texts, which can be the definition text and the interpretation text of the legal clause. The above two types of texts constitute the standard legal text of the legal clause. The terminal device can select the legal clauses associated with the consulting field, obtain the standard legal texts of each associated legal clause, and construct a sample library of the associated clause identification submodule based on all the standard legal texts. In the subsequent associated legal clause identification operation, the legal regulations associated with the consulting content will be extracted from the legal clauses recorded in the sample library, thereby reducing the number of matching legal clauses and improving the accuracy and efficiency of identification.

[0087] In S1033, the consulting content is imported into the associated clause identification submodule, and the associated legal clauses of the legal consulting request are output.

[0088] In this embodiment, after the terminal device is configured with the sample library of the associated clause identification submodule, it can import the consulting content into the associated clause identification submodule to identify the associated legal clauses related to the consulting content.

[0089] In S1034, the associated legal clauses, the consulting field, and the consulting matrix are input into the fully connected layer in the legal type recognition model, and the consulting type is output.

[0090] In this embodiment, after the terminal device identifies the associated legal terms and consulting fields, it can import the above two parameters and the consulting matrix into the fully connected layer at the same time, so as to calculate the correlation between each candidate type in the fully connected layer and the above three parameters, that is, the probability value of the legal consulting request being the candidate type, and select the candidate type with the largest probability value as the consulting type of the legal consulting request. Preferably, when the legal consulting report is subsequently produced, the associated legal terms can also be identified as a sample library of the consulting result recognition model, and the related paragraphs can be extracted from the associated legal terms to generate consulting results.

[0091] In the embodiment of the present invention, the legal type recognition model is divided into three levels, so that the scope of consultation types can be gradually narrowed, and the accuracy and efficiency of consultation type recognition can be improved.

[0092] Figure 5 The following is a flowchart showing a specific implementation of a method for generating a legal consulting report provided by the fifth embodiment of the present invention. Figure 5 , relative to Figure 1The embodiment, a method for generating a legal consulting report provided by the embodiment, after importing the consulting matrix into a preset legal type identification model and determining the consulting type corresponding to the legal consulting request, further includes: S501 to S504, which are specifically described as follows:

[0093] Furthermore, after selecting the consulting report template associated with the consulting type and generating a legal consulting report according to the consulting report template and the consulting content, it also includes:

[0094] In S501, if the consultation type is a litigation judgment type, the consultation content is imported into a preset evidence analysis model to output a first judgment result.

[0095] In this embodiment, in addition to responding to the user's consultation request, the terminal device can also assist the legal personnel in making a judgment with the help of the legal consultation report. In this case, when the consultation type is a litigation judgment type, the terminal device can import the evidence parsing model according to the consultation content, which can be the preliminary evidence materials submitted by the prosecution and the defense, and output the first judgment result.

[0096] In S502, the first judgment result is imported into the consulting report template to generate a preliminary judgment report.

[0097] In this embodiment, if the terminal device detects that the consultation type is a litigation judgment type, the corresponding consultation report template can be set as a judgment report template, and the first judgment result can be imported into the judgment report template to generate a preliminary judgment report. Lawyers or judges can quickly determine the case based on the preliminary judgment report to improve trial efficiency.

[0098] In S503, litigation evidence in the litigation process is collected, and the litigation evidence and the preliminary judgment report are imported into the evidence analysis model to output a second judgment result.

[0099] In this embodiment, during the litigation process, the prosecution and the defense can provide multiple pieces of evidence and testimonies related to the evidence. The terminal device can collect the above types of information as litigation evidence, and import the litigation evidence and the preliminary judgment report into the evidence analysis model to make a secondary judgment and obtain the second judgment result. Preferably, a voice collection module can be set up in the litigation venue to obtain voice information during the litigation process, convert the voice information to obtain corresponding text data, and identify the text data as litigation evidence.

[0100] In S504, the second judgment result is imported into the consulting report template to generate a judgment recommendation report.

[0101] In this embodiment, similarly, after outputting the second judgment result, the terminal device can import the second judgment result into the corresponding area in the preset consulting report template to obtain a judgment recommendation report, and the judge can assist in the judgment based on the judgment recommendation report.

[0102] In an embodiment of the present invention, when the consultation type is identified as a litigation judgment type, a preliminary judgment report and a judgment recommendation report can be output to assist the judge in making a judgment, thereby improving the judge's judgment speed and reducing the time for reading evidence.

[0103] Figure 6 The specific implementation flow chart of the method S102 for generating a legal consulting report provided by the sixth embodiment of the present invention is shown. Figure 6 , relative to Figures 1 to 5 In any of the above embodiments, a method S102 for generating a legal consulting report provided in this embodiment includes: S1021 to S1023, which are described in detail as follows:

[0104] In S1021, a preset keyword dictionary is obtained; the keyword dictionary contains a plurality of candidate keywords; each of the candidate keywords is configured with a keyword vector.

[0105] In this embodiment, the terminal device can automatically extract keywords from historical legal texts through manual configuration or through a semantic recognition algorithm to generate a key dictionary, and generate a keyword vector corresponding to each candidate keyword based on the word sequence number of the candidate keyword in the key dictionary.

[0106] In S1022, candidate keywords included in the consultation content are searched according to the key dictionary, and the candidate keywords obtained by the search are identified as the consultation keywords.

[0107] In this embodiment, the terminal device can determine whether the consultation content contains candidate keywords recorded in the keyword dictionary, and if so, identify the candidate keywords as consultation keywords.

[0108] In S1023, the consultation matrix is ​​generated based on the keyword vector corresponding to the consultation keyword.

[0109] In this embodiment, the terminal device can determine the word sequence number of the keyword vector according to the order in which each consulting keyword appears in the consulting content, and merge each keyword vector based on the word sequence number to generate a consulting matrix.

[0110] In the embodiment of the present invention, the legal consultation report is generated by selecting the standard paragraphs corresponding to the consultation keywords, thereby achieving the purpose of automatically generating the legal consultation report.

[0111] Figure 7FIG. 1 is a flowchart showing a specific implementation of a method S102 for generating a legal consulting report provided by the seventh embodiment of the present invention. Figure 7 , relative to Figures 1 to 5 In any of the above embodiments, a method S102 for generating a legal consulting report provided in this embodiment includes: S1024 to S1027, which are described in detail as follows:

[0112] Furthermore, the extracting consulting keywords from the consulting content and constructing the consulting matrix of the legal consulting request through the consulting keywords includes:

[0113] In S1024, the undetermined keywords are extracted from the consultation content through a semantic recognition algorithm.

[0114] In this embodiment, the terminal device is provided with a semantic parsing algorithm, which can identify the correlation between each character in the consultation content. If the correlation between any two or more characters is greater than a preset correlation threshold, the above-mentioned multiple characters are identified as the same phrase, so that the consultation content can be divided into multiple pending keywords.

[0115] In S1025, the third occurrence number of the pending keyword in the consultation content is counted, and the word frequency parameter of the pending keyword is determined according to the third number.

[0116] In this embodiment, the terminal device can count the number of occurrences of the pending keyword in the consulting content to which it belongs, that is, the third number of occurrences mentioned above. The terminal device can calculate the word frequency parameter of the pending keyword based on the third number of occurrences, specifically, the value of the third number of occurrences can be directly used as the word frequency parameter, and the ratio between the total number of characters contained in the consulting content and the third number of occurrences can also be used as the word frequency parameter.

[0117] In S1026, the consultation feature value of the pending keyword is calculated based on the word frequency parameter of the pending keyword.

[0118] In this embodiment, after calculating the word frequency parameter of the pending keyword, the terminal device can calculate the text feature value of the pending keyword. Specifically, the larger the value of the word frequency parameter is, the higher the frequency of occurrence in the consulting content, and the higher the degree of text characteristic of the consulting content, so the consulting feature value can be calculated.

[0119] In S1027, the undetermined keyword whose consultation characteristic value is greater than the characteristic threshold is selected as the consultation keyword, and the consultation matrix is ​​constructed through the consultation keywords.

[0120] In this embodiment, after calculating the consultation feature value of each pending keyword, the terminal device may select the pending keyword with a text feature value greater than a feature threshold as the consultation keyword, and generate a consultation matrix according to the consultation keyword.

[0121] In the embodiment of the present invention, by extracting keywords from the consultation content and calculating the consultation feature value of each pending keyword, invalid keywords can be filtered out, the amount of data to be processed later can be reduced, and the report output efficiency can be improved.

[0122] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0123] Figure 8 The structure block diagram of a device for generating a legal consulting report provided by an embodiment of the present invention is shown. The device for generating a legal consulting report includes units for executing Figure 1 For details, please refer to the steps in the corresponding embodiment. Figure 1 and Figure 1 For the convenience of explanation, only the parts related to this embodiment are shown.

[0124] See also Figure 8 , the device for generating the legal consulting report includes:

[0125] The legal consultation request receiving unit 81 is used to receive a legal consultation request; the legal consultation request includes consultation content;

[0126] A consultation matrix construction unit 82, configured to extract consultation keywords from the consultation content and construct a consultation matrix of the legal consultation request through the consultation keywords;

[0127] A consultation type identification unit 83, used to import the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request;

[0128] The legal consultation template selection unit 84 is used to select the consultation report template associated with the consultation type, and query the standard paragraphs corresponding to each of the consultation keywords in the consultation content;

[0129] The legal consulting report generating unit 85 is used to import the standard paragraph into the consulting report template to generate a legal consulting report.

[0130] Optionally, the legal consulting report generation device further includes:

[0131] A historical legal text acquisition unit, used to acquire a plurality of historical legal texts and output a training matrix of each of the historical legal texts;

[0132] A sample training group division unit, used for classifying each of the training matrices based on the text type corresponding to the historical legal text, and dividing them into a plurality of sample training groups; all training matrices in the sample training group correspond to the same text type;

[0133] A training efficiency configuration unit, used to query the training efficiency associated with the text type, and respectively train and learn the preset classification model network with the training efficiency of the sample training group through the training matrix in each of the sample training groups until the loss function of the classification model network is less than a preset loss threshold;

[0134] The legal type identification model creation unit is used to identify the trained classification model network as the legal type identification model.

[0135] Optionally, the historical legal text acquisition unit includes:

[0136] A candidate keyword extraction unit, used to extract candidate keywords from the target historical legal text by using a semantic recognition algorithm; the target historical legal text is any one of a plurality of historical legal texts;

[0137] A first occurrence counting unit, used for counting the first occurrence number of the candidate keyword in the target historical legal text, and determining a word frequency parameter of the candidate keyword according to the first occurrence number;

[0138] A second occurrence count unit, used for identifying a second occurrence count of the candidate keyword in all the historical legal texts, and determining an inverse text parameter of the candidate keyword according to the second occurrence count;

[0139] A text feature value calculation unit, used for calculating the text feature value of the candidate keyword based on the word frequency parameter and the inverse text parameter;

[0140] The training matrix creation unit is used to select candidate keywords whose text feature values ​​are greater than feature thresholds as the sample keywords, and construct the training matrix of the target historical legal text through the sample keywords.

[0141] Optionally, the consultation type identification unit 83 includes:

[0142] A consulting field identification unit, used for importing the consulting matrix into the legal field submodule in the legal type identification model to identify the consulting field of the legal consulting request;

[0143] A sample library configuration unit, used for selecting standard legal texts associated with the consulting field, and using the standard legal texts as sample libraries for the associated clause identification submodule in the legal type identification model;

[0144] An associated legal clause identification unit, used to import the consulting content into the associated clause identification submodule, and output the associated legal clauses of the legal consulting request;

[0145] The fully connected layer output unit is used to input the associated legal terms, the consulting field and the consulting matrix into the fully connected layer in the legal type recognition model, and output the consulting type.

[0146] Optionally, the legal consulting report generation device further includes:

[0147] A first judgment result output unit, configured to, if the consultation type is a litigation judgment type, import the consultation content into a preset evidence analysis model to output a first judgment result;

[0148] A preliminary judgment report output unit, used for importing the first judgment result into the consulting report template to generate a preliminary judgment report;

[0149] A second judgment result output unit is used to collect litigation evidence in the litigation process, import the litigation evidence and the preliminary judgment report into the evidence parsing model, and output a second judgment result;

[0150] The judgment recommendation report output unit is used to import the second judgment result into the consulting report template to generate a judgment recommendation report.

[0151] Optionally, the consultation matrix construction unit 82 includes:

[0152] A key word dictionary acquisition unit is used to acquire a preset key word dictionary; the key word dictionary includes a plurality of candidate key words; each of the candidate key words is configured with a key word vector;

[0153] A consulting keyword identification unit, configured to query candidate keywords included in the consulting content according to the key dictionary, and identify the candidate keywords obtained by the query as the consulting keywords;

[0154] The keyword vector encapsulation unit is used to generate the consultation matrix based on the keyword vector corresponding to the consultation keyword.

[0155] Optionally, the consultation matrix construction unit 82 includes:

[0156] A pending keyword acquisition unit, used to extract the pending keywords from the consultation content through a semantic recognition algorithm;

[0157] A third occurrence number counting unit, used for counting the third occurrence number of the pending keyword in the consultation content, and determining the word frequency parameter of the pending keyword according to the third number;

[0158] A consulting characteristic value calculation unit, used for calculating the consulting characteristic value of the pending keyword based on the word frequency parameter of the pending keyword;

[0159] The consulting keyword selection unit is used to select the pending keyword whose consulting characteristic value is greater than the characteristic threshold as the consulting keyword, and construct the consulting matrix through the consulting keywords.

[0160] Therefore, the legal consultation report generation device provided by the embodiment of the present invention can also parse the user's consultation content, output a consultation matrix that can represent the characteristic information of the consultation content, and identify the consultation type of the consultation content through the consultation matrix. Since different consultation types involve different legal clauses and legal process steps, after determining the consultation type, the corresponding consultation report template can be selected, and the legal consultation report required by the user can be generated according to the consultation report template and the consultation content. The legal consultation template and the type of consultation content can be adaptively adjusted to meet the consultation of multiple types of legal issues, expand the scope of application of the legal consultation report, and effectively improve the user's consultation efficiency in the legal field.

[0161] Fig. 9 FIG. 1 is a schematic diagram of a terminal device provided by another embodiment of the present invention. Fig. 9 As shown, the terminal device 9 of this embodiment includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and executable on the processor 90, such as a program for generating a legal consulting report. When the processor 90 executes the computer program 92, the steps in the above-mentioned embodiments of the method for generating a legal consulting report are implemented, such as Figure 1 Alternatively, when the processor 90 executes the computer program 92, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 8 The functions of modules 81 to 85 are shown.

[0162] Exemplarily, the computer program 92 may be divided into one or more units, which are stored in the memory 91 and executed by the processor 90 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 92 in the terminal device 9. For example, the computer program 92 may be divided into a legal consultation request receiving unit, a consultation matrix building unit, a consultation type identification unit, a legal consultation template selection unit, and a legal consultation report generation unit, and the specific functions of each unit are as described above.

[0163] The terminal device 9 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that Fig. 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0164] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0165] The memory 91 may be an internal storage unit of the terminal device 9, such as a hard disk or memory of the terminal device 9. The memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 9. Further, the memory 91 may also include both an internal storage unit of the terminal device 9 and an external storage device. The memory 91 is used to store the computer program and other programs and data required by the terminal device. The memory 91 may also be used to temporarily store data that has been output or is to be output.

[0166] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0167] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for generating a legal consulting report, characterized in that: include: Receive requests for legal advice; The legal consultation request includes consultation content; Extract consulting keywords from the consulting content, and construct a consulting matrix of the legal consulting request through the consulting keywords, including: pre-processing the consulting matrix according to the standard input template of the legal type recognition model, if it is detected that the consulting matrix is ​​smaller than the standard matrix size, then fill the consulting matrix with invalid characters, and generate a character shielding matrix according to the position of the invalid characters filled in, when subsequently calculating the loss rate, filter the loss values ​​corresponding to the invalid characters through the character shielding matrix, if it is detected that the consulting matrix is ​​larger than the standard matrix size, then perform a dimensionality reduction operation on the consulting matrix through a preset pooling matrix, thereby ensuring that the consulting matrix after dimensionality reduction is consistent with the size of the standard matrix; Importing the consultation matrix into a preset legal type recognition model to determine the consultation type corresponding to the legal consultation request; Selecting a consulting report template associated with the consulting type, and searching for standard paragraphs corresponding to each consulting keyword in the consulting content; Importing the standard paragraph into the consulting report template to generate a legal consulting report; Also includes: Acquire multiple historical legal texts, and output training matrices for each of the historical legal texts; Classifying each of the training matrices based on the text type corresponding to the historical legal text, and dividing them into a plurality of sample training groups; all training matrices in the sample training group correspond to the same text type; Query the training efficiency associated with the text type, and respectively train and learn the preset classification model network using the training matrices in each of the sample training groups with the training efficiency of the sample training group until the loss function of the classification model network is less than a preset loss threshold; Identify the trained classification model network as the legal type recognition model; After importing the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request, the method further includes: If the consultation type is a litigation judgment type, the consultation content is imported into a preset evidence analysis model to output a first judgment result; Importing the first judgment result into the consulting report template to generate a preliminary judgment report; Collect litigation evidence during the litigation process, import the litigation evidence and the preliminary judgment report into the evidence analysis model, and output the second judgment result; Importing the second judgment result into the consulting report template to generate a judgment recommendation report; The step of extracting consulting keywords from the consulting content and constructing a consulting matrix of the legal consulting request through the consulting keywords includes: Extracting undetermined keywords from the consultation content through a semantic recognition algorithm; Counting the third occurrence times of the pending keyword in the consultation content, and determining the word frequency parameter of the pending keyword according to the third occurrence times; Calculating the consultation feature value of the pending keyword based on the word frequency parameter of the pending keyword; The undetermined keywords whose consultation characteristic values ​​are greater than the characteristic threshold are selected as the consultation keywords, and the consultation matrix is ​​constructed through the consultation keywords.

2. The generation method according to claim 1, characterized in that: The acquiring of multiple historical legal texts and outputting training matrices of each of the historical legal texts respectively include: Extracting candidate keywords from a target historical legal text by a semantic recognition algorithm; the target historical legal text is any one of a plurality of historical legal texts; Counting the first occurrence number of the candidate keyword in the target historical legal text, and determining the word frequency parameter of the candidate keyword according to the first occurrence number; Identifying a second number of occurrences of the candidate keyword in all the historical legal texts, and determining an inverse text parameter of the candidate keyword according to the second number of occurrences; Calculate the text feature value of the candidate keyword based on the word frequency parameter and the inverse text parameter; The candidate keywords whose text feature values ​​are greater than the feature threshold are selected as sample keywords, and the training matrix of the target historical legal text is constructed through the sample keywords.

3. The generation method according to claim 1, characterized in that: The step of importing the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request includes: Importing the consultation matrix into the legal field submodule in the legal type identification model to identify the consultation field of the legal consultation request; Selecting standard legal texts related to the consulting field, and using the standard legal texts as sample libraries for the associated clause identification submodule in the legal type identification model; Importing the consulting content into the associated clause identification submodule, and outputting the associated legal clauses of the legal consulting request; The associated legal clauses, the consulting field and the consulting matrix are input into the fully connected layer in the legal type recognition model, and the consulting type is output.

4. The generation method according to any one of claims 1 to 3, characterized in that: The step of extracting consulting keywords from the consulting content and constructing a consulting matrix of the legal consulting request through the consulting keywords includes: Obtaining a preset keyword dictionary; the keyword dictionary contains a plurality of candidate keywords; each of the candidate keywords is configured with a keyword vector; According to the keyword dictionary, querying the candidate keywords contained in the consulting content, and identifying the candidate keywords obtained by the query as the consulting keywords; The consultation matrix is ​​generated based on the keyword vector corresponding to the consultation keyword.

5. A device for generating a legal consulting report, characterized in that: include: A legal consultation request receiving unit, used for receiving a legal consultation request; The legal consultation request includes consultation content; A consultation matrix construction unit is used to extract consultation keywords from the consultation content and construct a consultation matrix of the legal consultation request through the consultation keywords, including: pre-processing the consultation matrix according to the standard input template of the legal type recognition model, filling invalid characters into the consultation matrix if it is detected that the consultation matrix is ​​smaller than the standard matrix size, and generating a character shielding matrix according to the position of the invalid characters, filtering the loss values ​​corresponding to the invalid characters through the character shielding matrix when calculating the loss rate later, and if it is detected that the consultation matrix is ​​larger than the standard matrix size, the consultation matrix can be reduced in dimension through a preset pooling matrix, thereby ensuring that the consultation matrix after dimension reduction is consistent with the size of the standard matrix; A consultation type identification unit, used for importing the consultation matrix into a preset legal type identification model to determine the consultation type corresponding to the legal consultation request; A legal consultation template selection unit, used to select a consultation report template associated with the consultation type, and query the standard paragraphs corresponding to each of the consultation keywords in the consultation content; A legal consulting report generating unit, used for importing the standard paragraph into the consulting report template to generate a legal consulting report; The device for generating the legal consulting report also includes: A historical legal text acquisition unit, used to acquire a plurality of historical legal texts and output a training matrix of each of the historical legal texts; A sample training group division unit, used for classifying each of the training matrices based on the text type corresponding to the historical legal text, and dividing them into a plurality of sample training groups; all training matrices in the sample training group correspond to the same text type; A training efficiency configuration unit, used to query the training efficiency associated with the text type, and respectively train and learn the preset classification model network with the training efficiency of the sample training group through the training matrix in each of the sample training groups until the loss function of the classification model network is less than a preset loss threshold; A legal type identification model creation unit, used to identify the trained classification model network as the legal type identification model; The device for generating the legal consulting report also includes: A first judgment result output unit, configured to, if the consultation type is a litigation judgment type, import the consultation content into a preset evidence analysis model to output a first judgment result; A preliminary judgment report output unit, used for importing the first judgment result into the consulting report template to generate a preliminary judgment report; A second judgment result output unit is used to collect litigation evidence in the litigation process, import the litigation evidence and the preliminary judgment report into the evidence parsing model, and output a second judgment result; A judgment recommendation report output unit, used for importing the second judgment result into the consulting report template to generate a judgment recommendation report; The consultation matrix construction unit comprises: A pending keyword acquisition unit, used to extract the pending keywords from the consultation content through a semantic recognition algorithm; A third occurrence counting unit, used for counting the third occurrence number of the pending keyword in the consultation content, and determining the word frequency parameter of the pending keyword according to the third occurrence number; A consulting characteristic value calculation unit, used for calculating the consulting characteristic value of the pending keyword based on the word frequency parameter of the pending keyword; The consulting keyword selection unit is used to select the pending keyword whose consulting characteristic value is greater than the characteristic threshold as the consulting keyword, and construct the consulting matrix through the consulting keywords.

6. A terminal device, characterized in that: The terminal device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the steps of the method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.