A construction engineering contract dispute text clustering method

By constructing a domain-parallel corpus and a weighted concept library, and utilizing specific perspective prompts and text generation models, the accuracy and adaptability issues of text clustering in construction project contract disputes in existing technologies have been resolved, achieving higher-precision capture and clustering of legal dispute points.

CN122196186APending Publication Date: 2026-06-12湖南工商大学

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
湖南工商大学
Filing Date
2026-05-15
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively capture the core legal disputes in construction contract texts, have low clustering accuracy, and lack domain adaptability, thus failing to meet the needs of legal practice.

Method used

We construct a domain-specific parallel corpus, translate the Chinese fine-tuning dataset into English, fine-tune the general text generation model, select prompt words from specific perspectives, generate an expanded query set, perform text preprocessing and weighted concept library sorting, calculate the similarity between the document concept matrix and probability matrix, prune and normalize, and obtain an importance weight matrix for cluster allocation.

Benefits of technology

It improves the accuracy and domain adaptability of construction project contract dispute text clustering, effectively captures core legal dispute points, and enhances the precision and consistency of clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122196186A_ABST
    Figure CN122196186A_ABST
Patent Text Reader

Abstract

The application provides a construction engineering contract dispute text clustering method, based on original text data, a Chinese fine-tuning data set is constructed for translation, an English fine-tuning data set is obtained, a general text generation model is fine-tuned, a prompt word is selected for each document in the original text data, the fine-tuned text generation model is input, and an expanded query set file is obtained; the original text data is preprocessed, and the fine-tuned text generation model is calculated by inputting the expanded query set file, and a basic probability matrix is obtained; the score of any legal concept and the corresponding weight in the constructed weighted concept library is calculated, a document concept matrix and a query concept matrix are obtained to calculate a proposal distribution vector and an importance weight matrix, and the contract dispute text data set is cluster assigned, the core legal dispute points of the construction engineering contract dispute can be effectively captured, and the accuracy and field adaptability of the construction engineering contract dispute text clustering are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural speech processing technology, and in particular to a method for clustering texts related to construction project contract disputes. Background Technology

[0002] The texts in the field of construction contract disputes are highly specialized and complex, containing numerous specific legal concepts, procedural rules, and rights and obligations clauses. Traditional text clustering methods, such as prototype-based objective function clustering (K-Means) and density-based spatial clustering of applications with noise (DBSCAN), lack the integration of domain knowledge, making it difficult to capture core legal points of contention. Furthermore, the lack of large-scale labeled data in this field results in low clustering accuracy and poor consistency of themes within clusters, failing to meet the needs of case classification and point of contention extraction in construction contract dispute legal practice.

[0003] The development of generative models has provided new avenues for text semantic expansion. However, existing high-performance generative query expansion models, trained on English corpora, face issues such as terminology distortion and semantic bias when directly applied to Chinese legal texts. Meanwhile, core legal concepts in the field of construction contract disputes are crucial for distinguishing the nature of disputes. How to effectively integrate domain expert knowledge into the generative clustering process to improve the model's adaptability to specialized texts has become an urgent technical challenge. Summary of the Invention

[0004] This invention provides a method for clustering construction project contract dispute texts, the purpose of which is to improve the accuracy and domain adaptability of construction project contract dispute text clustering.

[0005] To achieve the above objectives, this invention provides a method for clustering construction project contract dispute texts, including: Step 1: Obtain the original text data related to construction project contract disputes, and construct a domain-specific parallel corpus based on the original text data to obtain a Chinese fine-tuning dataset; Step 2: Translate the Chinese fine-tuning dataset to obtain the English fine-tuning dataset, and use the English fine-tuning dataset to fine-tune the pre-trained general text generation model to obtain the fine-tuned text generation model. Step 3: Select a specific perspective cue word for each document in the original text data, input the original text data and cue word into the fine-tuned text generation model to obtain the expanded query set file; Step 4: Preprocess the original text data to obtain the contract dispute text dataset, and input the contract dispute text dataset and the expanded query set file into the fine-tuned text generation model to calculate the basic probability matrix; Step 5: Organize and weight the key legal concepts in the construction engineering field to obtain a weighted concept library, and calculate the score of any legal concept in the weighted concept library and its corresponding weight in the target contract dispute text data or target expanded query to obtain the document concept matrix and query concept matrix. Step 6: Calculate the concept similarity between the document concept matrix and the probability matrix, and correct each element in the basic probability matrix based on the probability similarity to obtain the corrected probability matrix; Step 7: Clip the modified probability matrix in the logarithmic field to obtain the clipped probability matrix, and calculate the proposal distribution vector for each probability element in the clipped probability matrix. Step 8: Calculate and normalize the pruned probability matrix and proposal distribution vector to obtain the importance weight matrix, and then perform cluster assignment on the contract dispute text dataset based on the importance weight matrix to obtain the cluster assignment results.

[0006] Furthermore, specific perspectives include: Used to guide the model to focus on the legal element analysis perspective of the constituent elements; A practical perspective used to strengthen the logic of engineering practice; The perspective of legal provisions used as the basis for related legal provisions; A focused perspective for clarifying the relationships between multiple stakeholders and their responsibilities; A case-analogy perspective used to enhance generalization ability.

[0007] Furthermore, the original text data is preprocessed to obtain a contract dispute text dataset, including: The original text data is deeply cleaned to obtain the first text data; The first text data is formatted to obtain the contract dispute text dataset.

[0008] Furthermore, by inputting the contract dispute text dataset and the expanded query set file into the fine-tuned text generation model, the basic probability matrix is ​​obtained, including: Randomly and uniformly select several documents from the contract dispute text dataset and input them together with the expanded query set file into the fine-tuned text generation model to obtain the query corresponding to each document. Perform prior distribution sampling on all queries to obtain the prior distribution sampling results; Collect multiple queries from the prior distribution sampling results; The initial generation probability is obtained by calculating the generation probability of each query using the logarithmic field summation formula. After length normalization of the initial generation probabilities, a normalization transformation is performed to obtain the basic probability matrix.

[0009] Furthermore, the calculation expression for the initial generation probability after length normalization and normalization transformation is as follows: ; in, This indicates that the normalization transformation yields the probability distribution. This indicates the length of the word sequence after the word segmenter has processed it. Indicates the query's first Each word element, Indicates the first One document, Indicates the first in the query All lexical sequences preceding each lexical unit Indicates the number of queries.

[0010] Furthermore, the expression for calculating the score of any legal concept and its corresponding weight in the weighted concept library within the target contract dispute text data or target expanded query is as follows: ; in, Indicates the score. Indicates the first A legal concept, Indicates the first The weight corresponding to each legal concept Indicates the mixing equilibrium coefficient. This indicates a rule matching indicator function. This indicates the target contract dispute text data or the target extended query. Represents the semantic similarity function. Both represent dense vectors.

[0011] Furthermore, the expression for correcting each element in the basic probability matrix based on probability similarity is as follows: ; in, Represents the first element in the corrected probability matrix. Line number Column elements, Represents the first in the fundamental probability matrix Line number Column elements, Indicates the adjustment factor. Document With query The original probability, Document With query The adjustment factor.

[0012] Furthermore, step 7 includes: The mean and standard deviation are calculated using the corrected probability matrix; The modified probability matrix is ​​clipped and normalized using the mean and standard deviation to obtain the clipped probability matrix. Using formula After calculating and normalizing each probability element in the cropped probability matrix, the proposal distribution vector is obtained, where... This represents the proposal distribution vector before normalization. Represents the regularization parameter. Represents the th element in the pruned probability matrix. Line number Column elements, This represents the number of probability elements in the clipped probability matrix.

[0013] Furthermore, based on the importance weight matrix, clusters are assigned to the contract dispute text dataset, yielding the following cluster assignment results: Calculate the concept richness score of each document in the contract dispute text dataset, and use the importance weight matrix corresponding to the documents with the highest concept richness scores as the initial centroid of each cluster to obtain the cluster centroid matrix; The importance weight matrix is ​​used as the importance sampling weight. The logarithmic ratio of the cropped probability matrix to the cluster centroid matrix is ​​weighted and summed to obtain the distance of each document to the cluster. Each document is assigned based on its distance to the cluster, resulting in an initial assignment. Based on the initial allocation results, the initial centroid of each cluster is updated using the pruned probability matrix to obtain the updated cluster centroid matrix. The initial allocation results are then iteratively updated based on the updated cluster centroid matrix until the iteration termination condition is met, thus obtaining the cluster allocation results.

[0014] Furthermore, following step 8, the following also includes: We use a weighted concept library to extract the set of concepts contained in each document of a contract dispute text dataset. The frequency and weight of concepts appearing in all documents within each cluster are statistically analyzed in the cluster assignment results to obtain the core concept set of each cluster. For each document in each cluster, calculate the overlap between the concept set contained in the document and the core concept set of the cluster; Outliers in each cluster are redistributed based on overlap and a set consistency threshold to obtain the corrected cluster assignment results.

[0015] The above-described solution of the present invention has the following beneficial effects: Compared with existing technologies, this invention constructs a domain-specific parallel corpus based on original text data to obtain a Chinese fine-tuning dataset; translates the Chinese fine-tuning dataset to obtain an English fine-tuning dataset, and uses the English fine-tuning dataset to fine-tune a pre-trained general text generation model; selects a specific perspective cue word for each document in the original text data, inputs the original text data and cue word into the fine-tuned text generation model to obtain an expanded query set file; preprocesses the original text data and inputs it along with the expanded query set file into the fine-tuned text generation model to calculate the basic probability matrix; and sorts and weights key legal concepts in the field of construction engineering to obtain... The system retrieves a weighted concept library and calculates the scores of any legal concept and its corresponding weight in the target contract dispute text data or target extended query, resulting in a document concept matrix and a query concept matrix. Based on the concept similarity between the document concept matrix and the probability matrix, the elements in the basic probability matrix are modified, pruned, and a proposal distribution vector is calculated. The pruned probability matrix and proposal distribution vector are then used to calculate and normalize the importance weight matrix, which is then used to cluster the contract dispute text dataset. This approach can effectively capture the core legal disputes in construction contract disputes and improve the accuracy and domain adaptability of construction contract dispute text clustering.

[0016] Other beneficial effects of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating an embodiment of the present invention. Detailed Implementation

[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0019] This invention addresses existing problems by providing a method for clustering construction project contract dispute texts.

[0020] like Figure 1 As shown, an embodiment of the present invention provides a method for clustering construction contract dispute texts, including: Step 1: Obtain the original text data related to construction project contract disputes, and construct a domain-specific parallel corpus based on the original text data to obtain a Chinese fine-tuning dataset; Step 2: Translate the Chinese fine-tuning dataset to obtain the English fine-tuning dataset, and use the English fine-tuning dataset to fine-tune the pre-trained general text generation model to obtain the fine-tuned text generation model. Step 3: Select a specific perspective cue word for each document in the original text data, input the original text data and cue word into the fine-tuned text generation model to obtain the expanded query set file; Step 4: Preprocess the original text data to obtain the contract dispute text dataset, and input the contract dispute text dataset and the expanded query set file into the fine-tuned text generation model to calculate the basic probability matrix; Step 5: Organize and weight the key legal concepts in the construction engineering field to obtain a weighted concept library, and calculate the score of any legal concept in the weighted concept library and its corresponding weight in the target contract dispute text data or target expanded query to obtain the document concept matrix and query concept matrix. Step 6: Calculate the concept similarity between the document concept matrix and the probability matrix, and correct each element in the basic probability matrix based on the probability similarity to obtain the corrected probability matrix; Step 7: Clip the modified probability matrix in the logarithmic field to obtain the clipped probability matrix, and calculate the proposal distribution vector for each probability element in the clipped probability matrix. Step 8: Calculate and normalize the pruned probability matrix and proposal distribution vector to obtain the importance weight matrix, and then perform cluster assignment on the contract dispute text dataset based on the importance weight matrix to obtain the cluster assignment results.

[0021] In this embodiment of the invention, the original text data related to construction project contract disputes includes judgments related to construction project contract disputes, the "Compilation of Judicial Interpretations and Guiding Opinions of Courts Nationwide on the Trial of Construction Project Contract Disputes", and 300 typical cases, including points of contention.

[0022] The specific process by which this invention constructs a domain-specific parallel corpus based on original text data to obtain a Chinese fine-tuning dataset is as follows: Using the "Compilation of Judicial Interpretations and Guiding Opinions on the Trial of Construction Project Contract Disputes by Courts Nationwide" and typical cases as data sources, a reverse question generation paradigm is adopted. That is, given a legal answer or judgment reason, the corresponding legal questions are manually or semi-automatically labeled to form Chinese text and query pairs, thereby constructing a Chinese fine-tuning dataset. For example, inputting a judgment reason about "extension of construction period" will label the corresponding question "Under what circumstances can the contractor claim an extension of construction period?" The final result is a Chinese fine-tuning dataset containing 376 high-quality samples, ensuring coverage of core issues such as "project price", "construction period delay" and "quality disputes".

[0023] In the embodiment of the present invention, the general text generation model selects doc2 query / all-with_prefix-t5-base-v1 as the base model. This model has been pre-trained on the MS MARCO dataset and has good query generation capabilities. It adopts a Seq2Seq (sequence-to-sequence) architecture and uses maximizing conditional log probability as the fine-tuning objective. The training parameter settings are as follows: the input sequence length is 512, the output sequence length is 64, Epochs = 5, Batch Size = 4, Learning Rate = 2e -5 , and the optimizer uses AdamW and adopts the Teacher Forcing strategy to accelerate convergence. This process enables the model to migrate from "general question answering" to "question answering for construction project contract disputes" and can generate more professional queries.

[0024] Since the general text generation model can only generate English queries, step 2 needs to adopt the method of translation-generation-back translation. The specific process is as follows: Use the Helsinki-NLP translation model to translate the Chinese fine-tuning dataset into an English fine-tuning dataset; Input the English fine-tuning dataset into the pre-trained general text generation model to generate the top-K English queries for each English document. This step utilizes the divergent ability of the general generation model, and the generated queries may contain semantically related words that do not appear explicitly in the document; Back-translate the generated English queries into Chinese queries, and match the terms in the Chinese queries with the terms in the original term library to ensure that "Lien" is accurately back-translated as "priority of compensation" rather than "lien". Based on the matching results, fine-tune the pre-trained general text generation model to obtain the fine-tuned text generation model.

[0025] Most preferably, before using the Helsinki-NLP translation model to translate the Chinese fine-tuning dataset into an English fine-tuning dataset, it is necessary to identify the core legal terms in the Chinese fine-tuning dataset and replace them with feature placeholders (such as '_TERM_001_') or enforce the retention format to prevent semantic drift during the translation process. For example, "priority of compensation" may be translated as "Priority Payment Right" in general translation, but should be "Priority of Compensation" in the legal context.

[0026] In the embodiment of the present invention, when generating queries, it is necessary to randomly select a prompt word from a specific perspective for each document in the original text data to stimulate the model to analyze from different dimensions and generate queries.

[0027] Specifically, the specific perspectives include: The legal element analysis perspective for guiding the model to focus on the constitutive elements, the practical perspective for strengthening the engineering practice logic, the legal provision basis perspective for correlating legal provisions, the subject relationship focus perspective for clarifying the responsibilities of multiple parties, and the case analogy perspective for enhancing the generalization ability.

[0028] Specifically, step 3 includes: Select a prompt word for each document in the original text data from a specific perspective; Repeat multiple times to randomly and evenly select a document and a prompt word from the original text data and input them into the fine-tuned text generation model to generate multiple queries to construct an augmented query set file.

[0029] Specifically, 1024 queries are generated by repeating 1024 times. Therefore, the augmented query set file contains 1024 generated dispute foci, and each dispute focus records the source document, the prompt word used, and the finally generated Chinese query, greatly enriching the semantic representation of the document.

[0030] Specifically, preprocess the original text data to obtain a contract dispute text data set, including: Deep clean the original text data to obtain the first text data; Format the first text data to obtain a contract dispute text data set.

[0031] In the embodiment of the present invention, deep clean the original text data to obtain the first text data, specifically including: In view of the particularity of legal texts, remove the HTML tags in the original text data, process the errors in the recognition of scanned documents (such as misrecognizing "壹" as "1"), use the regular expression `[^\u4e00-\u9fa5a-zA-Z0-9]` to remove garbled symbols, retain the key punctuation marks in legal documents (such as book titles, parentheses), and remove redundant blank characters (such as consecutive line breaks, tab characters) to obtain the first text data.

[0032] In the embodiment of the present invention, format the first text data to obtain a contract dispute text data set, that is, convert the unstructured text into standard JSON format data, and the core processing unit is the "question" field. The structure of the generated `questions.json` file is as follows: `[{"id":"doc_001","content":"Original content:","question":"Extracted or generated core question..."}]`.

[0033] Specifically, input the contract dispute text data set and the augmented query set file into the fine-tuned text generation model for calculation to obtain a basic probability matrix, including: Several documents were randomly and uniformly selected from the contract dispute text dataset. The expanded query set file is input into the fine-tuned text generation model to obtain the query corresponding to each document. ; Prior distribution sampling is performed on all queries to obtain the prior distribution sampling results. ; Sampling results from prior distribution Collection in China One query The number of queries collected balances the coverage of the query space with the computational overhead; Using the summation formula for the logarithmic field Calculate the generation probability for each query to obtain the initial generation probability; Using public The formula performs length normalization on the initial generation probability and then performs normalization transformation to obtain the basic probability matrix.

[0034] Specifically, the calculation expression for the initial generation probability after length normalization and normalization transformation is as follows: ; in, This indicates that the normalization transformation yields the probability distribution. This indicates the length of the word sequence after the word segmenter has processed it. Indicates the query's first Each word element, Indicates the first One document, Indicates the first in the query All lexical sequences preceding each lexical unit Indicates the number of queries.

[0035] Specifically, key legal concepts in the construction engineering field include: Core rights and validity concepts are the decisive characteristics of cases in the field of construction engineering. Key facts and milestones are concepts used to describe the specific details and trial stages of cases in the field of construction engineering. General background concepts are used to describe common facts.

[0036] In this embodiment of the invention, core rights and validity concepts may include priority right to payment for project costs, right to stop work, and right to claim compensation; invalid contracts, black and white contracts, affiliation, subcontracting, etc., with a weight of 9.0-10.0. These concepts directly correspond to the core points of contention in legal relationships. The high weight ensures that the clustering algorithm can prioritize the identification and aggregation of cases with the same legal nature, avoiding classification errors due to the similarity of secondary facts. Key facts and milestone concepts can include actual contractor, employer, and contractor (subject type); completion acceptance, settlement, and cost appraisal (procedural requirements); quantity of work and quality of work (engineering elements); liquidated damages and interest (liability for breach of contract), with a weight of 6.0-8.0. This type of concept plays an important role in distinguishing different causes of action under the same legal nature (such as whether they are both for recovering project payments due to quality issues or construction period issues). General background concepts can include notices, filings, materials, meeting minutes, etc., with a weight of 1.0-5.0. These concepts are common in various construction project disputes and have low distinguishability. Assigning low weights aims to preserve semantic integrity while suppressing noise interference from common high-frequency words on the clustering results.

[0037] Specifically, the expression for calculating the score of any legal concept and its corresponding weight in the weighted concept library within the target contract dispute text data or target expanded query is as follows: ; in, Indicates the score. Indicates the first A legal concept, Indicates the first The weight corresponding to each legal concept Indicates the mixing equilibrium coefficient. This indicates a rule matching indicator function. This indicates the target contract dispute text data or the target extended query. Represents the semantic similarity function. Both represent dense vectors.

[0038] In this embodiment of the invention, taking To ensure that concept scores are non-negative and to avoid interference from negative cosine similarity in weight calculation; when text explicit inclusion of concept words or its predefined set of synonyms Any word in it, then ,otherwise To ensure accurate capture of technical terms; utilizing pre-trained BGE Large ZH model will text With concept Mapped to dense vectors It also calculates cosine similarity, which can capture the implicit semantic associations of "different words with the same meaning"; the embodiments of the present invention take a hybrid balance coefficient. The score is 0.2. A semantic matching-based strategy is adopted to improve the recall rate of implicit semantic associations and avoid missing semantically equivalent expressions that do not use standard terms.

[0039] Based on the above expressions, the document concept matrix and query concept matrix are obtained as follows: , .

[0040] Specifically, step 6 includes: First, use the formula Normalize the concept vectors in the document concept matrix and query concept matrix to obtain normalized vectors for the document concept matrix and query concept matrix, where, To prevent division by zero by the smoothing constant, when the vector norm is much larger than the smoothing constant... When this expression is used, it is approximately equivalent to the standard cosine similarity. Calculate the concept similarity between the document probability matrix and the probability matrix using normalized vectors of the document concept matrix and query concept matrix. The calculation expression is: ; The adjustment factor is calculated based on probabilistic similarity, and the calculation expression is as follows: ; The basic concept matrix is ​​adjusted based on the adjustment factor, expressed as follows: ; The expression for correcting each element in the adjusted basic concept matrix using the logarithmic field formula is as follows: ; in, Represents the corrected probability matrix The first in Line number Column elements, Represents the first in the fundamental probability matrix Line number Column elements, Indicates the adjustment factor. Document With query The original probability, Document With query The adjustment factor, use Calculation techniques are employed to ensure numerical stability.

[0041] Because probabilistic clipping can sometimes create illusions in generative models or lead to overconfident high probabilities for certain common words (such as contracts and disputes), statistical methods are used to clip the probability matrix in the logarithmic domain to suppress outliers. Therefore, step 7 specifically includes: The mean is calculated using the corrected probability matrix. and standard deviation The calculation expression is: ; ; The expressions for cropping and normalizing the corrected probability matrix using the mean and standard deviation are as follows: ; ; in, This represents the probability matrix after clipping; Using formula After calculating and normalizing each probability element in the cropped probability matrix, the proposal distribution vector is obtained. ,in, This represents the proposal distribution vector before normalization. Represents the regularization parameter. ,when It degenerates into the geometric mean. When the time approaches the maximum value, the embodiment of the present invention takes =0.25 (i.e., 2) A value of 0.5 places the distribution between the geometric mean and the arithmetic mean, providing a moderate emphasis on high-probability values ​​and effectively identifying common queries widely generated by most documents. Represents the th element in the pruned probability matrix. Line number Column elements, This represents the number of probability elements in the clipped probability matrix.

[0042] Specifically, the importance weight matrix is ​​calculated and normalized using the clipped probability matrix and the proposal distribution vector, and the expression for the calculation is as follows: ; The formula for the logarithmic field is: ; in, This is to prevent numerical overflow caused by a denominator of zero. Normalization: ; in, This represents the importance weight matrix.

[0043] Specifically, cluster assignment is performed on the contract dispute text dataset based on an importance weight matrix, yielding the following cluster assignment results: Using formula Calculate the concept richness score for each document in the contract dispute text dataset. And the one with the highest concept richness score The importance weight matrix corresponding to each document As the initial centroid of each cluster The cluster centroid matrix is ​​obtained. The importance weight matrix is ​​used as the importance sampling weight. A weighted sum is then applied to the logarithmic ratio of the cropped probability matrix to the cluster centroid matrix to obtain the distance from each document to the cluster. The calculation expression is as follows: ; Each document is assigned based on its distance to the cluster, and the expression for the initial assignment result is as follows: ; Based on the initial assignment results, the initial centroid of each cluster is updated using the pruned probability matrix, and the updated cluster centroid matrix is ​​shown in Table 1 below: Table 1. Cluster centroid matrix (partial)

[0044] The initial allocation result is iteratively updated based on the updated cluster centroid matrix until the iteration termination condition is met, thus obtaining the cluster allocation result.

[0045] Specifically, the expression for updating the initial centroid of each cluster using the pruned probability matrix is ​​as follows: ; in, This represents the normalization constant.

[0046] In this embodiment of the invention, the iteration termination condition is to monitor the rate of change of total distortion or the maximum number of iterations, wherein the expression for calculating total distortion is: ; The iteration termination condition is: or ; in, Indicates relative tolerance. , This indicates the lower bound of the absolute tolerance. , Indicates the maximum number of iterations. .

[0047] In this embodiment of the invention, when each cluster is empty, the centroid of the previous round is maintained. Or reinitialize randomly.

[0048] Specifically, after step 8, the following is also included: The concept set contained in each document of the contract dispute text dataset was extracted using a weighted concept library. ; The statistical cluster assignment results, which analyze the frequency and weight of concepts in all documents within each cluster, yield the core concept set for each cluster as follows: ; in, Indicates weight, , indicating the number of core concepts, in this embodiment of the invention, is taken as ; For each document in each cluster, calculate the overlap between the concept set contained in the document and the core concept set of the cluster. ; Outliers in each cluster are redistributed based on overlap and a set consistency threshold, resulting in the corrected cluster allocation: .

[0049] In this embodiment of the invention, overlap refers to the proportion of core concepts in a document that cover the entire cluster; outlier identification and redistribution: setting a consistency threshold. In this embodiment, =0.3; if Then determine the document For documents identified as outliers in the current cluster, the document is considered an outlier. Recalculate the overlap among all K clusters and assign the cluster with the highest overlap. If the cluster corresponding to the highest overlap is the original cluster, or if the highest overlap is still lower than the original cluster, then the cluster is assigned to the cluster with the highest overlap. If the original allocation remains unchanged, as shown in Table 2 below: Table 2

[0050] Compared with existing technologies, this invention constructs a domain-specific parallel corpus based on original text data to obtain a Chinese fine-tuning dataset; translates the Chinese fine-tuning dataset to obtain an English fine-tuning dataset, and uses the English fine-tuning dataset to fine-tune a pre-trained general text generation model; selects a specific perspective prompt word for each document in the original text data, inputs the original text data and prompt word into the fine-tuned text generation model to obtain an expanded query set file; preprocesses the original text data and inputs it along with the expanded query set file into the fine-tuned text generation model to calculate the basic probability matrix; and sorts and weights key legal concepts in the field of construction engineering. The process involves obtaining a weighted concept library and calculating the scores of any legal concept and its corresponding weight in the target contract dispute text data or target extended query, resulting in a document concept matrix and a query concept matrix. Based on the concept similarity between the document concept matrix and the probability matrix, the elements in the basic probability matrix are modified, pruned, and a proposal distribution vector is calculated. The pruned probability matrix and proposal distribution vector are then used to calculate and normalize the importance weight matrix, which is used to cluster the contract dispute text dataset. This approach can effectively capture the core legal disputes in construction contract disputes and improve the accuracy and domain adaptability of construction contract dispute text clustering.

[0051] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for clustering construction project contract dispute texts, characterized in that, include: Step 1: Obtain the original text data related to construction project contract disputes, and construct a domain parallel corpus based on the original text data to obtain a Chinese fine-tuning dataset; Step 2: Translate the Chinese fine-tuning dataset to obtain the English fine-tuning dataset, and use the English fine-tuning dataset to fine-tune the pre-trained general text generation model to obtain the fine-tuned text generation model. Step 3: Select a specific perspective prompt word for each document in the original text data, and input the original text data and the prompt word into the fine-tuned text generation model to obtain the expanded query set file; Step 4: Preprocess the original text data to obtain a contract dispute text dataset, and input the contract dispute text dataset and the expanded query set file into the fine-tuned text generation model to calculate the basic probability matrix; Step 5: Organize and weight the key legal concepts in the construction engineering field to obtain a weighted concept library, and calculate the score of any legal concept and its corresponding weight in the weighted concept library in the target contract dispute text data or target expanded query to obtain the document concept matrix and the query concept matrix. Step 6: Calculate the concept similarity between the document concept matrix and the probability matrix, and correct each element in the basic probability matrix based on the probability similarity to obtain the corrected probability matrix; Step 7: Clip the modified probability matrix in the logarithmic field to obtain the clipped probability matrix, and calculate the proposal distribution vector for each probability element in the clipped probability matrix. Step 8: Calculate and normalize the importance weight matrix using the cropped probability matrix and the proposal distribution vector to obtain the importance weight matrix. Then, perform cluster allocation on the contract dispute text dataset based on the importance weight matrix to obtain the cluster allocation result.

2. The construction contract dispute text clustering method according to claim 1, characterized in that, The specific perspectives include: Used to guide the model to focus on the legal element analysis perspective of the constituent elements; A practical perspective used to strengthen the logic of engineering practice; The perspective of legal provisions used as the basis for related legal provisions; A focused perspective for clarifying the relationships between multiple stakeholders and their responsibilities; A case-analogy perspective used to enhance generalization ability.

3. The method for clustering construction contract dispute texts according to claim 1, characterized in that, The original text data is preprocessed to obtain a contract dispute text dataset, including: The original text data is deeply cleaned to obtain the first text data; The first text data is formatted to obtain a contract dispute text dataset.

4. The construction contract dispute text clustering method according to claim 3, characterized in that, The contract dispute text dataset and the expanded query set file are input into the fine-tuned text generation model to calculate the basic probability matrix, which includes: Randomly and uniformly select several documents from the contract dispute text dataset and input them together with the expanded query set file into the fine-tuned text generation model to obtain the query corresponding to each document; Perform prior distribution sampling on all queries to obtain the prior distribution sampling results; Multiple queries are collected from the prior distribution sampling results; The initial generation probability is obtained by calculating the generation probability of each query using the logarithmic field summation formula. The initial generation probability is length normalized and then normalized to obtain the basic probability matrix.

5. The method for clustering construction contract dispute texts according to claim 4, characterized in that, The calculation expression for the initial generation probability after length normalization and normalization transformation is as follows: ; in, This indicates that the normalization transformation yields the probability distribution. This indicates the length of the word sequence after the word segmenter has processed it. Indicates the query's first Each word element, Indicates the first One document, Indicates the first in the query All lexical sequences preceding each lexical unit Indicates the number of queries.

6. The method for clustering construction contract dispute texts according to claim 1, characterized in that, The expression for calculating the score of any legal concept and its corresponding weight in the weighted concept library in the target contract dispute text data or target expanded query is as follows: ; in, Indicates the score. Indicates the first A legal concept, Indicates the first The weight corresponding to each legal concept Indicates the mixing equilibrium coefficient. This indicates a rule matching indicator function. This indicates the target contract dispute text data or the target extended query. Represents the semantic similarity function. Both represent dense vectors.

7. The method for clustering construction contract dispute texts according to claim 1, characterized in that, The expression for correcting each element in the basic probability matrix based on the probability similarity is as follows: ; in, Represents the first element in the corrected probability matrix. Line number Column elements, Represents the first in the fundamental probability matrix Line number Column elements, Indicates the adjustment factor. Document With query The original probability, Document With query The adjustment factor.

8. The method for clustering construction contract dispute texts according to claim 7, characterized in that, Step 7 includes: The mean and standard deviation are calculated using the corrected probability matrix; The modified probability matrix is ​​then pruned and normalized using the mean and standard deviation to obtain the pruned probability matrix. Using formula After calculating and normalizing each probability element in the cropped probability matrix, a proposal distribution vector is obtained, where... This represents the proposal distribution vector before normalization. Represents the regularization parameter. Represents the th element in the pruned probability matrix. Line number Column elements, This represents the number of probability elements in the clipped probability matrix.

9. The method for clustering construction contract dispute texts according to claim 1, characterized in that, Clustering is performed on the contract dispute text dataset based on the importance weight matrix to obtain the clustering results, including: Calculate the concept richness score of each document in the contract dispute text dataset, and use the importance weight matrix corresponding to the documents with the highest concept richness scores as the initial centroid of each cluster to obtain the cluster centroid matrix; The importance weight matrix is ​​used as the importance sampling weight to perform a weighted summation of the logarithmic ratio of the cropped probability matrix to the cluster centroid matrix, thus obtaining the distance from each document to the cluster. Each document is assigned based on its distance to the cluster, resulting in an initial assignment. Based on the initial allocation result, the initial centroid of each cluster is updated using the pruned probability matrix to obtain the updated cluster centroid matrix. The initial allocation result is then iteratively updated based on the updated cluster centroid matrix until the iteration termination condition is met, thus obtaining the cluster allocation result.

10. The method for clustering construction contract dispute texts according to claim 1, characterized in that, Following step 8, the following is also included: The weighted concept library is used to extract the concept set contained in each document of the contract dispute text dataset; The frequency and weight of concepts appearing in all documents within each cluster are statistically analyzed in the cluster allocation results to obtain the core concept set of each cluster. For each document in each cluster, calculate the overlap between the concept set contained in the document and the core concept set of the cluster; Based on the overlap and the set consistency threshold, outliers in each cluster are redistributed to obtain the corrected cluster allocation results.