Command recommendation method and device of script editor and computer equipment
By receiving the command fragments to be associated in the data development editor, matching and scoring commands, and using the pre-trained query model to obtain recommended commands, the problem of low script editing in the existing technology is solved and more efficient script editing is achieved.
Patent Information
- Application Number
- CN202411868084.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-25
AI Technical Summary
Existing data development editors mainly rely on manual editing scripts, resulting in low editing efficiency.
By receiving the command fragment to be associated during the editing script, matching the commands in the specified command list, using the pre-trained query model to extract the low-order and high-order combination characteristics of the command, scoring and selecting the highest-rated command as the target command.
It realizes the rapid acquisition of recommended commands through artificial intelligence, improves script editing efficiency, and solves the problem of low script editing efficiency in the existing technology.
Smart Images

Figure CN119883225A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data development technology, and in particular to a command recommendation method, device and computer equipment for a script editor. Background Art
[0002] With the rapid development and popularization of computer and information technology, the scale of industry application systems has expanded rapidly, and the data generated by industry applications has exploded. Industry / enterprise big data has far exceeded the processing capabilities of existing traditional computing technology and information systems. Therefore, seeking effective big data processing technologies, methods and means has become an urgent need in the real world. Due to the urgency and importance of big data processing needs, big data technology has received high attention and attention in recent years. Data development, as a tool for big data processing, is becoming increasingly important. The importance of easy-to-use data development editors is obvious. However, since existing data development editors mainly use manual editing scripts, professionals are required to input a large number of editing commands, and the editing efficiency is low. Summary of the invention
[0003] The embodiments of the present application provide a command recommendation method, apparatus, and computer device for a script editor to at least solve the technical problem of low script editing efficiency in the related art.
[0004] According to one aspect of an embodiment of the present application, a command recommendation method for a script editor is provided, comprising: receiving a command fragment to be associated in a script editing process; matching the command fragment to be associated with commands in a specified command list, and selecting a first number of commands with the highest relevance to the command fragment from the specified command list; extracting low-order combined features and high-order combined features of the first number of commands using a pre-trained query model; scoring the first number of commands based on the low-order combined features and the high-order combined features, and selecting a second number of commands with the highest scores from the first number of commands; determining a target command of the command fragment to be associated based on the second number of commands, the target command being a command associated with the command fragment to be associated.
[0005] Optionally, matching the command fragment to be associated with commands in a specified command list includes: determining a command type to be matched of the command fragment to be associated in response to a trigger instruction to a target control, wherein the command type includes: a command word and a command line; and selecting a first number of commands with the highest text relevance from the specified command list based on the command type to be matched and an interpreter type of the script.
[0006] Optionally, according to the trigger instruction of the target control, the command type to be matched of the command fragment to be associated is determined, including: when receiving the first trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command word; when receiving the second trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command line.
[0007] Optionally, selecting a first number of commands with the highest text relevance from the designated command list includes: obtaining the word frequency-inverse document frequency vector of the command fragment to be associated in the designated command list; obtaining the word frequency-inverse document frequency vector of each command in the designated command list; determining the cosine similarity between the word frequency-inverse document frequency vector of the command fragment to be associated in the designated command list and the word frequency-inverse document frequency vector of each command in the designated command list as the relevance; and selecting the first number of commands with the highest relevance from the designated command list.
[0008] Optionally, scoring the first number of commands based on the low-order features and the high-order features includes: taking the command fragment to be associated, the user identifier, the interpreter type and the first number of commands as input data, inputting them into the pre-trained query model for analysis, and obtaining an analysis result, wherein the analysis result at least includes: a first prediction value output by a linear part of the pre-trained query model, a second prediction value output by a factor decomposition machine of the pre-trained query model, and a third prediction value output by a deep neural network part of the pre-trained query model, the first prediction value being used to represent a prediction value obtained based on a linear feature prediction of the input data, the second prediction value being used to represent a prediction value obtained based on a combination of low-order features of the input data, and the third prediction value being used to represent a prediction value obtained based on a combination of high-order features of the input data; jointly determining a final prediction value for each command in the first number of commands based on the first prediction value, the second prediction value and the third prediction value; determining a score for each command in the first number of commands based on the final prediction value, the score for each command in the first number of commands being used to represent a degree of correlation between the score for each command in the first number of commands and the command fragment to be associated.
[0009] Optionally, determining the target command of the command fragment to be associated based on the second number of commands includes: determining the second number of commands as recommended commands for display on the interface to be selected; in response to a selection instruction of the interface to be selected, selecting the target command from the recommended commands, and determining the target command as a positive command, and determining non-target commands in the recommended commands as negative commands, wherein the positive command and the negative command are used to update the model parameters of the pre-trained query model.
[0010] Optionally, the method further includes: when the script is not completely input, continuing to determine the target command based on the received command fragment to be associated; when the script is completely input, running the script, and when the script runs successfully, saving all commands contained in the script.
[0011] According to another aspect of an embodiment of the present application, a command recommendation device for a script editor is also provided, including: a receiving module for receiving a command fragment to be associated in a script editing process; a matching module for matching the command fragment to be associated with commands in a specified command list, and selecting a first number of commands with the highest relevance to the command fragment from the specified command list; an extraction module for extracting low-order combined features and high-order combined features of the first number of commands using a pre-trained query model; a scoring module for scoring the first number of commands based on the low-order combined features and the high-order combined features, and selecting a second number of commands with the highest scores from the first number of commands; and a determination module for determining a target command of the command fragment to be associated based on the second number of commands, the target command being a command associated with the command fragment to be associated.
[0012] According to another aspect of the embodiment of the present application, a computer device is also provided, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the command recommendation method of the above-mentioned script editor.
[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the command recommendation method of the above-mentioned script editor by running the computer program.
[0014] According to another aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, which implement the command recommendation method of the script editor when executed by a processor.
[0015] In an embodiment of the present application, a command fragment to be associated in the process of editing a script is received; the command fragment to be associated is matched with commands in a specified command list, and a first number of commands with the highest relevance to the command fragment are selected from the specified command list; a pre-trained query model is used to extract low-order combination features and high-order combination features of the first number of commands; the first number of commands are scored based on the low-order combination features and the high-order combination features, and a second number of commands with the highest scores are selected from the first number of commands; a target command of the command fragment to be associated is determined based on the second number of commands, and the target command is a command associated with the command fragment to be associated, thereby achieving the purpose of quickly obtaining recommended commands using artificial intelligence, thereby achieving the technical effect of improving script editing efficiency, and further solving the technical problem of low script editing efficiency in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a command recommendation method of a script editor according to an embodiment of the present application;
[0018] Figure 2 is a flowchart of a command recommendation method of a script editor according to an embodiment of the present application;
[0019] Figure 3 is a flowchart of another command recommendation method of a script editor according to an embodiment of the present application;
[0020] Figure 4 It is a structural diagram of a command recommendation device of a script editor according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0024] In order to solve the problems existing in the related art, the present application embodiment provides a command recommendation method for a script editor, which can be run on Figure 1 In the computer terminal shown, the computer terminal is explained below.
[0025] The command recommendation method embodiment of the script editor provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a command recommendation method of a script editor. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1More or fewer components as shown, or with Figure 1 Different configurations shown.
[0026] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0027] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the command recommendation method of the script editor in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the command recommendation method of the script editor described above is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0030] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0031] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a command recommendation method for a script editor. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 2 is a flowchart of a command recommendation method of a script editor according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0033] Step S202, receiving a command segment to be associated in the script editing process;
[0034] The command fragment to be associated refers to the command text that the user is currently entering or partially entering in the data development editor. When the user starts to write a script command, instead of entering the entire command, he or she enters a portion of the command text. The command text being entered or edited is the "command fragment to be associated". The command fragment to be associated can be a single command word or part of a command line.
[0035] Step S204, matching the command fragment to be associated with commands in a specified command list, and selecting a first number of commands with the highest relevance to the command fragment from the specified command list;
[0036] The first number can be set according to actual application scenarios, for example: 50.
[0037] It should be noted that, before receiving the command fragment to be associated, the type of interpreter for script editing needs to be determined. Table 1 shows the types of various interpreters.
[0038]
[0039] Table 1
[0040] Step S206, extracting low-order combined features and high-order combined features of the first number of commands using a pre-trained query model;
[0041] In step S206, low-order feature combination: first-order or second-order combination of features. The first-order feature combination is the original feature itself without any combination, while the second-order feature combination takes into account the interaction between two features, that is, the impact of the simultaneous appearance of two features on the model prediction results. For example: the low-order feature combination can consider the single features of user identification and interpreter type, as well as the second-order combination of these two features. For example, when user A uses the Hive interpreter, the Hive commands he uses will constitute a low-order feature combination. This combination can help the model understand the command preferences of a specific user when using a specific type of interpreter.
[0042] High-order feature combination: refers to the third-order or higher-order combination of features, that is, taking into account the complex interactions between three or more features. High-order feature combination can capture the deeper interdependence between features, which is critical for understanding complex data structures and improving the prediction accuracy of the model. High-order feature combination can consider: user name, command usage frequency and command type. For example, when user A uses the Mysql interpreter, he combines the frequency of using the SELECT command with the frequency of using the INSERT command. This combination can help the model understand the user's preferences and usage habits for different types of commands when using a specific interpreter, as well as the mutual influence between these preferences and habits.
[0043] The pre-trained query model can be trained by following the steps below:
[0044] Step 1, define the DeepFM function, the input parameters are linear_feature_columns and dnn_feature_columns, which represent the feature columns of the linear model part and the feature columns of the deep neural network part respectively. Step 2, use the build_input_layers function to build the input layer, that is, create an input layer representing all features (including the linear part and the DNN part). These input layers will be stored in the dense_input_dict and sparse_input_dict dictionaries according to the type of features (dense features or sparse features), which is convenient for subsequent model construction and feature processing. Step 3, filter the features in linear_feature_columns to find out the sparse features (SparseFeat type), which will be used for subsequent 1-dimensional embedding processing. Step 4, collect all input layers (dense feature layers and sparse feature layers) into the input_layers list, ready to be used as the input of the model. Step 5, the get_linear_logits function is used to calculate the logits value of the linear model part, which is the output value before the model prediction. This part of logits is calculated linearly from dense features and sparse features, reflecting the direct impact of features on the output. Step 6, create the embedding_layers dictionary, which contains the embedding layers of all DNN features. These layers will be used to build the FM intersection part and the input of the DNN. The embedding layer can convert sparse features (such as category features) into dense vector representations, which is convenient for subsequent neural network processing. Step 7, filter out the sparse features in dnn_feature_columns to prepare for building the input of the DNN. The get_fm_logits function calculates the logits value of the FM (Factorization Machine) part, focusing on the second-order intersection between features (that is, the impact of two features appearing at the same time), and uses the embedding representation constructed in embedding_layers for calculation. The get_dnn_logits function is responsible for building and calculating the logits value of the DNN (Deep NeuralNetwork) part. This part of the model can learn complex nonlinear relationships between features, including high-order feature combinations. Step 8: Add the logits values of the linear model, FM, and DNN parts to get the final predicted logits value. The Add() function implements this addition operation, that is, merging the outputs of the three parts into one output.Step 9: Use the Activation function to add an activation layer for the final output logits value. The sigmoid activation function is selected here to convert the logits value into a probability value and return the constructed DeepFM model (query model).
[0045] Step S208, scoring the first number of commands based on the low-order combined features and the high-order combined features, and selecting a second number of commands with the highest scores from the first number of commands;
[0046] The second number can be set according to the actual application scenario, for example: 10. It can be understood that the first number is greater than the second number.
[0047] Step S210: determining a target command of the command fragment to be associated based on the second number of commands, wherein the target command is a command associated with the command fragment to be associated.
[0048] The target command can be the complete command text of the command fragment to be associated.
[0049] Through the above steps S202 to S206, by receiving the command fragment to be associated in the script editing process; matching the command fragment to be associated with the commands in the specified command list, selecting the first number of commands with the highest relevance to the command fragment from the specified command list; using a pre-trained query model to extract the low-order combination features and high-order combination features of the first number of commands; scoring the first number of commands based on the low-order combination features and the high-order combination features, and selecting the second number of commands with the highest scores from the first number of commands; determining the target command of the command fragment to be associated based on the second number of commands, the target command being the command associated with the command fragment to be associated, thereby achieving the purpose of using artificial intelligence to quickly obtain recommended commands, thereby achieving the technical effect of improving script editing efficiency, and further solving the technical problem of low script editing efficiency in related technologies. The following is a detailed description.
[0050] In the technical solution provided in step S204 of the command recommendation method of the above-mentioned script editor, the specific steps of comparing the command fragment to be associated with the commands in the specified command list are: in response to a trigger instruction to a target control, determining the command type to be matched of the command fragment to be associated, wherein the command type includes: a command word and a command line; and selecting a first number of commands with the highest text relevance from the specified command list based on the command type to be matched and the interpreter type of the script.
[0051] It should be noted that the target control may be various keys, such as the shift key.
[0052] Among them, according to the trigger instruction of the target control, the command type to be matched of the command fragment to be associated is determined, including: when receiving the first trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command word; when receiving the second trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command line.
[0053] For example, the first trigger instruction is that the shift key is triggered once, and the second trigger instruction is that the shift key is triggered twice.
[0054] In some embodiments of the present application, the specific steps of selecting the first number of commands with the highest text relevance from the specified command list are: obtaining the word frequency-inverse document frequency vector of the command fragment to be associated in the specified command list; obtaining the word frequency-inverse document frequency vector of each command in the specified command list; determining the cosine similarity between the word frequency-inverse document frequency vector of the command fragment to be associated in the specified command list and the word frequency-inverse document frequency vector of each command in the specified command list as the relevance; and selecting the first number of commands with the highest relevance from the specified command list.
[0055] Specifically, TF-IDF (Term Frequency-Inverse Document Frequency) is a statistical method widely used in information retrieval and text mining to evaluate the importance of a word to a document in a document set. In this technical solution, the TF-IDF algorithm is used to retrieve the commands most relevant to the user input. The specific process is as follows: Building an index: First, the historical commands need to be preprocessed and an index based on Elasticsearch is built. Each command is regarded as a document (Document), and each word in the document is regarded as a term (Term). Elasticsearch will index the frequency (TF) of each term in the document and its frequency of occurrence (IDF) in the entire document set. Extracting keywords entered by the user: When the user enters the command fragment to be associated in the data development editor, the system extracts and tokenizes the command fragment entered by the user to form a series of keywords. Calculating TF-IDF weight: Term frequency (TF) calculation: For each keyword entered by the user, the system calculates its frequency in each historical command through the index. The higher the term frequency, the more the word appears in the command, so it is more representative of the command. Inverse Document Frequency (IDF) calculation: Next, the system calculates the inverse document frequency of the keyword, which reflects the prevalence of the keyword in the entire command set. If a keyword appears in many commands, its IDF value will be low; conversely, if a keyword appears in only a few commands, its IDF value will be high, indicating that it is a more discriminative and distinctive word. Calculate the TF-IDF vector of the commands in the specified command list: Each command will generate a TF-IDF vector representation based on the terms it contains and the TF-IDF weight of each term. These vectors are stored in the Elasticsearch index for fast retrieval and comparison. Calculate the TF and IDF values of the command fragment to be associated entered by the user and form a vector. Using the TF-IDF vector, the system calculates the similarity between the user input and the historical commands. Usually, this is done by calculating the cosine similarity between the two vectors. Cosine similarity measures the angle between the two vectors. The smaller the angle (the closer the cosine value is to 1), the higher the similarity; conversely, the larger the angle, the lower the similarity. The historical commands are sorted according to the calculated similarity scores, and the most relevant command words or command lines are selected.
[0056] After selecting a first number of commands, the first number of commands are scored based on the low-order features and the high-order features. Specifically, the command fragment to be associated, the user identifier, the interpreter type and the first number of commands are used as input data and input into the pre-trained query model for analysis to obtain an analysis result, wherein the analysis result at least includes: a first prediction value output by a linear part of the pre-trained query model, a second prediction value output by a factor decomposition machine of the pre-trained query model and a third prediction value output by a deep neural network part of the pre-trained query model, the first prediction value is used to represent a prediction value obtained based on a linear feature prediction of the input data, the second prediction value is used to represent a prediction value obtained based on a combination of low-order features of the input data, and the third prediction value is used to represent a prediction value obtained based on a combination of high-order features of the input data; a final prediction value of each command in the first number of commands is jointly determined based on the first prediction value, the second prediction value and the third prediction value; a score of each command in the first number of commands is determined based on the final prediction value, and the score is used to represent the degree of correlation between the score of each command in the first number of commands and the command fragment to be associated.
[0057] For example: the first prediction value, the second prediction value and the third prediction value are added together to obtain the final prediction value.
[0058] In some embodiments of the present application, determining the target command of the command fragment to be associated based on the second number of commands includes: determining the second number of commands as recommended commands for display on the interface to be selected; in response to a selection instruction of the interface to be selected, selecting the target command from the recommended commands, and determining the target command as a positive command, and determining the non-target command in the recommended commands as a negative command, wherein the positive command and the negative command are used to update the model parameters of the pre-trained query model.
[0059] Optionally, a second number of commands (recommended commands) may be displayed in the display interface of the client, and the user may select the commands, and the selected commands are the target commands.
[0060] When the script is not input completely, continue to determine the target command according to the received command fragment to be associated; when the script is input completely, run the script, and when the script runs successfully, save all commands included in the script.
[0061] The present application embodiment also provides another script editor command recommendation, such as Figure 3 As shown, including:
[0062] Step 1, start script development, enter the interpreter category, put it in the first line of the script file, indicate the interpreter type, if not set, command global search; Step 2, enter the script command, if you need to associate the command word, go to step 3, if you need to match the command line, go to step 4; Step 3, the user presses the matching command word shortcut key (the shortcut key can be set by yourself, such as pressing the shift key once) to enter step 5; Step 4, the user presses the matching command line shortcut key (the shortcut key can be set by yourself, such as setting the shift key twice) to enter step 6; Step 5, query the similar command word list, the historical commands are stored in Elasticsearch, and its matching algorithm uses the TF-IDF text similarity matching algorithm The similarity is calculated by the method. The query conditions are limited to the interpreter such as (hive), type word (matching command words), command usage frequency, and the 50 most relevant command words are queried, and step 7 is entered; step 6, query the list of similar command words, historical commands are stored in Elasticsearch, and its matching algorithm uses the TF-IDF text similarity matching algorithm to calculate the similarity. The query conditions are limited to the interpreter such as (hive), type line (matching command line), command usage frequency, and the 50 most relevant command lines are queried, and step 8 is entered; step 7, enter the command word fragment, user name, interpreter type and other features in step 5 to query the list of 50 words, and enter step Step 9; Step 8, input command line fragment, user name, step 6 query 50 command lists, interpreter type and other features, enter step 9; Step 9, machine learning query engine: use DeepFM model to query, if query command words, enter step 10, if query command lines, enter step 11; Step 10, return 10 command words with the highest scores calculated by the machine learning engine, enter step 12; Step 11, return 10 command lines with the highest scores after the query model, enter step 13; Step 12, the user selects a recommended matching word list, if there is a matching command word, store the forward command word information, and enter step 14, if there is no suitable word, enter step 2 Continue to edit the command, save the negative command word information and go to step 16; Step 13, the user selects a matching command line list. If there is a matching command line, select and go to step 14. If there is no suitable word, go to step 2 to continue editing the command, and save the negative command line information and go to step 16; Step 14, whether the script input is completed and the relevant script needs to be run, if not, go to step 2 to continue editing, if it can be run, go to step 15; Step 15, run the command script, if the run fails, go to step 2 to continue editing; if the run is successful, go to step 16 to save the command; Step 16, store the command: command storage uses Elasticsearch to store, and its word segmenter selects IK word segmenter.It mainly stores interpreter classification, user name, command type, update command usage frequency and other feature values, and stores positive data according to user selection: user selected command line, command word; negative data: eliminated command word, command line. After the command storage is completed, it ends and goes to step 17; step 17, DeepFM model training: at 1 am every day, all positive commands, negative commands and commands entered yesterday are trained according to interpreters, users, and related tags, and the relevant trained model data is pushed to step 9.
[0063] Figure 4 A command recommendation device for a script editor according to an embodiment of the present application, the device comprising:
[0064] A receiving module 40, used for receiving a command segment to be associated in the script editing process;
[0065] A matching module 42, configured to match the command fragment to be associated with commands in a specified command list, and select a first number of commands with the highest relevance to the command fragment from the specified command list;
[0066] An extraction module 44, configured to extract low-order combined features and high-order combined features of the first number of commands using a pre-trained query model;
[0067] A scoring module 46, configured to score the first number of commands based on the low-order combined features and the high-order combined features, and select a second number of commands with the highest scores from the first number of commands;
[0068] The determination module 48 is configured to determine a target command of the command fragment to be associated based on the second number of commands, wherein the target command is a command associated with the command fragment to be associated.
[0069] Through the command recommendation device of the script editor mentioned above, by receiving the command fragment to be associated in the process of editing the script; matching the command fragment to be associated with the commands in the specified command list, selecting a first number of commands with the highest relevance to the command fragment from the specified command list; using a pre-trained query model to extract the low-order combination features and high-order combination features of the first number of commands; scoring the first number of commands based on the low-order combination features and the high-order combination features, and selecting a second number of commands with the highest scores from the first number of commands; determining the target command of the command fragment to be associated based on the second number of commands, the target command being the command associated with the command fragment to be associated, thereby achieving the purpose of quickly obtaining recommended commands using artificial intelligence, thereby achieving the technical effect of improving script editing efficiency, and further solving the technical problem of low script editing efficiency in related technologies.
[0070] The matching module 42 includes: a matching submodule, which is used to match the command fragment to be associated with the commands in the specified command list, including: in response to a trigger instruction to a target control, determining the command type to be matched of the command fragment to be associated, wherein the command type includes: a command word and a command line; based on the command type to be matched and the interpreter type of the script, selecting a first number of commands with the highest text relevance from the specified command list.
[0071] The matching submodule includes: a trigger unit, which is used to determine the command type to be matched of the command fragment to be associated according to the trigger instruction of the target control, including: when receiving the first trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command word; when receiving the second trigger instruction in the trigger instruction, determining that the command type to be matched of the command fragment to be associated is a command line.
[0072] The matching module 42 also includes: a selection submodule, which is used to select a first number of commands with the highest text relevance from the specified command list, including: obtaining the word frequency-inverse document frequency vector of the command fragment to be associated in the specified command list; obtaining the word frequency-inverse document frequency vector of each command in the specified command list; determining the cosine similarity between the word frequency-inverse document frequency vector of the command fragment to be associated in the specified command list and the word frequency-inverse document frequency vector of each command in the specified command list as the relevance; and selecting the first number of commands with the highest similarity from the specified command list.
[0073] The scoring module 46 includes: a scoring submodule, which is used to score the first number of commands based on the low-order combined features and the high-order combined features, including: taking the command fragment to be associated, the user identifier, the interpreter type and the first number of commands as input data, inputting them into the pre-trained query model for analysis, and obtaining an analysis result, wherein the analysis result at least includes: a first prediction value output by the linear part of the pre-trained query model, a second prediction value output by the factor decomposition machine of the pre-trained query model, and a third prediction value output by the deep neural network part of the pre-trained query model, the first prediction value is used to represent the prediction value obtained based on the linear feature prediction of the input data, the second prediction value is used to represent the prediction value obtained based on the low-order feature combination of the input data, and the third prediction value is used to represent the prediction value obtained based on the high-order feature combination of the input data; jointly determining a final prediction value of each command in the first number of commands according to the first prediction value, the second prediction value and the third prediction value; determining a score of each command in the first number of commands based on the final prediction value, and the score is used to represent the degree of correlation between the score of each command in the first number of commands and the command fragment to be associated.
[0074] The determination module 48 includes: a determination submodule, which is used to determine the target command of the command fragment to be associated based on the second number of commands, including: determining the second number of commands as recommended commands for display on the interface to be selected; in response to the selection instruction of the interface to be selected, selecting the target command from the recommended commands, and determining the target command as a positive command, and determining the commands that are not target commands in the recommended commands as negative commands, wherein the positive command and the negative command are used to update the model parameters of the pre-trained query model.
[0075] The determination submodule includes: a determination unit, which is used to continue to determine the target command according to the received command fragment to be associated when the script is not input completely; when the script is input completely, run the script, and when the script runs successfully, save all commands contained in the script.
[0076] It should be noted that Figure 4 The script editor commands shown are recommended for executing Figure 2 The command recommendation method of the script editor shown, therefore the relevant explanations in the above-mentioned command recommendation method of the script editor are also applicable to the command recommendation device of the script editor, and will not be repeated here.
[0077] An embodiment of the present application also provides a computer device, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the command recommendation method of the above-mentioned script editor.
[0078] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the command recommendation method of the above-mentioned script editor by running the computer program.
[0079] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the command recommendation method of the script editor in the present application.
[0080] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0081] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0082] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0083] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0084] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0085] If the integrated unit is implemented in the form of 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 the present application, 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, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0086] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A command recommendation method for a script editor, characterized in that: include: Receiving command fragments to be associated during script editing; Matching the command fragment to be associated with commands in a specified command list, and selecting a first number of commands with the highest relevance to the command fragment from the specified command list; extracting low-order combined features and high-order combined features of the first number of commands using a pre-trained query model; Scoring the first number of commands based on the low-order combined features and the high-order combined features, and selecting a second number of commands with the highest scores from the first number of commands; A target command of the command fragment to be associated is determined based on the second number of commands, where the target command is a command associated with the command fragment to be associated.
2. The method according to claim 1, characterized in that Matching the command fragment to be associated with the commands in the specified command list includes: In response to a trigger instruction to a target control, determining a command type to be matched of the command segment to be associated, wherein the command type includes: a command word and a command line; A first number of commands with the highest text relevance are selected from the specified command list based on the command type to be matched and the interpreter type of the script.
3. The method according to claim 2, characterized in that Determining the command type to be matched of the command fragment to be associated according to the trigger instruction of the target control includes: In the case of receiving a first trigger instruction in the trigger instructions, determining that the command type to be matched of the command segment to be associated is a command word; In case of receiving the second trigger instruction in the trigger instruction, it is determined that the command type to be matched of the command segment to be associated is a command line.
4. The method according to claim 1, characterized in that: Selecting a first number of commands with the highest text relevance from the specified command list includes: Obtaining a word frequency-inverse document frequency vector of the command fragment to be associated in the specified command list; Obtaining a term frequency-inverse document frequency vector for each command in the specified command list; Determine the relevance as the cosine similarity between the word frequency-inverse document frequency vector of the command segment to be associated in the specified command list and the word frequency-inverse document frequency vector of each command in the specified command list; A first number of commands with the highest correlation are selected from the specified command list.
5. The method according to claim 1, characterized in that Scoring the first number of commands based on the low-order combined features and the high-order combined features includes: The command fragment to be associated, the user identifier, the interpreter type and the first number of commands are used as input data, and input into the pre-trained query model for analysis to obtain an analysis result, wherein the analysis result at least includes: a first prediction value output by a linear part of the pre-trained query model, a second prediction value output by a factor decomposition machine of the pre-trained query model and a third prediction value output by a deep neural network part of the pre-trained query model, the first prediction value is used to represent a prediction value obtained based on a linear feature prediction of the input data, the second prediction value is used to represent a prediction value obtained based on a low-order feature combination of the input data, and the third prediction value is used to represent a prediction value obtained based on a high-order feature combination of the input data; Determine a final prediction value of each command in the first number of commands according to the first prediction value, the second prediction value, and the third prediction value; A score for each command in the first number of commands is determined based on the final prediction value, wherein the score for each command in the first number of commands is used to indicate a degree of relevance between the score for each command in the first number of commands and the command fragment to be associated.
6. The method according to claim 1, characterized in that Determining the target command of the command fragment to be associated based on the second number of commands includes: Determine the second number of commands as recommended commands and display them on the interface to be selected; In response to the selection instruction of the interface to be selected, the target command is selected from the recommended commands, and the target command is determined as a positive command, and the non-target command in the recommended commands is determined as a negative command, wherein the positive command and the negative command are used to update the model parameters of the pre-trained query model.
7. The method according to claim 6, characterized in that The method further comprises: When the script is not inputted completely, continue to determine the target command according to the received command fragment to be associated; When the script input is completed, the script is run, and when the script runs successfully, all commands included in the script are saved.
8. A command recommendation device for a script editor, characterized in that: include: A receiving module, used for receiving a command fragment to be associated in the process of editing a script; a matching module, configured to match the command fragment to be associated with commands in a specified command list, and select a first number of commands with the highest relevance to the command fragment from the specified command list; An extraction module, configured to extract low-order combined features and high-order combined features of the first number of commands using a pre-trained query model; a scoring module, configured to score the first number of commands based on the low-order combined features and the high-order combined features, and select a second number of commands with the highest scores from the first number of commands; A determination module is used to determine a target command of the command fragment to be associated based on the second number of commands, wherein the target command is a command associated with the command fragment to be associated.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory is used to store program instructions; The processor is connected to the memory, and is used to execute the command recommendation method of the script editor as described in any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the command recommendation method of the script editor described in any one of claims 1 to 7 is implemented.