Disclosure of Invention
The invention provides a judging result obtaining method and device based on deep learning, and the case processing efficiency is improved.
In a first aspect, the present invention provides a method for obtaining a referee result based on deep learning, including:
acquiring the information of a legal provision, and acquiring the case information of the case to be processed according to the original text of the case to be processed;
and processing the law information and the case information of the case to be processed through a judge model to obtain a judge result output by the judge model, wherein the judge model is obtained through deep learning training by taking the law information, the case information of at least one judge document and the judge result as samples.
Further, before acquiring case information of the case to be processed according to the original text of the case to be processed, the method further includes:
identifying the amount information in the original text, and converting the amount information in an integer format;
further, before acquiring case information of the case to be processed according to the original text of the case to be processed, the method further includes:
identifying name information in the original text, and replacing the name information with the same name identifier;
further, before acquiring case information of the case to be processed according to the original text of the case to be processed, the method further includes:
and identifying the time information in the original text, and replacing the time information with the same time identifier.
Further, the processing the law information and the case information of the case to be processed through a referee model to obtain a referee result output by the referee model includes:
after a corresponding first text word vector matrix is obtained according to the case information of the case to be processed, respectively performing forward interpretation and reverse interpretation on the first text word vector matrix to obtain a first forward interpretation result and a first reverse interpretation result, splicing the first forward interpretation result and the first reverse interpretation result, and performing information extraction on spliced data to obtain a first text content vector;
after a corresponding first normal word vector matrix is obtained according to the normal information, information extraction is carried out on the first normal word vector matrix to obtain a first normal content vector;
fusing the first normal content vector and the first text content vector to obtain a first to-be-output vector;
and extracting a first arbitration vector from the first to-be-output vector, and analyzing the first arbitration vector to obtain the arbitration result.
Further, the extracting information of the first normal word vector matrix to obtain a first normal content vector includes:
processing the first normal word vector matrix through an attention-rnn submodel in the referee model to obtain a second normal content vector output by the attention-rnn submodel, wherein the shape of the second normal content vector is { N, D }, N is the number of normal, and D is the word vector dimension of the first normal word vector matrix;
performing the following operation according to the second normal content vector to extract information of the second normal content vector to obtain the first normal content vector:
Y3=Y2*Y1+(1-Y2)*X
wherein, Y1=relu(XM1+C1),Y2=sigmoid(Y1M2+XM3+C2) Wherein M is1、M2、M3Are all variable matrices of { D, D }, C1、C2Are all variable matrixes with the shape of { N, D }, X is the second normal content vector, Y3Is the first normal content vector.
Further, the fusing the first normal content vector and the first text content vector to obtain a first to-be-output vector includes:
performing the following operation according to the first normal content vector and the first text content vector to fuse the first normal content vector and the first text content vector to obtain the first to-be-output vector;
Y5=Y3Y4
wherein, Y4=M4YbWherein Y isbFor the first text content vector, M4Is a variable matrix of { D, N } shape, Y5The vector to be output is the first vector to be output.
Further, the method further comprises:
acquiring case information and a judge result of the law information and the at least one judge document;
after a corresponding second text word vector matrix is obtained according to case information of the at least one referee document, respectively performing forward interpretation and reverse interpretation on the second text word vector matrix to obtain a second forward interpretation result and a second reverse interpretation result, splicing the second forward interpretation result and the second reverse interpretation result, and performing information extraction on spliced data to obtain a second text content vector;
after a corresponding second normal word vector matrix is obtained according to the normal information, information extraction is carried out on the second normal word vector matrix to obtain a third normal content vector;
fusing the third normal content vector and the second text content vector to obtain a second vector to be output;
extracting a second arbitration vector from the second vector to be output;
calculating according to the second judgment vector and the vector corresponding to the judgment result of the judgment document to obtain a loss error; and carrying out learning training on the referee model by using the loss error until the referee model converges.
In a second aspect, the present invention provides an apparatus for obtaining a referee result based on deep learning, comprising:
the first acquisition unit is used for acquiring the information of the legal provision and acquiring the case information of the case to be processed according to the original text of the case to be processed;
and the second acquisition unit is used for processing the law information and the case information of the case to be processed through a referee model to obtain a referee result output by the referee model, wherein the referee model is obtained through deep learning training by taking the law information, the case information of at least one referee document and the referee result as samples.
Further, the apparatus further comprises: and the first processing unit is used for identifying the amount information in the original text and converting the amount information in an integer format.
Further, the apparatus further comprises: and the second processing unit is used for identifying the name information in the original text and replacing the name information with the same name identifier.
Further, the apparatus further comprises: and the third processing unit is used for identifying the time information in the original text and replacing the time information with the same time identifier.
Further, the second obtaining unit includes:
the first word vector conversion module is used for obtaining a corresponding first text word vector matrix according to the case information of the case to be processed;
the first reading module is used for respectively performing forward reading and reverse reading on the first text word vector matrix after the first word vector conversion module obtains the first text word vector matrix to obtain a first forward reading result and a first reverse reading result;
the first splicing module is used for splicing the first forward interpretation result and the first reverse interpretation result;
the first information extraction module is used for extracting information of the data spliced by the splicing module to obtain a first text content vector;
the second word vector conversion module is used for obtaining a corresponding first normal word vector matrix according to the normal information;
the second information extraction module is used for extracting information of the first normal word vector matrix after the second word vector conversion module obtains the first normal word vector matrix to obtain a first normal content vector;
the first fusion module is used for fusing the first normal content vector and the first text content vector to obtain a first to-be-output vector;
the first extraction module is used for extracting a first arbitration vector from the first vector to be output;
and the first analysis module is used for analyzing the first judgment vector to obtain the judgment result.
Further, the second information extraction module includes:
the first processing submodule is used for processing the first law bar word vector matrix through an attention-rnn submodel in the referee model to obtain a second law bar content vector output by the attention-rnn submodel, wherein the shape of the second law bar content vector is { N, D }, N is the number of law bars, and D is the word vector dimension of the first law bar word vector matrix;
the second processing sub-module is configured to perform the following operation according to the second normal content vector to extract information of the second normal content vector, so as to obtain the first normal content vector:
Y3=Y2*Y1+(1-Y2)*X
wherein, Y1=relu(XM1+C1),Y2=sigmoid(Y1M2+XM3+C2) Wherein M is1、M2、M3Are all variable matrices of { D, D }, C1、C2Are all variable matrixes with the shape of { N, D }, X is the second normal content vector, Y3Is the first normal content vector.
Further, the first fusion module is configured to perform the following operation according to the first normal content vector and the first text content vector, so as to fuse the first normal content vector and the first text content vector, and obtain the first to-be-output vector;
Y5=Y3Y4
wherein, Y4=M4YbWherein Y isbFor the first text content vector, M4Is a variable matrix of { D, N } shape, Y5The vector to be output is the first vector to be output.
Further, the apparatus further comprises: a third obtaining unit and a model training unit, wherein,
the third acquiring unit is used for acquiring the case information and the referee result of the law enforcement information and the at least one referee document;
the model training unit comprises:
the third word vector conversion module is used for obtaining a corresponding second text word vector matrix according to the case information of the at least one referee document;
the second reading module is used for respectively performing forward reading and reverse reading on the second text word vector matrix after the third word vector conversion module obtains the second text word vector matrix to obtain a second forward reading result and a second reverse reading result;
the second splicing module is used for splicing the second forward interpretation result and the second reverse interpretation result;
the third information extraction module is used for extracting information of the data obtained by splicing to obtain a second text content vector;
the fourth word vector conversion module is used for obtaining a corresponding second normal word vector matrix according to the normal information;
the fourth information extraction module is used for extracting information of the second normal word vector matrix after the fourth word vector conversion module obtains the second normal word vector matrix to obtain a third normal content vector;
the second fusion module is used for fusing the third normal content vector and the second text content vector to obtain a second vector to be output;
the second extraction module is used for extracting a second arbitration vector from the second vector to be output;
the optimization module is used for calculating and obtaining loss errors according to the second judging vector and the vector corresponding to the judging result of the judging document; and carrying out learning training on the referee model by using the loss error until the referee model converges.
In a third aspect, the present invention provides a referee result acquisition apparatus based on deep learning, including: a processor, a memory, and a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement any of the methods of the first aspect.
In a fourth aspect, the invention provides a computer readable storage medium having stored thereon a computer program for execution by a processor to perform any of the methods of the first aspect.
The invention provides a method and a device for acquiring a referee result based on deep learning. According to the scheme, intelligent judgment is realized through a judgment model obtained through deep learning training based on input case information, so that case processing efficiency is effectively improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a method for obtaining a referee result based on deep learning according to an embodiment of the present invention, which is exemplified by applying the method provided in the embodiment to a referee result obtaining apparatus based on deep learning, and as shown in fig. 1, the method may include:
step 101: and acquiring the information of the legal provision, and acquiring the case information of the case to be processed according to the original text of the case to be processed.
In practical applications, the execution subject of the embodiment may be a referee result acquisition device based on deep learning, and the referee result acquisition device may be program software, or a medium storing a related computer program, such as a usb disk; alternatively, the referee result acquisition device may also be a physical device integrated or installed with a related computer program, for example, a chip, an intelligent terminal, a computer, a server, and the like.
The law information in the scheme is used as the input of the referee model, so that the referee model is subjected to deep learning training or the output referee result is obtained through the processing of the referee model. In practical application, there may be a plurality of methods for acquiring the legal information for different scenes. Optionally, on the basis of any embodiment, for a scene of the 1 st deep learning training, acquiring the legal information may specifically include:
acquiring original information corresponding to the R legal items respectively;
performing word segmentation processing on original information corresponding to each of the R law bars to obtain a plurality of first words to be processed corresponding to each law bar;
according to Word identifications (Word ids) corresponding to different words, Word ids corresponding to a plurality of first words to be processed of each French are obtained and used as French information, and the French information is stored, wherein R is a positive integer.
For the following scenes of training and application of the referee model (for example, in the embodiment, the referee model is used for obtaining the referee result of the case to be processed), when obtaining the law enforcement information, the stored law enforcement information can be directly called without performing a series of processing operations again according to the original text of the law enforcement, so that the implementation mode greatly improves the training efficiency and the acquisition efficiency of the referee result, and improves the user experience.
In addition, in order to improve the processing capacity of the referee model, the method further comprises the following steps:
and taking the law containing the most Word ids as a reference, and adjusting the number of the Word ids respectively corresponding to other laws.
Specifically, for other laws, 0 may be complemented after the Word id corresponding thereto, respectively.
Examples are made in connection with actual scenarios: the original text in the scheme refers to original information related to the case, and the form of the original information is not limited, and the original information may be, for example, a paper case, an electronic case, and the like. Specifically, the original text in the embodiment is used for extracting case information, so that the original text processable by a computer can be obtained in different scenes, and further, the obtaining way can be various, for example, the entry of the original text can be performed according to case materials, and the accuracy of the embodiment is higher; or to perform word recognition on paper's case material to obtain the original text, this embodiment is more efficient.
The case information in the scheme is used as the input of the referee model, so that the referee model is subjected to deep learning training or the output referee result is obtained through the processing of the referee model. In practical application, the case information of a case can be obtained according to the obtained original text, and specific processing methods can be various. Optionally, on the basis of any embodiment, 101 may specifically include:
performing word segmentation processing on an original text of a case to be processed to obtain a plurality of second words to be processed;
and obtaining and using the word identifications corresponding to the second words to be processed as case information of the cases to be processed according to the word identifications corresponding to the different words.
Specifically, a maximum reverse matching method can be adopted for word segmentation, and the word segmentation algorithm is high in accuracy and beneficial to improving the accuracy of output of judgment results.
In addition, when the data volume of the original text is large, the data volume of the case information is also large, so to further improve the processing efficiency, the method further comprises the following steps:
and adjusting the word identification number of the case information to a preset threshold value.
Wherein the threshold value can be determined as required. The way of adjustment includes addition or deletion of word identity. In one case, when the number of word identifications corresponding to the case information is less than the threshold value, the word identifications corresponding to the case information may be supplemented. Alternatively, a preset identifier may be appended to the case information, and the preset identifier may be a predetermined letter identifier, a number identifier, or the like, and may be 0, for example. In practical applications, the word identifiers in the case information may be sorted, for example, the word identifiers may be arranged from front to back according to the obtaining order, and correspondingly, when the word identifier of the case information is appended, at least one 0 may be appended after the last word identifier until the word identifier of the case information is the threshold.
In another case, when the number of word identifications corresponding to the case information is greater than the threshold, the number of word identifications may be decremented to the threshold. Optionally, there may be multiple specific deletion methods, for example, words with smaller information amount (such as, e.g., ones, etc.) may be deleted from the word identifiers of the case information to improve accuracy. For another example, in combination with the foregoing example of sorting word identifiers, when a word identifier is deleted, the word identifier beyond the threshold may be directly deleted, so as to improve efficiency.
It should be noted that the term identifier in the present scheme is used to uniquely identify a single term, and the length of the term is not limited, and the term may be a term formed by at least one word. In addition, the execution sequence for acquiring the legal information and the case information in the scheme is not limited.
Step 102: and processing the law information and the case information of the case to be processed through a judge model to obtain a judge result output by the judge model, wherein the judge model is obtained through deep learning training by taking the law information, the case information of at least one judge document and the judge result as samples.
In practical application, the referee model may adopt different types of models, such as adding an attention-rnn submodel on the basis of the BiBloSAN model. The referee model is obtained by taking the law information, case information of at least one referee document and a referee result as samples and performing deep learning training. The judgment result in the scheme can comprise at least one of the following items: the name of the criminal suspect, whether to death or not, whether to untimely petition or not, the length of the criminal period, the amount of the penalty, the name of the crime and related legal provisions.
The embodiment provides a referee result acquisition method based on deep learning, which is characterized by acquiring case information according to an original text of a case to be processed, and then processing the case information and the acquired legal information through a referee model so as to obtain a referee result. According to the scheme, intelligent judgment is realized through a judgment model obtained through deep learning training based on input case information, so that case processing efficiency is effectively improved. In addition, the method and the device can also avoid the influence of subjective factors in the judging process based on the scheme, provide more objective judging results and are beneficial to improving the accuracy of the judging. In addition, when the model is trained, the law information is fused on the basis of the referee document, so that when the referee model predicts the law related to the case to be processed, the accuracy of law prediction can be improved, and then the accuracy of prediction such as crime name, penalty, criminal term and the like is indirectly improved, and therefore the accuracy of a referee result can be greatly improved.
Fig. 2 is a flowchart of a referee result obtaining method based on deep learning according to a second embodiment of the present invention, and as shown in fig. 2, the method may include:
step 201: identifying the amount information in the original text of the case to be processed, and converting the amount information in an integer format; and/or recognizing name information in the original text, and replacing the name information with the same name identifier; and/or identifying the time information in the original text, and replacing the time information with the same time identifier.
The conversion of the amount information in an integer format can specifically refer to the conversion of the amount information into an integer closest to the amount information; the same NAME identifier may be preset by the user according to actual requirements, for example, the same NAME identifier may be < NAME >; the same-TIME identifier may be preset by the user according to actual needs, for example, the same-TIME identifier may be < TIME >.
This embodiment takes as an example that the above three processes need to be performed simultaneously. For example, the original text of the case to be processed is that a national institute of civil inspection in the C area, B, C, of province A directs the victim to travel to the gate of a supermarket in the C area from 7 months and 4 days in 2016, the victim is stolen by a motorcycle (identified as the valuable RMB 3086 yuan) parked at the gate of the supermarket, and then the motorcycle paid is returned to the victim due to suspicious patterns and stolen by public security personnel. ", specifically, in the treatment, 3086 can be converted to 3000, Zhang III and Li IV are both replaced by < NAME >, and 2016 is replaced by < TIME > on 7/4 th. Thus, after the treatment, the original text of the case to be treated is changed into' instructing the notifier < NAME > to the gate of a supermarket in the C district of B City of A province to control the notifier < TIME > in the gate of the supermarket in the C district, stealing the victim < NAME > in a motorcycle (the value RMB is 3000 yuan after being identified) in the gate of the supermarket, and then, because of suspicious patterns, the motorcycle is stolen and obtained by the public security personnel, and the obtained motorcycle has returned the victim. ".
Step 202: and acquiring the information of the legal provision, and acquiring the case information of the case to be processed according to the original text acquired after processing.
It should be noted that fig. 2 only represents an execution sequence that may exist in the present embodiment, wherein the process of acquiring the legal information may also be executed in step 201, and so on.
On one hand, according to the first embodiment, the stored legal information can be directly called here.
On the other hand, when case information of a case to be processed is acquired, a word segmentation process is first performed on an original text obtained after the process to obtain a plurality of second words to be processed, which are ' a province ', ' B city ', ' C district ', ' people inspection house ', ' finger control ', ' advertiser ', ' < NAME > ', ' payment ', ' motorcycle ', ' hair returning ', ' victim ', ' for processing. '; and then converting each Word to be processed into a corresponding Word id according to the Word ids corresponding to different words, and assuming that the Word ids corresponding to the obtained multiple words to be processed are [79,123,1824,434,1112,4978.,. 65,7,45,236,426,56,21], finally judging whether the number of the obtained Word ids exceeds a preset threshold value, assuming that the threshold value is 30 and the number of the obtained Word ids is 31, deleting the 31 st Word id, namely 21 according to the front-to-back arrangement sequence, thus finally using [79,123,1824,434,1112,4978.,. 65,7,45,236,426,56] as case information of the case to be processed and inputting the case information into a judgment model.
Step 203: after a corresponding first text word vector matrix is obtained according to case information of a case to be processed, forward interpretation and reverse interpretation are respectively carried out on the first text word vector matrix to obtain a first forward interpretation result and a first reverse interpretation result, the first forward interpretation result and the first reverse interpretation result are spliced, information extraction is carried out on data obtained by splicing, and a first text content vector is obtained.
Fig. 3 is a schematic structural diagram of a referee model according to a second embodiment of the present invention, where the present solution is not limited to the referee model shown in fig. 3. In this embodiment, as shown in fig. 3, first, case information of a case to be processed is input to an Embedding layer Embedding of a referee model, each input Word id is converted into a Word vector through the layer, and a first text Word vector matrix is output to a full-connected layer 1 and a full-connected layer 2, on one hand, forward interpretation of the first text Word vector matrix is realized through the full-connected layer 1 and an mBiOSAwith forward mask, and a first forward interpretation result is obtained and output to a splice layer Concatenate; on the other hand, the reverse interpretation of the first text word vector matrix is realized through the full connection layer 2 and the mBiOSA with backward mask, a first reverse interpretation result is obtained and output to the concatemate, the concatemate layer realizes splicing, the spliced data is output to the Source to token self-entry of the information extraction layer, and the extraction of information is realized through the layer, so that the first text content vector is obtained.
Step 204: and after obtaining a corresponding first normal word vector matrix according to the normal information, extracting information of the first normal word vector matrix to obtain a first normal content vector.
As shown in fig. 3, the law information is input to an Embedding layer of the referee model, and similarly, a first law word vector matrix with a shape of { N, L, D } can be obtained, where N is the number of laws (e.g., total number 183), L is the maximum law word number, and D is a word vector dimension adopted by the Embedding layer, that is, a word vector dimension of the first law word vector matrix, and then information extraction is performed on the first law word vector matrix, and one implementation manner of obtaining the first law content vector may be:
processing the first normal word vector matrix through the attention-rnn submodel in fig. 3 to obtain a second normal content vector with { N, D } shape output by the attention-rnn submodel; performing the following operation according to the second normal content vector to extract information of the second normal content vector to obtain a first normal content vector:
Y3=Y2*Y1+(1-Y2)*X
wherein, Y1=relu(XM1+C1),Y2=sigmoid(Y1M2+XM3+C2) Wherein M is1、M2、M3Are all variable matrices of { D, D }, C1、C2Are all variable matrices with the shape of { N, D }, X is a second normal content vector, Y3For the first legal content vector, relu and sigmoid are two existing activation functions.
To the above-mentioned values it is worth mentioning:
first, assume that 183 french terms are adopted in this embodiment, and if after word segmentation, the number of first to-be-processed words obtained for the ith french term is 200 at most, and the numbers corresponding to other french terms are all less than 200, it is determined that the maximum number of french terms L is 200.
Second, before training the model for the 1 st time, five matrices may be preset to be M1、M2、M3、C1、C2And after each training is finished, learning and optimizing the last five matrixes respectively based on the loss errors obtained by the training, so that the five matrixes are all called as variable matrixes.
In addition, the execution sequence between step 203 and step 204 is not limited.
Step 205: and fusing the first normal content vector and the first text content vector to obtain a first to-be-output vector.
Specifically, one way to achieve fusion is: performing the following operation according to the first normal content vector and the first text content vector to fuse the first normal content vector and the first text content vector to obtain a first to-be-output vector;
Y5=Y3Y4
wherein, Y4=M4YbWherein Y isbIs a first text content vector, Y5Is the first vector to be output, M4Is a variable matrix with the shape of { D, N }, and after each training is completed, the last M is paired based on the current loss error, as described in the previous step4And (6) performing learning optimization.
Step 206: and extracting a first arbitration vector from the first vector to be output, and analyzing the first arbitration vector to obtain an arbitration result.
In this embodiment, the first referee vector can be extracted based on a preset referee dimension, wherein the referee dimension can be set according to the requirements of referee results, such as related law articles, criminal term, criminal name, penalty, and the like. In the embodiment, three referee dimensions of law, criminal name and criminal phase are preset as an example.
For example, the first to-be-output vector is {1, D }, the first arbitration vector with the shape of { D, 202} is obtained by multiplying the first to-be-output vector by the vector with the shape of { D, 202}, the first arbitration vector with the shape of {1, 183} is obtained by multiplying the first to-be-output vector by the vector with the shape of { D, 183}, the first arbitration vector with the shape of {1,3} is obtained by multiplying the first to-be-output vector by the vector with the shape of { D, 1}, the first arbitration vector with the shape of {1,1} is obtained by multiplying the first to-be-output vector by the vector with the shape of { D, 1}, wherein the first arbitration vector with the shape of {1,202} is arbitrated for the arbitrated dimension of the crime name, and the first arbitration vector with the shape of {1, 183} is for the arbitrated dimension of the concerned french, the first adjudication vector with the shape of {1,3} is for the criminal phase dimension, and the first adjudication vector with the shape of {1,1} is for the specific criminal phase length, that is, according to three adjudication dimensions, four first adjudication vectors are extracted.
When analyzing the names of the guilties, the first adjudication vector with the shape of {1,202} can be understood as that the vector consists of 1 row and 202 columns, the corresponding numerical value of each column is the predicted value of the corresponding name of the guilty, in addition, a guilty threshold value can be set in advance according to the actual requirement, the guilty threshold value is assumed to be 0.5, and in the analyzing process, if the predicted values corresponding to the 1 st column, the 3 rd column and the 140 th column are respectively 1, and the rest are all less than 0.5, the guilty names corresponding to the cases to be processed are the 1 st, the 3 rd and the 140 th guilty names in the preset guilty list.
The process of the law strip analysis is similar to that of the criminal name analysis, and is not described in detail here.
When analyzing the criminal period, first analyzing the first adjudication vector with the shape of {1,3}, wherein the vector is composed of 1 row and 3 columns, the 3 columns respectively correspond to the dead criminal, the dead criminal and the dead criminal, and the current period, if the dead criminal or the dead criminal is analyzed, directly outputting the adjudication result, and if the current period is analyzed, continuously analyzing the first adjudication vector with the shape of {1,1}, so as to output the time corresponding to the current period.
The embodiment carries out conversion processing of an integer format on the amount information in the original text of the case to be processed, carries out replacement processing on the name information and carries out replacement processing on the time information, so that a referee model can not generate a large-scale word list when processing the case information of the input case to be processed, thereby improving the processing capacity, further being capable of rapidly obtaining a final referee result, greatly reducing the error rate in the processing process, and further greatly improving the accuracy of a final output result. Moreover, in the embodiment, the corresponding first refereeing vector can be extracted through the referee dimension of the referee result, so that the referee result with multiple referee dimensions can be analyzed, and an objective criminal reference mode under multiple referee dimensions is provided for a judge.
Fig. 4 is a flowchart of a referee result obtaining method based on deep learning according to a third embodiment of the present invention, and as shown in fig. 4, the method includes:
step 401: and acquiring case information and a judge result of the law information and at least one judge document.
On one hand, according to the first embodiment, taking the 1 st training and R183 as an example, the obtained original texts of 183 french articles can be shown in table 1 below.
TABLE 1
The Word id converted from the first to-be-processed words corresponding to each law may be as shown in table 2 below.
TABLE 2
1
|
1,31,57,128,8876,….431,1,3,0
|
|
……
|
183
|
53,323,357,1728,3876,….342,41,311,1,3 |
And finally, filling the number which is less than the maximum number in the table 2, and obtaining and storing the filled legal information.
On the other hand, the form of data to be acquired from the official document may be as shown in the following table 3, but is not limited to table 1.
TABLE 3
In table 1, the fact part, that is, the case description part, is a part for specifically describing the corresponding case, for example, what time, what place, what happens, and the like, that is, the fact part corresponds to the case information in the embodiment; and the meta part comprises 7 items, wherein the last 6 items are the judgment results of the corresponding case, such as 3 years of criminal with period and the like.
After obtaining one piece of data from hundreds of thousands of referee documents respectively according to the data form of table 1, preprocessing (money information integer format conversion, word segmentation, etc.) can be performed on all pieces of data in advance as in the second embodiment to obtain and store case information of hundreds of thousands of referee documents, so that at least one case information can be selected at random directly from the stored case information of hundreds of thousands of referee documents each time when the referee model is trained, for example, 64 cases are selected at random this time, and the selected 64 cases are directly used for learning and training, thereby greatly improving the training efficiency of the referee model.
In addition, for the meta part of each piece of data, that is, the referee result part, the loss error is calculated according to the vector corresponding to the referee result, so that the related data of the meta part needs to be converted into a vector, and the data used for training the referee model can be shown in table 4.
TABLE 4
Step 402: and after a corresponding second text word vector matrix is obtained according to case information of at least one referee document, respectively performing forward interpretation and reverse interpretation on the second text word vector matrix to obtain a second forward interpretation result and a second reverse interpretation result, splicing the second forward interpretation result and the second reverse interpretation result, and performing information extraction on data obtained by splicing to obtain a second text content vector.
Specifically, reference may be made to the referee model shown in fig. 3, in this embodiment, the first text word vector matrix in fig. 3 should be a second text word vector matrix.
Step 403: and after a corresponding second normal word vector matrix is obtained according to the normal information, extracting information of the second normal word vector matrix to obtain a third normal content vector.
Similarly, in the present embodiment, the first normal word vector matrix in fig. 3 should be the second normal word vector matrix.
Step 404: and fusing the third normal content vector and the second text content vector to obtain a second vector to be output.
Step 405: and extracting a second arbitration vector from the second vector to be output.
Step 406: calculating according to the second judgment vector and the vector corresponding to the judgment result of the judgment document to obtain a loss error; and (4) learning and training the referee model by using the loss error until the referee model converges.
During model training, the second arbitration vector is no longer parsed, but rather the second arbitration vector and the vectors in table 4 are used to calculate the loss error. For example, the referee result includes three referee dimensions of the name of the crime, the law and the criminal phase, the second referee vector aiming at the referee dimension of the name of the crime can be obtained through the steps, the name of the crime loss can be obtained through calculation according to the second referee vector, the vector corresponding to the name of the crime in 64 referee documents and the preset crime loss function, and similarly, the name of the crime loss and the criminal phase loss can be obtained, then calculating the loss error of the judge model according to the weight of the criminal name loss, the law loss, the criminal period loss and each judge dimension, to optimize the referee model by using the loss error, the steps 401 to 406 are repeated until the referee model converges, for example, after repeatedly performing the above steps several times, the fluctuation of the loss error is small, so that the referee model can be determined to be converged, which is only an example, and the determination of whether the referee model is converged includes but is not limited thereto.
Step 407: and acquiring the information of the legal provision, and acquiring the case information of the case to be processed according to the original text of the case to be processed.
Step 408: and processing the law information and the case information of the case to be processed through the judging model to obtain a judging result output by the judging model.
In the embodiment, when the model is trained, the case information and the referee results of the law information and a large number of referee documents are fused, so that the accuracy of law forecast can be improved, and the accuracy of forecast of crime names, penalties, criminal periods and the like is further improved. Therefore, the scheme greatly improves the accuracy of judgment results.
Fig. 5 is a schematic structural diagram of a referee result acquisition device based on deep learning according to a fourth embodiment of the present invention, as shown in fig. 5, including:
the first obtaining unit 501 is configured to obtain the information of the law enforcement, and obtain the case information of the case to be processed according to the original text of the case to be processed;
a second obtaining unit 502, configured to process, by using a referee model, the law information and the case information of the case to be processed, and obtain a referee result output by the referee model, where the referee model is obtained through deep learning training by taking the law information, and the case information and the referee result of at least one referee document as samples.
In this embodiment, the judging result obtaining device based on deep learning of this embodiment can execute the method provided in the first embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In this embodiment, for a case to be processed, case information is obtained according to an original text of the case to be processed, and then the case information and the obtained legal information are processed through a referee model, so as to obtain a referee result. According to the scheme, intelligent judgment is realized through a judgment model obtained through deep learning training based on input case information, so that case processing efficiency is effectively improved. In addition, the method and the device can also avoid the influence of subjective factors in the judging process based on the scheme, provide more objective judging results and are beneficial to improving the accuracy of the judging. In addition, when the model is trained, the law information is fused on the basis of the referee document, so that when the referee model predicts the law related to the case to be processed, the accuracy of law prediction can be improved, and then the accuracy of prediction such as crime name, penalty, criminal term and the like is indirectly improved, and therefore the accuracy of a referee result can be greatly improved.
Fig. 6 is a schematic structural diagram of a referee result acquisition device based on deep learning according to a fifth embodiment of the present invention, and based on a fourth embodiment, as shown in fig. 6,
the device further comprises: a first processing unit 601, configured to identify amount information in the original text, and perform integer format conversion on the amount information;
further, the apparatus further comprises: a second processing unit 602, configured to identify name information in the original text, and replace the name information with a same name identifier;
further, the apparatus further comprises: a third processing unit 603, configured to identify time information in the original text, and replace the time information with the same time identifier.
The second obtaining unit 502 includes:
a first word vector conversion module 5021, configured to obtain a corresponding first text word vector matrix according to the case information of the case to be processed;
the first interpretation module 5022 is configured to perform forward interpretation and reverse interpretation on the first text word vector matrix respectively after the first word vector conversion module obtains the first text word vector matrix, so as to obtain a first forward interpretation result and a first reverse interpretation result;
a first splicing module 5023, configured to splice the first forward interpretation result and the first reverse interpretation result;
the first information extraction module 5024 is used for extracting information of the data spliced by the splicing module to obtain a first text content vector;
the second word vector conversion module 5025 is used for obtaining a corresponding first normal word vector matrix according to the normal information;
a second information extraction module 5026, configured to extract information of the first normal word vector matrix after the second word vector conversion module obtains the first normal word vector matrix, so as to obtain a first normal content vector;
a first fusion module 5027, configured to fuse the first normal content vector and the first text content vector to obtain a first to-be-output vector;
a first extracting module 5028, configured to extract a first arbitration vector from the first to-be-output vector;
a first parsing module 5029, configured to parse the first arbitration vector to obtain the arbitration result.
Further, the second information extraction module 5026 includes:
the first processing submodule is used for processing the first law bar word vector matrix through an attention-rnn submodel in the referee model to obtain a second law bar content vector output by the attention-rnn submodel, wherein the shape of the second law bar content vector is { N, D }, N is the number of law bars, and D is the word vector dimension of the first law bar word vector matrix;
the second processing sub-module is configured to perform the following operation according to the second normal content vector to extract information of the second normal content vector, so as to obtain the first normal content vector:
Y3=Y2*Y1+(1-Y2)*X
wherein, Y1=relu(XM1+C1),Y2=sigmoid(Y1M2+XM3+C2) Wherein M is1、M2、M3Are all variable matrices of { D, D }, C1、C2Are all variable matrixes with the shape of { N, D }, X is the second normal content vector, Y3Is the first normal content vector.
Further, the first fusion module 5027 is configured to perform the following operation according to the first normal content vector and the first text content vector, so as to fuse the first normal content vector and the first text content vector to obtain the first to-be-output vector;
Y5=Y3Y4
wherein, Y4=M4YbWherein Y isbFor the first text content vector, M4Is a variable matrix of { D, N } shape, Y5The vector to be output is the first vector to be output.
In this embodiment, the referee result acquisition device based on deep learning of this embodiment can execute the method provided in the second embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
The embodiment carries out conversion processing of an integer format on the amount information in the original text of the case to be processed, carries out replacement processing on the name information and carries out replacement processing on the time information, so that a referee model can not generate a large-scale word list when processing the case information of the input case to be processed, thereby improving the processing capacity, further being capable of rapidly obtaining a final referee result, greatly reducing the error rate in the processing process, and further greatly improving the accuracy of a final output result. Moreover, in the embodiment, the corresponding first refereeing vector can be extracted through the referee dimension of the referee result, so that the referee result with multiple referee dimensions can be analyzed, and an objective criminal reference mode under multiple referee dimensions is provided for a judge.
Fig. 7 is a schematic structural diagram of an apparatus for obtaining a referee result based on deep learning according to a sixth embodiment of the present invention, and based on the fourth embodiment, as shown in fig. 7,
the device further comprises: a third acquisition unit 701 and a model training unit 702, wherein,
the third obtaining unit 701 is configured to obtain the case information and the referee result of the law enforcement information and the at least one referee document;
the model training unit 702 includes:
a third word vector conversion module 7021, configured to obtain a corresponding second text word vector matrix according to case information of the at least one referee document;
a second interpretation module 7022, configured to perform forward interpretation and reverse interpretation on the second text word vector matrix respectively after the third word vector conversion module obtains the second text word vector matrix, so as to obtain a second forward interpretation result and a second reverse interpretation result;
a second splicing module 7023, configured to splice the second forward interpretation result and the second backward interpretation result;
a third information extraction module 7024, configured to perform information extraction on the data obtained by splicing to obtain a second text content vector;
a fourth word vector conversion module 7025, configured to obtain a corresponding second normal word vector matrix according to the normal information;
a fourth information extraction module 7026, configured to, after the fourth word vector conversion module obtains the second normal word vector matrix, perform information extraction on the second normal word vector matrix to obtain a third normal content vector;
a second fusion module 7027, configured to fuse the third normal content vector and the second text content vector to obtain a second to-be-output vector;
a second extracting module 7028, configured to extract a second arbitration vector from the second vector to be output;
an optimizing module 7029, configured to obtain a loss error by calculating according to the second referee vector and a vector corresponding to a referee result of the referee document; and carrying out learning training on the referee model by using the loss error until the referee model converges.
In this embodiment, the referee result acquisition device based on deep learning of this embodiment can execute the method provided in the third embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment, when the model is trained, the case information and the referee results of the law information and a large number of referee documents are fused, so that the accuracy of law forecast can be improved, and the accuracy of forecast of crime names, penalties, criminal periods and the like is further improved. Therefore, the scheme greatly improves the accuracy of judgment results.
The invention provides a referee result acquisition device based on deep learning, which comprises: a processor, a memory, and a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method provided by any of the first to third embodiments.
The invention provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the method provided by any one of the first to third embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.