Keyword generation method, electronic equipment and computer readable storage medium
By obtaining device configuration information, using configuration databases and large language models to generate target keywords and parameters, the problem of inflexible and accurate generation in the existing technology is solved, and more efficient automated script development is achieved.
Patent Information
- Application Number
- CN202410144537.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the keyword and parameter generation method is not flexible enough and the generation is not accurate enough, which affects the efficiency and quality of automated script development.
By obtaining device configuration information, using the preset configuration database to determine the target corpus entries, and combining the large language model to generate target keywords and parameters, avoiding hard-coded methods, and using similarity matching and large language model inference transformation.
Improve the accuracy and flexibility of keyword and parameter generation, and improve the efficiency and quality of automated script development.
Smart Images

Figure CN120407864A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to, but are not limited to, the field of data processing technology, and in particular to a keyword generation method, an electronic device, and a computer-readable storage medium. Background Art
[0002] When testing embedded software, such as routers and switches, it's often necessary to input a large number of device configurations for initial environment configuration. When developing automated scripts, these device configurations need to be converted into keywords within the scripts. However, the methods used in related technologies for generating keywords and parameters are not flexible enough, and parameter generation is not accurate enough. Summary of the Invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present application provide a keyword generation method, an electronic device, and a computer-readable storage medium, which can solve the problems of insufficient flexibility in the generation of keywords and parameters and insufficient accuracy in parameter generation.
[0005] In a first aspect, an embodiment of the present application provides a keyword generation method, the method comprising:
[0006] Get the configuration information of the device to be converted;
[0007] Determining a target corpus entry based on the configuration information and a preset configuration database, wherein the preset configuration database includes at least one corpus entry, the corpus entry being used to represent a correspondence between a device configuration and keyword association information, the keyword association information including a keyword and a parameter corresponding to the keyword;
[0008] A target keyword and a target parameter corresponding to the target keyword are generated according to the target corpus item, the configuration information and a preset large language model.
[0009] In a second aspect, an embodiment of the present application provides an electronic device, including:
[0010] at least one processor;
[0011] at least one memory for storing at least one program;
[0012] When at least one of the programs is executed by at least one of the processors, the keyword generating method described above is implemented.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the keyword generation method as described above.
[0014] Embodiments of the present application include: in the process of keyword generation, first obtain the configuration information of the device to be converted; then determine the target corpus entry according to the configuration information and a preset configuration database, where the preset configuration data includes at least one corpus entry, and the corpus entry is used to represent the corresponding relationship between device configuration and keyword association information, and the keyword association information includes a keyword and parameters corresponding to the keyword; finally, the target keyword and the target parameters corresponding to the target keyword can be generated according to the target corpus entry, the configuration information, and a preset large language model. According to the technical solution provided by the embodiments of the present application, first use the configuration database to determine the corpus entry, and then use the large language model for inference conversion, so that the parameter generation process can be more accurate; and it avoids using the hard-coded method and can be flexibly applied to the automated script development of various devices and other scenarios that require keyword generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings are used to provide a further understanding of the technical solution of the present application, and constitute a part of the specification. They are used together with the embodiments of the present application to explain the technical solution of the present application, and do not constitute a limitation to the technical solution of the present application.
[0016] Figure 1 is a flowchart of a keyword generation method provided by an embodiment of the present application;
[0017] Figure 2 is a flowchart of determining the target corpus entry provided by an embodiment of the present application;
[0018] Figure 3 is a flowchart of determining the target similarity corpus entry provided by an embodiment of the present application;
[0019] Figure 4 is a flowchart of generating the target keyword and the parameters corresponding to the keyword provided by an embodiment of the present application;
[0020] Figure 5 is a flowchart of determining the relevant corpus entry provided by an embodiment of the present application;
[0021] Figure 6 is a flowchart of a keyword generation method provided by another embodiment of the present application;
[0022] Figure 7 is a flowchart of performing verification processing on the target keyword and the target parameters provided by an embodiment of the present application;
[0023] Figure 8 is a flowchart of performing verification processing on the target keyword and the target parameters provided by another embodiment of the present application;
[0024] Figure 9 is a flowchart for adjusting a large language model provided by an embodiment of the present application;
[0025] Figure 10 is a flowchart for adjusting a large language model provided by another embodiment of the present application;
[0026] Figure 11 is a flowchart for adjusting prompt words provided by an embodiment of the present application;
[0027] Figure 12 is a flowchart for constructing a configuration database provided by an embodiment of the present application;
[0028] Figure 13 is a flowchart for determining target corpus entries provided by another embodiment of the present application;
[0029] Figure 14 is a schematic diagram of the architecture of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0030] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] It should be noted that although functional module division is performed in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different module division in the device or a different order in the flowchart. Terms such as "first" and "second" in the description of the specification, claims and the above drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.
[0032] In the description of the present application, the meaning of "several" is one or more, the meaning of "multiple" is two or more, "greater than", "less than", "exceeding", etc. are understood as not including the number itself, and "above", "below", "within", etc. are understood as including the number itself. If there is a description of "first" and "second", it is only for the purpose of distinguishing technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence of the indicated technical features.
[0033] In the description of the present application, unless otherwise clearly defined, words such as "set", "installed", "connected", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present application in combination with the specific content of the technical solution.
[0034] The embodiments of the present application provide a keyword generation method, an electronic device, and a computer-readable storage medium. During the keyword generation process, first, the configuration information of the device to be converted is obtained; then, according to the configuration information and a preset configuration database, the target corpus entry is determined. The preset configuration database includes at least one corpus entry, and the corpus entry is used to represent the relationship between the device configuration and the keyword association information. The keyword association information includes a keyword and the parameter corresponding to the keyword; finally, the target keyword and the target parameter corresponding to the target keyword can be generated according to the target corpus entry, the configuration information, and a preset large language model. According to the technical solution provided by the embodiments of the present application, first, the corpus entry is determined by using the configuration database, and then the large language model is used for inference and conversion, so that the parameter generation process can be more accurate; and the use of hard coding is avoided, and it can be flexibly applied to the automated script development of various devices and other scenarios that require keyword generation.
[0035] The following further elaborates on the embodiments of the present application with reference to the accompanying drawings.
[0036] As Figure 1 shown, a flowchart of a keyword generation method provided by an embodiment of the first aspect of the present application is shown. The method includes but is not limited to step S100, step S200, and step S300.
[0037] Step S100, obtaining the configuration information of the device to be converted;
[0038] Step S200, determining the target corpus entry according to the configuration information and the preset configuration database, where the preset configuration database includes at least one corpus entry, and the corpus entry is used to represent the corresponding relationship between the device configuration and the keyword association information, and the keyword association information includes a keyword and the parameter corresponding to the keyword;
[0039] Step S300, generating the target keyword and the target parameter corresponding to the target keyword according to the target corpus entry, the configuration information, and the preset large language model.
[0040] In an embodiment of the present application, during the process of keyword generation, first obtain the configuration information of the device to be converted; then determine the target corpus entry according to the configuration information and a preset configuration database, where the preset configuration data includes at least one corpus entry, and the corpus entry is used to represent the correspondence between device configuration and keyword association information, and the keyword association information includes a keyword and a parameter corresponding to the keyword; finally, the target keyword and the target parameter corresponding to the target keyword can be generated according to the target corpus entry, the configuration information, and a preset large language model. According to the technical solution provided by the embodiment of the present application, first use the configuration database to determine the corpus entry, and then use the large language model for inference conversion, so that the parameter generation process can be more accurate; and it avoids using the hard-coded method and can be flexibly applied to the automated script development of various devices and other scenarios that require keyword generation.
[0041] It should be noted that the device to be converted is the device that needs to be software-tested; during the process of testing the device, a large amount of device configuration needs to be input for initial environment configuration, and during the process of automated script development for environment configuration, the input device configuration needs to be converted into keywords in the corresponding script. Among them, the device to be converted can be a router, a switch, or other data exchange devices, which is not limited here. The configuration information can be a set of instructions for operating the device to be converted.
[0042] It should be noted that the target corpus entry can be determined by performing a similarity matching process on the configuration information and the preset configuration database; where the configuration database includes at least one corpus entry, and the corpus entry is used to represent the relationship between device configuration and keyword association information, and the keyword association information includes a keyword and a parameter corresponding to the keyword, that is, each device configuration corresponds to a keyword and a parameter, and different device configurations can also correspond to the same keyword, but the parameters corresponding to different device configurations are different. Among them, the keyword can be an action or a function, which is not limited here.
[0043] It should be noted that the large language model is an artificial intelligence model. The large language model is a super-large deep learning model pre-trained based on a large amount of data. Its underlying converter is a set of neural networks, and these neural networks are composed of an encoder and a decoder with self-attention functions; the encoder and decoder can extract the meaning from a series of texts and understand the relationship between words and phrases. The large language model can quickly generate text, so that in the embodiment of the present application, the rapid generation of device configuration to keywords and the parameters corresponding to the keywords can be quickly realized, improving the generation efficiency of keywords and parameters.
[0044] It should be noted that this application is applicable to any scenario of generating keywords through input device configuration in automatic script development; in this process, this application mainly utilizes large language models to achieve generation; it can also be achieved through similarity matching in machine learning or regular expressions in coding. During the corresponding automatic script development process, these device configurations need to be converted into corresponding keywords in the script. By using the method of the embodiment of this application, the rapid generation from device configuration to script keywords and parameters can be quickly realized, which can not only improve the efficiency of automatic script development, but also improve the standardization and quality of automatic scripts.
[0045] It should be noted that based on the above technical solution, during the process of various automatic script developments, by inputting the description information of the device configuration, the corresponding keywords can be quickly generated, and then the script development can be completed.
[0046] As Figure 2 shown, the configuration database includes a vector database and a corpus database, and the above step S200 may include but is not limited to step S210 and step S220.
[0047] Step S210, in the configuration database according to the configuration information, determine the target similarity corpus entry with the highest similarity to the configuration information, and the target keyword information corresponding to the target similarity corpus entry;
[0048] Step S220, in the corpus database, determine the target corpus entry corresponding to the target keyword information, where the corpus data in the vector database is obtained by vectorizing the corpus data in the corpus database.
[0049] In the embodiment of this application, during the process of determining the target corpus entry, first, in the configuration database according to the configuration information, determine the target similarity corpus entry with the highest similarity to the configuration information, and determine the corresponding target keyword information from the target similarity corpus entry; finally, determine the target corpus entry corresponding to the target keyword information from the corpus database; determine the target similarity corpus entry with the highest similarity to the configuration information in the configuration database according to the configuration information to implement the preliminary matching process of the configuration information and prepare the premise for subsequent keyword generation. From the corpus database, determine the target corpus entry corresponding to the target keyword information according to the target keyword information, so that the obtained target corpus entry can be more accurate.
[0050] It should be noted that the corpus data in the vector database is obtained after vectorizing the corpus data in the corpus database; and in the process of determining the target corpus entry according to the configuration information and the preset configuration database, first, according to the configuration information, the target similarity corpus entry with the highest similarity can be matched in the vector database, where the target similarity corpus entry contains the target keyword information; then, through the determined target keyword information, the target corpus entry corresponding to the target keyword information can be determined from the corpus database; first, the target similarity corpus entry with the highest similarity is determined by means of similarity matching, and then the target corpus entry with the highest relevance to the target keyword information is filtered from the corpus database, so that the matched target corpus entry can be more accurate, and thus the subsequent keyword and parameter generation can be more accurate.
[0051] As Figure 3 shown, the above step S210 may include but is not limited to step S211 and step S212.
[0052] Step S211, performing vectorization processing on the configuration information to obtain vectorized configuration information;
[0053] Step S212, performing similarity calculation on the corpus data in the vector database and the vectorized configuration information, and determining the corpus data with the highest similarity to the vectorized configuration information in the vector database as the target similarity corpus entry.
[0054] In the embodiment of the present application, in the process of determining the target similarity corpus entry with the highest similarity to the configuration information, first, vectorization processing on the configuration information can obtain vectorized configuration information; then, performing similarity calculation on the corpus data in the vector database and the vectorized configuration information can determine the corpus data with the highest similarity to the vectorized configuration information in the vector database, and determining this corpus data as the target similarity corpus entry.
[0055] It should be noted that in the process of performing similarity matching processing, first, the configuration information needs to be vectorized because only in the vector database can the similarity matching operation be realized; and in the process of performing similarity calculation on the corpus data in the vector database and the vectorized configuration information, multiple similarity calculations can be performed to screen out the target similarity corpus entry with the highest similarity.
[0056] It should be noted that the similarity calculation includes similarity matching methods, where the vector database can adopt clustering algorithms, such as the calculation of Euclidean distance or cosine similarity.
[0057] As Figure 4 shown, the above step S300 may include but is not limited to step S310, step S320 and step S330.
[0058] Step S310, determine the top K relevant corpus entries with the highest similarity to the configuration information from the target corpus entries, and use the K relevant corpus entries as sample examples;
[0059] Step S320, determine the prompt words based on the sample examples, the configuration information, and the preset task information;
[0060] Step S330, input the prompt words into the large language model for inference conversion to obtain the target keyword and the target parameter corresponding to the target keyword.
[0061] In some embodiments of the present application, in the process of generating the target keyword and the target parameter corresponding to the target keyword, first determine the top K relevant corpus entries with the highest similarity to the configuration information from the target corpus entries, then use the K relevant corpus entries as sample examples; then determine the prompt words based on the sample examples, the configuration information, and the preset task information; finally, input the prompt words into the large language model for inference conversion to obtain the target keyword and the target parameter corresponding to the target keyword.
[0062] It should be noted that determining the top K relevant corpus entries with the highest similarity to the configuration information from the target corpus entries, that is, further screening and processing the target corpus entries, so that the selected relevant corpus entries can be more accurate; through the above method, the sample examples can be well simplified, reducing the sample data to improve the efficiency of keyword generation; and since the large language model has a context length limit, further simplifying the target corpus entries can meet the input requirements of the large language model. Wherein, K is greater than or equal to 1.
[0063] It should be noted that in the process of using the large language model for inference conversion, an initial question or sentence needs to be provided, and this question or sentence can be regarded as the prompt word.
[0064] Such as Figure 5 shown, the above step S310 may include but is not limited to step S311 and step S312.
[0065] Step S311, perform vectorization processing on the target corpus entries to obtain vectorized corpus information;
[0066] Step S312, perform similarity calculation in the vectorized corpus information according to the configuration information to obtain K relevant corpus entries.
[0067] In some embodiments of the present application, in the process of determining the top K relevant corpus entries with the highest similarity to the configuration information from the target corpus entries, first, the target corpus entries are vectorized to obtain vectorized corpus information; then, similarity calculation processing is performed on the vectorized corpus information according to the configuration information to obtain K relevant corpus entries. In the above steps, a similarity matching process is performed on the target corpus entries again, and relevant corpus entries are screened out by means of similarity calculation, so that the samples input into the large language model can be well simplified. This can not only make the generation of subsequent keywords and parameters more accurate, but also well meet the input requirements of the large language model.
[0068] As Figure 6 shown, after executing the above step S300, it may further include, but is not limited to, step S410, step S420, and step S430.
[0069] Step S410, perform verification processing on the target keyword and the target parameter;
[0070] Step S420, when the result of the verification processing is verification passed, use the target keyword and the target parameter as the final output result;
[0071] Step S430, when the result of the verification processing is verification failed, adjust at least one of the large language model and the prompt to generate a new target keyword and the corresponding target parameter.
[0072] In some embodiments of the present application, after generating the target keyword and the target parameter corresponding to the target keyword, in order to reduce the uncertainty of the large language model, it is also necessary to perform verification processing on the generated target keyword and the target parameter corresponding to the target keyword to determine whether the generated target keyword and the target parameter corresponding to the target keyword are accurate. When the result of the verification processing is verification passed, the generated target keyword and the target parameter corresponding to the target keyword can be used as the final output result; when the result of the verification processing is verification failed, at least one of the large language model and the prompt will be adjusted to generate a new target keyword and the target parameter corresponding to the target keyword until the generated target keyword and the target parameter corresponding to the target keyword can pass the verification; in the above manner, the accuracy of the generated keyword and the parameter corresponding to the keyword can be well improved.
[0073] As Figure 7 and Figure 8 shown, the above step S410 may at least include step S411 or step S412.
[0074] Step S411: Perform format checks on the target keyword and target parameter based on a preset regular expression, and determine that the result of the format check passes when the target keyword and target parameter meet the preset format conditions.
[0075] Step S412: Generate simulated device configuration information based on the target keyword and target parameter, and compare the simulated device configuration information with the configuration information. Determine that the result of the verification process passes when the simulated device configuration information is consistent with the configuration information.
[0076] In some embodiments of the present application, during the verification of the target keyword and the target parameter corresponding to the target keyword, format detection processing can be performed on the target keyword and the target parameter based on a preset regular expression, and when the target keyword and the target parameter both meet the preset format conditions, it is determined that the result of the format check passes; it is also possible to generate simulated device configuration information based on the target keyword and the target parameter, and compare the simulated device configuration information with the configuration information. When the simulated device configuration information is consistent with the configuration information, it is determined that the result of the verification process passes; when the simulated device configuration information is inconsistent with the configuration information, it is determined that the result of the verification process fails. Through the above two verification methods, the generated keyword and the parameter corresponding to the keyword can be verified, and the accuracy of the generated keyword and the parameter corresponding to the keyword can be improved.
[0077] It should be noted that during the verification process of the target keyword and the target parameter, format checks can be performed on the target keyword and the target parameter based on a preset regular expression and simulated device configuration information can be generated based on the target keyword and the target parameter at the same time, and the simulated device configuration information is compared with the configuration information; when the above two methods are used to verify the target keyword and the target parameter at the same time, the verification can be made more accurate.
[0078] As Figure 9 shown, during the process of adjusting the large language model, it can include but is not limited to step S431.
[0079] Step S431: Adjust the temperature parameter of the large language model, where the temperature parameter is used to adjust the prediction word probability of the output layer of the large language model.
[0080] In some embodiments of the present application, during the process of adjusting the large language model, the temperature parameter of the large language model can be adjusted, where the temperature parameter can be used to adjust the prediction word probability of the output layer of the large language model; during the process of adjusting the large language model, the temperature parameter of the large language model can be adjusted, so that by inputting the prompt into the large language model with adjusted parameters, new target keywords and target parameters corresponding to the target keywords can be obtained.
[0081] As Figure 10 shown, during the process of adjusting the large language model, it may include but is not limited to step S432.
[0082] Step S432, adjusting the large language model based on the corpus database.
[0083] In some embodiments of the present application, during the process of adjusting the large language model, the large language model can be adjusted based on the corpus, and then by inputting the prompt into the adjusted large language model, new target keywords and target parameters corresponding to the target keywords can be obtained.
[0084] As Figure 11 shown, during the process of adjusting the prompt, it may include but is not limited to step S433.
[0085] Step S433, adjusting the content of the prompt.
[0086] In some embodiments of the present application, in the case where the generated target keywords and the parameters corresponding to the target keywords do not pass the verification, the content of the prompt input into the large language model can also be adjusted; exemplarily, since the prompt can be determined through sample examples, configuration information, and task information, the task information can be adjusted, and thus the content of the prompt can be adjusted.
[0087] As Figure 12 shown, before executing step S200, it may also include but is not limited to step S110, step S120, and step S130.
[0088] Step S110, obtaining a plurality of original device configuration information and original keyword association information, where the original device configuration information corresponds to the original keyword association information, and the original keyword association information includes original keywords and original parameters corresponding to the original keywords;
[0089] Step S120, determining the correspondence between the original device configuration information and the original keyword association information as the original corpus entry;
[0090] Step S130: Construct a configuration database based on multiple original corpus entries.
[0091] In some embodiments of the present application, during the process of constructing the configuration database, first obtain multiple original device configuration information and the corresponding original keyword association information; wherein, the original keyword association information may include the original keyword and the original parameters corresponding to the original keyword; determine the correspondence between the original device configuration information and the original keyword association information as the original corpus entry; finally, based on multiple original corpus entries, the corresponding configuration database can be constructed, laying a prerequisite for subsequent matching of target corpus entries.
[0092] It should be noted that one original device configuration information corresponds to one original keyword information, and the corresponding original keyword information in turn corresponds to one original parameter; the relationship existing among the above three parameters can be recognized as one original corpus entry; based on the obtained multiple original corpus entries, the configuration database can be constructed. The configuration database includes a vector database and a corpus database, and the corpus data in the corpus database can be vectorized and used as the corpus entries of the vector database.
[0093] As Figure 13 shown, the configuration database includes a corpus database, and the above step S200 may further include but is not limited to step S230.
[0094] Step S230: When the total data volume of the corpus data in the corpus database is within the input length threshold of the preset large language model, determine the corpus data in the corpus database as the target corpus entry.
[0095] In some embodiments of the present application, during the process of determining the target corpus entry, if the total data volume of the corpus data in the corpus database is within the input length threshold of the preset large language model, the corpus data in the corpus database can be determined as the target corpus entry, and the entire corpus database can be used as part of the prompt to filter samples using the large language model.
[0096] In addition, as Figure 14 shown, an embodiment of the present application further provides an electronic device 700, which includes:
[0097] A memory 720, a processor 710, and a computer program stored on the memory 720 and executable on the processor 710.
[0098] The processor 710 and the memory 720 can be connected through a bus or other means.
[0099] It should be noted that the electronic device 700 in this embodiment and the keyword generation method in the above embodiment belong to the same inventive concept. Therefore, these embodiments have the same implementation principles and technical effects, which will not be elaborated here.
[0100] The non-transitory software program and instructions required to implement the keyword generation method of the above embodiment are stored in the memory 720. When executed by the processor 710, the keyword generation method in the above embodiment is executed. For example, the Figure 1 method steps S100 to S300 described above, Figure 2 the method steps S210 to S220 in Figure 3 the method steps S211 to S212 in Figure 4 the method steps S310 to S330 in Figure 5 the method steps S311 to S312 in Figure 6 the method steps S410 to S430 in Figure 7 the method step S411 in Figure 8 the method step S412 in Figure 9 the method step S431 in Figure 10 the method step S432 in Figure 11 the method step S433 in Figure 12 the method steps S110 to S130 and Figure 13 the method step S230 in
[0101] In addition, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor 710, for example, by a processor 710 in the above embodiment of the electronic device 700, the processor 710 can be caused to execute the keyword generation method in the above embodiment. For example, the Figure 1 method steps S100 to S300 described above, Figure 2 the method steps S210 to S220 in Figure 3 the method steps S211 to S212 in Figure 4 the method steps S310 to S330 in Figure 5 the method steps S311 to S312 in Figure 6 the method steps S410 to S430 in Figure 7 the method step S411 in Figure 8 the method step S412 in Figure 9 the method step S431 in Figure 10 the method step S432 in Figure 11Method step S433 in Figure 12 Method steps S110 to S130 in Figure 13 and method step S230 in
[0102] Those of ordinary skill in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory, or other memory technologies, CD-ROM, digital versatile disk (DVD), or other optical disk storage, magnetic cassettes, tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.
[0103] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the above embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A keyword generation method, comprising: Obtaining the configuration information of the device to be converted; Determining a target corpus entry according to the configuration information and a preset configuration database, wherein the preset configuration database includes at least one corpus entry, and the corpus entry is used to represent the correspondence between device configuration and keyword association information, and the keyword association information includes a keyword and a parameter corresponding to the keyword; Generating a target keyword and a target parameter corresponding to the target keyword according to the target corpus entry, the configuration information and a preset large language model.
2. The keyword generation method according to claim 1, characterized in that The configuration database includes a vector database and a corpus database. The determining a target corpus entry according to the configuration information and the preset configuration database includes: Determining, in the configuration database according to the configuration information, a target similarity corpus entry with the highest similarity to the configuration information, and target keyword information corresponding to the target similarity corpus entry; Determining, from the corpus database, a target corpus entry corresponding to the target keyword information, wherein the corpus data in the vector database is obtained by vectorizing the corpus data in the corpus database.
3. The keyword generation method according to claim 2, wherein The determining, in the configuration database according to the configuration information, a target similarity corpus entry with the highest similarity to the configuration information includes: Performing vectorization processing on the configuration information to obtain vectorized configuration information; Performing similarity calculation on the corpus data in the vector database and the vectorized configuration information, and determining the corpus data with the highest similarity to the vectorized configuration information in the vector database as the target similarity corpus entry.
4. The keyword generation method according to claim 1, wherein The generating a target keyword and a target parameter corresponding to the target keyword according to the target corpus entry, the configuration information and a preset large language model includes: Determining K relevant corpus entries with the highest similarity to the configuration information from the target corpus entry, and using the K relevant corpus entries as sample examples; Determining a prompt word according to the sample examples, the configuration information and a preset task information; Inputting the prompt word into the large language model for inference conversion to obtain the target keyword and the target parameter corresponding to the target keyword.
5. The keyword generation method according to claim 4, characterized in that, The determining K relevant corpus entries with the highest similarity to the configuration information from the target corpus entry includes: Performing vectorization processing on the target corpus entry to obtain vectorized corpus information; Performing similarity calculation in the vectorized corpus information according to the configuration information to obtain K relevant corpus entries.
6. The keyword generation method according to claim 4, wherein After generating the target keyword and the target parameter corresponding to the target keyword according to the target corpus entry, the configuration information and a preset large language model, the method further includes: Performing verification processing on the target keyword and the target parameter; In the case that the result of the verification processing is verification passed, using the target keyword and the target parameter as the final output result; In the case where the result of the verification process fails the verification, at least one of the large language model and the prompt is adjusted to generate a new target keyword and the corresponding target parameter.
7. The keyword generation method according to claim 6, wherein The verification process for the target keyword and the target parameter includes at least one of the following: Performing a format check on the target keyword and the target parameter based on a preset regular expression, and determining that the result of the format check passes the verification when the target keyword and the target parameter meet the preset format conditions; Generating simulated device configuration information based on the target keyword and the target parameter, and comparing the simulated device configuration information with the configuration information. When the simulated device configuration information is consistent with the configuration information, determining that the result of the verification process passes the verification.
8. The keyword generation method according to claim 6, wherein The adjustment process for the large language model includes at least one of the following: Adjusting the temperature parameter of the large language model, where the temperature parameter is used to adjust the prediction word probability of the output layer of the large language model; Adjusting the large language model based on the corpus database.
9. The keyword generation method according to claim 6, wherein The adjustment process for the prompt includes: Adjusting the content of the prompt.
10. The keyword generation method according to claim 1, wherein Before determining the target corpus entry according to the configuration information and the preset configuration database, the method further includes: Obtaining a plurality of original device configuration information and original keyword association information, where the original device configuration information corresponds to the original keyword association information, and the original keyword association information includes an original keyword and an original parameter corresponding to the original keyword; Determining the correspondence between the original device configuration information and the original keyword association information as an original corpus entry; Constructing the configuration database based on a plurality of the original corpus entries.
11. The keyword generation method according to claim 1, wherein The configuration database includes a corpus database. Determining the target corpus entry according to the configuration information and the preset configuration database includes: When the total amount of corpus data in the corpus database is within the input length threshold of the preset large language model, determining the corpus data in the corpus database as the target corpus entry.
12. An electronic device, characterized in that, Includes: At least one processor; At least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the keyword generation method according to any one of claims 1 to 11 is implemented.
13. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the keyword generation method according to any one of claims 1 to 11.