CN118277538A - Legal intelligent question-answering method based on retrieval enhancement language model - Google Patents
Legal intelligent question-answering method based on retrieval enhancement language model Download PDFInfo
- Publication number
- CN118277538A CN118277538A CN202410714259.6A CN202410714259A CN118277538A CN 118277538 A CN118277538 A CN 118277538A CN 202410714259 A CN202410714259 A CN 202410714259A CN 118277538 A CN118277538 A CN 118277538A
- Authority
- CN
- China
- Prior art keywords
- legal
- vector
- text
- knowledge
- retrieval
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 239000013598 vector Substances 0.000 claims abstract description 138
- 238000013145 classification model Methods 0.000 claims abstract description 13
- 238000011156 evaluation Methods 0.000 claims abstract description 3
- 238000012549 training Methods 0.000 claims description 44
- 230000006870 function Effects 0.000 claims description 25
- 230000008569 process Effects 0.000 claims description 20
- 238000004364 calculation method Methods 0.000 claims description 14
- 239000011159 matrix material Substances 0.000 claims description 13
- 238000013528 artificial neural network Methods 0.000 claims description 11
- 238000013527 convolutional neural network Methods 0.000 claims description 11
- 238000011176 pooling Methods 0.000 claims description 11
- 230000002457 bidirectional effect Effects 0.000 claims description 9
- 125000004122 cyclic group Chemical group 0.000 claims description 9
- 230000007246 mechanism Effects 0.000 claims description 9
- 238000013507 mapping Methods 0.000 claims description 8
- 238000012216 screening Methods 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 7
- 238000010276 construction Methods 0.000 claims description 6
- 238000005520 cutting process Methods 0.000 claims description 6
- 230000008707 rearrangement Effects 0.000 claims description 5
- 230000004913 activation Effects 0.000 claims description 3
- 230000003044 adaptive effect Effects 0.000 claims description 3
- 238000004458 analytical method Methods 0.000 claims description 3
- 230000004927 fusion Effects 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims description 3
- 230000000306 recurrent effect Effects 0.000 claims description 2
- 238000010606 normalization Methods 0.000 claims 1
- 241000288105 Grus Species 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 206010039203 Road traffic accident Diseases 0.000 description 2
- 208000027418 Wounds and injury Diseases 0.000 description 2
- 230000008094 contradictory effect Effects 0.000 description 2
- 230000010485 coping Effects 0.000 description 2
- 230000006378 damage Effects 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 208000014674 injury Diseases 0.000 description 2
- 238000002360 preparation method Methods 0.000 description 2
- 230000007115 recruitment Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000003213 activating effect Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001427 coherent effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 230000017105 transposition Effects 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
- G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/02—Knowledge representation; Symbolic representation
- G06N5/022—Knowledge engineering; Knowledge acquisition
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a legal intelligent question-answering method based on a retrieval enhancement language model, which comprises the steps of obtaining legal texts of different categories, constructing a database, and obtaining vector databases of different categories; obtaining a corresponding category by obtaining legal problem text and inputting a problem classification model for adjusting self-attention based on dynamic weight; according to the category of the legal problem text, a matched set of legal knowledge is found from a vector database of the corresponding category through a retrieval model, and then the legal knowledge is rearranged based on the relevance evaluation of the legal problem text and the legal knowledge; integrating legal knowledge and legal questions to construct a transitional prompt template, inputting the transitional prompt template into a large language model, inputting the obtained transitional answers together with a vector database and a question category into a retrieval model to obtain iterated legal knowledge, integrating the iterated legal knowledge and legal questions to construct a final prompt template, and inputting the final prompt template into the large language model again to obtain final answers.
Description
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a legal intelligent question-answering method based on a retrieval enhancement language model.
Background
With the rapid development of artificial intelligence technologies such as deep learning, large-scale neural networks and the like in recent years, particularly the appearance of large language models, the capability of machine logic reasoning learning is greatly improved. The large language model has strong language understanding and generating capability, can understand complex context information and generate coherent, logical and rich and diverse texts. By means of large-scale pre-training and fine tuning, various downstream tasks such as legal questions and answers, intelligent customer service, medical consultants and the like can be dealt with.
In practical tasks, pre-trained or fine-tuned language models have the problems of insufficient knowledge timeliness and accuracy, deep logic loss, lack of deep insight in the professional field and the like. Legal intelligent questions and answers purely based on pre-trained or fine-tuned language models may be faced with specific, professional and cool legal problems, resulting in poor accuracy and reliability of their solutions due to insufficient or outdated coverage of relevant legal knowledge in the training corpus. It is therefore desirable to combine a large-scale legal text database with a large language model to enhance the model's answer capabilities in real-time by retrieving the most relevant legal terms, cases, etc.
The current basic retrieval technology adopts a full-library retrieval strategy for the problems, does not classify the problems and does not finely divide the database, and has the problems of low retrieval efficiency and low retrieval accuracy. Moreover, the current retrieval method mainly relies on calculating the similarity between the problem vector and the text vector of the database to acquire the context knowledge required by the large model, and the method does not fully consider the coping requirement of complex problems, so that the correlation between partial problems and the retrieved knowledge is low. In addition, the current vector retrieval method has the problem of poor recall effect, namely, the ordering positions of knowledge items highly related to the problem in the retrieval result list are often lagged.
Disclosure of Invention
In order to solve the defects of the prior art, and achieve the purposes of improving knowledge timeliness, accuracy, depth logic and professional insight capability of a pre-training or fine-tuning language model in the legal field, and improving retrieval efficiency, retrieval precision, complex problem coping capability and recall effect in the legal young question-answering field, the invention adopts the following technical scheme:
a legal intelligent question-answering method based on a search enhancement language model comprises the following steps:
step 1: obtaining legal texts of different categories, and constructing a database to obtain vector databases of different categories;
Step 2: obtaining legal problem text, and inputting BiGRU-CNN problem classification model for adjusting self-attention based on dynamic weight to obtain the corresponding category; wherein the categories include: marital family disputes, traffic accident disputes, labor and recruitment disputes, personal injury and reimbursement, industrial and medical disputes, contract lending disputes, real estate renting and selling disputes, banking and financial insurance, consumption and shopping disputes, village and social neighbors and other contradicting disputes share;
Step 3: according to the category of the legal problem text, a matched set of legal knowledge is found from a vector database of the corresponding category through a retrieval model, and then the legal knowledge is rearranged based on the relevance evaluation of the legal problem text and the legal knowledge;
step 4: integrating legal knowledge and legal questions to construct a transitional prompt template, and inputting the template into a large language model to obtain a transitional answer;
Step 5: inputting the transitional answers, the vector database constructed in the step 1 and the question category obtained in the step 2 into a retrieval model to obtain legal knowledge after secondary iteration, integrating the legal knowledge and the legal questions after secondary iteration to construct a final prompt template, and inputting the final prompt template into a large language model to obtain the final answers.
Further, the construction of the database in the step 1 includes the following steps:
Step 1.1: the obtained legal texts with different categories comprise legal regulations, judicial cases and legal questions and answers, the original texts are preprocessed, irrelevant information such as header footers, advertisements, special symbols and the like are cleaned and removed, short and incoherent answers are filtered for question and answer data, and only high-quality and meaningful texts are ensured to be contained;
Step 1.2: the preprocessed long text is segmented according to terms, the legal and legal case text is segmented according to case disputed focus and case analysis, the legal question-answer text is segmented according to questions and answers, and the legal question-answer text is segmented into smaller units (such as paragraphs, sentences or clauses) for the creation of a subsequent vector database, so that the calculation cost of vectorization operation can be reduced, and the accuracy of vector retrieval is improved;
step 1.3: coding the cut legal text by using a pre-training embedded model based on legal text fine adjustment, and converting the cut legal text into a high-dimensional feature vector;
Step 1.4: mapping the legal text vector obtained by encoding with the original text in an associated manner, constructing a vector index by using a vector retrieval tool faiss, and recalling a corresponding text through the vector index;
Step 1.5: writing the constructed vector indexes into a vector database, and constructing legal regulations, legal cases and legal question-answer vector databases of different categories.
Further, the pre-training embedding model in step 1.3 uses bge-large-zh, the fine tuning data uses professional legal sentences and constructs sentence triple samples, the sentence triple samples comprise similar pairs of the professional legal sentences and a dissimilar sentence as negative example contrast, the fine tuning training process uses a triple loss function to calculate the distance between the positive and negative sentence sample pairs, and the characteristic distance of the positive sample pair is smaller than the characteristic distance of the negative sample pair as far as possible, and the calculation formula of the triple loss function is as follows:
Wherein, margin is a positive number super parameter, which represents a distance threshold value and is used for adjusting the strictness degree of the fine adjustment training process, A vector representation representing the current sentence,Representing a sentence vector semantically similar to the current sentence,Representing sentence vectors that are semantically dissimilar to the current sentence whenAnd (3) withCosine distance ratio of (2)And (3) withWhen the cosine distance of (1) is smaller than the margin, punishment is carried out on the sentence sample. By optimizing the triplet loss function, the learning capability of the embedded model on the similarity and the difference between samples can be improved, and further, the performance of the model in processing the semantic similarity and the retrieval problem is improved. And (3) inputting sentence triplet samples constructed by professional legal sentences into the embedded model in the training process of each round of fine tuning of the embedded model, calculating a triplet loss function, updating model parameters by using a random gradient descent SGD (Stochastic GRADIENT DESCENT) optimizer, and storing the fine-tuned embedded model after the loss is converged.
Further, the training of the problem classification model in the step 2 includes the following steps:
step 2.1: collecting various legal problem texts and corresponding class labels thereof, performing operations such as removing duplication, removing irrelevant information, filling missing values, unifying formats, vocabulary specifications and the like on the collected data, and arranging the well-arranged data according to 7:1.5:1.5, dividing the training set, the verification set and the test set;
Step 2.2: constructing a BiGRU-CNN problem classification model based on dynamic weight adjustment self-attention, modeling global information of legal problem texts by the model through a bidirectional gating cyclic neural network, adjusting the self-attention layer through the dynamic weight, inputting the further extracted deep global semantic features and local features of legal problem texts extracted by a convolutional neural network together into a feature fusion layer, and predicting problem categories by the fused features through a classifier;
step 2.3: word segmentation is carried out on legal problem texts, word embedding operation is carried out on the segmented texts, each word in natural language is expressed into a vector with unified meaning and dimension, the obtained word vector matrix is respectively input into a convolution network layer and a bidirectional gating cyclic neural network, and a trained problem classification model is obtained through calculating the difference calculation model loss between a prediction result and a real result.
Further, in the step 2.3, the convolutional neural network includes a convolutional layer and a max-pooling layer, the convolutional layer performs a convolutional operation on the acquired text features through a set of sliding windows with different sizes, and learns the local features of the text, and the calculation formula is as follows:
Wherein, Representing word vector matricesThe text feature vector obtained after the convolution operation of the ith row,Representing word vector matricesFrom row i to row i + k-1,Representing the function of the ReLU activation,The offset vector is represented as such,Representing word vector matricesThe feature matrix formed by the text feature vectors of the ith row, k represents the number of sliding windows,Is the sequence length; the sliding step length is 1;
The maximum pooling layer pools the feature set output by the convolution layer, reserves local key features in the text, discards irrelevant features, reduces feature vector dimension, prevents overfitting, screens out a maximum feature value from each sliding window by using a maximum pooling (Max Pooling) method, and has the following calculation formula:
。
Further, in the step 2.3, the bidirectional gating and circulating neural network includes two sets of unidirectional gating and circulating units GRU with opposite directions, at each moment, two gating and circulating units GRU with opposite directions are simultaneously provided for the input word vector matrix, and the hidden layer state at the current t moment is input by the current moment Input of hidden layer state forward at time t-1And an output of the inverted hidden stateCo-determination by forward hidden layer stateReverse hidden layer stateWeighted summation results in:
Wherein, Indicating the current input at time t,、Respectively represents the forward hidden state of the gate control circulation unit GRU at the time tReverse hidden stateThe weight of the corresponding weight is set to be equal to the weight,The bias corresponding to the hidden layer state at the time t is represented,The coding operation performed by the gate control loop unit GRU is represented, the word vector is coded into a corresponding gate control loop unit GRU hidden layer state through nonlinear transformation of the input word vector, and finally the global semantic feature G after data coding is output.
Further, in the step 2.3, the global semantic feature G is input to a dynamic weight adjustment self-attention layer to enhance the feature, a position weight parameter W weight is introduced on the basis of a self-attention mechanism, the calculated self-attention weight probability value is redistributed according to the position of text vector training, the text vector weight at the front of the training position is reduced, the text vector weight at the rear of the training position is improved, the representation of optimized text feature vectors is realized, the expression capability of text features is enhanced, and the dynamic weight adjustment self-attention mechanism has the following realization formula:
The weight is a parameter iterator, the initial value is 1, the self-attention overall weight of the front initial feature is reduced through parameter iteration in the training process, the rear feature obtains higher weight, and m represents the text word length; An n-dimensional global semantic feature vector representing the output of the bi-directional gated recurrent neural network, The adjustment factors representing functions are usually input into the dimension of vectors, the inner product of X.X T is adjusted, T represents the transposition of a matrix, and uneven distribution of results caused by overlarge value difference obtained by the functions is avoided.
Further, the step 3 includes the following steps:
Step 3.1: converting legal issue text into vectors: mapping legal problem text to a high-dimensional vector space through an embedded model to form a dense vector representation with a fixed length;
Step 3.2: screening legal regulations, legal cases and legal question-answering vector databases of corresponding categories according to legal problem categories;
Step 3.3: to the legal problem vector Legal knowledge vector in corresponding vector databaseCosine similarity is calculated, and legal knowledge index with maximum dot product is used for calculating cosine similarityRecall is realized, and a group of legal knowledge with highest similarity is respectively taken as a recall retrieval result;
Step 3.4: and based on the BERT ordering model of the self-adaptive edge ordering loss, carrying out relevance score judgment on legal question query text and legal knowledge, thereby carrying out rearrangement screening on the legal knowledge.
Further, in the step 3.3, the cosine similarity formula is as follows:
wherein dot_product (Q, D) represents legal issue vector And legal knowledge vectorI.e., the sum after multiplication of the respective corresponding elements,Representation ofThe modular length of the vector is calculated,Representation ofThe modular length of the vector is calculated,Representing the legal knowledge index with the largest dot product.
Further, the sorting model in the step 3.4 splices the legal question query text and the corresponding positive text or negative text with a second special symbol, adds the first special symbol and the second special symbol at the beginning and the end of the spliced sentence, and takes the obtained positive sample and negative sample as training data, wherein the output corresponding to the position of the first special symbol is the semantic representation of the whole sentence; based on the spliced sentences, obtaining semantic vectors through BERT coding, mapping the semantic vectors to 1-dimensional scalar by a full-connection layer, mapping output to a range from 0 to 1 through a normalized sigmoid function, and then judging relevance scores of legal problem query texts and legal knowledge, thereby rearranging the legal knowledge; in the model training process, the query and the knowledge are fused to construct a classification task, namely, whether the relation between the current query and the knowledge is 0 or 1 is predicted, wherein 0 represents that the current query is irrelevant to the recalled knowledge, 1 represents that the current query is completely relevant to the recalled knowledge, and an adaptive edge ordering loss function is usedAnd (3) optimizing:
where neg (i) represents a negative set of examples corresponding to positive examples of sample i, margin j is the distance between legal knowledge recalled and legal questions queried Determined hyper-parameters, positive sample pairs for queriesAnd corresponding to negative sample pairThe comparison is made one by one and then added as a penalty to the current query.
Further, in the step 4, legal knowledge is textAnd legal question textTogether as a prompt, input a large language modelGenerating transitional answersTransitional answersThe generation formula of (2) is as follows:
Wherein, A prompt is presented.
Further, in the step 5, in the initial iteration stage, only the legal question text is relied onThe knowledge base is searched, in the secondary iteration process, as the output of the large language model in the previous iteration can reveal related information possibly related to answer the question, the semantic gap can be bridged by using the output of the large language model in the previous iteration to search legal knowledge, the correlation of the searched knowledge is improved, the legal knowledge of the next iteration is obtained after the secondary iteration search, and the legal knowledge after the secondary iteration is usedAnd legal question textTogether as a prompt, input a large language modelGenerating final answersFinal answerThe generation formula of (2) is as follows:
。
the invention has the advantages that:
According to the invention, a retrieval mechanism is added on the basis of a large language model, and the retrieval enhancement is carried out by combining a large-scale legal knowledge base, so that the accuracy of answer and legal specialty can be effectively improved. According to the invention, a problem classification and database refinement division mechanism is introduced, and the database is subdivided in advance according to the type and attribute of the problem, so that the retrieval efficiency is remarkably improved, and the accuracy of the retrieval result is improved; the invention provides a secondary iteration retrieval mechanism, which utilizes the output of a large language model in the first iteration to further retrieve legal knowledge and improve the correlation of the retrieved knowledge; the invention also provides a rearrangement filter which can effectively optimize the ordering of knowledge items related to the problems in the retrieval result list, thereby improving the recall quality of legal knowledge.
Drawings
FIG. 1 is a flow chart of a method in an embodiment of the invention.
FIG. 2 is a schematic diagram of a database construction module in an embodiment of the present invention.
FIG. 3 is a schematic diagram of a problem classification module according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a search module according to an embodiment of the present invention.
Detailed Description
In order to better understand the purpose, structure and function of the invention, a legal intelligent question-answering method based on the search enhancement language model is further described in detail below with reference to the accompanying drawings.
As shown in FIG. 1, the legal intelligent question-answering method based on the retrieval enhancement language model comprises the following steps:
step 1: and acquiring legal regulations, cases and question-answering documents, and inputting the legal regulations, the cases and the question-answering documents into a database construction module to obtain a vector database. As shown in fig. 2, the construction of the database includes the steps of:
Step 1.1: data preparation: in the embodiment of the invention, 12 types of legal documents are collected, including laws and regulations, judicial cases and legal questions and answers. The original text is cleaned, irrelevant information such as header footers, advertisements, special symbols and the like is removed, short and incoherent answers are filtered for question-answer data, and only high-quality and meaningful text is ensured to be contained.
Step 1.2: document segmentation: the cleaned legal long document is segmented into smaller units (such as paragraphs, sentences or clauses) for the creation of a subsequent vector database, so that the calculation cost of vectorization operation can be reduced, and the accuracy of vector retrieval is improved. Cutting the legal and legal documents according to the clauses; dividing the judicial case document according to the case dispute focus and case analysis; and cutting the legal question-answering document according to the questions and answers.
Step 1.3: text encoding: and coding the cut legal text by using a pre-training embedded model based on legal text fine tuning, and converting the cut legal text into a high-dimensional feature vector.
The pre-training embedding model uses bge-large-zh, the fine tuning data uses professional legal sentences and builds sentence triple samples, and the sentence triple samples comprise similar pairs of the professional legal sentences and a dissimilar sentence serving as negative example contrast. And the fine tuning training process uses a triplet loss function to calculate the distance between the positive sentence sample pair and the negative sentence sample pair, and enables the characteristic distance of the positive sample pair to be smaller than that of the negative sample pair as far as possible. The formula for the triplet loss function is as follows:
wherein, margin is a positive number super parameter used for adjusting the strictness degree of the fine adjustment training process, For the vector representation of the current sentence,Is a sentence vector semantically similar to the current sentence,Is a sentence vector dissimilar to the current sentence semantic, whenAnd (3) withCosine distance ratio of (2)And (3) withWhen the cosine distance of (2) is smaller than the threshold margin, punishment is carried out on the sentence sample. By optimizing the triplet loss function, the learning capability of the embedded model on the similarity and the difference between samples can be improved, and further, the performance of the model in processing the semantic similarity and the retrieval problem is improved. And (3) inputting sentence triplet samples constructed by professional legal sentences into the embedded model in the training process of each round of fine tuning of the embedded model, calculating a triplet loss function, updating model parameters by using a random gradient descent SGD (Stochastic GRADIENT DESCENT) optimizer, and storing the fine-tuned embedded model after the loss is converged.
Step 1.4: creating an index: the corresponding text may be recalled by mapping the encoded legal text vector to the original text and constructing a vector index using vector retrieval tool faiss.
Step 1.5: creating a vector database: writing the constructed vector index into a vector database, and constructing a 12-class legal regulation, legal case and legal question-answer vector database.
Step 2: obtaining legal questions, inputting the legal question text into a question classification module, and obtaining category information of corresponding legal questions by using a BiGRU-CNN question classification model based on dynamic weight adjustment self-attention. As shown in fig. 3, the problem classification module refers to a problem classification model capable of classifying an input legal problem, wherein the classes include: marital family disputes, traffic accident disputes, labor and recruitment disputes, personal injury and reimbursement, industrial and medical disputes, contract lending disputes, real estate renting and selling disputes, banking and financial insurance, consumption and shopping disputes, village and social neighbors and other contradicting disputes share; and training of BiGRU-CNN problem classification model based on dynamic weight adjustment self-attention, comprising the following steps:
Step 2.1: data preparation: and various legal questions and corresponding class labels thereof are widely collected from authoritative sources such as various legal consultation platforms. And performing operations such as de-duplication, irrelevant information removal, missing value filling, unified format and vocabulary specification on the collected data. The collated data were read according to 7:1.5:1.5 are divided into training, validation and test sets.
Step 2.2: model network structure design: the BiGRU-CNN problem classification model based on dynamic weight adjustment self-attention fuses a deep learning architecture of a convolutional neural network and a bidirectional gating cyclic neural network, the convolutional neural network is used for extracting local features of legal problems, the bidirectional gating cyclic neural network is used for modeling global information of legal problem texts, and a dynamic weight adjustment self-attention layer is used for further extracting deep global semantic features.
Step 2.3: and performing word segmentation processing on the text by using a word segmentation device, and removing stop words to obtain word segmentation results corresponding to the text to be classified. Word embedding operation is carried out on the text information after word segmentation, each word in the natural language is expressed into a vector with unified meaning and dimension, and a word vector matrix is obtained.
The output word vector matrix is input into a convolution layer, and the local characteristics of the text are learned by adopting k sliding windows with different sizes to carry out convolution operation on the text characteristics in the convolution layer, wherein the calculation formula is as follows:
Wherein, The feature vector is obtained after convolution operation; A feature matrix composed of feature vectors; Is a word vector matrix A sub-matrix from row i to row i+k-1; Activating a function for a ReLU; is a bias vector; is the sequence length; the sliding step is 1.
And then, pooling the feature set output by the convolution layer to reserve local key features in the text, discarding irrelevant features, reducing the feature vector dimension and preventing overfitting. And (3) screening out a maximum characteristic value from each sliding window by adopting a maximum pooling (Max Pooling) method, wherein the calculation formula is as follows:
The output word quantity matrix is input into a two-way gating unit (BiGRU), biGRU is a neural network model, which is composed of two opposite-direction unidirectional GRUs (gating loop units), at each moment, the input provides two opposite-direction GRUs at the same time, and the output is determined by the two unidirectional GRUs together.
BiGRU the current hidden layer state is input by the currentInput of hidden layer state forward at time (t-1)And an output of the inverted hidden stateThe three parts jointly determine that BiGRU hidden states at the time t pass through forward hidden statesReverse hidden layer stateWeighted summation results in:
Wherein, 、Respectively represent forward hidden layers corresponding to the bidirectional GRU at the time tReverse hidden stateThe weight of the corresponding weight is set to be equal to the weight,The bias corresponding to the hidden layer state at the time t is represented,Representation ofEncoding operations of the encoder encode word vectors into corresponding non-linear transformations of the input word vectorsAnd outputting global semantic features G after data encoding through BiGRU by the hidden layer state.
The global semantic feature G is input into a dynamic weight adjustment self-attention layer to enhance the feature, a position weight parameter weight is introduced to improve on the basis of a self-attention mechanism, the calculated self-attention weight probability value is redistributed according to the position of text vector training, the text vector weight at the front of the training position is reduced, the text vector weight at the rear of the training position is improved, the representation of optimized text feature vectors is realized, and the expression capability of text features is enhanced. The dynamic weight adjustment self-attention mechanism implementation formula is as follows:
The weight is a parameter iterator, the initial value is 1, and the optimization is continuously carried out in the training process, so that the self-attention integral weight of the characteristic close to the beginning is reduced in training, and the characteristic close to the beginning obtains higher weight; m is the text word length; an n-dimensional vector output for BiGRU; The adjustment factor of the function is usually expressed as the dimension of the input vector, and can adjust the inner product of X.X T, so that uneven distribution of results caused by overlarge value difference obtained by the function is avoided. Dynamic weight adjustment outputs deep global semantic features from the attention layer.
Finally, the local features S obtained by convolution pooling and the deep global semantic features obtained by dynamic weight adjustment from the attention layer are combined and converted into class labels through a feature fusion layer, the probability of each class is calculated by using a Softmax classifier, and the class with the highest probability is taken as a prediction result.
Calculating the loss of the model network by calculating the difference between the predicted result and the real result, and if the loss of the network is continuously reduced, continuously performing the training process until the preset iteration number m is reached, thereby obtaining a final optimized model; if the loss of the network tends to be stable and does not drop significantly any more in the training process, the iteration is stopped, and the model in the current state is taken as a final result.
Step 3: and inputting legal questions, legal question category information and a vector database into a retrieval module to obtain legal knowledge. As shown in fig. 4, the specific implementation of the retrieval module includes the following steps:
Step 3.1: converting legal issue text into vectors: legal issue text is mapped to a high dimensional vector space by an embedded model to form a fixed length dense vector representation.
Step 3.2: database screening: and screening according to the legal problem category to obtain a legal rule, legal case and legal question-answering vector database of the corresponding category.
Step 3.3: calculating the similarity and recalling: by law problem vectorAnd legal knowledge vectorThe cosine similarity is calculated to evaluate the matching degree between the legal problem and the legal knowledge, and the calculation formula is as follows:
Wherein, Is a legal question vectorAnd legal knowledge vectorI.e. the sum after multiplication of the respective corresponding elements; Is that The modular length of the vector is calculated,Is thatThe modulo length of the vector.
Recall process by law knowledge setIs found to be a law question vectorLegal knowledge vector corresponding to the sameLegal knowledge index with maximum dot productThe method is realized by the following calculation formula:
by law knowledge index The recall of legal knowledge texts can be realized, and finally top-k1, top-k2 and top-k3 relevant legal regulations, relevant cases and relevant question-answer knowledge texts with highest similarity are respectively taken as the recall retrieval results.
Step 3.4: and (3) rearranging and screening legal and legal knowledge: and inputting the top-k1 legal and legal knowledge recalled in the previous step into a rearrangement filter for reordering and filtering to obtain top-k1 'legal and legal knowledge, thereby improving the accuracy of the search result, wherein top-k1' < top-k1. The rearrangement screener adopts a BERT sorting model based on self-adaptive edge sorting loss, and splices and constructs training data by using a query and a positive sample or a negative sample corresponding to the query as a pre-training model to be input, wherein the specific construction process is as follows:
And splicing the positive sample or the negative sample corresponding to the query by using a special symbol [ SEP ], and adding special symbols [ CLS ], ' and [ SEP ], ' at the beginning and the end of the spliced sentence to obtain the positive sample or the negative sample, wherein the output corresponding to the position of the [ CLS ], ' is the semantic representation of the whole sentence. And (3) performing BERT coding on the spliced sentences to obtain semantic vectors, mapping the semantic vectors to 1-dimensional scalar by a full-connection layer, and mapping output to a range from 0 to 1 by a sigmoid function, so as to realize the relevance score judgment of query and knowledge. In the model training process, the query and the knowledge are fused to construct a classification task, namely, whether the current relationship between the query and the knowledge is 0 or 1 is predicted, wherein 0 represents that the current query is irrelevant to the recalled knowledge, and 1 represents that the current query and the recalled knowledge are completely relevant. Optimizing using an adaptive edge ordering penalty function The formula is as follows:
where neg (i) represents a negative set of examples corresponding to the positive example of sample i, margin j=αdj, which is a super-parameter, is determined by recalled knowledge and the distance between queries Determining that alpha represents a preset distance adjustment coefficient, wherein the formula means positive sample pair for queryAnd corresponding to negative sample pairThe comparison is made one by one and then added as a penalty to the current query.
Step 4: and integrating legal knowledge and legal questions to construct a prompt template, and inputting the prompt template into a large language model to obtain transitional answers.
In particular, text of legal knowledgeAnd legal question textTogether as a prompt, input a large language modelGenerating transitional answersWherein the large language model uses open source models such as Baichuan, chatGLM3, qwen, etc., transitional answersThe generation formula of (2) is as follows:
Wherein, A prompt is presented.
Step 5: and (3) performing secondary iteration operation, and inputting the transitional answers, the vector database constructed in the step (1) and the question category obtained in the step (2) into a retrieval module to obtain legal knowledge after the secondary iteration. And integrating legal knowledge and legal questions after the second iteration to construct a prompt template, and inputting the prompt template into a large language model to obtain a final answer.
In particular, in the initial iteration stage, only the problem is relied uponThe knowledge base is searched, in the secondary iteration process, as the output of the large language model in the previous iteration can reveal related information possibly related to answer the question, the semantic gap can be bridged by using the output of the large language model in the previous iteration to search legal knowledge, the correlation of the searched knowledge is improved, the legal knowledge after the secondary iteration is obtained after the secondary iteration is searched,
Using legal knowledge after a second iterationAnd legal textTogether as a prompt, input a large language modelGenerating final answersFinal answerThe generation formula of (2) is as follows:
。
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced with equivalents; such modifications and substitutions do not depart from the spirit of the technical solutions according to the embodiments of the present invention.
Claims (10)
1. A legal intelligent question-answering method based on a search enhancement language model is characterized by comprising the following steps:
step 1: obtaining legal texts of different categories, and constructing a database to obtain vector databases of different categories;
Step 2: obtaining legal problem text, and inputting a problem classification model for adjusting self-attention based on dynamic weight to obtain the corresponding category;
Step 3: according to the category of the legal problem text, a matched set of legal knowledge is found from a vector database of the corresponding category through a retrieval model, and then the legal knowledge is rearranged based on the relevance evaluation of the legal problem text and the legal knowledge;
step 4: integrating legal knowledge and legal questions to construct a transitional prompt template, and inputting the template into a large language model to obtain a transitional answer;
Step 5: inputting the transitional answers, the vector database constructed in the step 1 and the question category obtained in the step 2 into a retrieval model to obtain iterative legal knowledge, integrating the iterative legal knowledge and legal questions to construct a final prompt template, and inputting the final prompt template into a large language model to obtain the final answers.
2. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 1, wherein the method comprises the following steps: the construction of the database in the step 1 comprises the following steps:
step 1.1: the obtained legal texts with different categories comprise laws and regulations, judicial cases and legal questions and answers, and the original text is preprocessed;
Step 1.2: cutting the preprocessed long text, cutting the legal and legal texts according to terms, cutting the judicial case text according to case disputed focus and case analysis, and cutting the legal question-answering text according to questions and answers;
step 1.3: coding the cut legal text by using a pre-training embedded model based on legal text fine adjustment, and converting the cut legal text into a high-dimensional feature vector;
step 1.4: mapping the legal text vector obtained by encoding with the original text in an associated manner, and constructing a vector index by using a vector retrieval tool;
Step 1.5: writing the constructed vector indexes into a vector database, and constructing legal regulations, legal cases and legal question-answer vector databases of different categories.
3. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 2, wherein the method comprises the following steps: the pre-training embedded model in the step 1.3 uses professional legal sentences and builds sentence triple samples, the sentence triple samples comprise similar pairs of the professional legal sentences and a dissimilar sentence as negative example contrast, the distance between the positive and negative sentence sample pairs is calculated by using a triple loss function in the fine-training process, the characteristic distance of the positive sample pair is smaller than the characteristic distance of the negative sample pair, and the calculation formula of the triple loss function is as follows:
,
Wherein, margin is a positive number super parameter, which represents a distance threshold value and is used for adjusting the strictness degree of the fine adjustment training process, A vector representation representing the current sentence,Representing a sentence vector semantically similar to the current sentence,Representing sentence vectors that are semantically dissimilar to the current sentence whenAnd (3) withCosine distance ratio of (2)And (3) withWhen the cosine distance of (1) is smaller than the margin, punishment is carried out on the sentence sample.
4. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 1, wherein the method comprises the following steps: the training of the problem classification model in the step 2 comprises the following steps:
step 2.1: collecting various legal problem texts and corresponding class labels thereof;
step 2.2: constructing a problem classification model for adjusting self-attention based on dynamic weight, modeling global information of legal problem texts by the model through a bidirectional gating cyclic neural network, adjusting the self-attention layer through the dynamic weight, inputting the further extracted deep global semantic features and local features of the legal problem texts extracted by a convolutional neural network together into a feature fusion layer, and predicting problem categories by the fused features through a classifier;
step 2.3: word segmentation is carried out on legal problem texts, word embedding operation is carried out on the segmented texts, the obtained word vector matrixes are respectively input into a convolutional network layer and a bidirectional gating cyclic neural network, and a trained problem classification model is obtained through calculating the difference calculation model loss between a prediction result and a real result.
5. The legal intelligent question-answering method based on the search enhancement language model according to claim 4, wherein the method comprises the following steps: in the step 2.3, the convolutional neural network comprises a convolutional layer and a maximum pooling layer, the convolutional layer carries out convolutional operation on the acquired text features through a group of sliding windows with different sizes, the local features of the text are learned, and the calculation formula is as follows:
,
,
Wherein, Representing word vector matricesThe text feature vector obtained after the convolution operation of the ith row,Representing word vector matricesFrom row i to row i + k-1,The activation function is represented as a function of the activation,The offset vector is represented as such,Representing word vector matricesThe feature matrix formed by the text feature vectors of the ith row, k represents the number of sliding windows,Is the sequence length; the sliding step length is 1;
The maximum pooling layer pools the feature set output by the convolution layer, local key features in the text are reserved, a maximum feature value is screened out from each sliding window by adopting a maximum pooling method, and the calculation formula is as follows:
。
6. The legal intelligent question-answering method based on the search enhancement language model according to claim 4, wherein the method comprises the following steps: in the step 2.3, the bidirectional gating cyclic neural network includes two sets of unidirectional gating cyclic units with opposite directions, and at each moment, two gating cyclic units with opposite directions are simultaneously provided for the input word vector matrix, and the hidden layer state at the current t moment is input by the current input Input of hidden layer state forward at time t-1And an output of the inverted hidden stateCo-determination by forward hidden layer stateReverse hidden layer stateWeighted summation results in:
,
,
,
Wherein, Indicating the current input at time t,、Respectively represent the forward hidden state of the gate control circulation unit at the time tReverse hidden stateThe weight of the corresponding weight is set to be equal to the weight,The bias corresponding to the hidden layer state at the time t is represented,The coding operation performed by the gating circulation unit is represented, the word vector is coded into the corresponding hidden layer state of the gating circulation unit through nonlinear transformation of the input word vector, and finally the global semantic features after data coding are output.
7. The legal intelligent question-answering method based on the search enhancement language model according to claim 4, wherein the method comprises the following steps: in the step 2.3, the global semantic features are input into a dynamic weight adjustment self-attention layer to enhance the features, a position weight parameter W weight is introduced on the basis of a self-attention mechanism, the calculated self-attention weight probability value is redistributed according to the position of text vector training, the text vector weight at the front of the training position is reduced, the text vector weight at the rear of the training position is improved, and the dynamic weight adjustment self-attention mechanism has the following implementation formula:
,
,
,
the weight is a parameter iterator, the self-attention overall weight of the front initial feature is reduced through parameter iteration in the training process, the rear feature obtains higher weight, and m represents the text word length; Represents the bi-directional gated recurrent neural network to output global semantic feature vectors, The adjustment factor representing the function, typically the dimension of the input vector, adjusts the inner product of X.X T, and T represents the transpose of the matrix.
8. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 1, wherein the method comprises the following steps: the step 3 comprises the following steps:
Step 3.1: converting legal problem text into vectors;
Step 3.2: screening a vector database of the corresponding category according to the legal problem category;
Step 3.3: to the legal problem vector Legal knowledge vector in corresponding vector databaseCosine similarity is calculated, and legal knowledge index with maximum dot product is used for calculating cosine similarityRecall is realized, and a group of legal knowledge with highest similarity is respectively taken as a recall retrieval result;
step 3.4: and based on a sorting model of the self-adaptive edge sorting loss, carrying out relevance score judgment on legal question query text and legal knowledge, thereby carrying out rearrangement screening on the legal knowledge.
9. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 8, wherein the method comprises the following steps: in the step 3.3, the cosine similarity formula is as follows:
,
,
wherein dot_product (Q, D) represents legal issue vector And legal knowledge vectorIs used for the dot product of (a),Representation ofThe modular length of the vector is calculated,Representation ofThe modular length of the vector is calculated,Representing the legal knowledge index with the largest dot product.
10. The legal intelligent question-answering method based on the retrieval enhancement language model according to claim 8, wherein the method comprises the following steps: the sorting model in the step 3.4 splices legal question query texts and the corresponding positive texts or negative texts by using a second special symbol, adds a first special symbol and a second special symbol at the beginning and the end of a spliced sentence, and takes the obtained positive sample and negative sample as training data, wherein the output corresponding to the position of the first special symbol is the semantic representation of the whole sentence; based on the spliced sentences, semantic vectors are obtained through coding, the semantic vectors are mapped to scalar quantities through a full-connection layer, and after normalization, correlation score judgment of legal problem query texts and legal knowledge is carried out, so that legal knowledge is rearranged; in the model training process, an adaptive edge ordering loss function is usedAnd (3) optimizing:
,
where neg (i) represents a negative set of examples corresponding to positive examples of sample i, margin j is the distance between legal knowledge recalled and legal questions queried Determined hyper-parameters, positive sample pairs for queriesAnd corresponding to negative sample pairThe comparison is made one by one and then added as a penalty to the current query.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410714259.6A CN118277538B (en) | 2024-06-04 | 2024-06-04 | Legal intelligent question-answering method based on retrieval enhancement language model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410714259.6A CN118277538B (en) | 2024-06-04 | 2024-06-04 | Legal intelligent question-answering method based on retrieval enhancement language model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118277538A true CN118277538A (en) | 2024-07-02 |
CN118277538B CN118277538B (en) | 2024-10-01 |
Family
ID=91644545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410714259.6A Active CN118277538B (en) | 2024-06-04 | 2024-06-04 | Legal intelligent question-answering method based on retrieval enhancement language model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118277538B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118469039A (en) * | 2024-07-10 | 2024-08-09 | 恒银金融科技股份有限公司 | Training method and using method of multi-modal language model |
CN118551033A (en) * | 2024-07-30 | 2024-08-27 | 数据空间研究院 | Contradiction dispute plan recommendation method based on large model |
CN118643903A (en) * | 2024-07-30 | 2024-09-13 | 中国科学院深圳先进技术研究院 | Search enhancement generation method, system, equipment and medium, and query method and system |
CN118656481A (en) * | 2024-08-20 | 2024-09-17 | 山东浪潮科学研究院有限公司 | Multi-stage dynamic search question-answering system and working method thereof |
CN118643903B (en) * | 2024-07-30 | 2024-11-15 | 中国科学院深圳先进技术研究院 | Search enhancement generation method, system, equipment and medium, and query method and system |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2718978C1 (en) * | 2019-09-24 | 2020-04-15 | Общество с ограниченной ответственностью «ПРАВОВЕД.РУ ЛАБ» | Automated legal advice system control method |
CN112347269A (en) * | 2020-11-11 | 2021-02-09 | 重庆邮电大学 | Method for recognizing argument pairs based on BERT and Att-BilSTM |
KR20220042838A (en) * | 2020-09-28 | 2022-04-05 | 한국에이아이소프트 주식회사 | Systems and Methods to Provide AI Answering Service for Legal Questions |
CN115168579A (en) * | 2022-07-08 | 2022-10-11 | 智慧中医科技(广东)有限公司 | Text classification method based on multi-head attention mechanism and two-dimensional convolution operation |
CN116341546A (en) * | 2023-02-15 | 2023-06-27 | 道亿科技医疗健康(海南)有限公司 | Medical natural language processing method based on pre-training model |
CN116821297A (en) * | 2023-06-27 | 2023-09-29 | 华院计算技术(上海)股份有限公司 | Stylized legal consultation question-answering method, system, storage medium and equipment |
CN117668199A (en) * | 2023-12-25 | 2024-03-08 | 郑州悉知信息科技股份有限公司 | Intelligent customer service question-answer prediction and recommendation dialogue generation method and device |
CN117725169A (en) * | 2023-11-15 | 2024-03-19 | 清华大学 | Legal question answering method and device based on large model and knowledge guidance |
CN118093829A (en) * | 2024-03-28 | 2024-05-28 | 中国科学技术大学 | Legal consultation method based on knowledge graph enhancement |
-
2024
- 2024-06-04 CN CN202410714259.6A patent/CN118277538B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2718978C1 (en) * | 2019-09-24 | 2020-04-15 | Общество с ограниченной ответственностью «ПРАВОВЕД.РУ ЛАБ» | Automated legal advice system control method |
KR20220042838A (en) * | 2020-09-28 | 2022-04-05 | 한국에이아이소프트 주식회사 | Systems and Methods to Provide AI Answering Service for Legal Questions |
CN112347269A (en) * | 2020-11-11 | 2021-02-09 | 重庆邮电大学 | Method for recognizing argument pairs based on BERT and Att-BilSTM |
CN115168579A (en) * | 2022-07-08 | 2022-10-11 | 智慧中医科技(广东)有限公司 | Text classification method based on multi-head attention mechanism and two-dimensional convolution operation |
CN116341546A (en) * | 2023-02-15 | 2023-06-27 | 道亿科技医疗健康(海南)有限公司 | Medical natural language processing method based on pre-training model |
CN116821297A (en) * | 2023-06-27 | 2023-09-29 | 华院计算技术(上海)股份有限公司 | Stylized legal consultation question-answering method, system, storage medium and equipment |
CN117725169A (en) * | 2023-11-15 | 2024-03-19 | 清华大学 | Legal question answering method and device based on large model and knowledge guidance |
CN117668199A (en) * | 2023-12-25 | 2024-03-08 | 郑州悉知信息科技股份有限公司 | Intelligent customer service question-answer prediction and recommendation dialogue generation method and device |
CN118093829A (en) * | 2024-03-28 | 2024-05-28 | 中国科学技术大学 | Legal consultation method based on knowledge graph enhancement |
Non-Patent Citations (1)
Title |
---|
吴海滨;魏喜盈;王爱丽;岩堀祐之;: "八度卷积和双向门控循环单元结合的X光安检图像分类", 中国光学, no. 05, 13 October 2020 (2020-10-13) * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118469039A (en) * | 2024-07-10 | 2024-08-09 | 恒银金融科技股份有限公司 | Training method and using method of multi-modal language model |
CN118469039B (en) * | 2024-07-10 | 2024-10-01 | 恒银金融科技股份有限公司 | Training method and using method of multi-modal language model |
CN118551033A (en) * | 2024-07-30 | 2024-08-27 | 数据空间研究院 | Contradiction dispute plan recommendation method based on large model |
CN118643903A (en) * | 2024-07-30 | 2024-09-13 | 中国科学院深圳先进技术研究院 | Search enhancement generation method, system, equipment and medium, and query method and system |
CN118551033B (en) * | 2024-07-30 | 2024-10-22 | 数据空间研究院 | Contradiction dispute plan recommendation method based on large model |
CN118643903B (en) * | 2024-07-30 | 2024-11-15 | 中国科学院深圳先进技术研究院 | Search enhancement generation method, system, equipment and medium, and query method and system |
CN118656481A (en) * | 2024-08-20 | 2024-09-17 | 山东浪潮科学研究院有限公司 | Multi-stage dynamic search question-answering system and working method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN118277538B (en) | 2024-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271522B (en) | Comment emotion classification method and system based on deep hybrid model transfer learning | |
CN118277538B (en) | Legal intelligent question-answering method based on retrieval enhancement language model | |
CN110298037B (en) | Convolutional neural network matching text recognition method based on enhanced attention mechanism | |
CN110990564B (en) | Negative news identification method based on emotion calculation and multi-head attention mechanism | |
CN110750635B (en) | French recommendation method based on joint deep learning model | |
CN112487143A (en) | Public opinion big data analysis-based multi-label text classification method | |
CN110674252A (en) | High-precision semantic search system for judicial domain | |
CN117171333B (en) | Electric power file question-answering type intelligent retrieval method and system | |
CN112749274B (en) | Chinese text classification method based on attention mechanism and interference word deletion | |
CN111914062B (en) | Long text question-answer pair generation system based on keywords | |
CN111291188B (en) | Intelligent information extraction method and system | |
CN112328900A (en) | Deep learning recommendation method integrating scoring matrix and comment text | |
CN115269857A (en) | Knowledge graph construction method and device based on document relation extraction | |
CN115048447B (en) | Database natural language interface system based on intelligent semantic completion | |
CN113806547B (en) | Deep learning multi-label text classification method based on graph model | |
CN113987187A (en) | Multi-label embedding-based public opinion text classification method, system, terminal and medium | |
CN115526236A (en) | Text network graph classification method based on multi-modal comparative learning | |
CN109446326B (en) | Biomedical event combined extraction method based on replication mechanism | |
CN116910238A (en) | Knowledge perception false news detection method based on twin network | |
CN114626367A (en) | Sentiment analysis method, system, equipment and medium based on news article content | |
CN114356990A (en) | Base named entity recognition system and method based on transfer learning | |
CN113535928A (en) | Service discovery method and system of long-term and short-term memory network based on attention mechanism | |
CN111859955A (en) | Public opinion data analysis model based on deep learning | |
Xiao et al. | Multi-Task CNN for classification of Chinese legal questions | |
CN117112794A (en) | Knowledge enhancement-based multi-granularity government service item recommendation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |