An intelligent algorithm knowledge extraction method and device based on a pre-trained language model
By employing a pre-trained language model-based intelligent algorithm for knowledge extraction, and utilizing the BART and ChatGLM2-6B models to construct a question-answer pair dataset, the problem of difficulty in understanding intelligent algorithms is solved, achieving efficient and accurate knowledge extraction and application.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU UNIVERSITY
- Filing Date
- 2023-12-11
- Publication Date
- 2026-06-09
Smart Images

Figure CN117874186B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge extraction technology, and in particular to an intelligent algorithm knowledge extraction method and apparatus based on a pre-trained language model. Background Technology
[0002] With the rapid development of artificial intelligence technology, intelligent algorithms are being applied more and more widely in various fields. These algorithms are not only the core of modern technological innovation, but also play a vital role in promoting scientific research, industrial automation, medical research, and other fields. The core of intelligent algorithms lies in their ability to simulate, optimize, and automate human decision-making processes, thereby improving efficiency and accuracy. However, as the number and complexity of intelligent algorithms increase, understanding and applying them also becomes more difficult. Summary of the Invention
[0003] The main objective of this application is to propose a method and apparatus for extracting knowledge from intelligent algorithms based on pre-trained language models, so as to accurately extract knowledge from intelligent algorithms and facilitate the understanding and application of intelligent algorithms.
[0004] To achieve the above objectives, one aspect of this application proposes an intelligent algorithm knowledge extraction method based on a pre-trained language model, the method comprising:
[0005] Obtain summary text corresponding to multiple information parameters; each of the information parameters is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each of the information parameters and the corresponding context text;
[0006] Based on pre-constructed target prompts, obtain the entities of each of the first intelligent algorithms and the relationship information between each entity;
[0007] A first question-answer pair dataset is constructed based on the summary text, each of the entities, and the relationship information.
[0008] Based on the first question and answer, a pre-set language model is trained on the dataset to obtain the pre-trained language model;
[0009] The pre-trained language model is used to extract knowledge from the second intelligent algorithm to obtain the knowledge of the intelligent algorithm.
[0010] In some embodiments, obtaining the summary text corresponding to multiple information parameters includes:
[0011] Obtain each of the information parameters corresponding to the first intelligent algorithm;
[0012] Generate corresponding summary text based on each of the aforementioned information parameters.
[0013] In some embodiments, before generating the corresponding summary text based on each of the information parameters, the method further includes:
[0014] Each of the aforementioned information parameters undergoes data cleaning and data format standardization to obtain preprocessed information parameters; the preprocessed information parameters are in text form and are used as parameter text;
[0015] Each parameter text is categorized into its corresponding paragraph to obtain categorized text; each paragraph corresponds to an information topic.
[0016] The step of generating corresponding summary text based on each of the information parameters includes:
[0017] Generate corresponding summary texts based on each of the categorized texts.
[0018] In some embodiments, before obtaining the entities of each of the first intelligent algorithms and the relationship information between each of the entities based on the pre-constructed target prompt words, the method further includes a step of constructing the target prompt words, the step of constructing the target prompt words including:
[0019] The first initial prompt word is constructed based on the type of information to be extracted and the data format of the information to be extracted in the dataset;
[0020] The first initial prompt word is used to obtain information about the preset training intelligent algorithm to obtain the training result;
[0021] If the training result meets the preset conditions, then the first initial prompt word is determined as the target prompt word;
[0022] If the training result does not meet the preset conditions, the process of adjusting the wording and structure of the first initial prompt word is repeated to obtain the adjusted first initial prompt word; the adjusted first initial prompt word is edited according to the preset prompt word template, the information to be extracted, and the preset target information to obtain the second initial prompt word; the second initial prompt word is used as the new first initial prompt word, and the information of the preset training intelligent algorithm is obtained using the first initial prompt word to obtain the training result, until the training result meets the preset conditions, and then the final second initial prompt word is determined as the target prompt word.
[0023] In some embodiments, constructing the first question-answer pair dataset based on the summary text, each of the entities, and the relationship information includes:
[0024] Multiple question-and-answer text pairs are constructed based on the summary text, each entity, and the relationship information, and each question-and-answer text pair serves as the first question-and-answer pair dataset.
[0025] In some embodiments, training a preset language model based on the first question-and-answer dataset to obtain the pre-trained language model includes:
[0026] Obtain additional training parameters, including training mode information and training prompt information;
[0027] The pre-trained language model is trained based on the additional training parameters and the first question-answer pair dataset to obtain the pre-trained language model.
[0028] In some embodiments, the method further includes:
[0029] A knowledge base is constructed using the knowledge from the aforementioned intelligent algorithm.
[0030] Based on the intelligent algorithm knowledge in the knowledge base, perform at least one of the following steps:
[0031] Construct an intelligent algorithm knowledge graph based on the intelligent algorithm knowledge in the knowledge base;
[0032] Alternatively, the dependency information between the various second intelligent algorithms can be obtained based on the intelligent algorithm knowledge in the knowledge base;
[0033] Alternatively, a second question-answer pair dataset can be constructed based on the intelligent algorithm knowledge in the knowledge base.
[0034] To achieve the above objectives, another aspect of this application proposes an intelligent algorithm knowledge extraction device based on a pre-trained language model, the device comprising:
[0035] A text acquisition unit is used to acquire summary text corresponding to multiple information parameters; each of the information parameters is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each of the information parameters and the corresponding context text.
[0036] The information acquisition unit is used to acquire the entities of each of the first intelligent algorithms and the relationship information between each entity based on the pre-constructed target prompt words;
[0037] A dataset construction unit is used to construct a first question-answer pair dataset based on the summary text, each of the entities, and the relationship information.
[0038] The model training unit is used to train a preset language model on the dataset based on the first question and answer, so as to obtain the pre-trained language model.
[0039] The knowledge extraction unit is used to extract knowledge from the second intelligent algorithm using the pre-trained language model to obtain intelligent algorithm knowledge.
[0040] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0041] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0042] The embodiments of this application include at least the following beneficial effects:
[0043] This application provides a method and apparatus for knowledge extraction from intelligent algorithms based on a pre-trained language model. The scheme involves acquiring summary text corresponding to multiple information parameters; each information parameter represents a parameter corresponding to multiple first intelligent algorithms; the summary text includes the semantic text of each information parameter and its corresponding context text; obtaining the entities of each first intelligent algorithm and the relationship information between these entities based on pre-constructed target prompts; constructing a first question-and-answer pair dataset based on the summary text, the entities, and the relationship information; training a pre-set language model based on the first question-and-answer pair dataset to obtain a pre-trained language model; and using the pre-trained language model to extract knowledge from a second intelligent algorithm to obtain intelligent algorithm knowledge. This application obtains the entities and entity relationships of each first intelligent algorithm through pre-constructed target words, and then constructs a first question-and-answer pair dataset with the summary text. The language model trained using this dataset can more accurately extract knowledge from intelligent algorithms. Based on accurate knowledge of intelligent algorithms, intelligent algorithms can be quickly understood and applied more rationally. Attached Figure Description
[0044] Figure 1 A flowchart illustrating an intelligent algorithm knowledge extraction method based on a pre-trained language model, provided in an embodiment of this application;
[0045] Figure 2 An example flowchart for generating summary text is provided in an embodiment of this application;
[0046] Figure 3 An example flowchart for constructing prompt words is provided in an embodiment of this application;
[0047] Figure 4 An example flowchart of an intelligent algorithm knowledge extraction method provided in this application embodiment;
[0048] Figure 5 A schematic diagram of the structure of an intelligent algorithm knowledge extraction device based on a pre-trained language model provided in an embodiment of this application;
[0049] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0051] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0052] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0054] Currently, knowledge extraction in intelligent algorithms primarily relies on manual annotation, simple keyword matching, and Named Entity Recognition (NER). NER is a key technology in Natural Language Processing (NLP) used to identify entities with specific meanings from text, such as names of people, places, and organizations. In the context of intelligent algorithms, NER is often used to identify algorithm names, parameters, etc., but these methods have significant limitations:
[0055] 1. Manual labeling: Although it can provide accurate data, the process is time-consuming and labor-intensive, and is easily affected by human bias.
[0056] 2. Keyword matching: Although this method is fast, it often fails to accurately capture the complex relationships and subtle differences between algorithms.
[0057] 3. Named Entity Recognition Technology:
[0058] (1) Limited generalization ability: Traditional NER models are usually trained for specific entity types. Their recognition ability may be limited for newly emerging or uncommon algorithm entities.
[0059] (2) Insufficient contextual understanding: NER technology often focuses on the identification of individual entities rather than the relationships between them. This is especially important in the field of intelligent algorithms, because the relationships between algorithms (such as dependencies and similarities) are crucial for a complete understanding of the algorithm;
[0060] (3) Poor adaptability: The field of intelligent algorithms is constantly developing, and new algorithms and concepts are constantly emerging. Traditional NER models need to be constantly retrained to adapt to these changes, which is both time-consuming and labor-intensive.
[0061] In view of this, embodiments of this application provide a method and apparatus for intelligent algorithm knowledge extraction based on a pre-trained language model. This approach can not only identify and classify entities related to intelligent algorithms, but also understand and parse the complex relationships between these entities. Embodiments of this application utilize the latest pre-trained language models and deep learning techniques, combined with powerful contextual understanding capabilities and adaptive learning mechanisms, to achieve efficient and accurate extraction of knowledge from intelligent algorithms. Through the above approach, embodiments of this application not only improve the efficiency and accuracy of intelligent algorithm knowledge extraction, but also adapt to the rapid development of the intelligent algorithm field, providing researchers and developers with richer and deeper insights.
[0062] This application provides a knowledge extraction method based on a pre-trained language model using intelligent algorithms, relating to the field of knowledge extraction technology. The knowledge extraction method provided in this application can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the knowledge extraction method, but is not limited to the above forms.
[0063] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0064] Reference Figure 1 This application provides an intelligent algorithm knowledge extraction method based on a pre-trained language model. This method may include, but is not limited to, steps S100 to S140, as follows:
[0065] Step S100: Obtain summary text corresponding to multiple information parameters; each information parameter is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each information parameter and the corresponding context text.
[0066] Specifically, the first intelligent algorithm can be any type of intelligent algorithm, and the information parameters can be relevant parameters describing the first intelligent algorithm, such as the application field, algorithm name, or implemented function. This embodiment can extract summary text based on each information parameter to obtain the meaning and contextual relationship of each information parameter.
[0067] Further, step S100 may include steps S101 to S102:
[0068] Step S101: Obtain each of the information parameters corresponding to the first intelligent algorithm.
[0069] Specifically, this embodiment can utilize a web crawler script written in the Python programming language to match relevant data of intelligent algorithms from a predetermined data source (such as public papers, code repositories, technical forums, and blogs in the field of artificial intelligence) and crawl various information parameters corresponding to multiple first intelligent algorithms through regular expressions, string parsing, and other methods.
[0070] Step S102: Generate the corresponding summary text based on each of the information parameters.
[0071] Considering that the acquired information parameters may contain interfering data, as a further implementation, this embodiment may also include steps S103 to S104 before step S102:
[0072] Step S103: Perform data cleaning and standardize the data format of each of the information parameters to obtain the preprocessed information parameters; the preprocessed information parameters are in text form and are used as parameter text.
[0073] Specifically, the steps of preprocessing (i.e., data cleaning) the crawled data may include: removing information that is not related to the first intelligent algorithm and correcting format errors (such as encoding problems or line break errors), as well as standardizing the data format to ensure that all data follows a uniform structure and format.
[0074] Optionally, the data crawled in this embodiment can be in text form, so the information parameters can be used as parameter text.
[0075] Step S104: Classify each parameter text into its corresponding paragraph to obtain classified text; each paragraph corresponds to an information topic.
[0076] Specifically, the parameter text is segmented to ensure that each paragraph focuses on a specific topic or concept, so that the language model can summarize more effectively.
[0077] Therefore, step S102 can be more specifically described as follows:
[0078] Generate corresponding summary texts based on each of the categorized texts.
[0079] As an optional implementation, this embodiment can utilize the BART (Bidirectional and Auto-Regressive Transformers) model to generate corresponding summary texts based on each categorized text. A sample flowchart for generating summary texts can be found here. Figure 2 .
[0080] Specifically, the BART model works by combining autoregressive and autoencoder mechanisms. It first disrupts the categorized text in some way (e.g., deleting words or reordering sentences), then attempts to reconstruct the original categorized text. By using this disruptive and reconstructive approach, the BART model is trained to understand and predict text structure, making it more efficient at handling complex texts.
[0081] In this embodiment, the preprocessed categorized text is then input into the trained BART model. The encoder-decoder structure within the BART model is used to understand the input text content and generate a concise and accurate summary text. The encoder is responsible for understanding the context and meaning of the input text, while the decoder is responsible for generating the summary text. That is, the BART model is used to extract and reorganize key information from the categorized text to generate a summary text containing the main points and information.
[0082] Post-processing and optimization: The generated summary text may require further post-processing to improve its quality and usability. This includes proofreading the summary text to ensure accuracy and making necessary adjustments to ensure coherence and consistency. Furthermore, the BART model can be fine-tuned based on feedback from real-world applications to optimize its performance on specific datasets.
[0083] Step S110: Obtain the entities of each of the first intelligent algorithms and the relationship information between each entity based on the pre-constructed target prompt words.
[0084] Specifically, the role of prompts in AI models is primarily to provide the AI model with contextual information about the input and the parameters it provides. When training AI models in both supervised and unsupervised learning environments, prompts help the model better understand the intent of the input and respond accordingly. Furthermore, prompts improve the interpretability and accessibility of AI models; that is, prompts provide the AI model with a "hint" or "guide," helping it better understand and complete the task.
[0085] Furthermore, prior to step S110, this embodiment may further include a step of constructing the target prompt word, wherein the step of constructing the target prompt word includes steps S111 to S114:
[0086] Step S111: Construct the first initial prompt word based on the type of information to be extracted and the data format of the information to be extracted in the dataset.
[0087] Constructing an effective cue word for knowledge extraction in intelligent algorithms requires comprehensive consideration of the specific needs of the knowledge extraction task, the characteristics of the target dataset, and domain knowledge. First, it's crucial to define the type of information to be extracted, such as algorithm names, parameters, or performance metrics, and determine the representation of this information in the dataset (i.e., the data format). Then, based on the aforementioned type and data format, create highly indicative and context-sensitive cue words as initial cue words. These initial cue words should clearly guide the AI model to focus on the key information.
[0088] Step S112: Use the first initial prompt word to obtain information about the preset training intelligent algorithm and obtain the training result.
[0089] Specifically, the training results can reflect whether the first initial prompt word is constructed reasonably, and thus this embodiment can determine whether the first initial prompt word needs to be adjusted based on the training results.
[0090] Step S113: If the training result meets the preset conditions, then the first initial prompt word is determined as the target prompt word.
[0091] Specifically, the preset condition can be whether the accuracy or relevance meets the standard. If so, it means that the first initial prompt word constructed in step S111 is reasonable, and the first initial prompt word can be used as the target prompt word.
[0092] Step S114: If the training result does not meet the preset conditions, the process of adjusting the wording and structure of the first initial prompt word is repeated to obtain the adjusted first initial prompt word; the adjusted first initial prompt word is edited according to the preset prompt word template, the information to be extracted, and the preset target information to obtain the second initial prompt word; the second initial prompt word is used as the new first initial prompt word, and the information of the preset training intelligent algorithm is obtained using the first initial prompt word to obtain the training result, until the training result meets the preset conditions, and then the final second initial prompt word is determined as the target prompt word.
[0093] Reference Figure 3 This embodiment provides an example flowchart for constructing prompt words.
[0094] Specifically, if the training results do not meet the preset conditions, this embodiment can adjust the wording and structure of the prompt words through iterative testing and optimization to improve the accuracy and efficiency of extraction. Simultaneously, dynamic prompt words can be created using prompt word templates and variables of the information to be extracted to adapt to different text scenarios. Furthermore, incorporating domain-specific knowledge (i.e., preset target information) into the prompt words can improve the AI model's understanding of technical terms and complex concepts. Finally, this embodiment may also include steps for periodic evaluation and feedback to ensure the continued effectiveness of the prompt words. Constructing prompt words is a continuous iterative and refined process; the prompt words need to be constantly adjusted and optimized based on actual applications and test results.
[0095] To more clearly describe this embodiment, a specific example of constructing prompt words will be given below. Assume that the goal of this embodiment is to extract information about a specific intelligent algorithm from scientific papers, such as the algorithm name, algorithm parameters, and algorithm performance metrics. The following is an example flow for constructing prompt words:
[0096] 1. Define the information type: First, determine the type of information to be extracted. Assume this embodiment targets the following information:
[0097] Algorithm name (e.g., "convolutional neural network" or "random forest"); algorithm parameter settings (e.g., learning rate or number of iterations); algorithm performance metrics (e.g., accuracy or recall).
[0098] 2. Determine the format of the dataset: For example, in a scientific paper, the name of the intelligent algorithm may appear in the method section, the parameter settings may be detailed in the experimental settings, and the performance metrics may be mentioned in the results discussion.
[0099] 3. Create initial prompt words: Based on the above information types and dataset presentation, create initial prompt words.
[0100] Examples of initial prompt words are as follows:
[0101] 3.1 The main algorithm used in this paper is ______.
[0102] 3.2 The key parameter settings for this algorithm include ______.
[0103] 3.3 In the experiment, the main performance indicators achieved by the algorithm are ______.
[0104] 4. Iterative Testing and Optimization: Test the AI model using the initial prompts to assess its accuracy and efficiency in information extraction. Based on the test results, adjust the wording and structure of the initial prompts. An example of the adjustments is shown below:
[0105] The core algorithm used in this study is ______, and its main parameters are set to ______. The performance indicators shown in the test include ______.
[0106] 5. Using Templates and Variables: To adapt to different text scenarios, templates and variables can be used to create dynamic prompts. For example, a template can be built to dynamically adjust the content of the prompts based on different algorithm types.
[0107] 6. Incorporate Domain Knowledge: Incorporate domain-specific knowledge into the prompts to improve the AI model's understanding of technical terms and complex concepts. For example, for deep learning algorithms, prompts related to neural network structures can be added.
[0108] 7. Regular Evaluation and Feedback: Building effective prompts is an iterative and refined process that requires continuous adjustment and optimization based on practical applications and test results. This embodiment allows for regular evaluation of the prompts' effectiveness and adjustments based on feedback. For example, prompts can be updated based on domain experts' definitions or the latest research trends.
[0109] Step S120: Construct a first question-answer pair dataset based on the summary text, each of the entities, and the relationship information.
[0110] Specifically, this embodiment can combine the entities and relationships identified by the intelligent algorithm (including key information such as algorithm name, parameters, and performance indicators) with the summary text generated by the pre-trained language model (BART model) to construct the first question-answer pair dataset.
[0111] Further, step S120 may include:
[0112] Multiple question-and-answer text pairs are constructed based on the summary text, each entity, and the relationship information, and each question-and-answer text pair serves as the first question-and-answer pair dataset.
[0113] Specifically, this embodiment can create a rich question-answer pair dataset, where each question-answer pair can have a highly relevant association with the knowledge points of the corresponding intelligent algorithm.
[0114] Step S130: Train a preset language model based on the first question-and-answer dataset to obtain the pre-trained language model.
[0115] Specifically, the first question-answer pair dataset can be used as training data to fine-tune a locally deployable language model, such as the ChatGLM2-6B model. Based on a large-scale pre-trained rig and possessing approximately 600 million parameters, the ChatGLM2-6B model is capable of understanding and generating highly complex and nuanced text content, making it suitable for handling complex natural language processing tasks. The ChatGLM2-6B model is highly flexible and adaptable, and can be fine-tuned to suit various specific application scenarios (such as intelligent algorithm knowledge extraction, dialogue systems, text summarization, etc.) to more effectively perform intelligent algorithm knowledge extraction tasks. By fine-tuning the language model, this embodiment ensures that the language model can not only understand and answer questions about specific algorithms but also apply this knowledge in a broader context.
[0116] Furthermore, step S130 may include steps S131 to S132:
[0117] Step S131: Obtain additional training parameters, which include training mode information and training prompt information;
[0118] Step S132: Train the preset language model according to the additional training parameters and the first question-answer pair dataset to obtain the pre-trained language model.
[0119] Specifically, fine-tuning the ChatGLM2-6B model can make it more specialized in intelligent algorithm knowledge extraction tasks. In this embodiment, the P-tuning-v2 method can be used to fine-tune the ChatGLM2-6B model. The P-tuning-v2 method enhances the task adaptability and learning ability of the language model by introducing trainable patterns and prompts.
[0120] The P-tuning-v2 method avoids directly modifying the model's pre-trained parameters. Instead, it achieves fine-tuning by adding a small number of trainable additional parameters. These additional parameters exist in the form of patterns and prompts, which guide the language model to better understand and perform specific tasks. In intelligent algorithm knowledge extraction scenarios, the language model can identify and understand algorithm-related entities and relationships based on these patterns and prompts.
[0121] This embodiment uses the first question-and-answer pair dataset constructed in step S120 as training data to fine-tune the ChatGLM2-6B model. The first question-and-answer pair dataset can include a large number of questions and answers about intelligent algorithms, covering various entities such as algorithm names, parameters, performance metrics, and the relationships between them. By training on the first question-and-answer pair dataset, the ChatGLM2-6B model can learn how to accurately identify and extract knowledge related to intelligent algorithms. The fine-tuned ChatGLM2-6B model will have higher professionalism and accuracy, enabling it to more effectively perform intelligent algorithm knowledge extraction tasks. Based on this, this embodiment not only improves the efficiency of knowledge extraction but also ensures the accuracy of the knowledge extraction results.
[0122] Step S140: Use the pre-trained language model to extract knowledge from the second intelligent algorithm to obtain intelligent algorithm knowledge.
[0123] Specifically, each of the second intelligent algorithms in the embodiments of this application can be completely or partially the same as each of the first intelligent algorithms, or they can be completely different from each of the first intelligent algorithms. That is, in this embodiment, the pre-trained language model can extract knowledge from any intelligent algorithm to obtain intelligent algorithm knowledge.
[0124] After obtaining accurate intelligent algorithm knowledge, the embodiments of this application can apply the intelligent algorithm knowledge to downstream tasks. Therefore, the embodiments of this application may further include steps S151 to S152:
[0125] Step S151: Construct a knowledge base using the knowledge from the intelligent algorithm;
[0126] Step S152: Execute at least one of steps S1521 to S1523 based on the intelligent algorithm knowledge in the knowledge base:
[0127] Step S1521: Construct an intelligent algorithm knowledge graph based on the intelligent algorithm knowledge in the knowledge base;
[0128] Step S1522: Obtain the dependency relationship information between each of the second intelligent algorithms based on the intelligent algorithm knowledge in the knowledge base;
[0129] Step S1523: Construct a second question-answer pair dataset based on the intelligent algorithm knowledge in the knowledge base.
[0130] Specifically, the intelligent algorithm knowledge obtained in this application embodiment can be used to construct a knowledge base. The data in the knowledge base (i.e., intelligent algorithm knowledge) is stored in a structured and standardized format, ensuring the accessibility and operability of the data. The data in the knowledge base not only includes basic information such as the name, parameters, and performance indicators of the algorithm, but also covers complex relationships between algorithms, such as dependencies, functional similarities, and synergistic effects in solving specific problems.
[0131] The aforementioned knowledge base can provide data support for various downstream tasks. For example, it can provide the data foundation for constructing intelligent algorithm knowledge graphs, enabling the intuitive display and analysis of relationships between various intelligent algorithms. Alternatively, the database can support in-depth detection and analysis of dependencies among intelligent algorithms for understanding and optimization. Furthermore, the knowledge base can be used to develop intelligent question-answering systems, which can utilize the rich knowledge of intelligent algorithms within the knowledge base to answer various queries about intelligent algorithms, thereby providing researchers and developers with immediate information support and decision-making assistance. This knowledge base not only stores acquired intelligent algorithm knowledge but also promotes the research and application of intelligent algorithms.
[0132] The following section will provide a detailed introduction and explanation of the solutions in the embodiments of this application, using specific application examples:
[0133] Reference Figure 4 This embodiment provides an example flowchart of an intelligent algorithm knowledge extraction method.
[0134] Specifically, this embodiment proposes an intelligent algorithm knowledge extraction method based on a pre-trained language model and prompt words. The method first collects intelligent algorithm data through web crawling, regular expressions, and string matching; then, it uses the BART model to summarize the intelligent algorithm data into a summary text; next, it avoids manual data annotation based on pre-built prompt words, thereby efficiently identifying and extracting entities and relationships of the intelligent algorithm from the summary text; then, it uses the extracted entities and relationships and the summary text to construct a question-answer pair dataset, and fine-tunes the ChatGLM2-6B model based on this dataset to train it as a language model for intelligent algorithm knowledge extraction; finally, it stores the extracted intelligent algorithm knowledge in a knowledge base, which can assist in downstream tasks such as constructing a knowledge graph of intelligent algorithms, detecting dependencies of intelligent algorithms, or building an intelligent algorithm question-answering system.
[0135] This embodiment has the following beneficial effects:
[0136] 1. Efficient knowledge extraction: By combining a pre-trained language model (BART model) and pre-built prompt words, this embodiment can achieve efficient and accurate intelligent algorithm knowledge extraction, avoiding the tediousness and inaccuracy of manual annotation, and significantly improving extraction efficiency and accuracy.
[0137] 2. Flexible data processing: By leveraging the powerful text summarization capabilities of the BART model, key information (i.e., summary text) can be quickly extracted from a large amount of complex information parameter text, thereby improving the efficiency of data processing and making it faster and more accurate to extract valuable information from a large dataset.
[0138] 3. Targeted model training: The ChatGLM2-6B model was fine-tuned using a question-and-answer dataset to make it more suitable for intelligent algorithm knowledge extraction tasks, thereby improving its performance on specific tasks and enhancing its professionalism and accuracy.
[0139] 4. Low resource requirements: By effectively utilizing existing pre-trained language models and reducing reliance on additional training data, the consumption of computing and human resources is reduced, achieving a significant reduction in resource requirements while maintaining efficient and accurate intelligent algorithm knowledge extraction.
[0140] 5. Broad Application Prospects: The knowledge base for intelligent algorithms can be widely applied in various fields such as intelligent algorithm knowledge graph construction, dependency detection, and question answering systems. The establishment of this knowledge base provides valuable resources for further research and application of intelligent algorithms, possessing significant practical value and broad application prospects.
[0141] Reference Figure 5 This application also provides an intelligent algorithm knowledge extraction device based on a pre-trained language model, which can implement the above-mentioned knowledge extraction method. The device includes:
[0142] A text acquisition unit is used to acquire summary text corresponding to multiple information parameters; each of the information parameters is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each of the information parameters and the corresponding context text.
[0143] The information acquisition unit is used to acquire the entities of each of the first intelligent algorithms and the relationship information between each entity based on the pre-constructed target prompt words;
[0144] A dataset construction unit is used to construct a first question-answer pair dataset based on the summary text, each of the entities, and the relationship information.
[0145] The model training unit is used to train a preset language model on the dataset based on the first question and answer, so as to obtain the pre-trained language model.
[0146] The knowledge extraction unit is used to extract knowledge from the second intelligent algorithm using the pre-trained language model to obtain intelligent algorithm knowledge.
[0147] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0148] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned knowledge extraction method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0149] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0150] Please see Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0151] The processor 601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0152] The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601 using the knowledge extraction method of the embodiments of this application.
[0153] The input / output interface 603 is used to implement information input and output;
[0154] The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0155] Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604);
[0156] The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.
[0157] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described knowledge extraction method.
[0158] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0159] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0160] This application provides a method and apparatus for knowledge extraction from intelligent algorithms based on a pre-trained language model. It involves acquiring summary text corresponding to multiple information parameters; each information parameter represents a parameter of a first intelligent algorithm; the summary text includes the meaning text of each information parameter and its corresponding context text; obtaining the entities of each first intelligent algorithm and the relationship information between these entities based on pre-constructed target prompts; constructing a first question-and-answer pair dataset based on the summary text, the entities, and the relationship information; training a pre-set language model based on the first question-and-answer pair dataset to obtain a pre-trained language model; and using the pre-trained language model to extract knowledge from a second intelligent algorithm to obtain intelligent algorithm knowledge. This application can accurately extract knowledge from intelligent algorithms, thereby enabling rapid understanding and more rational application of intelligent algorithms based on accurate knowledge.
[0161] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0162] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0163] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0164] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0165] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0166] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0167] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0168] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0169] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0170] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0171] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A knowledge extraction method based on a pre-trained language model using intelligent algorithms, characterized in that, The method includes: Obtain summary text corresponding to multiple information parameters; each of the information parameters is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each of the information parameters and the corresponding context text; Based on pre-constructed target prompts, obtain the entities of each of the first intelligent algorithms and the relationship information between each entity; A first question-answer pair dataset is constructed based on the summary text, each of the entities, and the relationship information. Based on the first question and answer, a pre-set language model is trained on the dataset to obtain the pre-trained language model; The pre-trained language model is used to extract knowledge from the second intelligent algorithm to obtain the knowledge of the intelligent algorithm. Before obtaining the entities of each of the first intelligent algorithms and the relationship information between each entity based on the pre-constructed target prompt words, the method further includes a step of constructing the target prompt words, the step of constructing the target prompt words including: The first initial prompt word is constructed based on the type of information to be extracted and the data format of the information to be extracted in the dataset; The first initial prompt word is used to obtain information about the preset training intelligent algorithm to obtain the training result; If the training result meets the preset conditions, then the first initial prompt word is determined as the target prompt word; If the training result does not meet the preset conditions, the process of adjusting the wording and structure of the first initial prompt word is repeated to obtain the adjusted first initial prompt word; the adjusted first initial prompt word is edited according to the preset prompt word template, the information to be extracted, and the preset target information to obtain the second initial prompt word; the second initial prompt word is used as the new first initial prompt word, and the information of the preset training intelligent algorithm is obtained using the first initial prompt word to obtain the training result, until the training result meets the preset conditions, and then the final second initial prompt word is determined as the target prompt word; wherein, the second initial prompt word is a dynamic prompt word; The step of training a pre-defined language model based on the first question-and-answer dataset to obtain the pre-trained language model includes: Obtain additional training parameters, including training mode information and training prompt information; The pre-trained language model is trained based on the additional training parameters and the first question-answer pair dataset to obtain the pre-trained language model.
2. The method according to claim 1, characterized in that, The process of obtaining the summary text corresponding to multiple information parameters includes: Obtain each of the information parameters corresponding to the first intelligent algorithm; Generate corresponding summary text based on each of the aforementioned information parameters.
3. The method according to claim 2, characterized in that, Before generating the corresponding summary text based on each of the information parameters, the method further includes: Each of the aforementioned information parameters undergoes data cleaning and data format standardization to obtain preprocessed information parameters; the preprocessed information parameters are in text form and are used as parameter text; Each parameter text is categorized into its corresponding paragraph to obtain categorized text; each paragraph corresponds to an information topic. The step of generating corresponding summary text based on each of the information parameters includes: Generate corresponding summary texts based on each of the categorized texts.
4. The method according to claim 1, characterized in that, The step of constructing the first question-answer pair dataset based on the summary text, each of the entities, and the relationship information includes: Multiple question-and-answer text pairs are constructed based on the summary text, each entity, and the relationship information, and each question-and-answer text pair serves as the first question-and-answer pair dataset.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: A knowledge base is constructed using the knowledge from the aforementioned intelligent algorithm. Based on the intelligent algorithm knowledge in the knowledge base, perform at least one of the following steps: Construct an intelligent algorithm knowledge graph based on the intelligent algorithm knowledge in the knowledge base; Alternatively, the dependency information between the various second intelligent algorithms can be obtained based on the intelligent algorithm knowledge in the knowledge base; Alternatively, a second question-answer pair dataset can be constructed based on the intelligent algorithm knowledge in the knowledge base.
6. A knowledge extraction device based on a pre-trained language model using intelligent algorithms, characterized in that, The apparatus is used to implement the intelligent algorithm knowledge extraction method based on a pre-trained language model as described in claim 1, and the apparatus includes: A text acquisition unit is used to acquire summary text corresponding to multiple information parameters; each of the information parameters is a parameter corresponding to multiple first intelligent algorithms, and the summary text includes the meaning text of each of the information parameters and the corresponding context text. The information acquisition unit is used to acquire the entities of each of the first intelligent algorithms and the relationship information between each entity based on the pre-constructed target prompt words; A dataset construction unit is used to construct a first question-answer pair dataset based on the summary text, each of the entities, and the relationship information. The model training unit is used to train a preset language model on the dataset based on the first question and answer, so as to obtain the pre-trained language model. The knowledge extraction unit is used to extract knowledge from the second intelligent algorithm using the pre-trained language model to obtain the knowledge of the intelligent algorithm.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.