A data query method and system based on large model platform
By analyzing the semantic closeness and intrinsic correlation of the query vocabulary, clustering and optimizing sorting, the problem of insufficient accuracy and completeness in data query of large model platforms is solved, and more accurate query results are achieved.
Patent Information
- Application Number
- CN202510928086.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-07
AI Technical Summary
In the prior art, the data query method based on the big model platform has problems of insufficient accuracy and completeness when the user queryes the content to obtain relevant information from the external knowledge base, especially in the case of numerous data in multiple fields or different subdivided fields, resulting in the content returned by the search and does not match the user's core needs.
By obtaining the relevant file candidate sets of query content, analyzing the semantic closeness and intrinsic correlation between query vocabulary, performing the first and second clustering, obtaining the query domain representativeness and offset of the largest cluster cluster, calculating the query intent match and match priority, and optimizing the sorting results of candidate files.
Ensure that the final query results accurately reflect the user's real needs, improve the accuracy and relevance of data queries, and reduce content that does not match the user's core needs.
Smart Images

Figure CN120429433B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a data query method and system based on a large model platform. Background Art
[0002] The Big Model Platform is an intelligent system that integrates large-scale pre-trained models and high-performance computing resources to support natural language understanding, generation, and reasoning. Data query is the process of rapidly retrieving, filtering, and integrating required information from various data sources based on user-specified conditions. The Big Model Platform-based data query method and system efficiently retrieves and displays accurate information from multiple data sources by performing semantic parsing and structured conversion of user natural language queries, combined with keyword matching and vector retrieval technologies. This provides data query functionality, enabling intelligent interaction between users and complex data systems.
[0003] In the prior art, when retrieving relevant information from an external knowledge base based on a user's query, the query is first preprocessed and key terms are extracted. Then, retrieval algorithms such as keyword matching are used to search for candidate documents within the knowledge base. However, due to the large volume of data associated with the user input, potentially covering multiple fields or different sub-fields, subsequent searches based on keyword or vector matching can return content that doesn't match the user's core needs, compromising the accuracy and completeness of the generated answers. Summary of the Invention
[0004] In order to solve the above problems, according to a first aspect of an embodiment of the present application, a data query method based on a large model platform is provided, the method comprising:
[0005] According to the query content, obtaining a candidate set of files related to the query content;
[0006] Obtaining semantic affinity between query terms in the relevant document candidate set;
[0007] Obtaining intrinsic relevance between the query terms based on the semantic closeness;
[0008] Performing a first clustering of the query terms according to the intrinsic relevance, and obtaining the query domain representativeness of the largest cluster of the first clustering;
[0009] Adding the candidate document words to the query words for a second clustering, obtaining a deviation of the query domain representativeness of the largest cluster after the second clustering, wherein the deviation represents the deviation of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster after the first clustering;
[0010] Obtaining a query intent matching degree of the candidate file according to the query domain representativeness of the largest cluster after the second clustering and the offset degree of the query domain representativeness;
[0011] Obtaining the query matching priority of the candidate file according to the query intent matching degree;
[0012] According to the query matching priority, a candidate file ranking result of the related file candidate set is obtained.
[0013] Optionally, obtaining the semantic affinity between query terms in the candidate set of relevant documents includes:
[0014] Obtaining a first frequency, where the first frequency is an occurrence frequency of the first query term in the candidate document;
[0015] Obtaining a second frequency, where the second frequency is an occurrence frequency of a second query term in the candidate document;
[0016] Obtaining a character spacing mean, where the character spacing mean is the mean number of characters between the first query term and the second query term when they appear in a group in the candidate file;
[0017] The semantic affinity between the query terms is obtained according to the first frequency, the second frequency and the character interval average.
[0018] Optionally, obtaining the intrinsic correlation between the query terms according to the semantic affinity includes:
[0019] Obtaining a first file quantity, where the first file quantity is the number of candidate files containing both the first query term and the second query term;
[0020] Obtaining a second number of files, where the second number of files is the number of candidate files containing the first query term or the second query term;
[0021] Obtaining a semantic affinity mean, where the semantic affinity mean is the mean of semantic affinities of all candidate documents containing both the first query term and the second query term;
[0022] The intrinsic correlation between the query terms is obtained according to the first document quantity, the second document quantity and the semantic affinity average.
[0023] Optionally, performing a first clustering of the query terms according to the intrinsic relevance to obtain the query domain representativeness of the largest cluster of the first clustering includes:
[0024] Obtaining a first query word quantity, where the first query word quantity is the query word quantity of the largest cluster in the first clustering result;
[0025] Obtaining the number of second query terms, where the second query term number is the number of all query terms in the query content;
[0026] Obtaining an intrinsic correlation mean, where the intrinsic correlation mean is the mean of the intrinsic correlations between any two words in the largest cluster of the first clustering;
[0027] The query domain representativeness of the largest cluster in the first clustering is obtained according to the number of the first query words, the number of the second query words, and the mean of the intrinsic relevance.
[0028] Optionally, the adding of the candidate document words to the query words for a second clustering and obtaining the query domain representativeness offset of the largest cluster after the second clustering includes:
[0029] The candidate document words are added to the query words for re-clustering, and the query domain representativeness corresponding to the largest cluster after re-clustering is obtained;
[0030] According to the query domain representativeness of the largest cluster of the first clustering and the query domain representativeness corresponding to the largest cluster after the re-clustering, the deviation degree of the query domain representativeness of the largest cluster after the second clustering is obtained.
[0031] Optionally, obtaining the query intent matching degree of the candidate file according to the query domain representativeness of the largest cluster after the second clustering and the deviation degree of the query domain representativeness includes:
[0032] Obtaining a first product, where the first product is the product of the query domain representativeness of the largest cluster after the second clustering and the offset;
[0033] The query intention matching degree of the candidate file is obtained according to the first product.
[0034] Optionally, obtaining the query matching priority of the candidate file according to the query intent matching degree includes:
[0035] Obtaining query question suitability of the candidate file;
[0036] The query matching priority of the candidate file is obtained according to the query intention matching degree and the query question adaptability.
[0037] Optionally, obtaining the query question suitability of the candidate file includes:
[0038] Obtaining a first TF-IDF value, where the first TF-IDF value is an average of the term frequency and the inverse text frequency index of all query terms in the query question in the candidate document;
[0039] Obtain a second TF-IDF value, where the second TF-IDF value is a word frequency and an inverse text frequency index of adjacent query words of the query question in the candidate document;
[0040] Obtaining the total number of adjacent query words of the query question;
[0041] The query question suitability of the candidate document is obtained according to the first TF-IDF value, the second TF-IDF value, and the total number of adjacent query words of the query question.
[0042] Optionally, obtaining the query matching priority of the candidate file according to the query intent matching degree and the query question suitability includes:
[0043] Obtaining a second product, where the second product is the product of the query intent matching degree and the query question adaptation degree;
[0044] Obtain the query matching priority of the candidate file according to the query intention matching degree and the second product.
[0045] According to a second aspect of an embodiment of the present application, a data query system based on a large model platform is provided, wherein the system includes the large model platform, and the large model platform includes:
[0046] a memory having a computer program stored thereon;
[0047] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods in the first aspect.
[0048] In summary, an embodiment of the present application provides a data query method based on a large model platform, the method comprising: obtaining a candidate set of relevant documents for the query content according to the query content; obtaining the semantic affinity between the query terms in the candidate set of relevant documents; obtaining the intrinsic association between the query terms according to the semantic affinity; performing a first clustering on the query terms according to the intrinsic association, and obtaining the query domain representativeness of the largest cluster of the first clustering; adding the candidate document terms to the query terms for a second clustering, and obtaining the offset of the query domain representativeness of the largest cluster after the second clustering, the offset representing the offset of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster of the first clustering; obtaining the query intent matching degree of the candidate documents according to the query domain representativeness of the largest cluster after the second clustering and the offset of the query domain representativeness; obtaining the query matching priority of the candidate documents according to the query intent matching degree; and obtaining the candidate document ranking result of the candidate set of relevant documents according to the query matching priority. The embodiment of the present application performs vocabulary analysis on the user's query content, confirms the field to which the query content belongs, and optimizes the sorting of the search results to ensure that the final query results can accurately reflect the user's real needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the implementation scheme of the present application, the following is a brief introduction to the drawings required for use in the implementation scheme. It should be understood that the drawings only show certain implementation schemes of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on the drawings without paying any creative work.
[0050] Figure 1 The figure is a flow chart of a data query method based on a large model platform according to an exemplary embodiment.
[0051] Figure 2 The present invention is a flowchart showing a method for obtaining semantic affinity between query terms in a set of related document candidates according to an exemplary embodiment.
[0052] Figure 3 The present invention is a flowchart showing a method for obtaining intrinsic relevance between query terms according to semantic closeness according to an exemplary embodiment.
[0053] Figure 4 The present invention is a flowchart showing a method for performing a first clustering of query terms according to intrinsic relevance and obtaining the query domain representativeness of the largest cluster of the first clustering according to an exemplary embodiment.
[0054] Figure 5The present invention is a flowchart illustrating a method for adding candidate document terms to query terms for a second clustering and obtaining a query domain representativeness offset of a maximum cluster after the second clustering according to an exemplary embodiment.
[0055] Figure 6 The present invention is a flowchart of a method for obtaining a query intent matching degree of a candidate file based on the query domain representativeness and the offset degree of the query domain representativeness of the largest cluster after the second clustering according to an exemplary embodiment.
[0056] Figure 7 The present invention is a flowchart showing a method for obtaining a query matching priority of a candidate file according to a query intent matching degree according to an exemplary embodiment.
[0057] Figure 8 The figure is a flowchart showing a method for obtaining query question suitability of candidate files according to an exemplary embodiment.
[0058] Figure 9 The present invention is a flowchart showing a method for obtaining a query matching priority of a candidate file according to a query intention matching degree and a query question adaptation degree according to an exemplary embodiment.
[0059] Figure 10 It is a block diagram of a data query system based on a large model platform according to an exemplary embodiment.
[0060] Figure 11 It is a block diagram of a large model platform according to an exemplary embodiment. DETAILED DESCRIPTION
[0061] In order to clearly illustrate the technical features of this solution, this application is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0062] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of protection of the present application.
[0063] It should be understood that the various steps described in the method embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0064] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0065] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0066] It should be noted that the modifiers "one" and "multiple" mentioned in this application are illustrative and non-restrictive. Those skilled in the art will understand that, unless the context clearly indicates otherwise, they should be understood as "one or more." In the description of this application, unless otherwise specified, "multiple" means two or more than two, and other quantifiers are similar. "At least one item (item)", "one (item) or more (items)" or similar expressions refer to any combination of these items (items), including any combination of single items (items) or plural items (items). For example, at least one item (item) a can refer to any number of a; for another example, one (item) or more (items) of a, b, and c can refer to: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural. "And / or" is a relationship that describes the association of related objects, indicating that three relationships can exist. For example, A and / or B can refer to three situations: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural.
[0067] Although operations or steps are described in a specific order in the drawings in the embodiments of the present application, this should not be understood as requiring that these operations or steps be performed in the specific order shown or in a serial order, or that all of the operations or steps shown be performed to obtain the desired result. In the embodiments of the present application, these operations or steps may be performed in serial; these operations or steps may be performed in parallel; or some of these operations or steps may be performed.
[0068] At the same time, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions. The following describes this application in conjunction with specific embodiments.
[0069] Figure 1 This is a flow chart showing a data query method based on a large model platform according to an exemplary embodiment. Figure 1As shown, the embodiment of the present application provides a data query method based on a large model platform, which may include the following steps:
[0070] In step S10, a candidate set of files related to the query content is obtained according to the query content.
[0071] In this step, a candidate set of documents related to the query content is obtained based on the query content. For example, the user's original query content data can be captured through front-end web technology and back-end API interfaces, and preliminary standardization processing can be performed on it, including unified character encoding, case conversion, and format normalization to ensure that all input data is consistent and processable. The query text is then segmented and fragmented using the Python language and its natural language processing library, breaking down continuous text into separate words or subword units. Regular expressions (the re module) are used to perform noise filtering operations to remove irrelevant punctuation, redundant spaces, and common stop words to reduce the interference of meaningless information. Pycorrector spelling correction and lemmatization technology are used to standardize user input to improve the accuracy and consistency of the query content. Named entity recognition (NER) is then used to extract key entity information (such as names of people, places, and institutions), and a pre-trained language model (BERT) is used to convert the key entity information into semantic vectors. Finally, an ANN (Approximate Nearest Neighbor) search based on vector representation is used to preliminarily obtain a candidate set of documents related to the query content from an external database.
[0072] In step S20, the semantic affinity between the query terms in the related document candidate set is obtained.
[0073] In this step, the semantic affinity between the query terms in the candidate set of relevant documents is obtained. For example, a first frequency can be obtained, which is the frequency of occurrence of the first query term in the relevant candidate documents (hereinafter referred to as candidate documents). A second frequency can be obtained, which is the frequency of occurrence of the second query term in the candidate documents. The mean character spacing is then obtained, which is the average number of characters between the first and second query terms when they appear as a group in the candidate documents. Finally, the semantic affinity between the query terms is obtained based on the first frequency, the second frequency, and the mean character spacing.
[0074] In step S30, the intrinsic association between the query terms is obtained according to the semantic affinity.
[0075] In this step, the intrinsic association between the query terms is obtained based on the semantic affinity. For example, the first number of documents can be obtained, which is the number of candidate documents containing both the first and second query terms. The second number of documents can be obtained, which is the number of candidate documents containing either the first or second query terms. The mean semantic affinity can then be obtained, which is the mean of the semantic affinity of all candidate documents containing both the first and second query terms. Finally, the intrinsic association between the query terms can be obtained based on the first and second document numbers and the mean semantic affinity.
[0076] In step S40, the query terms are clustered for the first time according to the intrinsic relevance, and the query domain representativeness of the largest cluster of the first clustering is obtained.
[0077] In this step, the query terms are clustered for the first time based on their intrinsic relevance, and the query domain representativeness of the largest cluster of the first clustering is obtained. For example, the number of first query terms can be obtained first, which is the number of query terms in the largest cluster of the first clustering results. The number of second query terms can then be obtained, which is the number of all query terms in the query content. The mean intrinsic relevance is then obtained, which is the mean of the intrinsic relevance between any two terms in the largest cluster of the first clustering results. Finally, the query domain representativeness of the largest cluster of the first clustering results is obtained based on the number of first query terms, the number of second query terms, and the mean intrinsic relevance.
[0078] In step S50, the candidate document terms are added to the query terms for a second clustering, and the offset of the query domain representativeness of the largest cluster after the second clustering is obtained. The offset represents the offset of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster in the first clustering.
[0079] In this step, the candidate document terms are added to the query terms for a second clustering, and the offset of the query domain representativeness of the largest cluster after the second clustering is obtained. The offset represents the offset of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster after the first clustering. For example, the candidate document terms can be first added to the query terms for a re-clustering, and the query domain representativeness corresponding to the re-clustered largest cluster is obtained. Then, based on the query domain representativeness of the largest cluster from the first clustering and the query domain representativeness corresponding to the re-clustered largest cluster, the offset of the query domain representativeness of the largest cluster after the second clustering is obtained.
[0080] In step S60, the query intent matching degree of the candidate document is obtained according to the query domain representativeness of the largest cluster after the second clustering and the deviation degree of the query domain representativeness.
[0081] In this step, the query intent match of the candidate file is obtained based on the query domain representativeness and the offset of the query domain representativeness of the largest cluster after the second clustering. For example, a first product can be obtained first. The first product is the product of the query domain representativeness and the offset of the largest cluster after the second clustering. Then, the query intent match of the candidate file is obtained based on the first product.
[0082] In step S70, the query matching priority of the candidate file is obtained according to the query intention matching degree.
[0083] In this step, the query matching priority of the candidate file is obtained based on the query intent matching degree. For example, the query question suitability of the candidate file can be obtained first, and then the query matching priority of the candidate file can be obtained based on the query intent matching degree and the query question suitability.
[0084] In step S80, a candidate file ranking result of the related file candidate set is obtained according to the query matching priority.
[0085] In this step, candidate files are ranked according to the query matching priority. For example, the candidate files can be sorted in descending order based on their query matching priority to obtain a list of files that most accurately match the current query. The first file in the list is the most accurate candidate file, and subsequent candidate files have decreasing query matching scores. Optionally, the retained candidate files can be subjected to in-depth content extraction and summary generation in their order. By employing a pre-trained generative model (such as the GPT series), the full-text structure of each file is automatically analyzed to identify and extract the information fragments that best represent its core content, ensuring that the summary is both highly condensed and faithfully reflects the original text. Simultaneously, the system incorporates knowledge graphs and entity recognition technologies to supplement key information, providing a clear, structured, and easy-to-understand data foundation for subsequent query result integration. Furthermore, the system can format and integrate the generated summary and supplementary key information according to a pre-defined output format (such as JSON, HTML, or a specific report template) to ensure that the results are presented intuitively and clearly. The integrated data query results are fed back to users in real time through the API interface or front-end UI, and users are supported to evaluate and provide feedback on the results in order to continuously optimize the entire data query and result feedback process.
[0086] In summary, an embodiment of the present application provides a data query method based on a large model platform, the method comprising: obtaining a candidate set of relevant documents for the query content according to the query content; obtaining the semantic affinity between the query terms in the candidate set of relevant documents; obtaining the intrinsic association between the query terms according to the semantic affinity; performing a first clustering on the query terms according to the intrinsic association, and obtaining the query domain representativeness of the largest cluster of the first clustering; adding the candidate document terms to the query terms for a second clustering, and obtaining the offset of the query domain representativeness of the largest cluster after the second clustering, the offset representing the offset of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster of the first clustering; obtaining the query intent matching degree of the candidate documents according to the query domain representativeness of the largest cluster after the second clustering and the offset of the query domain representativeness; obtaining the query matching priority of the candidate documents according to the query intent matching degree; and obtaining the candidate document ranking result of the candidate set of relevant documents according to the query matching priority. The embodiment of the present application performs vocabulary analysis on the user's query content, confirms the field to which the query content belongs, and optimizes the sorting of the search results to ensure that the final query results can accurately reflect the user's real needs.
[0087] Figure 2 FIG. 1 is a flow chart showing a method for obtaining semantic affinity between query terms in a set of related document candidates according to an exemplary embodiment. Figure 2 As shown, the obtaining of the semantic affinity between the query terms in the candidate set of related documents may include the following steps:
[0088] In step S201, a first frequency is obtained, where the first frequency is the frequency of occurrence of a first query term in a candidate document.
[0089] In this step, the first frequency is obtained , the first frequency is the frequency of occurrence of the first query term i in the candidate document a.
[0090] In step S202, a second frequency is obtained, where the second frequency is the frequency of occurrence of the second query term in the candidate document.
[0091] In this step, the second frequency is obtained , the second frequency is the frequency of occurrence of the second query term j in the candidate document a.
[0092] In step S203, the average value of character intervals is obtained, where the average value of the number of characters between the first query term and the second query term when they appear in a group in the candidate document.
[0093] In this step, the mean of the character intervals is obtained , mean character spacing is the average number of characters between the first query term i and the second query term j when they appear in a group in the candidate document a.
[0094] In step S204, the semantic affinity between the query terms is obtained according to the first frequency, the second frequency and the character interval mean.
[0095] In this step, according to the first frequency , second frequency and the mean character spacing , obtain the semantic affinity between query terms For example, the semantic affinity between query words It can be obtained by the following formula:
[0096] Formula 1
[0097] in, is an exponential function with the natural number e as its base.
[0098] To understand the user's query intent, we need to analyze the inherent connections between query context terms and narrow down the query domain. The retrieved candidate document set covers all terms in the query content. Therefore, we can analyze the connections between query terms within the candidate document set. If query terms consistently appear together and in close proximity within documents, this indicates a strong connection between the terms. For example, if query terms i and j appear frequently in multiple documents, this indicates a close semantic relationship between the two terms.
[0099] Figure 3 FIG. 1 is a flow chart showing a method for obtaining the intrinsic relevance between query words based on semantic closeness according to an exemplary embodiment. Figure 3 As shown, obtaining the intrinsic correlation between the query terms according to the semantic affinity may include the following steps:
[0100] In step S301, a first file quantity is obtained, where the first file quantity is the number of candidate files containing both the first query term and the second query term.
[0101] In this step, get the first file number , the first file number is the number of candidate documents that contain both the first query term i and the second query term j.
[0102] In step S302, a second number of files is obtained, where the second number of files is the number of candidate files containing the first query term or the second query term.
[0103] In this step, get the second file number , the second file number is the number of candidate documents that contain the first query term j or the second query term j.
[0104] In step S303, an average semantic affinity is obtained, where the average semantic affinity is the average semantic affinity of all candidate documents containing both the first query term and the second query term.
[0105] In this step, the mean semantic closeness is obtained , the mean value of semantic closeness is the mean value of the semantic closeness of all candidate documents that contain both the first query term i and the second query term j.
[0106] In step S304, the intrinsic correlation between the query terms is obtained according to the first document quantity, the second document quantity and the mean value of the semantic affinity.
[0107] In this step, according to the first file number , Second file number and the mean semantic closeness , obtain the intrinsic correlation between query terms For example, the intrinsic correlation between query words It can be obtained by the following formula:
[0108] Formula 2
[0109] in, Not zero.
[0110] Determine the correlation between the two query words and summarize all candidate documents containing these two words. If the two words appear frequently at the same time and the semantic affinity in the documents where they appear at the same time is large, then the intrinsic correlation between the two words is strong.
[0111] Figure 4 This is a flowchart of a method for performing a first clustering of query words based on intrinsic relevance and obtaining the query domain representativeness of the largest cluster of the first clustering according to an exemplary embodiment. Figure 4 As shown, performing a first clustering of the query terms according to the intrinsic relevance and obtaining the query domain representativeness of the largest cluster of the first clustering may include the following steps:
[0112] In step S401 , the first query word quantity is obtained, where the first query word quantity is the query word quantity of the largest cluster in the first clustering result.
[0113] In this step, get the number of first query terms , the number of first query terms The number of query terms in the largest cluster in the first clustering result.
[0114] In step S402, the second query word quantity is obtained, where the second query word quantity is the quantity of all query words in the query content.
[0115] In this step, the number of second query terms is obtained , the number of second query terms The number of all query terms in the query content.
[0116] In step S403, the intrinsic correlation mean is obtained, where the intrinsic correlation mean is the mean of the intrinsic correlation between any two words in the largest cluster of the first clustering.
[0117] In this step, the mean of the intrinsic correlation is obtained , the mean of intrinsic correlation is the mean of the intrinsic correlation between any two words in the largest cluster of the first clustering.
[0118] In step S404, the query domain representativeness of the largest cluster of the first clustering is obtained according to the number of the first query words, the number of the second query words and the mean value of the intrinsic relevance.
[0119] In this step, based on the number of first query words , the number of second query terms and the mean of intrinsic correlation , get the query domain representativeness of the largest cluster of the first clustering For example, the query domain representativeness of the largest cluster in the first clustering It can be obtained by the following formula:
[0120] Formula 3
[0121] in, Not zero.
[0122] A user's single query focuses on one field, and the query content revolves around one field. In the query context, there will be a large number of related words belonging to this field. By grouping highly relevant words, the specific field of the user's query can be determined. Through cluster analysis, a large number of candidate files are processed to screen out the candidate files most relevant to the user's query intent, eliminate interference content, and ensure the accuracy and relevance of the query results. In the process of data query, all relevant candidate files obtained by the large model platform may involve multiple fields. In the process of a user's single data query, the query content revolves around a fixed single field, and the correlation between the words that are representative of the field in the query context is relatively high. Therefore, through cluster analysis, the query words with high relevance can be grouped to determine the query field.
[0123] Cluster the words in the query content and perform DBSCAN clustering based on the intrinsic correlation between the query words to obtain several clusters. The cluster with the largest number of words in the clustering results based on word correlation represents the data query domain. When users perform data queries on the large model platform, they will continue to ask in-depth questions based on the query intent, and domain-specific words will frequently appear in the query context. By clustering query words based on correlation, the complex pre-training process of classifying domains can be avoided. Domain representativeness can be determined based on the aggregation of query words in the largest cluster.
[0124] Figure 5 This is a flow chart showing a method for adding candidate document words to query words for a second clustering and obtaining the query domain representativeness offset of the largest cluster after the second clustering according to an exemplary embodiment. Figure 5 As shown, the adding of candidate document words to query words for a second clustering and obtaining the query domain representativeness offset of the largest cluster after the second clustering may include the following steps:
[0125] In step S501, candidate document terms are added to query terms for re-clustering, and the query domain representativeness corresponding to the largest cluster after re-clustering is obtained.
[0126] In this step, the vocabulary of candidate document a is added to the query vocabulary for re-clustering, and the query domain representativeness corresponding to the largest cluster after re-clustering is obtained. .
[0127] In step S502, the query domain representativeness of the largest cluster after the second clustering is obtained according to the query domain representativeness of the largest cluster after the first clustering and the query domain representativeness corresponding to the largest cluster after the re-clustering.
[0128] In this step, the query domain representativeness of the largest cluster in the first clustering is The representativeness of the query domain corresponding to the largest cluster after re-clustering , get the representative deviation of the query domain of the largest cluster after the second clustering For example, the deviation of the query domain representativeness of the largest cluster after the second clustering is It can be obtained by the following formula:
[0129] Formula 4
[0130] in, is an exponential function with natural number e as base, For normalization processing.
[0131] Query terms may have multiple meanings, and the candidate documents initially retrieved may belong to multiple fields. In order to improve the accuracy of the data query function of the large model platform, it is necessary to accurately screen the documents. The largest cluster obtained by clustering the query content terms represents the query field. The words in the candidate documents (the intrinsic correlation of the words in the candidate documents is obtained using the same method as the query terms) are extracted and added for the second clustering. There are only a few words in the fuzzy field. If the candidate documents do not match, some file words may be associated with the query words, while most file words are treated as a cluster alone. The domain representativeness of the original query word cluster is weakened. If the candidate documents match, the domain representativeness of the largest cluster will be greater. Therefore, the changes in the clusters after the second clustering can be used to confirm whether the query field has shifted.
[0132] There are two results when adding files of the same field and files of different fields to the second clustering: after adding files of the same field to the clustering, the original data domain clusters become larger and the vocabulary becomes closer, and the domain representativeness is greater; after adding files of different fields to the clustering, the clusters become dispersed and the domain representativeness becomes smaller. Indicates in The changes in the clusters representing the query terms in the clustering results after adding candidate documents to the query content and re-clustering. If the query term clusters are tighter and the proportion of related terms is larger, which is representative of the query field, then the larger the formula is and the more positive it is. On the contrary, if the documents and the query content terms are divided into two clusters and the query terms are more dispersed, which is less representative of the field, then the smaller the formula is and may be negative, which means the query field may be shifted.
[0133] Figure 6 This is a flow chart showing a method for obtaining the query intent matching degree of a candidate file based on the query domain representativeness and the offset degree of the query domain representativeness of the largest cluster after the second clustering according to an exemplary embodiment. Figure 6As shown, obtaining the query intent matching degree of the candidate file based on the query domain representativeness of the largest cluster after the second clustering and the offset degree of the query domain representativeness may include the following steps:
[0134] In step S601 , a first product is obtained, where the first product is the product of the query domain representativeness of the largest cluster after the second clustering and the offset.
[0135] In this step, the first product is obtained , the first product The query domain representativeness of the largest cluster after the second clustering and offset The product of .
[0136] In step S602, the query intention matching degree of the candidate file is obtained according to the first product.
[0137] In this step, according to the first product , get the query intent matching degree of candidate document a For example, the query intent matching degree of candidate document a is It can be obtained by the following formula:
[0138] Formula 5
[0139] in, is an exponential function with the natural number e as its base.
[0140] The second clustering process selects the candidate documents most relevant to the user's query intent. If the candidate documents' domain representativeness remains unchanged after being added to the query content cluster and remain more focused on the original query domain, this indicates that the candidate documents meet the user's query intent.
[0141] Figure 7 This is a flow chart showing a method for obtaining the query matching priority of candidate files according to the query intent matching degree according to an exemplary embodiment. Figure 7 As shown, obtaining the query matching priority of the candidate file according to the query intent matching degree may include the following steps:
[0142] In step S701, the query question suitability of the candidate document is obtained.
[0143] In this step, the query suitability of the candidate document is obtained. For example, a first TF-IDF value can be obtained, which is the average of the word frequency and inverse text frequency index of all query terms in the query question in the candidate document. A second TF-IDF value can then be obtained, which is the word frequency and inverse text frequency index of the adjacent query terms in the query question in the candidate document. The total number of adjacent query terms in the query question is then obtained. Finally, the query suitability of the candidate document can be obtained based on the first TF-IDF value, the second TF-IDF value, and the total number of adjacent query terms in the query question.
[0144] In step S702, the query matching priority of the candidate file is obtained according to the query intention matching degree and the query question adaptation degree.
[0145] In this step, the query matching priority of the candidate file is obtained based on the query intent matching degree and the query question suitability. For example, a second product can be first obtained, which is the product of the query intent matching degree and the query question suitability. Then, the query matching priority of the candidate file is obtained based on the query intent matching degree and the second product.
[0146] Figure 8 FIG. 1 is a flow chart showing a method for obtaining the query question suitability of a candidate file according to an exemplary embodiment. Figure 8 As shown, obtaining the query question suitability of the candidate file may include the following steps:
[0147] In step S7011, a first TF-IDF value is obtained, where the first TF-IDF value is the average of the term frequency and the inverse text frequency index of all query terms in the query question in the candidate document.
[0148] In this step, get the first TF-IDF value , the first TF-IDF value is the mean of the term frequency and inverse text frequency index of all query terms in the query question in the candidate document a.
[0149] In step S7012, a second TF-IDF value is obtained, where the second TF-IDF value is the word frequency and inverse text frequency index of the adjacent query terms of the query question in the candidate document.
[0150] In this step, get the second TF-IDF value , the second TF-IDF value is the word frequency and inverse text frequency index of the query term q in the candidate document a.
[0151] In step S7013, the total number of adjacent query words of the query question is obtained.
[0152] In this step, the total number Q of neighboring query terms of the query question is obtained.
[0153] In step S7014, the query question suitability of the candidate document is obtained based on the first TF-IDF value, the second TF-IDF value, and the total number of adjacent query terms of the query question.
[0154] In this step, according to the first TF-IDF value , the second TF-IDF value And the total number of adjacent query words Q of the query question, obtain the query question fitness of candidate document a For example, the query question suitability of candidate document a is It can be obtained by the following formula:
[0155] Formula 6
[0156] Among them, Q is not zero.
[0157] After determining the user's data search domain based on the query content, the Big Model platform prioritizes the user's query before generating query results. The model then prioritizes the candidate documents by analyzing the documents that best match the query content, prioritizing the most relevant content for the user. After pinpointing the documents within the data search domain, the Big Model platform prioritizes documents closely related to the key terms in the query.
[0158] During data query, users will ask more and more detailed questions. Even in the same field, the words that appear may have different representative meanings. For example, when asking about interest rates, if the user's expression is vague, the large model platform will not be able to determine whether the user is asking about loan interest rates or deposit interest rates. Only based on the adjacent query content (such as the loan amount) can the user's true query intention be inferred. It is necessary to determine the subdivision field of the user's current query question based on the adjacent query content of the current query question and obtain the query question suitability of each candidate file.
[0159] Figure 9 This is a flow chart showing a method for obtaining the query matching priority of candidate files based on the query intent matching degree and the query question adaptation degree according to an exemplary embodiment. Figure 9 As shown, obtaining the query matching priority of the candidate file according to the query intent matching degree and the query question suitability may include the following steps:
[0160] In step S7021, a second product is obtained, where the second product is the product of the query intention matching degree and the query question adaptation degree.
[0161] In this step, the second product is obtained , the second product Query intent matching Compatibility with the query The product of .
[0162] In step S7022, the query matching priority of the candidate file is obtained according to the query intention matching degree and the second product.
[0163] In this step, the query intent is matched and the second product , get the query matching priority of candidate file a For example, the query matching priority of candidate file a is It can be obtained by the following formula:
[0164] Formula 7
[0165] in, For normalization processing.
[0166] During the data query process, accuracy and user satisfaction are core metrics for evaluating the data query capabilities of large-scale model platforms. Retrieving relevant documents requires not only matching the query content and understanding the user's query intent, but also accurately answering the query question. Therefore, we precisely locate the query domain based on the query content, further subdivide the domain, and combine the candidate files' compatibility with the current query question to determine the query matching priority for each candidate file. Subsequently, we sort the candidate files in descending order based on their query matching priority to obtain a list of candidate files that most accurately match the current query question.
[0167] In summary, an embodiment of the present application provides a data query method based on a large model platform, the method comprising: obtaining a candidate set of relevant documents for the query content according to the query content; obtaining the semantic affinity between the query terms in the candidate set of relevant documents; obtaining the intrinsic association between the query terms according to the semantic affinity; performing a first clustering on the query terms according to the intrinsic association, and obtaining the query domain representativeness of the largest cluster of the first clustering; adding the candidate document terms to the query terms for a second clustering, and obtaining the offset of the query domain representativeness of the largest cluster after the second clustering, the offset representing the offset of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster of the first clustering; obtaining the query intent matching degree of the candidate documents according to the query domain representativeness of the largest cluster after the second clustering and the offset of the query domain representativeness; obtaining the query matching priority of the candidate documents according to the query intent matching degree; and obtaining the candidate document ranking result of the candidate set of relevant documents according to the query matching priority. The embodiment of the present application performs vocabulary analysis on the user's query content, confirms the field to which the query content belongs, and optimizes the sorting of the search results to ensure that the final query results can accurately reflect the user's real needs.
[0168] The present application also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of the data query method based on the large model platform provided in the present application are implemented.
[0169] Figure 10 FIG. 1 is a block diagram of a data query system based on a large model platform according to an exemplary embodiment. Figure 10 As shown, an embodiment of the present application provides a data query system 1000 based on a large model platform, including a large model platform 1100.
[0170] Figure 11 1 is a block diagram of a large model platform according to an exemplary embodiment. For example, the large model platform 1100 can be provided as a server. Figure 11 The large model platform 1100 includes a processing component 1122, which further includes one or more processors and a memory resource represented by a memory 1132 for storing instructions executable by the processing component 1122, such as an application. The application stored in the memory 1132 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1122 is configured to execute the instructions to perform the above-mentioned data query method based on the large model platform.
[0171] The large model platform 1100 may also include a power supply component 1126 configured to perform power management of the large model platform 1100, a communication component 1150 configured to connect the large model platform 1100 to a network, and an input / output interface 1158. The large model platform 1100 may operate based on an operating system stored in the memory 1132.
[0172] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable electronic device, and the computer program has a code portion for executing the above-mentioned data query method based on the large model platform when executed by the programmable electronic device.
[0173] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the scope of the present application, and such modifications and improvements are all within the scope of protection of the present application.
Claims
1. A data query method based on a large model platform, characterized in that: The method comprises: According to the query content, obtaining a candidate set of files related to the query content; Obtaining semantic affinity between query terms in the relevant document candidate set; Obtaining intrinsic relevance between the query terms based on the semantic closeness; Performing a first clustering of the query terms according to the intrinsic relevance, and obtaining the query domain representativeness of the largest cluster of the first clustering; Adding the candidate document words to the query words for a second clustering, obtaining a deviation of the query domain representativeness of the largest cluster after the second clustering, wherein the deviation represents the deviation of the query domain representativeness of the largest cluster after the second clustering relative to the query domain representativeness of the largest cluster after the first clustering; Obtaining a query intent matching degree of the candidate file according to the query domain representativeness of the largest cluster after the second clustering and the offset degree of the query domain representativeness; Obtaining a query matching priority of the candidate file according to the query intent matching degree; According to the query matching priority, a candidate file ranking result of the related file candidate set is obtained.
2. The data query method based on the large model platform according to claim 1 is characterized in that: The obtaining of semantic affinity between query terms in the candidate set of related documents includes: Obtaining a first frequency, where the first frequency is an occurrence frequency of the first query term in the candidate document; Obtaining a second frequency, where the second frequency is an occurrence frequency of a second query term in the candidate document; Obtaining a character spacing mean, where the character spacing mean is the mean number of characters between the first query term and the second query term when they appear in a group in the candidate file; The semantic affinity between the query terms is obtained according to the first frequency, the second frequency and the character interval average.
3. The data query method based on the large model platform according to claim 1 is characterized in that: The obtaining of the intrinsic relevance between the query terms according to the semantic closeness includes: Obtaining a first file quantity, where the first file quantity is the number of candidate files containing both the first query term and the second query term; Obtaining a second number of files, where the second number of files is the number of candidate files containing the first query term or the second query term; Obtaining a semantic affinity mean, where the semantic affinity mean is the mean of semantic affinities of all candidate documents containing both the first query term and the second query term; The intrinsic correlation between the query terms is obtained according to the first document quantity, the second document quantity and the semantic affinity average.
4. The data query method based on the large model platform according to claim 1 is characterized in that: The first clustering of the query terms according to the intrinsic relevance to obtain the query domain representativeness of the largest cluster of the first clustering includes: Obtaining a first query word quantity, where the first query word quantity is the query word quantity of the largest cluster in the first clustering result; Obtaining the number of second query terms, where the second query term number is the number of all query terms in the query content; Obtaining an intrinsic correlation mean, where the intrinsic correlation mean is the mean of the intrinsic correlations between any two words in the largest cluster of the first clustering; The query domain representativeness of the largest cluster in the first clustering is obtained according to the number of the first query words, the number of the second query words, and the mean of the intrinsic relevance.
5. The data query method based on the large model platform according to claim 1 is characterized in that: The step of adding the candidate document words to the query words for a second clustering and obtaining the query domain representativeness offset of the largest cluster after the second clustering includes: The candidate document words are added to the query words for re-clustering, and the query domain representativeness corresponding to the largest cluster after re-clustering is obtained; According to the query domain representativeness of the largest cluster of the first clustering and the query domain representativeness corresponding to the largest cluster after the re-clustering, the deviation degree of the query domain representativeness of the largest cluster after the second clustering is obtained.
6. The data query method based on the large model platform according to claim 1 is characterized in that: The step of obtaining the query intent matching degree of the candidate file according to the query domain representativeness of the largest cluster after the second clustering and the deviation degree of the query domain representativeness includes: Obtaining a first product, where the first product is the product of the query domain representativeness of the largest cluster after the second clustering and the offset; The query intention matching degree of the candidate file is obtained according to the first product.
7. The data query method based on the large model platform according to claim 1 is characterized in that: The acquiring the query matching priority of the candidate file according to the query intent matching degree includes: Obtaining query question suitability of the candidate file; The query matching priority of the candidate file is obtained according to the query intention matching degree and the query question adaptability.
8. The data query method based on the large model platform according to claim 7 is characterized in that: The obtaining of the query question suitability of the candidate file includes: Obtaining a first TF-IDF value, where the first TF-IDF value is an average of the term frequency and the inverse text frequency index of all query terms in the query question in the candidate document; Obtain a second TF-IDF value, where the second TF-IDF value is a word frequency and an inverse text frequency index of adjacent query words of the query question in the candidate document; Obtaining the total number of adjacent query words of the query question; The query question suitability of the candidate document is obtained according to the first TF-IDF value, the second TF-IDF value, and the total number of adjacent query words of the query question.
9. The data query method based on the large model platform according to claim 7 is characterized in that: The obtaining the query matching priority of the candidate file according to the query intent matching degree and the query question suitability includes: Obtaining a second product, where the second product is the product of the query intent matching degree and the query question adaptation degree; Obtain the query matching priority of the candidate file according to the query intention matching degree and the second product.
10. A data query system based on a large model platform, characterized in that: The system includes a large model platform, and the large model platform includes: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Literature clustering method and device, electronic equipment and storage medium
CN112667810A
Response large model retrieval enhancement method and device based on hierarchical cluster index structure
CN119760057A