Data generation method and device, electronic equipment, storage medium and program product
By constructing a cross-document knowledge concept graph, integrating the knowledge concept nodes and edge weights of multiple documents, and generating knowledge combinations and semantic content, the limitations of the single-document generation method are overcome, and the efficient adaptability and accuracy of large models in multiple fields and scenarios are achieved.
Patent Information
- Application Number
- CN202510846917.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-09-26
AI Technical Summary
Existing data generation methods based on single documents cannot effectively integrate cross-document knowledge, resulting in the lack of breadth and depth of the generated questions, making it difficult to handle complex and multi-dimensional problems.
By constructing a cross-document knowledge concept graph, using the knowledge concept nodes and edge weights in multiple documents, knowledge combinations are generated, and relevant semantic content is determined from the documents and input into the large model to generate fine-tuning data.
It achieves effective fusion of cross-document knowledge, improves the processing capabilities of large models, enhances the pertinence and accuracy of fine-tuning data, breaks through the limitations of closed processing of single documents, and improves the adaptability and accuracy of the model in multiple fields and scenarios.
Smart Images

Figure CN120706374A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a data generation method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] Currently, fine-tuning large document-based models primarily relies on generating questions from a single document. This approach has significant limitations in terms of question coverage. The generated questions typically only reflect existing or potential information within the document and lack the ability to integrate knowledge across documents. In real life, complex questions often involve multiple knowledge points and background paragraphs, making them difficult to fully address using a single document.
[0003] This limitation means that the generated questions lack sufficient breadth and depth, failing to fully reflect multidimensional information and context. Existing generative methods struggle to provide accurate answers, especially when faced with information from multiple fields and sources. This not only limits the application scenarios of large models but also affects their accuracy when handling complex problems.
[0004] Therefore, how to effectively integrate cross-document knowledge becomes a key issue in improving the processing capabilities of large models.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0006] The present disclosure provides a data generation method, device, electronic device, storage medium and program product, which can effectively integrate knowledge across documents to a certain extent and generate fine-tuning data to improve the processing capabilities of large models.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0008] According to one aspect of the present disclosure, a data generation method is provided, comprising: acquiring a plurality of documents; constructing a cross-document knowledge concept graph based on the plurality of documents, the cross-document knowledge concept graph comprising a plurality of knowledge concept nodes and a plurality of edge weights, the edge weights being the weights between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; obtaining a knowledge combination based on the plurality of knowledge concept nodes and the plurality of edge weights; determining semantic content related to the knowledge combination from the plurality of documents; and inputting the knowledge combination and the semantic content into a large model to generate fine-tuning data.
[0009] In one embodiment of the present disclosure, the knowledge combination is obtained based on the multiple knowledge concept nodes and the multiple edge weights, including: taking the knowledge concept node corresponding to the same knowledge concept appearing in N documents as the first knowledge concept node, N is a preset value; obtaining a second knowledge concept node, the knowledge concept corresponding to the second knowledge concept node and the knowledge concept corresponding to the first knowledge concept node are located in the same document; determining the edge weight between the second knowledge concept node and the first knowledge concept node from the multiple edge weights; combining the second knowledge concept node with the first knowledge concept node when the edge weight between the second knowledge concept node and the first knowledge concept node meets a preset condition, the preset condition being that the edge weight between the second knowledge concept node and the first knowledge concept node is greater than an expansion threshold; taking the second knowledge concept node as a new first knowledge concept node, executing the step of obtaining the second knowledge concept node until the edge weight between the second knowledge concept node and the first knowledge concept node fails to meet the preset condition; obtaining the knowledge combination based on the combined second knowledge concept node and at least one of the first knowledge concept nodes.
[0010] In one embodiment of the present disclosure, the knowledge combination is obtained based on the combined second knowledge concept nodes and at least one first knowledge concept node, including: merging the first first knowledge concept node of at least one first knowledge concept node in each of N documents to obtain the knowledge combination to be processed; deduplicating and / or pruning the knowledge combination to be processed to obtain the knowledge combination.
[0011] In one embodiment of the present disclosure, constructing a cross-document knowledge concept graph based on the multiple documents includes: extracting knowledge concepts from the multiple documents and taking each of the knowledge concepts as a knowledge concept node; calculating the edge weights between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; and constructing the cross-document knowledge concept graph based on the edge weights and the knowledge concept nodes.
[0012] In one embodiment of the present disclosure, the calculation of the edge weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document includes: calculating the semantic similarity between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; calculating the association strength between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; and obtaining the edge weight based on the semantic similarity and the association strength.
[0013] In one embodiment of the present disclosure, determining the semantic content related to the knowledge combination from the multiple documents includes: encoding the knowledge combination to obtain a knowledge combination vector; decomposing the multiple documents to obtain multiple paragraphs; encoding the multiple paragraphs to obtain multiple paragraph vectors; calculating the similarity between the knowledge combination vector and each of the multiple paragraph vectors to obtain multiple vector similarities; and selecting a preset number of paragraphs with the highest vector similarities among the multiple paragraphs as the semantic content related to the knowledge combination.
[0014] In one embodiment of the present disclosure, before acquiring the plurality of documents, the method further includes: acquiring original documents in the target field; screening the original documents; and converting the screened original documents into a format to obtain documents in a text format.
[0015] According to another aspect of the present disclosure, a data generation device is provided, including: an acquisition module for acquiring multiple documents; a construction module for constructing a cross-document knowledge concept graph based on the multiple documents, the cross-document knowledge concept graph including multiple knowledge concept nodes and multiple edge weights, the edge weights being the weights between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; a determination module for obtaining a knowledge combination based on the multiple knowledge concept nodes and the multiple edge weights; the determination module is further used to determine semantic content related to the knowledge combination from the multiple documents; a generation module for inputting the knowledge combination and the semantic content into a large model to generate fine-tuning data.
[0016] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the above-mentioned data generation methods by executing the executable instructions.
[0017] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned data generation methods is implemented.
[0018] According to another aspect of the present disclosure, a computer program product is provided, which includes a computer program or computer instructions, and the computer program or the computer instructions are loaded and executed by a processor to enable a computer to implement any of the above-mentioned data generation methods.
[0019] In an embodiment of the present disclosure, multiple documents are first obtained, and then a cross-document knowledge concept graph is constructed based on the multiple documents. The cross-document knowledge concept graph includes multiple knowledge concept nodes and multiple edge weights. The edge weight is the weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document. Based on the multiple knowledge concept nodes and multiple edge weights, a knowledge combination is obtained. Then, semantic content related to the knowledge combination is determined from the multiple documents; the knowledge combination and semantic content are input into a large model to generate questions and answers corresponding to the questions. The present disclosure constructs a cross-document knowledge concept graph using multiple documents, and combines knowledge using multiple knowledge concept nodes and multiple edge weights in the cross-document knowledge concept graph to obtain a knowledge combination, thereby achieving cross-document knowledge fusion. Semantic content related to the knowledge combination is determined from the multiple documents, and the knowledge combination and semantic content are input into a large model to generate fine-tuning data (such as questions and answers corresponding to the questions). The semantic content can provide contextual support for the generation of fine-tuning data, thereby enhancing the pertinence and accuracy of the fine-tuning data. The present disclosure breaks through the limitations of single-document closed processing in traditional question-and-answer data construction, significantly improving the structural complexity of the data, the breadth of knowledge coverage, and the effectiveness of reasoning training. This disclosure provides solid data support for building large models with stronger generalization and reasoning capabilities, which helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0022] Figure 1 A schematic diagram showing a data generation system architecture in an embodiment of the present disclosure;
[0023] Figure 2 A flow chart of a data generation method according to an embodiment of the present disclosure is shown;
[0024] Figure 3 A cross-document knowledge concept graph is shown in an embodiment of the present disclosure;
[0025] Figure 4 A flow chart of a data generation method according to another embodiment of the present disclosure is shown;
[0026] Figure 5A schematic diagram showing a knowledge combination to be processed in an embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram showing a knowledge combination in an embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram of a data generating device according to an embodiment of the present disclosure is shown;
[0029] Figure 8 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0030] Figure 9 A schematic diagram of a computer-readable storage medium provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0032] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0033] It should be understood that the various steps described in the method embodiments of the present disclosure may 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 disclosure is not limited in this respect.
[0034] It should be noted that the concepts of "first" and "second" mentioned in this disclosure 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.
[0035] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0036] It should be pointed out that, in the absence of conflict, the embodiments of the present disclosure and the technical features therein may be combined with each other.
[0037] For ease of understanding, several terms involved in this disclosure are explained below:
[0038] Fine-tuning data: Large model fine-tuning data is a dataset with a clear input and output (such as questions, answers; instructions, replies) structure, which is prepared for capability improvement or task-oriented training of large models.
[0039] Named Entity Recognition (NER) is a natural language processing (NLP) technology used to identify entities with specific meanings in text.
[0040] Topic Modeling is a powerful text analysis tool that can extract potential topic structures (such as knowledge concepts) from a large number of documents, providing valuable support for tasks such as data analysis, information retrieval, and semantic understanding.
[0041] Relation Extraction is the process of identifying the relationships between entities in a text. By identifying entities in a document and the relationships between them, more complex knowledge concepts can be extracted.
[0042] In deep learning, large models can refer to models with very large parameters and training data. These models are capable of handling complex tasks, understanding and generating content such as natural language, images, and videos. Characteristics of large models include a large number of parameters, high computational requirements, and excellent performance across a wide range of tasks. For example, large models can include large language models.
[0043] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0044] Figure 1 A schematic diagram of a data generation system architecture in an embodiment of the present disclosure is shown, and the system can apply the data generation method or data generation device in various embodiments of the present disclosure.
[0045] like Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .
[0046] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103 , and can be a wired network or a wireless network.
[0047] Optionally, the wireless network or wired network described above uses standard communication technologies and / or protocols. The network is typically the Internet, but may also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPSec) may be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies may be used to replace or supplement the above-mentioned data communication technologies.
[0048] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, etc.
[0049] Optionally, the client of the application installed in different terminal devices 101 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile phone client, a PC client, etc.
[0050] The server 103 may be a server that provides various services, such as a background management server that provides support for the devices operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.
[0051] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0052] Those skilled in the art will know that Figure 1 The number of terminal devices, networks, and servers in the example is merely illustrative. Any number of terminal devices, networks, and servers may be used as needed. This disclosure does not limit this. This example implementation is described in detail below with reference to the accompanying drawings and examples.
[0053] Under the above system architecture, an embodiment of the present disclosure provides a data generation method, which can be executed by any electronic device with computing and processing capabilities.
[0054] In some embodiments, the data generation methods provided in the embodiments of the present disclosure can be executed by a terminal device in the above-described system architecture; in other embodiments, the data generation methods provided in the embodiments of the present disclosure can be executed by a server in the above-described system architecture; in still other embodiments, the data generation methods provided in the embodiments of the present disclosure can be implemented by the terminal device and server in the above-described system architecture through interaction. This disclosure is used to synthesize industry fine-tuning data and can be applied to the training of large industry models.
[0055] Figure 2 A flow chart of a data generation method according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the data generation method provided in the embodiment of the present disclosure includes the following S201 to S205.
[0056] S201, obtaining multiple documents.
[0057] In the embodiment of the present disclosure, the multiple documents may be documents containing different contents.
[0058] S202, constructing a cross-document knowledge concept graph based on multiple documents, the cross-document knowledge concept graph includes multiple knowledge concept nodes and multiple edge weights, and the edge weight is the weight between knowledge concept nodes corresponding to two different knowledge concepts in the same document.
[0059] The embodiments of this disclosure do not specifically limit the specific representation of a cross-document knowledge concept graph. For example, a cross-document knowledge concept graph may include multiple knowledge concept nodes, where two knowledge concept nodes corresponding to different knowledge concepts in the same document are connected by an edge, and the edge weight can be represented by the length of the edge. Edge weights can also be annotated on the edge, which is not limited in this disclosure.
[0060] S203: Obtain a knowledge combination according to the multiple knowledge concept nodes and the multiple edge weights.
[0061] In the embodiment of the present disclosure, the knowledge combination includes a plurality of connected knowledge concept nodes, and the connected knowledge concept nodes can be distributed in different documents. In other words, the knowledge concepts corresponding to the connected knowledge concept nodes are recorded in different documents.
[0062] S204: Determine semantic content related to the knowledge combination from multiple documents.
[0063] In the embodiments of the present disclosure, semantic content refers to content that provides semantic information, such as concept definitions, usage scenarios, and contextual examples. For example, semantic content may refer to semantic paragraphs in the original document related to the knowledge combination. Semantic content can provide contextual support for question and answer generation, thereby enhancing the relevance and accuracy of questions and answers.
[0064] S205: Input the knowledge combination and semantic content into the large model to generate fine-tuning data. For example, the fine-tuning data may be questions and answers corresponding to the questions.
[0065] In this disclosed embodiment, knowledge combinations and semantic content (semantically related paragraphs corresponding to the original document) are input into a large model, which is then asked to generate questions and corresponding answers centered around the entities in the knowledge combinations. This generates question-and-answer data that is both accurate and covers a wide range of knowledge.
[0066] In the disclosed embodiment, the large model used to generate questions and answers corresponding to the questions is a trained large model, and the generated questions and answers are used to train other large models (hereinafter referred to as the large model to be trained), which provides solid data support for building a large model with stronger generalization and reasoning capabilities, and helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0067] It should be noted that inputting knowledge combinations and semantic content into the large model can also generate instructions and responses. The present disclosure does not specifically limit what type of fine-tuning data is generated.
[0068] The embodiment of the present disclosure constructs a cross-document knowledge concept graph by utilizing multiple documents, and combines knowledge through multiple knowledge concept nodes and multiple edge weights in the cross-document knowledge concept graph to obtain a knowledge combination, thereby realizing cross-document knowledge fusion. Semantic content related to the knowledge combination is determined from multiple documents, and the knowledge combination and semantic content are input into the large model to generate fine-tuning data (questions and answers corresponding to the questions). The semantic content can provide contextual support for the generation of fine-tuning data, thereby enhancing the pertinence and accuracy of the fine-tuning data. The present disclosure breaks through the limitations of closed processing of single documents in traditional question-and-answer data construction, and significantly improves the structural complexity of the data, the breadth of knowledge coverage, and the effectiveness of reasoning training. The present disclosure provides solid data support for building a large model with stronger generalization and reasoning capabilities, which helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0069] The present disclosure is described below through several exemplary embodiments.
[0070] In an exemplary embodiment, it is characterized in that the data generation method provided by the present disclosure, which constructs a cross-document knowledge concept graph based on multiple documents, may include the following steps A1 to A3.
[0071] Step A1: extract knowledge concepts from multiple documents and take each knowledge concept as a knowledge concept node.
[0072] In the embodiments of the present disclosure, the method for extracting knowledge concepts from documents is not specifically limited. For example, the knowledge concepts in each document can be extracted using named entity recognition (NER) technology. Another example is the extraction of knowledge concepts in each document using topic modeling or relationship extraction technology.
[0073] In order to improve the accuracy of generating questions and answers, the documents may be pre-processed before extracting knowledge concepts. Exemplarily, before obtaining multiple documents, the data generation method may further include the following steps B1 to B3.
[0074] Step B1: Obtain original documents in the target domain.
[0075] In the embodiment of the present disclosure, the target domain is the technical field to which the questions and answers generated by the present disclosure belong. The fine-tuning data generated using documents in the target domain is more targeted and is conducive to improving the accuracy of the large model to be trained.
[0076] Step B2: Screening the original document.
[0077] The disclosed embodiments do not specifically limit how to screen the original documents. For example, the original documents may be screened using preset rules and / or preset statistical indicators, including removing original documents with too few words or low quality to ensure data quality.
[0078] It should be noted that statistical indicators refer to criteria used to evaluate and screen documents using quantitative data. These indicators can help the system automatically select documents that meet specific criteria. For example, by setting a document length range, documents of appropriate length can be screened to prevent results from being affected by documents that are too short or too long. For example, it may be necessary to filter out long documents with a word count exceeding a certain threshold. Another example is to use the rare word ratio to screen out documents that may contain more domain-specific information.
[0079] Step B3: convert the format of the filtered original document to obtain a document in text format.
[0080] In the disclosed embodiment, the format of the filtered original documents is standardized. For example, multiple formats such as PDF and HTML are uniformly converted to plain text. In another example, multiple formats such as PDF and HTML are uniformly converted to plain text, while removing noise characters, footnotes, special symbols, and other interfering content from the documents.
[0081] It should be noted that the present disclosure can also divide long documents into smaller text units by paragraphs and record metadata information such as source and location to support association analysis in subsequent steps. Dividing long documents into smaller text units by paragraphs and recording metadata information such as source and location can help improve the level of refinement in document processing. In this way, information retrieval, semantic analysis and data mining can be carried out more conveniently while ensuring the structured management of documents. The recording of metadata also provides an accurate context for subsequent association analysis, facilitates the tracing and integration of data from multiple sources, and improves the accuracy and reliability of the analysis results.
[0082] The disclosed embodiment screens and converts the format of original documents in the target field to facilitate the extraction of accurate knowledge concepts from multiple documents, thereby improving the accuracy of the large model.
[0083] Step A2: Calculate the edge weight between knowledge concept nodes corresponding to two different knowledge concepts in the same document.
[0084] In the embodiment of the present disclosure, the edge weight is used to characterize the association between the knowledge concept nodes corresponding to two different knowledge concepts in the same document. The embodiment of the present disclosure does not specifically limit what kind of parameters the edge weight is. For example, the edge weight can be the semantic similarity between the knowledge concept nodes corresponding to two different knowledge concepts in the same document. For another example, the edge weight can be the association strength between the knowledge concept nodes corresponding to two different knowledge concepts in the same document. For another example, the edge weight is calculated based on the semantic similarity and the association strength.
[0085] Exemplarily, calculating the edge weight between knowledge concept nodes corresponding to two different knowledge concepts in the same document may include the following steps C1 and C3.
[0086] Step C1, calculating the semantic similarity between knowledge concept nodes corresponding to two different knowledge concepts in the same document.
[0087] Exemplarily, the semantic similarity (Embedding similarity) may be cosine similarity.
[0088] The knowledge concept nodes corresponding to two different knowledge concepts are respectively called the first node and the second node. The semantic similarity is calculated by the following formula 1.
[0089]
[0090] Among them, Sim(e i ,e j ) is the semantic similarity between the knowledge concept nodes corresponding to two different knowledge concepts in the same document, Emb(e i ) is the embedding vector of the first node, Emb(e j ) is the embedding vector of the second node, e i is the first node, e j The second node.
[0091] Step C2: Calculate the association strength between knowledge concept nodes corresponding to two different knowledge concepts in the same document.
[0092] In the embodiment of the present disclosure, the association strength may be normalized to a range of 0-1 for the collinear frequencies of the knowledge concept nodes corresponding to two different knowledge concepts in all documents.
[0093] Exemplarily, the knowledge concept nodes corresponding to two different knowledge concepts are respectively referred to as the first node and the second node. The above-mentioned association strength (also known as the inter-entity relationship strength) is calculated by the following formula 2.
[0094]
[0095] Among them, Freqnorm (e i , e j ) is the association strength between the knowledge concept nodes corresponding to two different knowledge concepts in the same document, e i is the first node, e j is the second node, Freq norm (e i , e j ) is the collinear frequency of knowledge concept nodes corresponding to two different knowledge concepts in all documents, Freq min is the minimum value of collinear frequency, Freq max is the maximum value of the collinear frequency.
[0096] In step C3, edge weights are obtained based on semantic similarity and association strength.
[0097] In the embodiment of the present disclosure, the edge weight can be calculated using the following formula 3.
[0098] w ij =α·Sim(e i ,e j )+(1-α)Freq norm (e i , e j ) (3)
[0099] Among them, w ij is the edge weight, Sim(e i ,e j ) is the semantic similarity between the knowledge concept nodes corresponding to two different knowledge concepts in the same document, Freq norm (e i , e j ) is the association strength between the knowledge concept nodes corresponding to two different knowledge concepts in the same document, α is the weight coefficient, and the weight coefficient indicates the contribution of the two indicators of semantic similarity and association strength to the final edge weight.
[0100] The disclosed embodiments calculate edge weights by combining semantic similarity and association strength, effectively measuring their semantic and contextual relevance. This calculation helps us accurately assess the strength of relationships between knowledge concept nodes and provides valuable support for the subsequent generation of cross-document questions and answers.
[0101] Step A3: Construct a cross-document knowledge concept graph based on edge weights and knowledge concept nodes.
[0102] In the embodiment of the present disclosure, the embodiment of the present disclosure does not specifically limit the form of expression of the cross-document knowledge concept graph. Figure 3 As shown in the figure, the elliptical box represents the knowledge concept node, and the numerical value represents the edge weight. Figure 3 In the document, each knowledge concept node represents a clear and definite knowledge concept; when two concepts appear together in the same document, a solid edge is established between the corresponding nodes.
[0103] It should be noted that a dotted edge can be established between the same knowledge concept nodes in different documents. Alternatively, no dotted edge may be established between the same knowledge concept nodes in different documents.
[0104] It should be noted that the present disclosure can unify and merge repeated knowledge concept nodes that appear across documents. For example, knowledge concept nodes with the same meaning but different text representations can be unified into knowledge concept nodes with the same text representations. For example, speech recognition and voice recognition can be unified into speech recognition.
[0105] In the disclosed embodiment, a cross-document knowledge concept graph is constructed through edge weights and knowledge concept nodes, providing valuable support for the subsequent generation of cross-document questions and answers, thereby enabling the generation of fine-tuning data from a global perspective, and providing solid data support for building a large model with stronger generalization and reasoning capabilities, which helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0106] In another exemplary embodiment, Figure 4 As shown, the data generation method provided by the present disclosure may include obtaining a knowledge combination according to multiple knowledge concept nodes and multiple edge weights, which may include the following S401 to S406.
[0107] S401: taking a knowledge concept node corresponding to the same knowledge concept appearing in N documents as a first knowledge concept node, where N is a preset value.
[0108] In the embodiment of the present disclosure, the value of N can be set according to the actual application scenario and specific application experience, and the embodiment of the present disclosure does not specifically limit this. For example, the value of N can be any value between 2 and 2000.
[0109] S402 , obtaining a second knowledge concept node, where the knowledge concept corresponding to the second knowledge concept node and the knowledge concept corresponding to the first knowledge concept node are located in the same document.
[0110] S403: Determine the edge weight between the second knowledge concept node and the first knowledge concept node from the multiple edge weights.
[0111] S404, when the edge weight between the second knowledge concept node and the first knowledge concept node meets the preset condition, the second knowledge concept node is combined with the first knowledge concept node, and the preset condition is that the edge weight between the second knowledge concept node and the first knowledge concept node is greater than the expansion threshold.
[0112] In the embodiments of the present disclosure, the combination of the second knowledge concept node and the first knowledge concept node is not specifically limited. For example, to establish a connection between the second knowledge concept node and the first knowledge concept node, the second knowledge concept node and the first knowledge concept node can be connected via an edge.
[0113] S405 , taking the second knowledge concept node as a new first knowledge concept node, and executing the step of obtaining the second knowledge concept node until the edge weight between the second knowledge concept node and the first knowledge concept node fails to meet a preset condition.
[0114] In the embodiment of the present disclosure, after the second knowledge concept node is used as the new first knowledge concept node, S402 is executed until the edge weight between the second knowledge concept node and the first knowledge concept node fails to meet the preset condition. If the preset condition is met, S402 to S405 are executed in a loop. That is, if the preset condition is met, the knowledge concept nodes that meet the requirements are added one by one to the combined knowledge concept node.
[0115] In one embodiment, when the edge weight between the second knowledge concept node and the first knowledge concept node is less than or equal to the expansion threshold, the edge weight between the second knowledge concept node and the first knowledge concept node cannot meet the preset condition.
[0116] S406: Obtain a knowledge combination based on the combined second knowledge concept node and at least one first knowledge concept node.
[0117] In the disclosed embodiment, there is no specific limitation on how to obtain a knowledge combination based on the combined second knowledge concept node and at least one first knowledge concept node. Exemplarily, obtaining a knowledge combination based on the combined second knowledge concept node and at least one first knowledge concept node includes S4061 and S4062.
[0118] S4061 , merging the first first knowledge concept node in at least one first knowledge concept node in each of the N documents to obtain a knowledge combination to be processed.
[0119] For example, if the expansion threshold is 0.7, Figure 3As shown, in document 1, "big model" is the first knowledge concept node, "speech recognition" is the second knowledge concept node, and the edge weight between "big model" and "speech recognition" is 0.9, which is greater than 0.7. "Big model" and "speech recognition" are combined, and "speech recognition" is used as the new first knowledge concept node, and "security monitoring" is the second knowledge concept node. In other words, there are two first knowledge concept nodes in document 1, of which "big model" is the first first knowledge concept node. Similarly, in document 2, "big model" is the first knowledge concept node, and "energy management" is the second knowledge concept node. The edge weight between "big model" and "energy management" is 0.8, which is greater than 0.7. "Big model" and "energy management" are combined. Similarly, "speech recognition" and "traffic" are combined with "big model", and the following is obtained: Figure 5 The knowledge combination to be processed is shown.
[0120] S4062: De-duplicate and / or prune the knowledge combination to be processed to obtain a knowledge combination.
[0121] In the embodiments of the present disclosure, there is no specific limitation on how to perform deduplication and pruning on the knowledge combination to be processed, and corresponding settings can be made according to actual application scenarios and specific application experience.
[0122] For example, Figure 5 The knowledge combination to be processed is deduplicated to obtain Figure 6 The knowledge combination shown.
[0123] It should be noted that the embodiment of the present disclosure may also not perform deduplication and pruning on the knowledge combination to be processed, and directly use the knowledge combination to be processed as the knowledge combination. Whether deduplication and pruning are required is determined based on the actual application scenario and specific application experience.
[0124] Exemplarily, the knowledge combination is constructed based on the cross-document knowledge concept graph, and the knowledge concept nodes that appear simultaneously in at least N documents are selected from the cross-document knowledge concept graph as the first knowledge concept node set to ensure the representativeness and importance of these first knowledge concept nodes. The first knowledge concept node set is denoted as S = {e1, e2, ..., e k Then, with each first knowledge concept node as the core, the knowledge combination is dynamically expanded according to the edge weight. For example, the expansion threshold θ is set, and for the first knowledge concept node e in each document s, examine all nodes adjacent to the first knowledge concept node in the combination. If the edge weight between the two nodes is higher than the expansion threshold, then add this node (that is, combine the second knowledge concept node with the first knowledge concept node); if the edge weight is lower than or equal to the threshold, then do not add it temporarily. Repeat the above expansion steps until no node meets the preset conditions. After the above iterative expansion, the final knowledge combination is obtained: C s ={e s ,e j ,e k ,...}. e j To add the second knowledge concept node to the combination, e j As the new first knowledge concept node, e k It is the second knowledge concept node added to the combination.
[0125] The number of nodes in this combination is dynamic and not fixed. After the knowledge combination to be processed is generated, it is deduplicated and pruned. That is, if the knowledge combinations formed by multiple first knowledge concept nodes (also known as starting nodes) are highly overlapping (for example, the Jaccard similarity exceeds 0.8), these combinations are merged into one; if the combination is too small (for example, the number of nodes is only 1 or 2), it is considered to be meaningless and can be deleted or merged with other combinations.
[0126] It should be noted that Jaccard Similarity is a statistic used to measure the similarity between two sets. It evaluates their similarity by comparing the ratio of the intersection to the union of two sets.
[0127] The disclosed embodiment dynamically constructs knowledge combinations through multiple knowledge concept nodes and multiple edge weights, thereby realizing cross-document knowledge fusion, providing valuable support for the subsequent generation of cross-document questions and answers, thereby being able to generate fine-tuning data from a global perspective, and providing solid data support for building large models with stronger generalization and reasoning capabilities, which helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0128] In yet another exemplary embodiment, determining semantic contents related to a knowledge combination from a plurality of documents includes the following steps D1 to D5.
[0129] Step D1: Encode the knowledge combination to obtain a knowledge combination vector.
[0130] In the embodiment of the present disclosure, the embodiment of the present disclosure does not specifically limit how the knowledge combination is encoded. For example, the knowledge combination is encoded by embedding vectors.
[0131] Step D2: Decompose multiple documents to obtain multiple paragraphs.
[0132] In the embodiment of the present disclosure, decomposition can be performed according to a preset decomposition method. For example, the document can be decomposed according to the segmentation method of the original paragraph to obtain multiple paragraphs. For another example, the document can be decomposed according to a preset number of words to obtain multiple paragraphs.
[0133] Step D3: Encode multiple paragraphs to obtain multiple paragraph vectors.
[0134] In the embodiment of the present disclosure, the embodiment of the present disclosure does not specifically limit how to encode the paragraph. For example, the paragraph may be encoded using an embedded vector.
[0135] Step D4, calculating the similarity between the knowledge combination vector and each paragraph vector in the multiple paragraph vectors to obtain multiple vector similarities.
[0136] Exemplarily, the similarity is cosine similarity, and multiple vector similarities are obtained by calculating the cosine similarity between the knowledge combination vector and each of the multiple paragraph vectors.
[0137] Step D5: Select a preset number of paragraphs with the highest vector similarity from the multiple paragraphs as semantic content related to the knowledge combination.
[0138] The present disclosure does not specifically limit the preset data, and the preset data can be set according to specific application scenarios and actual application experience.
[0139] For example, after the knowledge combination is determined, it is necessary to find the paragraphs in the original document that are most semantically relevant to it to provide a supporting context for question and answer generation. This process uses a vectorized matching method to encode each knowledge combination into a semantic vector (knowledge combination vector). Then, all paragraphs in the original document are also embedded in the vector encoding to obtain the paragraph vector. Finally, the cosine similarity between the knowledge combination vector and the paragraph vector is calculated, and the preset number of paragraphs with the highest similarity are selected as semantic content. These paragraphs provide semantic information such as concept definitions, usage scenarios, and context examples, which helps to enhance the pertinence and accuracy of subsequent question and answer generation.
[0140] The embodiments of the present disclosure provide a supporting context for question and answer generation through semantic content, which helps to enhance the pertinence and accuracy of subsequent question and answer generation.
[0141] In summary, this paper uniformly extracts and integrates knowledge concepts from multiple documents across the document level, forming a shared concept graph encompassing multi-source knowledge. Edge weights are determined by integrating the semantic similarity between knowledge concept nodes with cross-document co-occurrence relationships (i.e., association strength), and based on this, dynamic knowledge combination expansion is achieved, breaking through the limitations of traditional single-document construction.
[0142] The present disclosure can improve the diversity of fine-tuning data, and use cross-document semantic fusion to generate questions that cover multiple knowledge concepts and context combinations, thereby enhancing the complexity and realism of the questions.
[0143] Compared with the manual data construction in related technologies, the present disclosure significantly reduces the cost of manual data construction. The present disclosure can automatically complete document parsing, knowledge mapping, paragraph retrieval and question-answer generation in the entire process, replacing the traditional manual annotation mode; reducing the dependence on expert experience and achieving efficient construction of large-scale high-quality samples. In other words, the present disclosure greatly reduces the dependence on experts for data annotation, review, merging and other links through the construction of cross-document knowledge graphs and automatic vector retrieval, combined with the generation of question-answer pairs by large models. Efficient and high-quality structured processing of large-scale corpora can save enterprises or research institutions a lot of time and manpower in fine-tuning large models.
[0144] In addition, the present disclosure can enhance the capabilities of large models in professional fields. The present disclosure can construct a rich and wide-ranging knowledge combination, generate industry-fine-tuned question and answer data, and enhance the capabilities of large models in professional fields.
[0145] Based on the same inventive concept, the present disclosure also provides a data generation device, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0146] Figure 7 A schematic diagram of a data generating device according to an embodiment of the present disclosure is shown. Figure 7 As shown, the data generation device includes: an acquisition module 71, a construction module 72, a determination module 73 and a generation module 74. The acquisition module 71 can be used to acquire multiple documents; the construction module 72 can be used to construct a cross-document knowledge concept graph based on multiple documents, and the cross-document knowledge concept graph includes multiple knowledge concept nodes and multiple edge weights, where the edge weight is the weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; the determination module 73 can be used to obtain a knowledge combination based on the multiple knowledge concept nodes and the multiple edge weights; the determination module 73 can also be used to determine semantic content related to the knowledge combination from multiple documents; the generation module 74 can be used to input the knowledge combination and semantic content into the large model to generate fine-tuning data.
[0147] In one embodiment, the determination module 73 can also be used to take the knowledge concept node corresponding to the same knowledge concept appearing in N documents as the first knowledge concept node, where N is a preset value; obtain a second knowledge concept node, where the knowledge concept corresponding to the second knowledge concept node and the knowledge concept corresponding to the first knowledge concept node are located in the same document; determine the edge weight between the second knowledge concept node and the first knowledge concept node from multiple edge weights; when the edge weight between the second knowledge concept node and the first knowledge concept node meets a preset condition, combine the second knowledge concept node with the first knowledge concept node, and the preset condition is that the edge weight between the second knowledge concept node and the first knowledge concept node is greater than an expansion threshold; take the second knowledge concept node as the new first knowledge concept node, and execute the step of obtaining the second knowledge concept node until the edge weight between the second knowledge concept node and the first knowledge concept node fails to meet the preset condition; obtain a knowledge combination based on the combined second knowledge concept node and at least one first knowledge concept node.
[0148] In one embodiment, the determination module 73 can also be used to merge the first first knowledge concept node in at least one first knowledge concept node in each of the N documents to obtain a knowledge combination to be processed; and perform deduplication and / or pruning on the knowledge combination to be processed to obtain a knowledge combination.
[0149] In one embodiment, the construction module 72 can also be used to extract knowledge concepts from multiple documents, treating each knowledge concept as a knowledge concept node; calculating the edge weights between knowledge concept nodes corresponding to two different knowledge concepts in the same document; and constructing a cross-document knowledge concept graph based on the edge weights and knowledge concept nodes.
[0150] In one embodiment, the construction module 72 can also be used to calculate the semantic similarity between knowledge concept nodes corresponding to two different knowledge concepts in the same document; calculate the association strength between knowledge concept nodes corresponding to two different knowledge concepts in the same document; and obtain edge weights based on the semantic similarity and association strength.
[0151] In one embodiment, the determination module 73 can also be used to encode the knowledge combination to obtain a knowledge combination vector; decompose multiple documents to obtain multiple paragraphs; encode multiple paragraphs to obtain multiple paragraph vectors; calculate the similarity between the knowledge combination vector and each paragraph vector in the multiple paragraph vectors to obtain multiple vector similarities; among the multiple paragraphs, select a preset number of paragraphs with the highest vector similarity as the semantic content related to the knowledge combination.
[0152] In one embodiment, before acquiring multiple documents, the acquisition module 71 may also be used to acquire original documents in the target field; filter the original documents; and convert the filtered original documents into a text format to obtain documents.
[0153] The data generation device disclosed in the embodiment of the present disclosure constructs a cross-document knowledge concept graph by utilizing multiple documents, and combines knowledge through multiple knowledge concept nodes and multiple edge weights in the cross-document knowledge concept graph to obtain a knowledge combination, thereby realizing cross-document knowledge fusion. Semantic content related to the knowledge combination is determined from multiple documents, and the knowledge combination and semantic content are input into a large model to generate questions and answers corresponding to the questions. The semantic content can provide contextual support for question and answer generation, thereby enhancing the pertinence and accuracy of questions and answers. The present disclosure breaks through the limitations of closed processing of single documents in traditional question-and-answer data construction, and significantly improves the structural complexity of the data, the breadth of knowledge coverage, and the effectiveness of reasoning training. The present disclosure provides solid data support for building a large model with stronger generalization and reasoning capabilities, which helps to improve the adaptability and accuracy of the model in multiple fields and scenarios.
[0154] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0155] Refer to the following Figure 8 800 according to this embodiment of the present disclosure will be described. Figure 8 The electronic device 800 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0156] like Figure 8 As shown, electronic device 800 is implemented as a general-purpose computing device. Components of electronic device 800 may include, but are not limited to, the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, and a bus 830 connecting various system components (including storage unit 820 and processing unit 810).
[0157] Wherein, the storage unit stores a program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 810 can execute the following steps of the above method embodiment: obtain multiple documents; construct a cross-document knowledge concept graph based on multiple documents, the cross-document knowledge concept graph includes multiple knowledge concept nodes and multiple edge weights, and the edge weight is the weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; obtain a knowledge combination based on the multiple knowledge concept nodes and the multiple edge weights; determine the semantic content related to the knowledge combination from multiple documents; input the knowledge combination and the semantic content into the large model to generate fine-tuning data.
[0158] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0159] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0160] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0161] The electronic device 800 can also communicate with one or more external devices 840 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 850. Furthermore, the electronic device 800 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0162] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0163] In the disclosed exemplary embodiments, a computer-readable storage medium is also provided. The computer-readable storage medium may be a readable signal medium or a readable storage medium. Figure 9 A schematic diagram of a computer-readable storage medium according to an embodiment of the present disclosure is shown. Figure 9 As shown, the computer-readable storage medium 900 stores a program product capable of implementing the above-mentioned method of the present disclosure.
[0164] In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present disclosure described in the above "Specific Implementation Methods" section of this specification.
[0165] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0166] In the present disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0167] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0168] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0169] The present disclosure provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data generation method provided in any of the various optional embodiments of the present disclosure.
[0170] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0171] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0172] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0173] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope of the present disclosure being indicated by the appended claims.
Claims
1. A data generation method, characterized in that: include: Get multiple documents; Constructing a cross-document knowledge concept graph based on the multiple documents, the cross-document knowledge concept graph including multiple knowledge concept nodes and multiple edge weights, wherein the edge weight is a weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; Obtaining a knowledge combination according to the plurality of knowledge concept nodes and the plurality of edge weights; determining semantic content related to the knowledge combination from the plurality of documents; The knowledge combination and the semantic content are input into a large model to generate fine-tuning data.
2. The method according to claim 1, characterized in that The step of obtaining a knowledge combination according to the plurality of knowledge concept nodes and the plurality of edge weights includes: The knowledge concept node corresponding to the same knowledge concept appearing in N documents is taken as the first knowledge concept node, where N is a preset value; Acquire a second knowledge concept node, where the knowledge concept corresponding to the second knowledge concept node and the knowledge concept corresponding to the first knowledge concept node are located in the same document; determining an edge weight between the second knowledge concept node and the first knowledge concept node from the plurality of edge weights; If the edge weight between the second knowledge concept node and the first knowledge concept node meets a preset condition, combining the second knowledge concept node with the first knowledge concept node, wherein the preset condition is that the edge weight between the second knowledge concept node and the first knowledge concept node is greater than an expansion threshold; Taking the second knowledge concept node as a new first knowledge concept node, executing the step of obtaining the second knowledge concept node until the edge weight between the second knowledge concept node and the first knowledge concept node fails to meet the preset condition; The knowledge combination is obtained according to the combined second knowledge concept node and at least one first knowledge concept node.
3. The method according to claim 2, characterized in that Obtaining the knowledge combination according to the combined second knowledge concept node and at least one of the first knowledge concept nodes includes: Merging the first first knowledge concept node of at least one of the first knowledge concept nodes in each of the N documents to obtain a knowledge combination to be processed; Deduplication and / or pruning are performed on the knowledge combination to be processed to obtain the knowledge combination.
4. The method according to claim 1, wherein The constructing a cross-document knowledge concept graph according to the multiple documents includes: Extracting knowledge concepts from the plurality of documents, and treating each of the knowledge concepts as a knowledge concept node; Calculate the edge weight between knowledge concept nodes corresponding to two different knowledge concepts in the same document; The cross-document knowledge concept graph is constructed according to the edge weights and the knowledge concept nodes.
5. The method according to claim 4, characterized in that The calculation of the edge weight between knowledge concept nodes corresponding to two different knowledge concepts in the same document includes: Calculate the semantic similarity between knowledge concept nodes corresponding to two different knowledge concepts in the same document; Calculate the association strength between knowledge concept nodes corresponding to two different knowledge concepts in the same document; The edge weight is obtained according to the semantic similarity and the association strength.
6. The method according to claim 1, characterized in that Determining semantic content related to the knowledge combination from the multiple documents includes: Encoding the knowledge combination to obtain a knowledge combination vector; Decomposing the multiple documents to obtain multiple paragraphs; Encoding the plurality of paragraphs to obtain a plurality of paragraph vectors; Calculating the similarity between the knowledge combination vector and each of the paragraph vectors to obtain a plurality of vector similarities; Among the multiple paragraphs, a preset number of paragraphs with the highest vector similarity are selected as semantic content related to the knowledge combination.
7. The method according to any one of claims 1 to 6, characterized in that Before acquiring the plurality of documents, the method further includes: Obtain original documents in the target area; screening the original document; The filtered original document is formatted to obtain a document in text format.
8. A data generating device, characterized in that: include: The acquisition module is used to obtain multiple documents; A construction module, configured to construct a cross-document knowledge concept graph based on the multiple documents, wherein the cross-document knowledge concept graph includes multiple knowledge concept nodes and multiple edge weights, wherein the edge weight is a weight between the knowledge concept nodes corresponding to two different knowledge concepts in the same document; a determination module, configured to obtain a knowledge combination according to the plurality of knowledge concept nodes and the plurality of edge weights; The determining module is further configured to determine semantic content related to the knowledge combination from the plurality of documents; A generation module is used to input the knowledge combination and the semantic content into the large model to generate fine-tuning data.
9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the data generation method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data generation method according to any one of claims 1 to 7 is implemented.
11. A computer program product comprising computer instructions, characterized in that The computer instructions are stored in a computer-readable storage medium, and when the computer instructions are executed by a processor, they implement the operation instructions of the data generation method according to any one of claims 1 to 7.