Judicial assistance-oriented statute semantic matching and applicability recommendation method and system

CN122986000APending Publication Date: 2026-10-27SHANGHAI JINQIAO YIFA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611240256.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]然而,目前现有的法条检索与推荐技术普遍存在明显缺陷,不能满足公共法律服务对精度、可靠性、可解释性与规模化普惠的需求,具体表现为以下问题:

Benefits of technology

本发明提供的面向司法辅助的法条语义匹配与适用性推荐方法及系统,采用语义向量检索,突破关键词匹配局限,实现高精度语义匹配,提升了法条召回率与准确率;融合法律效力、时效、案由等维度,输出“最适用”而非仅“最相关”法条,实现智能化适用性推荐,降低了用户法律门槛;法条与类案向量知识库结构化存储,高效利用结构化知识,匹配司法实践,提升了推荐严谨性;引入裁判文书(类案)检索,使推荐结果与司法裁判对齐,增强了法条适用性推荐说服力,有助于提高司法辅助咨询服务的质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986000A_ABST
    Figure CN122986000A_ABST
Patent Text Reader

Abstract

The application provides a judicial assistance-oriented statute semantic matching and applicability recommendation method and system, relates to the artificial intelligence technical field of justice, and the method comprises the following steps: rewriting an original question of a user's spoken language consultation into structured information of a legal profession; constructing a statute and case vector knowledge base for respectively storing semantic vectors and structured metadata of statutes and judicial documents; performing vector retrieval and keyword retrieval on the case vector knowledge base by taking the original question as a query to recall similar cases; performing multi-path differentiated weight mixed statute retrieval on the statute vector knowledge base by taking the original question, the structured information and the similar cases as independent queries to recall statutes with the highest semantic similarity to the current retrieval request, thereby obtaining a candidate statute set; performing semantic rearrangement on the candidate statute set, combining statute attributes to calculate comprehensive applicability scores and finally sort, generating an interpretable reply, and outputting applicable statutes. The application breaks through the limitation of keyword matching and improves the recall rate and accuracy of statutes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of judicial artificial intelligence technology, and more specifically, to a method and system for legal provision semantic matching and applicability recommendation for judicial assistance. Background Technology

[0002] Intelligent legal assistants, online legal consultation platforms, and self-service judicial service terminals have become important carriers of grassroots legal services. Ordinary people often describe their legal disputes in colloquial, unstructured, and fragmented natural language, such as "Does a fall on the way home from overtime count as a work injury?", "Can I claim compensation if I'm dismissed without a contract?", and "How do I sue someone for not repaying a loan?". The system needs to quickly locate the most relevant, applicable, and effective legal provisions from a vast amount of laws, regulations, judicial interpretations, and guiding cases to provide users with authoritative, accurate, and directly usable legal basis.

[0003] However, existing legal provision retrieval and recommendation technologies generally have significant shortcomings and cannot meet the public legal services' needs for accuracy, reliability, interpretability, and scalable accessibility. Specifically, these shortcomings manifest in the following ways: 1. Limitations of Keyword Retrieval Mechanisms: Traditional retrieval relies on shallow bag-of-words models such as Boolean matching, TF-IDF, and BM25, which match based solely on literal word overlap, completely ignoring the professionalism, semantic relevance, and logical structure of legal language. When users use colloquial expressions rather than legal terminology, the system cannot complete semantic mapping, resulting in low recall and high mismatch rates. For example, if a user describes "breaking a bone on the way home from get off work," a traditional system cannot associate it with legal concepts such as "work injury determination" or "on the way to and from get off work," directly leading to retrieval failure.

[0004] 2. Severe Lack of Deep Semantic Understanding: Legal provisions have rigorous sentence structures, constituent elements, applicable premises, and logical hierarchies, while user questions are colloquial, vague, and factual, creating a significant semantic gap between the two. Current technology cannot understand the user's true legal intent, the nature of the dispute, or the relationship between rights and obligations, nor can it analyze the applicable scenarios and constituent elements of the legal provisions. This results in a large number of invalid results that are irrelevant to the question or inquiry, requiring users to manually filter and verify the information, leading to a very poor user experience.

[0005] 3. Lack of ability to determine the applicability of legal provisions: Most existing systems can only output a list of relevant legal provisions, but cannot determine whether a particular legal provision is applicable to the current specific case, its priority, its validity, whether it is expired, or whether it has been superseded by a new law. Ordinary users do not have legal expertise and cannot identify truly usable legal grounds from dozens of results, resulting in search results that are only formally relevant and lack practical usability.

[0006] 4. The legal knowledge base suffers from low structuring and poor utilization efficiency: Existing legal provision databases, judicial interpretation databases, and judgment document databases are mostly stored in unstructured text, without structured modeling of the legal provisions' validity level, timeliness, applicable causes of action, and relationships between legal provisions (such as superior law, subordinate law, new law, old law, general law, and special law). The system is unable to perform judicial logical reasoning and is prone to recommending repealed provisions, low-level documents, and legal provisions with inapplicable causes of action, seriously affecting the quality of consultation services.

[0007] 5. Lack of supporting cases and explainable output: Traditional legal provision retrieval is detached from judicial practice, does not incorporate judgment documents and similar case rules, and the recommended results lack the support of real court judgment logic; it does not provide reasons for recommendation and scoring basis, so users cannot understand why this legal provision is recommended, resulting in low trust and difficulty in meeting the requirements of standardization and traceability of public legal services.

[0008] 6. Insufficient automation and accessibility: Existing systems are mostly designed for commercial institutions and lawyers, with high deployment costs and complex operations, making them unsuitable for large-scale deployment in public institutions, communities, rural areas, and other accessible scenarios. Furthermore, they rely on manual intervention and professional operation, failing to achieve full-process automation and low-barrier-to-use.

[0009] In conclusion, existing technologies cannot provide high-precision, highly reliable, interpretable, and universally applicable legal provision retrieval, matching, and recommendation capabilities for judicial assistance scenarios, which seriously restricts the upgrading of public legal services. Summary of the Invention

[0010] Therefore, the purpose of this invention is to propose a method and system for semantic matching and applicability recommendation of legal provisions for judicial assistance. Through knowledge base construction, question understanding and rewriting, multi-path hybrid retrieval, reordering and ranking, and result generation and interpretation, the system performs deep semantic encoding on the natural language questions and legal texts input by users, overcoming the limitations of keyword matching and improving the recall and accuracy of relevant legal provisions. Based on semantic matching scores, and combined with features such as the legal validity level, timeliness, and relevance to the user's question, a ranking model is constructed to provide users with the most applicable, rather than the most relevant, legal provision recommendations. A structured knowledge base containing legal texts, legal attributes, and inter-legal relationships is constructed to provide richer feature support for semantic matching and applicability recommendation. This achieves high-precision semantic matching, intelligent applicability ranking, structured knowledge utilization, and interpretable result output, making it suitable for judicial assistance decision-making in public services and providing stable and reliable legal provision retrieval guarantees for public legal services.

[0011] This invention provides a method for semantic matching and applicability recommendation of legal provisions for judicial assistance, comprising the following steps: The user's original questions in natural language legal consultation (oral consultation) are rewritten into structured legal information (such as legal interpretations, legal keywords, and points of contention). A legal provision vector knowledge base and a case-like vector knowledge base are constructed to store the semantic vectors and structured metadata of legal provisions and judgment documents (case-like documents), respectively. Specifically, the legal provision vector knowledge base includes the legal provision number, text, level of validity, issuing authority, timeliness, and applicable cause of action; the case-like vector knowledge base includes the cause of action, case details, points of contention, key points of judgment, and legal basis.

[0012] Using the original question as a search request, perform a hybrid search (vector search and keyword search) on the case vector knowledge base to recall similar cases; using the original question, structured information, and similar cases as independent search requests, perform a hybrid legal provision search with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current search request, and obtain a set of candidate legal provisions. The candidate legal provisions are semantically rearranged, and a comprehensive applicability score is calculated by combining the legal provisions' attributes (legal provisions' level of effectiveness, timeliness, applicable causes of action, and characteristics of similar cases), and the final ranking is completed; an interpretable response is generated, and a list of legal provisions (as applicable legal provisions that can be used for judicial auxiliary reference), matching scores, applicability explanations, and reasons for recommendation are output.

[0013] Specifically, the explanatory response includes legal characterization, applicable legal provisions, reasons for application, legal consequences, suggestions for evidence, and avenues for protecting rights.

[0014] Furthermore, the method for recalling similar cases by performing a hybrid retrieval of vector retrieval and keyword retrieval on the similarity vector knowledge base includes: The semantic similarity results obtained from the vector retrieval and the relevance results obtained from the keyword retrieval are weighted and fused together. The results are sorted from high to low according to the fusion results, and the top K similar cases with the highest similarity to the retrieval request of the current original question are recalled. The weighting coefficients used in the weighted fusion calculation performed by the case vector knowledge base are fixed weighting coefficients.

[0015] Specifically, using the user's original question as the query, a hybrid search of vector retrieval and keyword retrieval is performed on the similarity vector knowledge base. The results of vector retrieval and keyword retrieval are then weighted and fused to recall the Top-K similar cases most similar to the current question. The weighted fusion formula for hybrid retrieval of the case vector knowledge base is as follows: S_hybrid=λ*S_vector+(1-λ)*S_keyword; Where S_vector is the cosine similarity of vector retrieval, and S_keyword is the relevance score of keyword retrieval; λ is the weight coefficient, with λ set to 0.6 for case retrieval, 0.6~0.7 for legal provisions retrieval for strong natural language queries, and 0.4~0.5 for strong terminology queries.

[0016] In a preferred embodiment of the present invention, λ is set to 0.6 to strengthen the dominant role of semantic matching in case retrieval.

[0017] Furthermore, the method for performing a hybrid legal provision retrieval with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provision with the highest semantic similarity to the current retrieval request includes: The original question, the rewritten structured information (including legal interpretations, legal keywords, and points of contention), and the recalled similar cases (legal provisions extracted from the similar cases) constitute a multi-way query. A hybrid retrieval is performed on the legal provision vector knowledge base. The comprehensive matching score is calculated by weighting and fusing vector retrieval scores and keyword retrieval scores to recall the top K legal provisions with the highest semantic similarity to the corresponding query. The weighting coefficients used in the weighted fusion calculation performed by the legal provision vector knowledge base are set differently according to the retrieval scenario and query type, and are configured differently for different types of retrieval paths. Natural language queries of original questions and terminology queries of structured information use different ranges of weighting coefficients. Specifically, a high weighting coefficient is used for the retrieval path of original questions belonging to the natural language description category, and a low weighting coefficient is used for the retrieval path of structured information belonging to legal terms, so as to adapt to the semantic and terminology features of different retrieval sources.

[0018] Specifically, the user's original question, the rewritten results (legal interpretation, legal keywords, points of contention), and the recalled similar cases are treated as independent search requests (multi-way queries). A hybrid search of vector retrieval and keyword retrieval is performed on the legal provision vector knowledge base to recall the Top-K legal provisions with the highest semantic similarity to the current query. The differential weighted hybrid retrieval of the legal vector knowledge base employs a weighted fusion strategy, with the formula as follows: S_hybrid=λ*S_vector+(1-λ)*S_keyword; Wherein, S_vector is the cosine similarity score of vector retrieval, and S_keyword is the relevance score of keyword retrieval; λ is the weight coefficient, and the value of λ is configured differently according to the characteristics of different retrieval paths. For retrieval paths with strong natural language expressions of user original questions and legal interpretations, the value of λ is set to 0.6~0.7 (higher value) to highlight the role of semantic matching; for retrieval paths with strong structured or terminological elements such as legal keywords and similar legal provisions, the value of λ is set to 0.4~0.5 (lower value) to highlight the role of keyword matching. By configuring the value of λ differently, the hybrid retrieval strategy can adapt to the characteristics of different retrieval sources and improve the overall recall quality.

[0019] After summarizing the search results from various sources, a set of candidate legal provisions is obtained, which may contain duplicate legal provisions.

[0020] Furthermore, the semantic reordering method includes: A reordering model is constructed, which is a semantic relevance calculation model based on a cross-encoder. Taking the user's original question as a reference, the candidate legal provisions recalled by each path are uniformly scored for semantic relevance, and sorted from high to low scores. The top N legal provisions are selected to form a fine-ranked candidate set.

[0021] Specifically, a re-ranking model is used to uniformly score the semantic relevance of the candidate legal provisions recalled from each path. The re-ranking model takes the user's original question as a reference, comprehensively calculates the relevance score of each candidate legal provision to the user's question, sorts them from high to low scores, and selects the Top-N legal provisions as the final fine-ranking candidate set. The calculation formula for the rearrangement model is as follows: S_rerank=Reranker(Q,T); Where Q is the user's original question, T is the candidate legal text, and S_rerank is the relevance score output by the reranking model.

[0022] Furthermore, the method for calculating the comprehensive applicability score and completing the final ranking includes: For each legal provision in the refined candidate set, a weighted calculation is performed by combining the semantic relevance score output by the rearrangement model with the legal provision attributes, including the legal validity level, timeliness status, and applicable cause of action matching degree, to obtain a comprehensive applicability score. The candidate legal provisions are then finally sorted from high to low according to the comprehensive applicability score.

[0023] Specifically, for each legal provision in the refined candidate set, the comprehensive applicability score is calculated by combining the semantic relevance score output by the rearrangement model with the legal provision attributes (effectiveness level, timeliness, applicable cause of action). The comprehensive applicability score is calculated as follows: S_app=α*S_rerank+β*F_attr(T,Q). Where α and β are weighting coefficients, and F_attr is the applicability function of legal provisions attributes; attributes include level of validity, timeliness, and applicable cause of action; The candidate legal provisions are finally sorted according to S_app, ensuring that the recommendation of "applicability" takes precedence over "relevance".

[0024] Furthermore, the method for constructing the legal provision vector knowledge base and the case study vector knowledge base includes: Collect various laws and regulations, extract the legal provisions in a structured manner, use the BGE vector model to convert the legal provisions into 1024-dimensional vectors, store them in the vector library, and label the level of validity, timeliness, and cause of action to establish a legal provision vector knowledge base; Collect labor dispute judgment documents, extract case details, points of contention, key points of judgment, and applicable legal provisions, and store them in a vector database after vectorization to establish a similar case vector knowledge base.

[0025] Furthermore, the method for generating interpretable responses based on the RAG architecture includes: The original question, the applicable legal provisions of the top K similar cases (Top-K cases) with the highest similarity to the current original question, and the key points of the judgments of the similar cases are used as context input to a large language model based on the RAG architecture (such as the GPT series and ChatGLM series). The output of the large language model includes: a concise legal characterization of the user's question; a list of the names, numbers, and contents of the applicable legal provisions; an explanation of why the legal provisions apply to this case; the legal consequences, the rights that can be asserted, and the method of calculating compensation; and suggestions on evidence and ways to protect rights. The system outputs structured recommendation results to the user. These results include: a sorted list of legal provisions, a relevance score for each provision, an explanation of its applicability, a reason for the recommendation, and supporting case studies. The results are transparent, reliable, and highly interpretable.

[0026] This invention also provides a legal provision semantic matching and applicability recommendation system for judicial assistance, used to implement the legal provision semantic matching and applicability recommendation method for judicial assistance as described above, including: Spoken language rewriting structured module: used to rewrite the user's original spoken consultation questions into structured information in the legal field; The dual-vector hybrid retrieval module is used to construct a legal provision vector knowledge base and a case vector knowledge base, which respectively store the semantic vectors of legal provisions and judgment documents and the structured metadata. Using the original question as the retrieval request, it performs a hybrid retrieval of vector retrieval and keyword retrieval on the case vector knowledge base to recall similar cases. Using the original question, structured information, and similar cases as independent retrieval requests, it performs a hybrid legal provision retrieval with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current retrieval request, thus obtaining a candidate legal provision set. Explainable response module: used to perform semantic rearrangement of the candidate legal provisions set, calculate the comprehensive applicability score by combining the legal provisions attributes and complete the final ranking, generate an explainable response, and output applicable legal provisions that can be used for judicial auxiliary reference.

[0027] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the preparation method for legal provision semantic matching and applicability recommendation for judicial assistance as described above.

[0028] The present invention also provides a computer device, the computer device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the preparation method for legal provision semantic matching and applicability recommendation for judicial assistance as described above.

[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention provides a method and system for semantic matching and applicability recommendation of legal provisions for judicial assistance. It employs semantic vector retrieval, overcoming the limitations of keyword matching to achieve high-precision semantic matching, thus improving the recall and accuracy of legal provisions. By integrating dimensions such as legal effect, statute of limitations, and cause of action, it outputs the "most applicable" rather than merely "most relevant" legal provisions, achieving intelligent applicability recommendations and lowering the legal threshold for users. The structured storage of legal provisions and similar case vector knowledge bases efficiently utilizes structured knowledge to match judicial practice, enhancing the rigor of recommendations. The introduction of judgment document (similar case) retrieval aligns the recommendation results with judicial decisions, strengthening the persuasiveness of legal provision applicability recommendations and contributing to improving the quality of judicial assistance consultation services. Attached Figure Description

[0030] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.

[0031] In the attached diagram: Figure 1 This is a flowchart illustrating the business process of legal provision semantic matching and applicability recommendation for judicial assistance in this embodiment of the invention. Figure 2 This is a schematic diagram of the configuration of a computer device according to an embodiment of the present invention. Detailed Implementation

[0032] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and products consistent with some aspects of this disclosure as detailed in the appended claims.

[0033] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0034] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0035] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0036] Example This invention provides a method for semantic matching and applicability recommendation of legal provisions for judicial assistance, including: rewriting the user's original natural language legal consultation questions into structured information such as legal interpretations, legal keywords, and points of contention through a large language model; A legal provision vector knowledge base and a case-like vector knowledge base are constructed to store the semantic vectors and structured metadata of legal provisions and judgment documents, respectively. The method for constructing the legal provision vector knowledge base and the case-like vector knowledge base is as follows: collect various laws and regulations, extract the legal provisions in a structured manner, use the BGE vector model to convert the legal provisions into 1024-dimensional vectors, store them in the vector library, and simultaneously label the level of validity, timeliness, and cause of action to establish the legal provision vector knowledge base; collect labor dispute judgment documents, extract the case details, points of contention, key points of the judgment, and applicable legal provisions, vectorize them, and store them in the vector library to establish the case-like vector knowledge base.

[0037] In this embodiment, raw data, such as the "Labor Contract Law of the People's Republic of China" and the "Civil Code of the People's Republic of China," is obtained from a publicly available database of laws and regulations. Natural language processing techniques (such as regular expressions and named entity recognition) are used to parse the legal text, identifying and extracting the legal provision number and main text content. Simultaneously, based on metadata information, attributes such as the legal provision's level of validity (e.g., law, administrative regulation, departmental rule), issuing authority, promulgation date, revision date, and timeliness (currently valid / revised / repealed), and applicable cause of action, are extracted.

[0038] Vectorization models (such as the BGE vector model) are used to convert legal texts into multi-dimensional high-dimensional vectors. These legal vectors, along with their corresponding metadata (legal number, text, attributes, etc.), are stored in a vector database (such as Milvus or Qdrant) to form a structured vector knowledge base. This knowledge base supports efficient near-nearest neighbor retrieval, as well as keyword and hybrid retrieval, enabling it to quickly find the legal vector that most closely matches the semantics of the query vector.

[0039] Judgment documents (similar case information) are obtained from publicly available legal databases. Natural language processing techniques (such as regular expressions and named entity recognition) are used to parse the judgment documents, identifying and extracting the following information: Title: The name of the judgment document; Cause of Action: The type of legal dispute to which the case pertains (e.g., labor contract dispute, private lending dispute, etc.); Case Summary: A description of the basic facts of the case; The core legal issues in dispute between the two parties; Key points of adjudication: The court's determination of the points of contention and the rules of adjudication; Keywords: core legal terms related to the case; Legal basis: The legal provisions on which the judgment was based.

[0040] Vectorization models (such as the BGE vector model) are used to convert case summaries, points of contention, and key judgments from court documents into high-dimensional vectors. These similar case vectors, along with their corresponding metadata (cause of action, points of contention, legal basis, etc.), are stored in a vector database, forming a structured similar case vector knowledge base. This knowledge base supports rapid retrieval of similar cases, providing case support for legal provision recommendations.

[0041] The user's original question is used as the search request. A hybrid search of vector retrieval and keyword retrieval is performed on the case vector knowledge base to recall similar cases. Specifically, the semantic similarity results obtained from vector retrieval and the relevance results obtained from keyword retrieval are weighted and fused. The results are sorted from high to low according to the fusion results, and the top K cases with the highest similarity to the current question are recalled. The weighting coefficients used in the weighted fusion calculation performed by the case vector knowledge base are fixed weighting coefficients.

[0042] The user's original question, the rewritten structured information, and the recalled similar cases are treated as independent search requests. A multi-path, differentiated weighted hybrid legal provision search is performed on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current search request, resulting in a candidate legal provision set. Specifically, a multi-path query is constructed using the user's original question, legal interpretation, legal keywords, points of contention, and legal provisions extracted from similar cases. A hybrid search is performed on the legal provision vector knowledge base, and a comprehensive matching score is calculated by weighted fusion of vector search score and keyword search score to recall the top K legal provisions with the highest semantic similarity to the current search request. The weighting coefficients used in the weighted fusion calculation performed on the legal provision vector knowledge base are configured differently for different types of search paths; a high weighting coefficient is used for search paths belonging to natural language description, and a low weighting coefficient is used for search paths belonging to legal terminology or structured text.

[0043] In this embodiment, the process of retrieving the legal vector database includes the following steps: Receiving User Inquiries: The interface receives legal questions from users in natural language. For example, a user might enter: "I worked at the company for six months without a contract, and now they've fired me. Am I entitled to compensation?" User Question Rewriting: The user's original question Q is input into the large language model. Through carefully designed prompts, the large language model is guided to rewrite the user question in a legal professional style, generating the following content: Legal interpretation: Transforming users' colloquial questions into descriptions that conform to legal expression conventions.

[0044] Legal keywords: Extract the core legal terms relevant to the issue.

[0045] Points of contention: Summarize the core legal disputes in the issue.

[0046] Here are some examples of prompt words: "# Role You are a senior Chinese legal expert, skilled at extracting the core legal elements of a case from the parties' account of the facts.

[0047] # Task Please read the case description provided by the user, conduct a professional legal analysis, and output the following three fields: legal_explanation: Re-describe the user issue in legal terms legal_keywords: Extract 3-5 core legal keywords dispute_focus: Identify the core points of contention in this case. # Require Legal interpretations should be accurate and rigorous, transforming colloquial expressions into legal terminology; Legal keywords should focus on the core legal issues of the case, avoiding generalized terms; The focus of the dispute should be on the fundamental differences between the parties regarding the facts of the case, the legal relationship, or the legal consequences. The statement should include both the "characterization of the disputed matter" and the "impact of the characterization on the legal consequences." The expression is rigorous, neutral, concise, and succinct.

[0048] # Output Format You must output a JSON object containing the following three fields: { "legal_explanation": "", "legal_keywords": [], "dispute_focus": "", } Please now analyze the following user case description: {user_query}” " The process of retrieving the case vector knowledge base is as follows: The user's original question Q is used as the search request to retrieve the similarity vector knowledge base. Through hybrid retrieval, the results of vector retrieval and keyword retrieval are combined and weighted to retrieve the Top-K similar cases most similar to the current question.

[0049] The weighted fusion formula for hybrid retrieval is as follows: S_hybrid = λ * S_vector + (1-λ) * S_keyword in: S_vector represents the cosine similarity score for vector retrieval. S_keyword is the relevance score for keyword retrieval (such as the BM25 algorithm). λ is the weighting coefficient, which balances the contributions of semantic matching and keyword matching.

[0050] For case retrieval scenarios, since judgment documents have high standardization and structure, and significant semantic features, the value of λ can be appropriately increased. In this embodiment, λ for case retrieval is set to 0.6 to strengthen the dominant role of semantic matching in case retrieval.

[0051] The user's original question Q and its rewritten results (legal interpretation, legal keywords, points of contention) and the legal provisions of similar cases extracted from the similar case search results (i.e. the legal basis cited in similar cases) are treated as independent search requests (multi-path legal provision search), and the legal provision vector knowledge base is searched at the same time.

[0052] Each search uses a hybrid search to recall the Top-K legal provisions with the highest semantic similarity to the current query. The algorithm for hybrid search is the same as the aforementioned case search, but the weight coefficient λ can be configured differently to suit the characteristics of the legal provision search scenario.

[0053] In legal provision retrieval, due to the highly concise and terminologically dense nature of legal provision texts, keyword matching is of significant value for legal provision recall. Therefore, the λ value can be appropriately reduced to balance the contribution of keyword retrieval. In this embodiment, the λ value for legal provision retrieval is set to 0.5, thus balancing the contribution weights of vector retrieval and keyword retrieval.

[0054] In practical applications, the λ value can be dynamically adjusted according to the characteristics of different search paths: for search paths with strong natural language expressions such as original user questions and legal interpretations, a higher λ value (e.g., 0.6~0.7) can be set to highlight the role of semantic matching. For search paths with strong structured or terminological elements such as legal keywords and similar legal provisions, a lower λ value (e.g., 0.4~0.5) can be set to highlight the role of keyword matching. By configuring the λ value differently, the hybrid search strategy can better adapt to the characteristics of different search sources and improve the overall recall quality.

[0055] After summarizing the search results from all sources, an initial set of candidate legal provisions is obtained, which may contain duplicate legal provisions.

[0056] After deduplication of the candidate legal provisions set, semantic reordering is performed. Specifically, a semantic relevance calculation model based on a cross-encoder is constructed. Taking the user's original question as a reference, the candidate legal provisions recalled from each path are uniformly scored for semantic relevance and sorted from high to low scores. The top N legal provisions are selected to form a finely ranked candidate set.

[0057] The system calculates a comprehensive applicability score by combining the attributes of the legal provisions and completes the final ranking; it generates an interpretable response based on the RAG framework, and outputs a list of legal provisions, matching scores, applicability explanations and reasons for recommendation. The list of legal provisions serves as applicable legal provisions that can be used for judicial assistance.

[0058] In this embodiment, after deduplication of the initial candidate legal provision set, a re-ranking model (such as the gte-rerank-v2 re-ranking model) is used to uniformly score the semantic relevance of the recalled candidate legal provisions. The re-ranking model takes the user's original question Q as the core reference, comprehensively calculates the relevance score between each candidate legal provision and the user's question, sorts them from high to low scores, and selects the Top-N legal provisions as the final refined candidate set.

[0059] The calculation formula for the rearrangement model is as follows: S_rerank = Reranker(Q, T); in: Q represents the user's original question; T represents the candidate legal text; Reranker is a reranking model based on a cross encoder (such as gte-rerank-v2). S_rerank is the relevance score output by the reranking model, and its value ranges from [0,1]. Subsequently, the user's question Q and the recalled Top-k legal provisions are used as context and input into a large language model (such as the GPT series or ChatGLM series). The large language model then generates an interpretable response in natural language, completing the entire RAG architecture chain. For example, the large language model can generate the following response: "Based on your description, the company's failure to sign a labor contract with you and its unilateral dismissal of you constitutes an illegal act. According to Article 87 of the Labor Contract Law of the People's Republic of China, if an employer terminates or cancels a labor contract in violation of this law, it shall pay the employee compensation at twice the rate of economic compensation stipulated in Article 47 of this law. Furthermore, according to Article 82, if an employer fails to conclude a written labor contract with an employee within one month but less than one year from the date of employment, the employer shall pay the employee twice the monthly wage." The method for calculating the comprehensive applicability score and completing the final ranking is as follows: for each legal provision in the fine-ranked candidate set, the semantic relevance score output by the rearrangement model is combined with the legal provision attributes for weighted calculation. The legal provision attributes include the legal validity level, timeliness status, and applicable cause of action matching degree to obtain the comprehensive applicability score. The candidate legal provisions are then ranked in the final ranking from high to low according to the comprehensive applicability score.

[0060] The method for generating interpretable responses based on the RAG architecture is as follows: The user's original question, the applicable legal provisions of the top K similar cases with the highest similarity to the current question, and the key points of the judgments in these cases are input into a large language model as context. The output of the large language model includes: a concise legal characterization of the user's question; a list of the names, numbers, and contents of the applicable legal provisions; an explanation of why the legal provision applies to this case; the legal consequences, the rights that can be asserted, and the method for calculating compensation; and suggestions on evidence and avenues for protecting rights. The structured recommendation results are returned to the user. The structured recommendation results include: a sorted list of legal provisions, a relevance score for each legal provision, an explanation of its applicability, a reason for recommendation, and supporting examples.

[0061] Figure 1 This embodiment illustrates the business process for legal provision semantic matching and applicability recommendation for judicial assistance.

[0062] This invention also provides a legal provision semantic matching and applicability recommendation system for judicial assistance, used to implement the legal provision semantic matching and applicability recommendation method for judicial assistance as described above, including: Spoken language rewriting structured module: used to rewrite the user's original spoken consultation questions into structured information in the legal field; The dual-vector hybrid retrieval module is used to construct a legal provision vector knowledge base and a case vector knowledge base, which respectively store the semantic vectors of legal provisions and judgment documents and the structured metadata. Using the original question as the retrieval request, it performs a hybrid retrieval of vector retrieval and keyword retrieval on the case vector knowledge base to recall similar cases. Using the original question, structured information, and similar cases as independent retrieval requests, it performs a hybrid legal provision retrieval with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current retrieval request, thus obtaining a candidate legal provision set. Explainable response module: used to perform semantic rearrangement of the candidate legal provisions set, calculate the comprehensive applicability score by combining the legal provisions attributes and complete the final ranking, generate an explainable response, and output applicable legal provisions that can be used for judicial auxiliary reference.

[0063] Application examples The following are real-world examples of the application of this invention: User Xiao Wang is a product manager at a tech company. He has been with the company for one year and two months, but the company has never signed an employment contract with him. Recently, due to business restructuring, the company dismissed Xiao Wang on the grounds of "departmental downsizing" without paying any severance pay. Xiao Wang consulted a smart legal assistant and entered the following questions: "I've worked at the company for over a year, but they never signed a contract with me. Now they're saying they're laying me off because of departmental downsizing, and they haven't given me any compensation. What kind of compensation am I entitled to?" The processing flow is as follows: 1. Rewriting user questions: The large language model analyzes user questions and outputs the following results: { The legal explanation states: "An employee and employer established an employment relationship for one year and two months, but the employer did not sign a written employment contract. Now, the employer unilaterally terminates the employment contract on the grounds of 'departmental downsizing' without paying economic compensation. The employee requests confirmation of the legality of the termination and demands payment of relevant compensation." "legal_keywords": ["No signed labor contract", "Economic layoffs", "Unlawful termination of labor contract", "Economic compensation", "Double wages"] "dispute_focus": "Does an employer's termination of an employment contract on the grounds of 'departmental downsizing' meet the legal conditions for economic layoffs? Does the employer's failure to sign an employment contract affect the legality of the termination? What legal remedies are employees entitled to claim?" } 2. Case Study: Using the user's original question Q as the search request, a hybrid search is performed on the case vector knowledge base to recall the following cases: { "case_retrieval_results":[ { “rank”: 1, “cause of action”: “labor dispute” "dispute_focus": "Statutory conditions for determining economic layoffs" "judgment_point": "Employers must meet the statutory conditions and follow the statutory procedures to conduct economic layoffs; otherwise, it constitutes an illegal termination." "legal_basis": ["Article 41 of the Labor Contract Law", "Article 87 of the Labor Contract Law"], "score": 0.92 }, { “rank”: 2, “cause of action”: “labor dispute” "dispute_focus": "Legal liability for failure to sign an employment contract" "judgment_point": "If an employer fails to sign a labor contract with an employee for more than one year, it shall be deemed that a labor contract with no fixed term has been entered into." "legal_basis": ["Article 14 of the Labor Contract Law", "Article 82 of the Labor Contract Law"], "score": 0.88 } ] } The legal basis extracted from similar cases includes Articles 14, 41, 82, and 87 of the Labor Contract Law.

[0064] 3. Multi-path legal provision retrieval: Based on a 6-way retrieval strategy (original question, legal interpretation, legal keywords, points of contention, key points of similar case judgments, and applicable legal provisions in similar cases), candidate legal provisions were retrieved from the legal provision vector knowledge base, and a total of 42 different legal provisions were obtained after aggregation.

[0065] 4. Rearranging search results from multiple paths: After the model is rearranged, the output results are as follows: { “rerank_results”: [ { “rank”: 1, "law": Article 82 of the Labor Contract Law of the People's Republic of China "score": 0.97 “description”: “If an employer fails to conclude a written employment contract with an employee within one month but less than one year from the date of employment, the employer shall pay the employee twice the monthly wage.” }, { “rank”: 2, "law": Article 87 of the Labor Contract Law of the People's Republic of China "score": 0.95 “description”: “If an employer terminates or cancels an employment contract in violation of the provisions of this Law, it shall pay the employee compensation at twice the standard of economic compensation stipulated in Article 47 of this Law.” }, { "rank": 3, "law": "Article 14 of the Labor Contract Law of the People's Republic of China" "score": 0.93 “description”: “If an employer fails to enter into a written employment contract with an employee within one year from the date of employment, it shall be deemed that the employer and the employee have entered into an open-ended employment contract.” }, { “rank”: 4, "law": "Article 41 of the Labor Contract Law of the People's Republic of China" "score": 0.91 "Description": "Under any of the following circumstances, if it is necessary to reduce the number of employees by 20 or more, or by less than 20 but accounting for more than 10% of the total number of employees, the employer shall explain the situation to the trade union or all employees 30 days in advance, listen to the opinions of the trade union or employees, and after reporting the reduction plan to the labor administrative department, the reduction of employees may be carried out..." }, { “rank”: 5, "law": "Article 46 of the Labor Contract Law of the People's Republic of China" "score": 0.88 “description”: “Under any of the following circumstances, the employer shall pay economic compensation to the employee: (i) the employee terminates the labor contract in accordance with Article 38 of this Law; (ii) the employer proposes to terminate the labor contract to the employee in accordance with Article 36 of this Law and reaches an agreement with the employee to terminate the labor contract; (iii) the employer terminates the labor contract in accordance with Article 40 of this Law; (iv) the employer terminates the labor contract in accordance with paragraph 1 of Article 41 of this Law; (v) except where the employer renews the labor contract while maintaining or improving the conditions stipulated in the labor contract and the employee does not agree to renew the contract, the fixed-term labor contract is terminated in accordance with item 1 of Article 44 of this Law; (vi) the labor contract is terminated in accordance with items 4 and 5 of Article 44 of this Law; (vii) other circumstances stipulated by laws and administrative regulations.” } ] } 5. Recommendation results generation and interpretation: The large language model generates the final response: "Hello, based on your description, you worked for the company for one year and two months without signing a labor contract. The company is now dismissing you on the grounds of 'department downsizing.' The analysis of your situation is as follows:" I. Regarding the lack of a signed employment contract: According to Article 82 of the Labor Contract Law, if an employer fails to conclude a written labor contract with an employee within one month but less than one year from the date of employment, the employer shall pay the employee twice the monthly wage. Since you have worked for one year and two months, you can claim double wages for the first 11 months. Furthermore, according to Article 14 of the Labor Contract Law, if an employer fails to conclude a written labor contract with an employee within one year from the date of employment, it shall be deemed that the employer and the employee have concluded an open-ended labor contract.

[0066] II. Regarding company dismissal: When an employer terminates an employment contract on the grounds of "departmental downsizing," it constitutes an economic layoff. According to Article 41 of the Labor Contract Law, economic layoffs must meet certain statutory conditions (such as reorganization in accordance with the Enterprise Bankruptcy Law, or serious difficulties in production and operation) and follow statutory procedures (informing the labor union or all employees of the situation 30 days in advance, soliciting opinions, and reporting to the labor administrative department, etc.). If the company fails to meet these conditions, it constitutes an illegal termination of the employment contract.

[0067] III. Rights You Can Claim: Double wage difference: According to Article 82 of the Labor Contract Law, you can claim double wage difference for the 11 months from the second to the twelfth month of employment.

[0068] Economic compensation or damages: If the company's layoffs are legitimate and based on economic grounds, it should pay severance pay according to Article 46 of the Labor Contract Law. Since you worked for one year and two months, your severance pay is equivalent to 1.5 months' salary.

[0069] If the company illegally terminates the labor contract, according to Article 87 of the Labor Contract Law, the company should pay compensation equal to twice the standard economic compensation, which is three months' salary.

[0070] We suggest you collect evidence such as your employment contract (if any), pay slips, termination notice, and company layoff announcements, and promptly file a complaint with the labor inspection department or apply for labor arbitration to protect your legitimate rights and interests.

[0071] This invention also provides a computer device. Figure 2 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention; see the accompanying drawings. Figure 2As shown, the computer device includes: an input device 23, an output device 24, a memory 22, and a processor 21; the memory 22 is used to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the legal provision semantic matching and applicability recommendation method for judicial assistance provided in the above embodiments; wherein the input device 23, the output device 24, the memory 22, and the processor 21 can be connected via a bus or other means. Figure 2 Taking the example of a connection between China and Israel via a bus.

[0072] The memory 22, as a read / write storage medium for a computing device, can be used to store software programs and computer-executable programs, such as the program instructions corresponding to the legal provision semantic matching and applicability recommendation method for judicial assistance described in this embodiment of the invention. The memory 22 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 22 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include memory remotely located relative to the processor 21, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0073] Input device 23 can be used to receive input digital or character information, and generate key signal inputs related to user settings and function control of the device; output device 24 may include display devices such as a display screen.

[0074] The processor 21 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 22, thereby realizing the above-mentioned method for legal provision semantic matching and applicability recommendation for judicial assistance.

[0075] The computer equipment provided above can be used to execute the legal provision semantic matching and applicability recommendation method for judicial assistance provided in the above embodiments, and has corresponding functions and beneficial effects.

[0076] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the legal provision semantic matching and applicability recommendation method for judicial assistance provided in the above embodiments. The storage medium can be any type of memory device or storage device, including: mounting media such as CD-ROM, floppy disk, or magnetic tape; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or combinations thereof; furthermore, the storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet); the second computer system can provide program instructions to the first computer for execution. The storage medium includes two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0077] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the legal provision semantic matching and applicability recommendation method for judicial assistance as described in the above embodiments, but can also perform related operations in the legal provision semantic matching and applicability recommendation method for judicial assistance provided in any embodiment of the present invention.

[0078] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0079] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for semantic matching and applicability recommendation of legal provisions for judicial assistance, characterized in that, include: Rewrite the original questions from users' spoken inquiries into structured information in the legal field; Construct a legal provision vector knowledge base and a case vector knowledge base to store the semantic vectors and structured metadata of legal provisions and judgment documents, respectively; using the original question as the retrieval request, perform a hybrid retrieval of vector retrieval and keyword retrieval on the case vector knowledge base to recall similar cases; using the original question, structured information and similar cases as independent retrieval requests, perform a hybrid legal provision retrieval with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current retrieval request, and obtain a candidate legal provision set; The candidate legal provisions are semantically rearranged, and a comprehensive applicability score is calculated based on the legal provisions attributes to complete the final ranking. An interpretable response is generated, and applicable legal provisions that can be used for judicial assistance are output.

2. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 1, characterized in that, The method for recalling similar cases by performing a hybrid retrieval of vector retrieval and keyword retrieval on the similarity vector knowledge base includes: The semantic similarity results obtained from the vector retrieval and the relevance results obtained from the keyword retrieval are weighted and fused together. The results are sorted from high to low according to the fusion results, and the top K similar cases with the highest similarity to the retrieval request of the current original question are recalled. The weighting coefficients used in the weighted fusion calculation performed by the case vector knowledge base are fixed weighting coefficients.

3. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 2, characterized in that, The method for performing a hybrid legal provision retrieval using multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provision with the highest semantic similarity to the current retrieval request includes: The original question, the rewritten structured information, and the recalled similar cases constitute a multi-way query. A hybrid retrieval is performed on the legal provision vector knowledge base. The comprehensive matching score is calculated by weighted fusion of vector retrieval score and keyword retrieval score. The top K legal provisions with the highest semantic similarity to the corresponding query are then recalled. The weighting coefficients used in the weighted fusion calculation performed by the legal provision vector knowledge base are configured differently for different types of retrieval paths; high weighting coefficients are used for retrieval paths belonging to the natural language description category, and low weighting coefficients are used for retrieval paths belonging to the legal terminology or structured text category.

4. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 2, characterized in that, The semantic reordering method includes: A reordering model is constructed, which is a semantic relevance calculation model based on a cross-encoder. Taking the user's original question as a reference, the candidate legal provisions recalled by each path are uniformly scored for semantic relevance, and sorted from high to low scores. The top N legal provisions are selected to form a fine-ranked candidate set.

5. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 4, characterized in that, The method for calculating the comprehensive suitability score and completing the final ranking includes: For each legal provision in the refined candidate set, a weighted calculation is performed by combining the semantic relevance score output by the rearrangement model with the legal provision attributes, including the legal validity level, timeliness status, and applicable cause of action matching degree, to obtain a comprehensive applicability score. The candidate legal provisions are then finally sorted from high to low according to the comprehensive applicability score.

6. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 1, characterized in that, The methods for constructing the legal provision vector knowledge base and the case study vector knowledge base include: Collect various laws and regulations, extract the legal provisions in a structured manner, use the BGE vector model to convert the legal provisions into 1024-dimensional vectors, store them in the vector library, and label the level of validity, timeliness, and cause of action to establish a legal provision vector knowledge base; Collect labor dispute judgment documents, extract case details, points of contention, key points of judgment, and applicable legal provisions, and store them in a vector database after vectorization to establish a similar case vector knowledge base.

7. The method for semantic matching and applicability recommendation of legal provisions for judicial assistance according to claim 2, characterized in that, The method for generating an interpretable response includes: The original question, the applicable legal provisions of the top K similar cases with the highest similarity to the current original question, and the key points of the judgments of the similar cases are used as context input to a large language model based on the RAG architecture. The output of the large language model includes: a concise legal characterization of the user's question; a list of the names, numbers, and contents of the applicable legal provisions; an explanation of why the legal provisions apply to this case; the legal consequences, the rights that can be asserted, and the method of calculating compensation; and suggestions on evidence and ways to protect rights. The structured recommendation results are returned to the user. The structured recommendation results include: a sorted list of legal provisions, a relevance score for each legal provision, an explanation of its applicability, a reason for recommendation, and supporting examples.

8. A legal provision semantic matching and applicability recommendation system for judicial assistance, used to implement the legal provision semantic matching and applicability recommendation method for judicial assistance as described in any one of claims 1-7, characterized in that, include: Spoken Language Rewriting Structured Module: Used to rewrite users' original spoken consultation questions into structured legal information; The dual-vector hybrid retrieval module is used to construct a legal provision vector knowledge base and a case vector knowledge base, which respectively store the semantic vectors of legal provisions and judgment documents and the structured metadata. Using the original question as the retrieval request, it performs a hybrid retrieval of vector retrieval and keyword retrieval on the case vector knowledge base to recall similar cases. Using the original question, structured information, and similar cases as independent retrieval requests, it performs a hybrid legal provision retrieval with multi-path differentiated weights on the legal provision vector knowledge base to recall the legal provisions with the highest semantic similarity to the current retrieval request, thus obtaining a candidate legal provision set. Explainable response module: used to perform semantic rearrangement of the candidate legal provisions set, calculate the comprehensive applicability score by combining the legal provisions attributes and complete the final ranking, generate an explainable response, and output applicable legal provisions that can be used for judicial auxiliary reference.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the legal provision semantic matching and applicability recommendation method for judicial assistance as described in any one of claims 1-7.

10. A computer device, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the legal provision semantic matching and applicability recommendation method for judicial assistance as described in any one of claims 1-7.