A legal regulation recommendation system and method based on multi-channel fusion

Through a multi-channel fusion legal and regulatory recommendation system, combined with rule recall, knowledge recall and standard answer recall, the problem of insufficient semantic understanding in the existing technology is solved, and efficient and accurate legal and regulatory recommendations are achieved.

CN119903234BActive Publication Date: 2025-07-25中国司法大数据研究院有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411968921.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-07-25
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

The existing legal search and recommendation technologies have shortcomings in semantic understanding, accuracy and immediacy, and it is difficult to meet the needs of users in the legal consultation process.

Method used

A multi-channel fusion-based legal and regulatory recommendation system is adopted, combining rule recall, knowledge recall and standard answer recall, RRF technology is used for fusion and rearrangement, and the correlation between problems and laws is strengthened through intent understanding and topic dictionary construction.

Benefits of technology

It significantly improves the accuracy and immediacy of legal and regulatory recommendations, ensuring the accuracy and comprehensiveness of the recommendation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903234B_ABST
    Figure CN119903234B_ABST
Patent Text Reader

Abstract

The present invention discloses a legal regulation recommendation system and method based on multi-channel fusion. The method is as follows: 1) Split the legal regulation text according to legal articles and extract structured content to construct a legal regulation set E; 2) Construct a standard answer library, which includes multiple QA pairs; 3) Vectorize each legal article in E using the fine-tuned embedding model E′(·), and vectorize each question Q using the pre-trained embedding model E(·); 4) Perform entity extraction, semantic understanding and knowledge enhancement on the user question Q as the extended information Q of the user question Q e ; Use E′(·) to perform vectorized weighted fusion on the user question Q and Q e to obtain a question vector Q representing the user's intention vec ; 5) Select the k legal articles most relevant to the user question Q from the multi-channel recall results; 6) Calculate the re-ranking scores of each of the k legal articles with the user question Q, and return several legal articles with the highest re-ranking scores to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information recall in natural language processing, and relates to the recall recommendation of laws and regulations. Specifically, it relates to a law and regulation recommendation system and method based on multi-channel fusion, that is, recommending relevant laws and regulations that can solve the problem according to the legal questions input by users. Background Art

[0002] With the popularization of the Internet and the enhancement of the public's legal awareness, more and more people choose to obtain legal consultation services through the Internet. The existing legal provision retrieval technologies mainly include methods such as keyword matching, tag classification, and traditional classification models. However, these methods each have certain limitations and are difficult to meet the user's needs for accurate legal provision recommendation and real-time response.

[0003] 1. Keyword-based retrieval method: This type of method relies on the matching of keywords in the user's question for legal provision retrieval. Although it can quickly find legal provisions related to the keywords, due to the lack of in-depth understanding of semantics, keyword matching may lead to retrieval results that do not match the user's true intention. For example, if the legal question asked by the user contains synonyms or differently expressed keywords, keyword-based retrieval often fails to accurately capture the user's needs, resulting in result deviation.

[0004] 2. Tag-based retrieval method: This method realizes fast retrieval by adding tags or classification tags to legal provisions. Although the tagging process helps to narrow the retrieval scope, the accuracy and comprehensiveness of the tags are crucial for the system effect. The tag division is usually relatively rough and cannot handle complex and abstract legal questions. Moreover, the update and management of tags are difficult, resulting in some legal provisions being misclassified or omitted, affecting the accuracy of the recommendation.

[0005] 3. Classification model-based retrieval method: The classification model classifies legal questions into different categories through a training data set and then returns relevant legal provisions according to the categories. Although this method can provide a certain degree of accuracy in some cases, it lacks flexibility and has a large dependence on the training data. If the training data is insufficient or the data annotation is biased, the accuracy of the classification model will decrease significantly. In addition, the classification model still lacks sufficient understanding of the deep semantics of the user's questions and is difficult to capture complex legal scenarios and user personalized needs.

[0006] In summary, the existing legal provision retrieval and recommendation technologies generally have problems such as insufficient semantic understanding, low accuracy, and inaccurate capture of user intentions, and cannot meet the dual needs of instantaneity and accuracy in the process of legal consultation. Therefore, there is an urgent need for a system that can accurately predict and recommend relevant legal provisions based on in-depth semantic understanding to improve the efficiency and quality of legal consultation retrieval services. Summary of the Invention

[0007] The present invention aims to solve the problems of low efficiency and poor accuracy in the existing legal and regulatory recommendation methods, and thus proposes a legal and regulatory recommendation system and method based on multi-channel fusion. This method fuses multiple recall strategies such as rule recall, knowledge recall, and standard answer recall, and uses the RRF technology to fuse and re-rank the multi-channel results. At the same time, combined with knowledge enhancement methods such as intention understanding and theme dictionary construction, the relevance between the question and the legal provision is strengthened, significantly improving the accuracy of legal and regulatory recommendations and ensuring the immediacy and precision of the recommendation process.

[0008] The technical solution of the present invention is as follows:

[0009] A legal and regulatory recommendation method based on multi-channel fusion, the steps of which include:

[0010] 1) Split the legal and regulatory text by legal provisions and extract the structured content to construct a legal and regulatory set E = {l i | i = 1, 2, …, n}; where, l i represents the i-th legal provision;

[0011] 2) Construct a standard answer library, which includes multiple QA pairs, and each QA pair includes a question Q and an answer text A;

[0012] 3) Fine-tune the pre-trained embedding model E(·) using the question-legal provision pair dataset G to obtain a fine-tuned embedding model E′(·); use the embedding model E′(·) to vectorize each legal provision in the legal and regulatory set E and store it in the legal provision vector library; for each question Q in the standard Q&A library, use the pre-trained embedding model E(·) to vectorize it and store it in the legal provision vector library;

[0013] 4) Use the question understanding module to perform entity extraction, semantic understanding, and knowledge enhancement on the received user question Q as the extended information Q e of the user question Q; use the embedding model E′(·) to vectorize the user question Q and its extended information Q e , and then perform weighted fusion on the obtained vectors to obtain a question vector Q vec representing the user's intention;

[0014] 5) Use the BM25 model to recall several relevant legal provisions from the legal and regulatory library E that are most relevant to the user question Q; calculate the similarity between the question vector Q vec and each legal provision vector in the legal provision vector library, and recall several legal provisions with the highest similarity; and select several Q&A pairs semantically similar to the user question Q from the standard answer library and extract the legal provisions from the answer part of each selected Q&A pair to obtain a relevant legal provision set LA as the recall results; then comprehensively sort the recall results from all channels and select the top-k legal articles L = {L1, L2, …, L k} that are most relevant to the user's question Q;

[0015] 6) Input the top-k legal articles L = {L1, L2, …, L k} and the user's question Q into the re-ranking model, calculate the re-ranking scores of each legal article in L = {L1, L2, …, L k} with respect to the user's question Q, and return several legal articles with the highest re-ranking scores to the user.

[0016] Furthermore, in step 1), design multi-stage prompt words, including the prompt word P m for generating topic words, the prompt word P k for generating keyword words, the prompt word P d for generating the interpretations of keyword words, and the prompt word P q for generating potential legal issues related to legal articles; for each legal article l i , first use the prompt word P m to guide the large language model to generate topic words, use the prompt word P k to guide the large language model to generate keyword words, and label the legal article l i using the generated topic words and keyword words; then for each keyword k i of the legal article l ij , use the prompt word P d to guide the large language model to generate the interpretation D(k ij ); then based on the topic words, keyword words and interpretations of the legal article l i , use the prompt word P q to generate potential legal issues related to the legal article l i , and predict the actual application scenario Q(T(l i ), k i , D(k ij )) = {q1, q2, …, q ij}, where q m is the m-th potential issue corresponding to the legal article l m . i

[0017] ​Further, the method for constructing the standard answer library is as follows: First, use the fuzzy matching method to filter out the answer texts that do not mention legal provisions. Then, perform regular extraction on each answer text to obtain the laws and their numbers included therein, and detect the legal status of each extracted law. If any of the laws in the answer text are invalid, repealed, or do not exist, the QA pairs in the answer text will be filtered out. Then, use the natural language inference matching and screening method to perform preliminary screening on each remaining QA pair, and then use the multi-model verification method to verify each remaining QA pair after preliminary screening, and store the verified QA pairs into the standard answer library.

[0018] Further, the question-law pair dataset G = {(Q j1 , Q j2 , …, Q jm , L j ) | j = 1, 2, …, N}, where the law L j is associated with m questions Q j1 , Q j2 , …, Q jm . Q jm represents the m-th question generated by the large language model according to the law L j .

[0019] Further, a sparse network layer is introduced at the output end of the pre-trained embedding model E(·) for generating sparse vectors.

[0020] Further, use the embedding model E′(·) to convert each law l in the laws and regulations set E into a dense vector e l and a sparse vector w l and store them in the law vector library. Use the embedding model E′(·) to convert the associated knowledge corresponding to each law l into a dense vector and a sparse vector and store them in the law vector library. For each question Q in the standard Q&A library, use the pre-trained embedding model E(·) to generate the dense vector e Q and the sparse vector w l and store them in the law vector library. The associated knowledge includes topic words, keywords, interpretations, and potential questions.

[0021] Further, the i-th law l i = {regulation name, article number, timeliness, legal type, law content, ……}; each law is stored in a tree-like or table structure.

[0022] A legal regulations recommendation system based on multi-path fusion, characterized by comprising a legal regulations set construction module, a standard answer library construction module, a law vector library construction module, a question understanding module, a multi-path recall module, and a re-rank model;

[0023] The legal regulation set construction module is used to split the legal regulation text according to legal articles and extract structured content, and construct a legal regulation set E = {l i |i = 1, 2, …, n}; where l i represents the i-th legal article;

[0024] The standard answer library construction module is used to construct a standard answer library, which includes multiple QA pairs, and each QA pair includes a question Q and an answer text A;

[0025] The legal article vector library construction module is used to fine-tune the pre-trained embedding model E(·) using the question-legal article pair dataset G to obtain a fine-tuned embedding model E′(·); then use the embedding model E′(·) to vectorize each legal article in the legal regulation set E and store it in the legal article vector library; and for each question Q in the standard Q&A library, use the pre-trained embedding model E(·) to vectorize it and store it in the legal article vector library;

[0026] The question understanding module is used to perform entity extraction, semantic understanding and knowledge enhancement on the received user question Q as the extended information Q of the user question Q e ; use the embedding model E′(·) to vectorize the user question Q and its extended information Q e and perform weighted fusion on the obtained vectors to obtain a question vector Q representing the user's intention vec ;

[0027] The multi-path recall module is used to recall several relevant legal articles most relevant to the user question Q from the legal regulation library E using the BM25 model; calculate the similarity between the question vector Q vec and each legal article vector in the legal article vector library, and recall several legal articles with the highest similarity; and select several Q&A pairs semantically similar to the user question Q from the standard answer library and extract legal articles from the answer part of each selected Q&A pair to obtain a relevant legal article set L A as the recall result; then comprehensively sort the recall results of each path and select the top-k legal articles L = {L1, L2, …, L k} most relevant to the user question Q;

[0028] The re-rank model is used to calculate the re-rank score of each legal article in the top-k legal articles L = {L1, L2, …, L k} with respect to the user question Q, and return several legal articles with the highest re-rank score to the user.

[0029] A server, characterized in that it includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing the above method.

[0030] A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program realizes the above method when executed by a processor.

[0031] A method for recommending laws and regulations based on multi-channel fusion, including the following steps:

[0032] Step 1. Construction of the laws and regulations library: (a) Obtain the latest and most complete laws and regulations texts from multiple sources such as national laws, local regulations, and legislative materials; split the collected laws and regulations by article and extract structured content to construct a set of laws and regulations E = {l i |i = 1, 2,..., n}. Among them, l i represents the i-th article of the law and includes the following text information: l i = {regulation name, item number, timeliness, legal type, content of the article,...}. The articles of the law are stored in a tree or table structure for convenient subsequent recall and associated query. (b) To further improve the accuracy of recommendation, a multi-stage prompt is designed to guide the large language model to parse the text of the articles of the law and generate metadata related to the articles of the law, including subject words, keywords, keyword interpretations, and potential legal issues. The multi-stage prompt includes a prompt P m for generating subject words, a prompt P k for generating keywords, a prompt P d for generating interpretations of keywords, and a prompt P q for generating potential legal issues related to the articles of the law. First, use the prompt P m to generate subject words and the prompt P k to generate keywords. These subject words and keywords are used to label the core content of the articles of the law for convenient quick indexing and matching. Then, for each keyword k ij , use the prompt P d to guide the model to generate detailed interpretations and background information: D(k ij ) = interpretation(k ij ). Input the prompt P d into the large language model to directly generate the interpretation and background information of the keyword k ij . Finally, based on the subject words, keywords, and interpretations, use the prompt P q to generate potential legal issues related to the articles of the law and predict the actual application scenarios of the articles of the law: Q(T(l i ), k ij, D(k ij )) = {q1, q2, …, q m}, where the subject term T(l i ), keyword k ij , interpretation D(k ij ), and prompt word P q are input into the large language model, and Q(T(l i ), k ij , D(k ij )) = {q1, q2, …, q m} can be output, where q m is the m-th potential problem corresponding to the i-th legal provision. By splitting and structurally storing the regulations, the system can quickly recall and manage a large number of regulation texts.

[0033] Step 2: Construction of the standard answer library: (a) Automatically collect millions of real user legal consultation question-and-answer pairs (QA pairs) from the Internet and the company's legal regulations recommendation system to ensure a wide collection range covering various legal regulation scenarios. (b) To ensure the high quality and consistency of the standard answer library, strict quality screening is required to filter out invalid or unqualified question-and-answer pairs. The final obtained standard answer library includes multiple QA pairs, and each QA pair includes a question Q and an answer text A as the standard legal question-and-answer pair. The following multi-level quality screening method is specifically adopted:

[0034] 1. Fuzzy matching and rule filtering

[0035] To ensure that the answers in the QA pairs in the standard answer library are based on clear legal provisions, those answers that do not cite legal regulations should be excluded first. The fuzzy matching and rule filtering method is used to identify and filter these invalid answers. Specifically, fuzzy matching is to search for keywords containing legal terms and article numbers, such as "XX Law", "Article XX", "XX Interpretation", etc., and filter out the answers that do not mention legal provisions. For example, regular expressions are used to match these keywords:

[0036]

[0037] Only the answers that satisfy Match(A) = 1 will be retained. Further, rule filtering is to perform regular extraction of the legal provisions and their numbers from the answer text A, such as "Article 47 of the Labor Law". These identified legal provisions are temporarily stored as a set L A = {l1, l2…, l n}, where l i represents the i-th provision cited in the answer, i = 1~n. Each identified legal provision l iIt will be matched with the legal database D in the system. The database D contains all currently effective legal provisions and their statuses (effective, invalidated, repealed).

[0038]

[0039] Among them, D valid represents the set of currently effective legal articles. If all the legal articles in the answer pass the verification (i.e., Valid Law Check(l i ) = 1 for all l i ∈L A holds, then the answer is retained:

[0040]

[0041] If the answer contains any invalidated, repealed or non-existent legal articles, then the QA pair will be filtered.

[0042] 2. Natural Language Inference Matching and Screening

[0043] To ensure the semantic relevance between the question and the answer, a Natural Language Inference (NLI) matching algorithm is introduced for preliminary screening. The NLI model can judge the relationship (entailment, contradiction, neutral) between the question and the answer to ensure that the answer truly responds to the intention of the question.

[0044] Working principle of the NLI model: Given a question (Q) and an answer (A), the NLI model judges whether there is one of the following relationships between A and Q:

[0045] Entailment: The answer is a valid response to the question.

[0046] Contradiction: The answer contradicts the question.

[0047] Neutral: The answer has nothing to do with the question and cannot directly answer the question.

[0048] Screening rules and decision formula: Using the NLI model trained by RoBERTa, the question Q and the answer A are input into the model to generate the probability distribution of three types of relationships: P(E) + P(C) + P(N) = 1. Among them, P(E) represents the probability of entailment, P(C) represents the probability of contradiction, and P(N) represents the probability of neutral. The NLI screening rules are as follows:

[0049]

[0050] Among them, θ is the threshold of the entailment probability (the recommended value is 0.85). Only when P(E) is higher than θ will the QA pair be retained. Otherwise, the QA pair will be filtered. Through the NLI screening method, it is possible to more accurately judge whether the answer truly responds to the question, thereby reducing the entry of irrelevant or invalid Q&A pairs and improving the overall quality of the standard answer library.

[0051] 3. Multi-model verification

[0052] To further enhance the robustness of quality screening. After preliminary screening, multiple advanced semantic models (such as BERT, SimCSE, large language models) are used to deeply verify the screened QA pairs, calculate their comprehensive scores, and ensure the consistency of the Q&A pairs in the multi-model semantic space. Integrate multiple semantic matching models to calculate the consistency score and take the average value to ensure the robustness of the result:

[0053]

[0054] Among them, Score i is the matching score of the i-th model, and n is the total number of models. Only QA pairs with a final score exceeding a certain threshold can be included in the standard answer library.

[0055] (c) Add the high-quality QA pairs that have passed quality screening to the standard answer library in an incremental manner. After each update, the system performs a deduplication operation on the newly added QA pairs to ensure that there are no semantically duplicate contents in the library. Incremental update formula: A t+1 = A t ∪ΔA. Among them, A t is the standard answer library at time t, and ΔA is the newly screened incremental QA pairs.

[0056] (d) Automatically update and construct the standard Q&A library A in a loop. The system automatically executes the above steps (a), (b), and (c) at a set time interval (such as daily, weekly) to ensure that the content of the standard answer library is always up-to-date and complete. The automated process can be achieved through a loop task scheduling system. For example: T(i + 1) = T(i) + Δt, where T(i) is the execution time of the i-th time, and Δt is the interval period. Such a designed automated process ensures that the standard answer library can dynamically adapt to the latest laws and regulations and user needs, providing reliable knowledge support for the recommendation performance of the system.

[0057] Step 3: Construction of the legal provision vector library: To implement an efficient legal provision recommendation system based on multi-way fusion, it is necessary to construct a sparse and dense vector library to achieve semantic matching and efficient recall between legal provisions and questions.

[0058] (a) Synthesize and fine-tune data based on LLM

[0059] Due to the lack of sufficient high-quality question-statute pair data, this system utilizes large language models to select appropriate question generation strategies for each statute and randomly generate multiple questions, constructing a diverse synthetic dataset. These questions need to be rich and comprehensive in breadth and depth to ensure that each statute is understood and expressed from multiple perspectives. The following are some question generation strategies:

[0060] 1. Background questions: Generate questions based on the applicable scenarios of the statute, simulating the background questions that users may raise in reality. Example: For labor law statutes, generate questions such as "Can a company terminate an employee without cause during the probation period?"

[0061] 2. Reverse reasoning questions: Construct opposing or contrary scenarios to test the boundaries and exceptions of the statute. Example: For provisions in the Consumer Rights Protection Law, generate questions such as "Can a refund be applied for if the return period exceeds 7 days?"

[0062] 3. Detail questions: Focus on the specific details of the statute, such as time, amount, procedural regulations, etc. Example: For tax law provisions, generate questions such as "By what time does the annual declaration need to be completed?"

[0063] 4. Vague questions: Generate questions containing vague or informal descriptions to simulate users' daily language expressions. Example: For regulations in the Intellectual Property Law, generate questions such as "Is it legal to use someone else's creative pictures without permission?"

[0064] 5. Clause comparison questions: Compare the differences between similar or related clauses to help users understand the nuances. Example: For provisions in the Contract Law and the Consumer Law, generate questions such as "What are the differences between a commodity sales contract and a service contract?"

[0065] 6. Multi-step reasoning questions: Design questions that require reasoning across multiple clauses or regulations to obtain answers, simulating complex scenarios. Example: For multiple clauses in the Company Law, generate questions such as "Can a company's shareholder transfer shares after a creditor files a lawsuit?"

[0066] 7. Case analysis questions: Generate questions based on actual or hypothetical cases to help the model handle complex scenarios. Example: For criminal law provisions, generate questions such as "If Party A spreads rumors in public, does it constitute a crime?"

[0067] According to the above strategy examples (not limited to these types), randomly select applicable strategies for each statute and generate multiple questions to form a diverse question-statute pair dataset G = {(Q j1 , Q j2 , …, Q jm , L j ) | j = 1, 2, …, N}, where the statute L jassociated with m questions Q j1 , Q j2 , …, Q jm to enhance the diversity and coverage of the dataset, where Q jm represents the m-th question generated by the large language model according to the legal provision L j .

[0068] (b) Fine-tuning the embedding model based on the synthetic dataset

[0069] The pre-trained embedding model E(·) is trained based on general corpus and is more suitable for similarity measurement in general scenarios. However, when applied to the legal field, the model often lacks in understanding legal terms, the logical relationship of legal provisions, and domain-specific semantics. Therefore, it is necessary to fine-tune the model using legal field data so that the model can better adapt to the semantic association and matching requirements in legal scenarios. Thus, this patent uses the generated dataset G to fine-tune the pre-trained embedding model E(·) to enable the model to better capture the semantic association between questions and legal provisions. During the fine-tuning process, the model will optimize the representations of both dense and sparse vectors simultaneously to improve the recall and matching accuracy. Specifically, for each pair of data (Q, L) ∈ G, the hidden state vectors will be generated respectively: H Q = E(Q), H L = E(L). Then, use norm(·) to normalize the first vector of the question vector H Q and the legal provision vector H L respectively to obtain their respective dense vectors: e Q = norm(H Q [0]), e L = norm(H L [0]). The core of dense recall is to calculate the inner product between the question and the legal provision to measure their semantic relevance: s dense = <e Q , e L >. Here, the <·> operation represents the inner product between two embedding vectors, and the larger the inner product value, the higher the semantic relevance between the question and the legal provision. Considering the particularity of the legal field, a sparse network layer is introduced at the output end of E(·) to address issues such as the model's domain adaptability, information density, and computational efficiency. The sparse network layer is used to generate sparse vectors, with its input H Q , and the output is w Qt, the results will be stored in the Milvus database. Sparse network layers perform well in handling technical terms or rare keywords and focus on key features rather than capturing all subtle relationships, making them more efficient in text search. The main purpose of the sparsification process is to select important terms in the questions and legal articles based on the weight estimation of terms and use the weights of these terms for lexical recall. Here, the hidden state vectors H Q and H L are used to estimate the importance of each term. Specifically, for each term in the question, its importance in the question is determined by calculating its weight. The weight calculation formula is: where is the weight matrix that maps the hidden state to a scalar. H Q [i] represents the hidden state vector of the i-th term in the question. ReLU(·) is the rectified linear unit (ReLU) activation function, which is used to ensure that the weights are non-negative. If a term t appears multiple times in the question, only the maximum weight (i.e., the maximum importance) of that term is retained. This strategy ensures that repeated terms are not overestimated due to simple frequency accumulation. Next, the weights of the terms in the legal article are calculated in the same way: H L [i] represents the hidden state vector of the i-th term in the legal article. Similarly, for terms that appear repeatedly in the legal article, only its maximum weight is retained. Further, the correlation score between the question and the legal article needs to be calculated, considering the common terms between them (i.e., Q∩L), and the final matching score is calculated based on the weights of these terms: s sparse =∑ t∈Q∩L (w Qt ·w Lt ). Where w Qt and w Lt represent the weights of the term t in the question and the legal article respectively. This formula obtains the lexical-level correlation score s sparse between the question and the legal article by summing the products of the weights of all common terms. Finally, a joint loss function is used to optimize the semantic correlation between the sparse and dense vectors. Through the above steps, the fine-tuned embedding model is represented as: E′(·)=FineTune(E(·),G). The fine-tuned model E′(·) can generate high-quality dense and sparse vectors and better capture the semantic association between the question and the legal article. This optimization process ensures the semantic matching ability of the model at different levels, enabling the legal regulation recommendation system to have higher accuracy and efficiency in complex recall tasks.

[0070] (c) Incorporation of legal articles, related knowledge, and standard questions into the database

[0071] To achieve efficient recall and matching, candidate legal articles, associated knowledge (such as topic words, keywords, interpretations, and potential problems, etc.), and questions in the standard Q&A library are encoded into dense vectors and sparse vectors, and these vectors are stored in the Milvus vector database for fast query. Specifically, using the pre-trained and fine-tuned embedding model E′(·), the legal article L is converted into a dense vector e L and a sparse vector w L , and then cached in the Milvus vector database. After storing the vectors, the system constructs an ANN (Approximate Nearest Neighbor) index for the dense vector table in the Milvus database to improve the recall performance. Similarly, the associated knowledge also uses the fine-tuned embedding model E′(·) to complete this vectorization and storage process, generating the dense vector and sparse vector corresponding to each piece of associated knowledge. Further, for each question Q in the standard Q&A library, the untuned embedding model E(·) is used to generate the dense e Q and sparse vector w Q . Similarly, the generated question vectors are stored in the corresponding tables of Milvus respectively.

[0072] Step 4. Understand the user question Q. After the user inputs a question Q, the question understanding module of this system will deeply analyze this question, including: entity extraction, semantic understanding, and knowledge enhancement. Specifically, it is divided into the following 3 small steps:

[0073] (a) Entity extraction: Use the UIE (Unified Information Extraction) model to extract key entities from the question Q, such as the legal name Q title , article number Q item and query topic Q key , etc. The purpose of using the UIE model lies in its high efficiency and accuracy, which can quickly identify and extract relevant legal entities E Q ={Q title :[e1,…,e n ,Q item :[e1,…,e n ,Q key :[e1,…,e n}.

[0074] (b) Semantic understanding: Guide the large language model to accurately analyze the implicit meaning and complex context in the question. This step constructs a specific Prompt template to guide the model to not only recognize the literal meaning of the question but also capture the potential semantic levels, such as the specific application of legal terms and the context-dependent meaning interpretation.

[0075] (c) Knowledge Enhancement: Design prompts for large language models to summarize key information such as legal terms, dispute focuses, legal issues, and problem explanations. At this stage, the model utilizes its extensive legal knowledge base and semantic understanding capabilities acquired during previous training to conduct in-depth analysis of the problem, thereby providing detailed legal insights and explanations to help the system accurately identify and respond to users' legal consultation needs.

[0076] (d) Integrate the information parsed in (a), (b), and (c) as the extended information Q of the question e , and use the embedded model E′(·) fine-tuned in Step 3 to encode Q and Q e , and then perform weighted fusion to obtain a question vector Q representing the user's intention vec .

[0077] Step Five, Multi-channel Recall: To improve the accuracy and coverage of the legal regulations recommendation system, the present invention integrates different information sources and model capabilities through a multi-channel recall method. This process includes three recall paths: rule recall, knowledge recall, and standard answer recall, and uses weighted fusion and the RRF (Reciprocal Rank Fusion) algorithm to comprehensively sort the results of each path, finally obtaining the relevant legal articles for the next stage (i.e., the re-ranking stage).

[0078] (a) The first path (rule recall) uses the BM25 model for recall. This model mainly evaluates the relevance between the question and legal articles based on term frequency and inverse document frequency. For the user question Q, use the BM25 model to recall the top p relevant legal articles most relevant to the question Q from the legal regulations library E. The scoring function of BM25 is:

[0079]

[0080] where M is the total number of legal articles, m(t) is the number of legal articles containing the term t, f(t, L) represents the number of times the term t appears in the legal article L, |L| is the length of the legal article L, avgdL is the average legal article length, and k1 and b are adjustable hyperparameters. Calculate the matching score for each legal article through BM25 and return the top-p legal articles.

[0081] (b) The second path (knowledge recall) uses the fine-tuned embedded model E′(·) to encode the user question Q and its extended information Q e to generate a vector representation Q vec =αE′(Q)+βE′(Q e), where α and β are adjustable parameters and α + β = 1. Calculate the semantic similarity between this vector and the legal article vectors in the legal article vector library. The legal articles in the legal article vector library have integrated legal knowledge such as the theme and interpretation to enhance the semantic matching ability. Vector recall uses cosine similarity to calculate the similarity between the question and the legal article:

[0082]

[0083] Among them, Q vec represents the vector representation of the user's question, and L vec is the vector representation of the legal article. Finally, recall the top-p legal articles.

[0084] (c) The third path (standard answer recall) recalls the top-n Q&A pairs (Q, A i ) that are semantically similar to the user's question Q from the standard answer library. Extract legal articles from the answer part A i to obtain the relevant legal article set L A = {L A1 , L A2 , …, L An}.

[0085] (d) Multi-path recall result fusion and ranking. The RRF algorithm is used to fuse the recall results of the three paths. The formula for calculating the RRF score for each legal article L i is as follows:

[0086]

[0087] Among them, R is the number of paths, k r is the smoothing parameter of path r, and rank r (L i ) is the ranking of legal article L i in path r. Finally, sort the legal articles according to the RRF score and return the top-k legal articles as the input for the next stage (i.e., the re-ranking stage).

[0088] Step 6. After obtaining the top-k legal articles through multi-path recall, the system enters the re-ranking stage to further optimize the recommendation order. In this stage, the re-ranking model performs a secondary ranking on the preliminary recall results to improve the accuracy and relevance of the recommendation results. The re-ranking model is a supervised learning model. The input is the top-k legal articles L = {L1, L2, …, L k} obtained through multi-path recall and the user's question Q, and the output is the re-ranking score S(L i ) of the legal article and the final ranking. The goal of the re-ranking model is to capture the deep semantic relationship between the legal article and the user's question, and at the same time perform refined ranking by combining the context information and the legal knowledge of the legal article.

[0089] The advantages of the present invention are as follows:

[0090] Advantage 1: Multi-channel fusion: Through parallel retrieval of three paths: rule recall, knowledge recall, and standard answer recall, and using RRF for fusion and re-ranking, the advantages of different information sources are efficiently integrated, thereby significantly improving the accuracy and comprehensiveness of legal article recommendations.

[0091] Advantage 2: Knowledge enhancement and multi-dimensional vectorization: Metadata such as subject words, keywords, paraphrases, and potential legal issues are introduced in the construction of the legal regulations library, and the legal articles are deeply analyzed and annotated through multi-stage prompt technology. At the same time, the legal articles and related knowledge are processed with sparse and dense vectorization, enabling the system to obtain stable results relying on the weights of terms during retrieval and achieve high-correlation matching relying on the embedding model of deep semantic understanding, thus realizing fast, accurate, and deeply intelligent legal regulations recommendations.

[0092] Advantage 3: Automatically build a high-quality standard answer library: A highly reliable standard answer library is constructed through automatic collection, strict multi-level quality screening, and multi-model verification strategies, providing an effective reference for one of the recall paths. This rigorous data governance and optimization process ensure that the system can continuously and stably provide accurate and reliable legal article recommendation results in complex legal consultation scenarios. Description of the Drawings

[0093] Figure 1 It is a model framework diagram of the embodiment.

[0094] Figure 2 It is a schematic diagram of the automatic incremental update of the standard answer library construction in the embodiment. Detailed Implementation Modes

[0095] The present invention will be further described in detail below with reference to the drawings. The examples given are only used to explain the present invention and are not intended to limit the scope of the present invention.

[0096] Embodiment:

[0097] Refer to Figure 1 , a legal regulations recommendation system and method based on multi-channel fusion, including the following steps:

[0098] Step 1: Construct a legal regulations library.

[0099] Obtain the latest and most complete legal regulations texts from multiple sources such as national laws, local regulations, and legislative materials; split the collected legal regulations by article, and extract structured content to construct a legal regulations library E = {l i |i = 1, 2,..., n}. Among them, l i represents the i-th legal article and includes the following legal article information: l i={Legal regulation name, Article number, Timeliness, Legal type, Content of legal article, ……}. Table 1 shows an example of a legal article in the legal regulation library.

[0100] Table 1 Example of a legal article

[0101]

[0102]

[0103] As shown in Table 2, multi-stage prompts are designed to guide the large language model to parse the legal article text and generate metadata related to the legal article, including subject words, keywords, keyword interpretations, and potential legal issues. By splitting and structurally storing the legal regulations, the system can quickly recall and manage a large number of legal regulation texts. Table 3 shows the metadata information related to the legal article parsed by the large model.

[0104] Table 2 Example of multi-stage prompts (classified content omitted)

[0105]

[0106]

[0107] Table 3 Example of metadata

[0108]

[0109] Step 2: Construction of the standard answer library.

[0110] As Figure 2 shown is the schematic diagram of the automatic incremental update for the construction of the standard answer library. (a) From the Internet and the company's legal regulation recommendation system, automatically crawl and collect millions of real user legal consultation question-and-answer pairs (QA pairs) to ensure a wide collection range covering various legal regulation scenarios. Table 4 lists some examples of the collected initial QA pairs.

[0111] Table 4 Example of initial QA pairs

[0112]

[0113]

[0114] (b) Further, strictly screen the quality of the initial QA pairs, filter out invalid or unqualified question-and-answer pairs, and specifically adopt a multi-level quality screening method:

[0115] 1. Use fuzzy matching to match legal terms in the answers. For example, "Labor Law" in A1 and "Civil Code" in A2. Through fuzzy matching, (Q1,A1), (Q2,A2), (Q3,A3), (Q6,A6), and (Q7,A7) have all matched specific legal provisions, so they have passed the screening of fuzzy matching and are retained. While (Q4,A4) and (Q5,A5) do not cite legal provisions and are filtered out. Further, rule filtering is to perform regular extraction of legal articles and their numbers on the answer text A. For example, extract "Article 10 of the Contract Law of the People's Republic of China" from A3. Each identified legal article will be matched with the legal database in the system. The database contains all currently effective legal provisions and their status (effective, invalid, repealed). If the answer contains any invalid, repealed, or non-existent legal articles, the QA pair will be filtered. For example, "Article 10 of the Contract Law of the People's Republic of China" in (Q3, A3) is marked as invalid in the database and is filtered.

[0116] 2. Use a natural language inference (NLI) model to judge the relationship between the question and the answer. The screening rules and decision formula are as follows: Input the question Q and the answer A into the NLI model trained with RoBERTa as the base to generate the probability distribution of three types of relationships: P(E)+P(C)+P(N) = 1. Among them, P(E) represents the probability of entailment, P(C) represents the probability of contradiction, and P(N) represents the probability of neutrality. The NLI screening rules are as follows:

[0117]

[0118] Among them, θ is the threshold of the entailment probability (the recommended value is 0.85). Only when P(E) is higher than θ will the QA pair be retained. Otherwise, the QA pair will be filtered. Therefore, for the QA pairs in the example, the following results are obtained:

[0119] (Q1,A1) - P(E) = 0.98 (entailment)

[0120] (Q2,A2) - P(E) = 0.90 (entailment)

[0121] (Q7,A7) - P(E) = 0.20 (contradiction)

[0122] Entailment means that the answer is an effective response to the question. (Q1,A1) and (Q2,A2) meet the requirements and need to be retained. Contradiction or neutrality indicates that the answer is contradictory or irrelevant to the question. Therefore, (Q7,A7) needs to be filtered out. Through the NLI screening method, it is possible to more accurately judge whether the answer truly responds to the question, thereby reducing the entry of irrelevant or invalid Q&A pairs and improving the overall quality of the standard answer library.

[0123] 3. Further, perform in-depth verification on the remaining QA pairs using multi-model verification and calculate the comprehensive score. Specifically, multiple advanced semantic models such as BERT, SimCSE, and large language models are used to calculate the relevance scores of each pair of QA, and the average value is taken:

[0124]

[0125] Among them, Score i is the matching score of the i-th model, and n is the total number of models. Only the QA pairs with the final score exceeding the set threshold (0.85) can be included in the standard answer library. The input QA pairs and model scores are as follows:

[0126] Score_1(Q1,A1) = 0.88, Score_2(Q1,A1) = 0.96, Score_2(Q1,A1) = 0.92

[0127] Score_1(Q2,A2) = 0.87, Score_2(Q2,A2) = 0.85, Score_2(Q1,A1) = 0.93

[0128] Score_1(Q6,A6) = 0.78, Score_2(Q6,A6) = 0.80, Score_2(Q6,A6) = 0.69

[0129] Calculate the final score:

[0130] (Q1,A1): Final score = (0.88 + 0.96 + 0.92) / 3 = 0.92

[0131] (Q2,A2): Final score = (0.87 + 0.85 + 0.93) / 3 = 0.88

[0132] (Q6,A6): Final score = (0.78 + 0.80 + 0.69) / 3 = 0.75

[0133] Screening results:

[0134] (Q1,A1) and (Q2,A2) have scores higher than the threshold and are retained.

[0135] (Q6,A6) has a score not reaching the threshold and is filtered out.

[0136] (c) Add the high-quality QA pairs that have passed the quality screening to the standard answer library in an incremental manner. After each update, the system performs a deduplication operation on the newly added QA pairs to ensure that there is no semantically repeated content in the library. Incremental update formula: A t+1 = A t∪ΔA. Where A t is the standard answer library at time t, and ΔA is the newly screened incremental QA pairs.

[0137] (d) Automatically update and construct the standard Q&A library A in a loop. The system automatically executes the above steps (a), (b), and (c) at set time intervals (such as daily or weekly) to ensure that the content of the standard answer library is always up-to-date and complete. The automation process can be achieved through a loop task scheduling system. For example: T(i + 1) = T(i) + Δt, where T(i) is the execution time of the i-th time, and Δt is the interval period. Such a designed automation process ensures that the standard answer library can dynamically adapt to the latest laws and regulations and user needs, providing reliable knowledge support for the recommendation performance of the system.

[0138] Step Three: Construct sparse and dense vector libraries.

[0139] Use a large language model to synthesize high-quality question-law pairs as training samples, and fine-tune the BGE-M3 model to obtain a new embedding model E suitable for the legal field model , and use this model to encode the law-related knowledge (such as subject words, interpretations, etc.) and the questions in the standard Q&A library into dense and sparse vectors, which are respectively represented as: LK dense ={lk d1 ,lk d2 ,…,lk dn},

[0140] LK sparse ={lk s1 ,lk s2 ,…,lk sn},

[0141] Q dense ={q d1 ,q d2 ,…,q dn},

[0142] Q sparse ={q s1 ,q s2 ,…,q sn}}.

[0143] Among them, each law vector has integrated legal knowledge such as the subject and interpretation, and then these vectors are stored in the Milvus vector database. After storing the vectors, the system constructs an ANN (Approximate Nearest Neighbor) index for the dense vector table in the Milvus database for fast query.

[0144] Step Four: Generally, for a user question Q, first, through Figure 1 's question understanding module, perform in-depth parsing on Q. Specifically, it includes the following sub-steps:

[0145] (a) Use the UIE (Unified Information Extraction) model to extract legal-related term concepts, entities, etc. from Q for assisting in queries, such as legal name Q title = {e1,…,e n}, item number Q item = {e1,…,e n} and query topic Q key = {e1,…,e n}, etc.

[0146] (b) Guide the large language model to accurately parse the implicit meaning and complex context in the question. This step constructs a specific Prompt template to guide the model to not only recognize the literal meaning of the question but also capture the potential semantic level S Q , such as the specific application of legal terms and the context-dependent meaning interpretation.

[0147] (c) Design the Prompt of the large language model to summarize key information such as legal terms, dispute focuses, legal issues, and question explanations. At this stage, the model uses its extensive legal knowledge base and semantic understanding ability obtained from previous training to deeply analyze the question, so as to provide detailed legal insights and explanations Key Q = {key1,key2,key3}, helping the system accurately identify and respond to the user's legal consultation needs.

[0148] (d) Integrate the information parsed in (a), (b), and (c) as the extended information Q of the question e , and use the embedded model E fine-tuned in step 3 model to encode Q and Q e , and then perform weighted fusion to obtain a question vector Q representing the user's intention vec .

[0149] Step Five. Further, through Figure 1 's multi-channel recall module, retrieve relevant legal articles for Q from different aspects. This process includes three paths: rule recall, knowledge recall, and standard answer recall, and uses the RRF (Reciprocal RankFusion) algorithm to comprehensively sort the results of each path, and finally obtains the relevant legal articles for the next stage (i.e., the re-ranking stage). Specifically, it includes the following sub-paths

[0150] (a) The first path (rule recall) uses the BM25 model for recall. For the user question Q, retrieve the top 20 relevant legal articles from the legal regulations library D constructed in step 1 to form a subset

[0151] (b) The second path (knowledge recall) takes the vector representation Q obtained in step 4(d). vec and the law - knowledge vector LK in the knowledge vector library constructed in step 3 dense and LK sparse to calculate the semantic similarity. Finally, the top 20 relevant laws are returned according to the similarity to form a subset

[0152] (c) The third path (standard answer recall) recalls the top 20 Q&A pairs (Q, A) that are semantically similar to the user question Q from the standard answer vector library constructed in steps 2 and 3 i ). For the answer part A i laws are extracted and frequency - counted to obtain the top 20 relevant law subsets

[0153] (d) Further, the RRF algorithm is used to fuse the recall results of the three paths, namely the subsets {S bm25 S vec S q}. Finally, the laws are sorted according to the RRF scores, and the top 20 relevant laws are returned as the input for the next stage (i.e., the re - ranking stage).

[0154] Step 6. After obtaining the top 20 candidate laws related to the question Q through multi - path recall, the system enters the re - ranking stage to further optimize the recommended order, as shown in the re - ranking module Figure 1 shown. Generally, the question Q is concatenated with each candidate law L and input into the re - ranking model to obtain a similarity score, and the laws are re - ranked based on this score. Finally, the top 5 most relevant laws will be returned to the user.

[0155] Although specific embodiments of the present invention are disclosed for illustrative purposes, which are intended to help understand the content of the present invention and implement it accordingly, those skilled in the art can understand that: without departing from the spirit and scope of the present invention and the appended claims, various substitutions, changes, and modifications are possible. Therefore, the present invention should not be limited to the content disclosed in the best embodiments, and the scope of protection required by the present invention is defined by the scope of the claims.

Claims

1. A legal regulation recommendation method based on multi-channel fusion, the steps of which include: 1) Split the legal texts by article and extract structured content to construct a legal set E = {l i |i=1,2,…,n}; where l i represents the i-th legal article; and designs multi-stage prompt words, including the prompt word P for generating subject words m , Prompt word P used to generate keywords k , Prompt word P used to generate the interpretation of the keyword d , used to generate prompt words P for potential legal issues related to legal provisions q ; For each article i , first use the prompt word P m Guide the large language model to generate topic words and use the prompt word P k Guide the large language model to generate keywords, and use the generated subject words and keywords to search for legal provisions. i Mark it; then for the legal article l i Each keyword k ij , use the prompt word P d Guide the large language model to generate interpretation D(k ij );Then based on this law i The subject words, keywords and definitions of q Generation and Law i Related potential legal issues, predict the legal provisions i Practical application scenarios of Q(T(l i ),k ij ,D(k ij ))={q1,q2,…,q m }, where q m For the law i The corresponding mth potential problem; 2) Construct a standard answer library, where the standard answer library includes multiple QA pairs, and each QA pair includes a question Q and an answer text A; 3) Fine-tune the pre-trained embedding model E(·) using the question-law pair dataset G to obtain the fine-tuned embedding model E(·); Use the embedding model E(·) to vectorize each law in the set of laws and regulations E and store it in the law vector library; For each question Q in the standard answer library, use the pre-trained embedding model E(·) to vectorize it and store it in the law vector library; wherein, a sparse network layer is introduced at the output end of the pre-trained embedding model E(·) for generating sparse vectors; Use the embedding model E(·) to convert each law l in the set of laws and regulations E into a dense vector e and a sparse vector w and store them in the law vector library, use the embedding model E(·) to convert the associated knowledge corresponding to each law l into a dense vector and a sparse vector and store them in the law vector library; For each question Q in the standard answer library, use the pre-trained embedding model E(·) to generate the dense vector e and the sparse vector w of the question Q and store them in the law vector library; the associated knowledge includes subject words, keywords, paraphrases, and potential questions. ′ (·); Use the embedding model E ′ (·) to vectorize each law in the set of laws and regulations E and store it in the law vector library; For each question Q in the standard answer library, use the pre-trained embedding model E(·) to vectorize it and store it in the law vector library; wherein, a sparse network layer is introduced at the output end of the pre-trained embedding model E(·) for generating sparse vectors; Use the embedding model E ′ (·) to convert each law l in the set of laws and regulations E into a dense vector e l and a sparse vector w l and store them in the law vector library, use the embedding model E ′ (·) to convert the associated knowledge corresponding to each law l into a dense vector and a sparse vector and store them in the law vector library; For each question Q in the standard answer library, use the pre-trained embedding model E(·) to generate the dense vector e Q and a sparse vector w l and store them in the law vector library; the associated knowledge includes subject words, keywords, paraphrases, and potential questions. 4) Use the problem understanding module to perform entity extraction, semantic understanding, and knowledge enhancement on the received user question Q as the extended information Q of the user question Q e ; Use the embedding model E ′ (·) After vectorizing the user question Q and its extended information Q e and performing weighted fusion on the obtained vectors to get a question vector Q representing the user's intention vec ; 5) Recall several relevant legal articles most relevant to the user's question Q from the legal regulations library E using the BM25 model; according to the question vector Q vec Calculate the similarity with each legal article vector in the legal article vector library, and recall several legal articles with the highest similarity; and select several Q&A pairs semantically similar to the user's question Q from the standard answer library and extract legal articles from the answer part of each selected Q&A pair to obtain the relevant legal article set L A As the recall result; then comprehensively sort the recall results from all channels and select the top-k legal articles most relevant to the user's question Q L = {L1, L2, …, L k}; 6) Input the top-k legal articles \(L = \{L_1, L_2, \ldots, L\) k \} and the user question \(Q\) into the re-ranking model, calculate the re-ranking scores of each legal article in \(L = \{L_1, L_2, \ldots, L\) k \} with respect to the user question \(Q\), and return several legal articles with the highest re-ranking scores to the user.

2. The method according to claim 1, wherein The method for constructing the standard answer library is as follows: First, use the fuzzy matching method to filter out the answer texts that do not mention legal provisions, and then perform regular extraction on each answer text to obtain the legal provisions and their numbers included therein, and detect the legal status of each extracted legal provision. If any of the legal provisions in the answer text are invalid, repealed or non-existent, the QA pair in the answer text will be filtered; then, use the natural language inference matching screening method to perform a preliminary screening on each remaining QA pair, and then use the multi-model verification method to verify each remaining QA pair after the preliminary screening, and store the QA pairs that pass the verification into the standard answer library.

3. The method according to claim 1 or 2, characterized in that, The above problem - the legal provisions for the dataset G = {(Q j1 , Q j2 , …, Q jm , L j ) | j = 1, 2, …, N}, where the legal provision L j is associated with m questions Q j1 , Q j2 , …, Q jm and is related. Q jm Indicates the m-th question generated by the large language model according to legal provision L j ​ 4. The method according to claim 1, characterized in that, The i-th legal provision l i = {regulation name, item number, timeliness, legal type, content of the legal provision,...}; Each legal provision is stored in a tree or table structure.

5. A legal and regulatory recommendation system based on multi-channel fusion, characterized in that It includes a legal regulation set construction module, a standard answer library construction module, a legal provision vector library construction module, a question understanding module, a multi-path recall module and a re-rank model; The legal regulations set building module is used to split the legal regulations text according to the legal provisions and extract the structured content to build the legal regulations set E = {l i |i=1,2,…,n}; where l i represents the i-th legal article; and designs multi-stage prompt words, including the prompt word P for generating subject words m , Prompt word P used to generate keywords k , Prompt word P used to generate the interpretation of the keyword d , used to generate prompt words P for potential legal issues related to legal provisions q ; For each article i , first use the prompt word P m Guide the large language model to generate topic words and use the prompt word P k Guide the large language model to generate keywords, and use the generated subject words and keywords to search for legal provisions. i Mark it; then for the legal article l i Each keyword k ij , use the prompt word P d Guide the large language model to generate interpretation D(k ij );Then based on this law i The subject words, keywords and definitions of q Generation and Law i Related potential legal issues, predict the legal provisions i Practical application scenarios of Q(T(l i ),k ij ,D(k ij ))={q1,q2,…,q m }, where q m For the law i The corresponding mth potential problem; The standard answer library construction module is used to construct a standard answer library, where the standard answer library includes multiple QA pairs, and each QA pair includes a question Q and an answer text A; The legal provision vector library construction module is used to fine-tune the pre-trained embedding model E(·) using the question-legal provision pair dataset G to obtain the fine-tuned embedding model E ′ (·); then use the embedding model E ′ (·) to vectorize each legal provision in the legal regulation set E and store it in the legal provision vector library; and for each question Q in the standard answer library, use the pre-trained embedding model E(·) to vectorize it and store it in the legal provision vector library; wherein, a sparse network layer is introduced at the output end of the pre-trained embedding model E(·) for generating sparse vectors; use the embedding model E ′ (·) to convert each legal provision l in the legal regulation set E into a dense vector e l and a sparse vector w l and store them in the legal provision vector library, use the embedding model E ′ (·) to convert the associated knowledge corresponding to each legal provision l into a dense vector and a sparse vector and store them in the legal provision vector library; for each question Q in the standard answer library, use the pre-trained embedding model E(·) to generate the dense vector e Q and the sparse vector w l and store them in the legal provision vector library; the associated knowledge includes topic words, keywords, interpretations, and potential questions; The problem understanding module is used to perform entity extraction, semantic understanding, and knowledge enhancement on the received user question Q as the extended information Q of the user question Q e ; Using the embedding model E ′ (·) After vectorizing the user question Q and its extended information Q e And performing weighted fusion on the obtained vectors to obtain a question vector Q representing the user's intention vec ; The multi-path recall module is used to recall several relevant legal articles most relevant to the user question Q from the legal regulations library E by using the BM25 model; according to the question vector Q vec calculate the similarity with each legal article vector in the legal article vector library, and recall several legal articles with the highest similarity; and select several question-answer pairs semantically similar to the user question Q from the standard answer library and extract legal articles from the answer part of each selected question-answer pair to obtain the relevant legal article set L A as the recall result; then comprehensively sort the recall results of each path and select the top-k legal articles most relevant to the user question Q L = {L1, L2, …, L k}; The rearrangement model is used to calculate the rearrangement scores of each legal provision in the top-k legal provisions L = {L1, L2, …, L k}, and returns several legal provisions with the highest rearrangement scores to the user.

6. A server, characterized in that, It includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing any one of the methods described in claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements any one of the methods described in claims 1 to 4.

Citation Information

Patent Citations

  • Input prompting method and device for question-answering robot

    CN110765247A

  • Knowledge graph driving type law intelligent consultation system

    CN110765257A