Natural language information processing method and device, equipment and storage medium
By using natural language information input and language model prediction, server control in a natural language manner was achieved, solving the problem of low server control efficiency in existing technologies and improving human-computer interaction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, controlling a server requires writing shell commands in the command-line interface, resulting in low control efficiency.
A method for processing natural language information is provided, which receives input operations by displaying a natural language information input entry point, displays a first control command and control feedback information in response to the input operations, uses a language model to predict the intention statement of the natural language information and converts it into a command line interface command to realize server control in a natural language manner.
It improves the efficiency of human-computer interaction, avoids the need to consider the syntactic correctness of command-line interface commands, and simplifies the server control process.
Smart Images

Figure CN121858683A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device and storage medium for processing natural language information. Background Technology
[0002] With the continuous development of computer technology, devices such as terminals and servers are able to perform more diverse functions.
[0003] In related technologies, taking servers as an example, administrators need to write their own shell commands for the server in the command-line interface to control the server.
[0004] However, writing the aforementioned Shell commands is quite complex, and the human-computer interaction for controlling the server is inefficient. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for processing natural language information, the technical solution of which is as follows:
[0006] According to one aspect of this application, a method for processing natural language information is provided, the method being executed by a first computer device, the method comprising:
[0007] The input field for displaying natural language information;
[0008] Receive input operations from the input port, the input operations being used to input natural language information, the natural language information being used to control the second computer device;
[0009] In response to the input operation, a first control command for the second computer device and control feedback information for the second computer device are displayed. The first control command is a command-line interface command for semantically controlling the second computer device based on the natural language information. The control feedback information is used to indicate the execution result of the first control command by the second computer device.
[0010] According to another aspect of this application, a natural language information processing apparatus is provided, the apparatus comprising:
[0011] The display module is used to display the input entry point for natural language information.
[0012] The receiving module is used to receive input operations on the input port, the input operations being used to input natural language information, and the natural language information being used to control the second computer device;
[0013] A processing module is configured to respond to the input operation by displaying a first control command for the second computer device and control feedback information for the second computer device. The first control command is a command-line interface command for semantically controlling the second computer device based on the natural language information. The control feedback information is used to indicate the execution result of the first control command by the second computer device.
[0014] In an optional design of this application, the processing module is further configured to:
[0015] In response to the input operation, a language model is invoked to perform prediction on the natural language information and a first preset statement to obtain the intention statement of the natural language information. The first preset statement is used to instruct the language model to predict the statement intention of the natural language information.
[0016] The language model is invoked to predict the intent statement and the second preset statement to obtain the first control command. The second preset statement is used to instruct the language model to predict the command line interface command corresponding to the intent statement.
[0017] Based on the first control command, the control feedback information is obtained, and the first control command and the control feedback information are displayed.
[0018] In an optional design of this application, the first preset statement includes a first demand statement and / or a first prediction sample;
[0019] The first requirement statement is used to indicate at least one of the statement basis, statement order, and tone of the natural language statement expected to be output by the language model;
[0020] The first prediction sample includes a sample input statement and a sample intent statement. The first prediction sample is used to guide the language model to predict a natural language statement that describes the intent of the natural language information by referring to the correspondence between the sample input statement and the sample intent statement.
[0021] In an optional design of this application, the second preset statement includes a second demand statement and / or a second prediction sample;
[0022] The second requirement statement is used to indicate the command language type of the first control command that is expected to be output by the language model;
[0023] The second prediction sample includes a sample intent statement and a sample output command. The second prediction sample is used to guide the language model to predict the command line interface command corresponding to the intent statement by referring to the correspondence between the sample intent statement and the sample output command.
[0024] In an optional design of this application, the natural language information includes a first sub-statement and a second sub-statement; the receiving module is further configured to:
[0025] Receive the first input operation of the first sub-statement, the first sub-statement being used to control the second computer device;
[0026] In response to the first input operation, a supplementary guidance statement is displayed, which is used to guide the supplementary control of the semantically missing elements of the second computer device;
[0027] Receive a second input operation for the second sub-statement, the second sub-statement having the semantic missing element that is missing in the first sub-statement;
[0028] The first control command and the control feedback information are displayed in response to the second input operation.
[0029] In an optional design of this application, the receiving module is further configured to:
[0030] In response to the first input operation, the language model is invoked to perform prediction on the first sub-statement and the third preset statement to obtain the first reference label and the supplementary guidance statement. The third preset statement is used to instruct the language model to predict whether there are missing elements in the statement intent of the first sub-statement, and to predict the guidance statement for the semantically missing elements.
[0031] The supplementary guiding statement is displayed, and the first reference label is used to indicate that the first sub-statement has missing elements;
[0032] The supplementary guiding statement is obtained by the language model based on the first sub-statement, given that the first reference label has been predicted.
[0033] In an optional design of this application, the subset of the third preset statement includes the first preset statement, which is used to instruct the language model to predict the statement intent of natural language information;
[0034] The first control command for the second computer device is obtained based on an intent statement, which is predicted by the language model when there are no missing elements in the union of the first and second sub-statements.
[0035] In an optional design of this application, the first control command is not part of the candidate command set for rejecting execution by the second computer device; the processing module is further configured to:
[0036] In response to the input operation, a second control command and a rejection message are displayed for the second computer device, the rejection message indicating that the execution of the second control command for the second computer device is refused, the second control command belonging to the candidate command set.
[0037] In an optional design of this application, the processing module is further configured to:
[0038] In response to the input operation, the language model is invoked to perform prediction on the natural language information and the fourth preset statement to obtain the second control command and the first execution label. The fourth preset statement is used to instruct the language model to predict the command line interface command corresponding to the natural language information, and to predict whether the command line interface command corresponding to the natural language information belongs to the candidate command set.
[0039] Based on the first execution label, the rejection information corresponding to the second control command and the first execution label is displayed; the first execution label is used to indicate that the second control command belongs to the candidate command set.
[0040] In an optional design of this application, the set of candidate commands carried by the fourth preset statement includes at least one of the following:
[0041] The commands include: a first command to delete the storage files of the second computer device; a second command to modify the configuration file of the second computer device; a third command to shut down or restart the second computer device; a fourth command to modify the operating permissions of the second computer device; and a fifth command that exceeds the current operating permissions of the second computer device.
[0042] In an optional design of this application, the display module is further configured to:
[0043] The analysis information displayed is used to interpret the control feedback information in natural language.
[0044] In an optional design of this application, the processing module is further configured to:
[0045] The language model is invoked to perform prediction on the first control command, the control feedback information, and the fifth preset statement to obtain the analysis information. The fifth preset statement is used to instruct the language model to predict the reason for obtaining the control feedback information based on the first control command.
[0046] In an optional design of this application, the receiving module is further configured to acquire input operations for chat statement information, wherein the chat statement information has chat semantics in natural language dialogue.
[0047] The processing module is also configured to respond to the input operation of the chat statement information by displaying a chat reply statement, which is a reply to the chat statement information.
[0048] In an optional design of this application, the processing module is further configured to:
[0049] In response to the input operation of the chat statement information, the language model is invoked to perform prediction on the chat statement information and the sixth preset statement to obtain the first intent label of the chat statement information. The sixth preset statement is used to instruct the language model to predict the intent type of the natural language information.
[0050] Based on the first intent tag, the chat reply statement is obtained according to the chat statement information, and the chat reply statement is displayed. The first intent tag is used to indicate that the intent type of the chat statement information is casual conversation.
[0051] In an optional design of this application, the processing module is further configured to:
[0052] In response to the input operation, a language model is invoked to perform prediction on the natural language information and the sixth preset statement to obtain a second intent label for the natural language information;
[0053] The second intent label is used to indicate that the intent type of the natural language information is to control the second computer device, and the first control command and the control feedback information are displayed when the natural language information corresponds to the second intent label.
[0054] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the natural language information processing method as described above.
[0055] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the natural language information processing method described above.
[0056] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor reads from the computer-readable storage medium and executes the computer instructions to implement the natural language information processing method described above.
[0057] The beneficial effects of the technical solution provided in this application include at least the following:
[0058] By providing a natural language input entry point, a functional entry point for controlling a second computer device in a natural language manner is provided. This enables the display of the corresponding command-line interface command and the execution result of the command-line interface command by the second computer device based on the input natural language information. Compared with the control method of writing command-line interface commands in related technologies, the input of natural language information does not need to consider factors such as the correctness of the syntax of the command-line interface command, thus improving the efficiency of human-computer interaction. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;
[0061] Figure 2 This is a schematic diagram of a natural language information processing method provided in an exemplary embodiment of this application;
[0062] Figure 3 This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0063] Figure 4 This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0064] Figure 5 This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0065] Figure 6 This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0066] Figure 7This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0067] Figure 8 This is an interface diagram for processing natural language information provided in an exemplary embodiment of this application;
[0068] Figure 9 This is a flowchart of a natural language information processing method provided in an exemplary embodiment of this application;
[0069] Figure 10 This is a schematic diagram of a language model provided in an exemplary embodiment of this application;
[0070] Figure 11 This is a schematic diagram of a natural language information processing method provided in an exemplary embodiment of this application;
[0071] Figure 12 This is a structural block diagram of a natural language information processing apparatus provided in an exemplary embodiment of this application;
[0072] Figure 13 This is a structural block diagram of a server provided in an exemplary embodiment of this application.
[0073] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0076] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0077] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the natural language information involved in this application was obtained with full authorization.
[0078] It should be understood that although the terms first, second, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, a first parameter may also be referred to as a second parameter without departing from the scope of this disclosure, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0079] First, let's explain some of the terms.
[0080] Large Language Models (LLMs): These are deep learning-based language models that learn rich semantic and grammatical knowledge by being trained on large amounts of text data. They possess excellent natural language understanding and generation capabilities and are widely used in chatbots, text summarization, question answering systems, and other scenarios.
[0081] Secure Shell (SSH) is an encrypted network communication protocol primarily used to establish secure connections between clients and servers in insecure network environments. Remote server management typically relies on the SSH protocol for remote login and command execution.
[0082] Shell: Shell is the command-line interface provided by the operating system, which allows users to control and manage the operating system by entering Shell commands.
[0083] Linux: Linux is an open-source operating system kernel widely used in servers, embedded devices, and other applications. Common shells in Linux systems include Bash and Zsh.
[0084] Figure 1 A schematic diagram of a computer system provided in one embodiment of this application is shown. This computer system can implement a system architecture for a natural language information processing method. The computer system may include: a terminal 100 and a server 200.
[0085] Terminal 100 can be an electronic device such as a mobile phone, tablet computer, or PC (Personal Computer). A client application for the target application can be installed and run on terminal 100. This target application can be a natural language processing application, or other applications that provide natural language processing functions; this application does not limit the specific application. Furthermore, this application does not limit the form of the target application, including but not limited to apps, mini-programs, etc., installed on terminal 100, and can also be in web page form.
[0086] Server 200 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Server 200 can be the backend server for the aforementioned target application, used to provide backend services to the clients of the target application.
[0087] The natural language information processing method provided in this application embodiment can be executed by a computer device, which refers to an electronic device with data computing, processing, and storage capabilities. Figure 1 Taking the implementation environment of the scheme shown as an example, the natural language information processing method can be executed by the terminal 100 (such as the natural language information processing method executed by the client of the target application installed and running in the terminal 100), or by the server 200, or by the terminal 100 and the server 200 interacting and cooperating to execute it. This application does not limit this.
[0088] Furthermore, the technical solution of this application can be combined with blockchain technology. For example, some data involved in the natural language information processing method disclosed in this application (such as preset sentences, model parameters of language models, etc.) can be stored on the blockchain. The terminal 100 and the server 200 can communicate through a network, such as a wired or wireless network.
[0089] Figure 2 A schematic diagram of a natural language information processing method provided in an exemplary embodiment of this application is shown.
[0090] The session interface 300 is an interface provided by the first computer device for controlling the second computer device using natural language. The session interface 300 provides input fields, including an input box 302 and a send control 304. The input box 302 displays the statement to be sent, and the send control 304 provides a function to confirm the sending of the information in the input box 302. In response to a trigger operation on the send control 304, the information in the input box 302 is confirmed for sending.
[0091] For example, in response to a triggering operation on the send control 304, natural language information 310 is displayed on the session interface 300. Natural language information 310 includes: "Help me print the 123.txt file and see what it contains." Natural language information 310 carries the semantics of controlling the second computer device to print the 123.txt file in natural language.
[0092] In response to the input operation of natural language information 310 (that is, in response to the input of natural language information 310 in input box 302 and the trigger operation of send control 304), feedback information 320 for natural language information 310 is displayed in the conversation interface 300.
[0093] For example, the feedback information 320 includes a first area 322 displayed as a code block and a second area 324 displayed as text.
[0094] The first region 322 includes a first control command 322a for the second computer device and control feedback information 322b for the second computer device. The first control command 322a includes: "cat 123.txt"; the control feedback information 322b includes: "(empty, no output)".
[0095] The second region 324 includes analysis information for control feedback information 322b. This analysis information is used to interpret control feedback information 322b in natural language, explaining why the control feedback information 322b was obtained when executing the first control command 322a. The analysis information includes: "Explanation: Since the provided [feedback] is empty, this means that when executing the cat 123.txt command, the following situations may have been encountered: 1. The file 123.txt does not exist in the current directory. 2. The file 123.txt exists, but is empty."
[0096] The `cat` command is used to display the contents of a file. If the file does not exist or has no content, there will be no output. Please check if the file path is correct or if the file contains any content.
[0097] The above analysis provides possible reasons why the second computer device executes the control feedback information 322b, and supplements the control feedback information 322b in natural language. Since the control of the second computer device is based on natural language control, to avoid the user being unable to understand the control feedback information 322b presented in code, or the difficulty in understanding the return information presented in code, the analysis is presented by interpreting the control feedback information 322b in natural language. This reduces the difficulty of understanding the information provided by the first computer device to the user and improves the efficiency of human-computer interaction.
[0098] The following examples will illustrate the method for processing natural language information.
[0099] Figure 3 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. The method can be executed by a first computer device. The method includes:
[0100] Step 510: Display the input field for natural language information;
[0101] For example, the input entry point for natural language information provides a functional entry point for inputting natural language information to obtain natural language information with natural language semantics. For example, the input entry point can be implemented as at least one of the following: the input entry point provides a functional entry point for inputting natural language text in text format using an input method; the input entry point provides a functional entry point for inputting natural language audio in audio format using speech recognition; the input entry point provides a functional entry point for inputting natural language images in image format using image recognition. This application does not limit the implementation method of the input entry point.
[0102] Step 520: Receive input operations at the input field;
[0103] For example, the input operation is a human-computer interaction operation targeting an input port, used to input natural language information; for example, the user of the first computer device types natural language information into the first computer device through the input operation. The natural language information is used to control the second computer device; the natural language information instructs the control of the second computer device in a natural language manner. This application does not limit the language of the natural language information.
[0104] Step 530: In response to the input operation, display the first control command for the second computer device and the control feedback information of the second computer device;
[0105] For example, the first control command is a command-line interface command for semantically controlling the second computer device based on natural language information. For example, the first control command is obtained based on natural language information; the first control command can be found based on the mapping relationship between natural language information and command-line interface commands, or it can be predicted based on natural language information.
[0106] For example, control feedback information is used to indicate the execution result of the first control command by the second computer device. For example, the control feedback information is displayed by the first computer device, or the control feedback information is the execution result provided by the second computer device, to achieve control of the second computer device in a natural language manner. This avoids the need to write command-line interface commands when controlling the second computer device in related technologies, thus improving human-computer interaction efficiency.
[0107] For example, the first control command is the semantic control information of the second computer device based on natural language information (i.e., the command-line interface command for the second computer device), and the control feedback information is the execution result of the second computer device. Control of the second computer device is achieved through the command-line interface command corresponding to the natural language information. For example, by displaying the first control command and showing the command-line interface command corresponding to the natural language information, the control feedback information is presented as being based on the execution of that command, which facilitates the analysis of the control feedback information.
[0108] In summary, the method provided in this embodiment offers a functional entry point for controlling a second computer device using natural language information input. It displays the corresponding command-line interface command and the execution result of the command-line interface command by the second computer device based on the input natural language information. Compared to the control method of writing command-line interface commands in related technologies, this method eliminates the need to consider factors such as the correctness of the command-line interface command syntax when inputting natural language information, thus improving the efficiency of human-computer interaction.
[0109] In one alternative design of this application, the first control command can be implemented as a Shell program executed by a command-line interpreter (Shell); further, the first control command is used to control a second computer device of a Unix-like system.
[0110] For example, the first control command is used to instruct the second computer device to perform at least one of the following.
[0111] To view files, use the `cat` command in a shell program;
[0112] Editing files, such as using the sed command in a shell program;
[0113] Modify the file save path, such as the cp command in a shell program;
[0114] To find files, use the gerp command in a shell program;
[0115] To check memory usage, use the `free -h` command in a shell program;
[0116] To check disk usage, use the `df -h` command in a shell program;
[0117] Terminating a process, such as the kill command in a shell program;
[0118] To query the process identity, such as the ps command in a shell program;
[0119] Starting a process, such as by directly writing the process name in a shell program;
[0120] Create files and directories, such as the mkdir command in a shell program.
[0121] Figure 4 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. This method can be executed by a first computer device. That is, in Figure 3 In the illustrated embodiment, step 530 can be implemented as steps 532, 534, and 536:
[0122] Step 532: In response to the input operation, call the language model to perform prediction on the natural language information and the first preset statement to obtain the intention statement of the natural language information;
[0123] For example, the language model has the ability to predict the intent of statements in natural language information; a first preset statement is used to instruct the language model to predict the intent of statements in natural language information. For example, in various embodiments of this application, the language model is pre-trained and has the ability to process natural language information. Furthermore, the language model has multiple processing capabilities for natural language information, such as the ability to predict statement intent, and also includes at least one of the following: natural language chat capability, natural language and command line interface command conversion capability, and natural language-based web search capability.
[0124] For example, the first preset statement is used to instruct the language model to predict the intent of the natural language information; the first preset statement is used to instruct, among the various natural language information processing capabilities of the language model, to use the ability to predict the intent of the natural language information, to perform prediction on the natural language information, and obtain the intent statement. For example, the intent statement is presented in natural language and indicates the control type of the first natural language information on the second computer device.
[0125] In various embodiments of this application, the language model can be implemented as a large language model (LLM), which has the processing capability of natural language processing (NLP) tasks; the language model can also be implemented as other artificial neural network (ANN) models with the processing capability of natural language processing tasks.
[0126] In one optional implementation of this embodiment, the first preset statement includes a first demand statement and / or a first prediction sample; the first demand statement and the first prediction sample are described below:
[0127] • The first requirement statement is used to indicate at least one of the following: statement basis, statement order, and tone of the natural language statement expected to be output by the language model;
[0128] For example, the first demand statement indicates that at least one of the following—the statement basis, the statement order, and the tone of voice—corresponds to the expected information based on the predictive ability of the statement's intent. In one example, the first demand statement includes:
[0129] "Imagine you are a command-based intelligent assistant, and you need to parse and extract commands. Given [historical messages] and [current message], parse the commands based on the [historical messages] and [current message] and output them according to the [output requirements]."
[0130] [Output Requirements] = """Parse the <user's command> based on the [historical messages] and [current message]. The [historical messages] are the context information preceding the [current message], and are understood by referring to the information in the [historical messages] and [user's current message]. The tone of the dialogue should be more lively and natural, like an assistant."""
[0131] Here, the double quotes ("") separate the start and end positions of the output requirements; "The tone of the dialogue should be more lively and natural, like an assistant" is the expected tone and emotion to be output by the language model; "Analyze the <user's command> based on [historical messages] and [current message]. [Historical messages] are the context information preceding the [current message], and understanding is achieved by using information from [historical messages] and [the user's current message]" is the expected statement basis for the language model's output.
[0132] Optionally, the first requirement statement may also include intent prediction or other methods to explicitly indicate that the prediction task performed by the language model is the statement intent. In another example, statement word order is used to indicate the order of output when predicting two clauses, which will be described later through a separate embodiment.
[0133] • The first prediction sample includes a sample input statement and a sample intent statement; for example, the first prediction sample is used to guide the language model to predict the natural language statement describing the intent of natural language information by referring to the correspondence between the sample input statement and the sample intent statement.
[0134] In one example, the first predicted sample includes:
[0135] """
[0136] <Dialogue 1>
[0137] <User's Current Message 1>: I need to check what files are in the current directory.
[0138] <User History Message 1>:
[0139] Output 1: {{The user's command was to view the files in the current directory}}
[0140] <Dialogue 2>
[0141] <User's current message 1>: Please execute the command `free -h` for me.
[0142] <User History Message 1>:
[0143] <Output 1>: {{The user's command was to execute the free-h command}}
[0144] <Dialogue 3>
[0145] <User's Current Message 1>: Please help me find the PID of the nginx process on the current server.
[0146] <User History Message 1>:
[0147] Output 1: {{The user's command was to query the PID of the nginx process}}
[0148] """"
[0149] For example, the double quote symbol is the separator between the start and end positions of the first predicted sample; the first predicted sample, in an exemplary manner, indicates the input and output information of the language model in at least one sample, and is the information that guides the language model to perform the sentence intent task. For example, the first predicted sample instructs the language model to extract the sentence core from the natural language information and / or remove colloquial expressions from the natural language information to obtain the intended sentence.
[0150] Step 534: Invoke the language model to predict the intent statement and the second preset statement to obtain the first control command;
[0151] For example, the language model has the ability to convert information in natural language form into command-line interface commands; the second preset statement is used to instruct the language model to predict the command-line interface command corresponding to the intent statement. For example, the language model in this step and the language model in step 532 have the same model parameters; furthermore, the language model in this step and the language model in step 532 are the same language model, and this application does not limit the language models in various embodiments or steps to be run by the same computer device.
[0152] For example, the second preset statement is used to instruct the language model to predict the first control command corresponding to the intention statement; the second preset statement is used to instruct the language model to use the ability to predict the command line interface command corresponding to the natural language information among the various natural language information processing capabilities of the language model, to perform prediction on the natural language information and obtain the first control command.
[0153] In one optional implementation of this embodiment, the second preset statement includes a second demand statement and / or a second prediction sample;
[0154] The second requirement statement is used to indicate the command language type of the first control command expected to be output by the language model;
[0155] The second prediction sample includes a sample intent statement and a sample output command. The second prediction sample is used to guide the language model to refer to the correspondence between the sample intent statement and the sample output command, and to predict the command-line interface command corresponding to the intent statement. The second requirement statement and the second prediction sample will be described in separate embodiments below.
[0156] Step 536: Based on the first control command, obtain control feedback information, and display the first control command and control feedback information;
[0157] In various embodiments of this application, the first control command can be implemented as a Shell program executed by a command-line interpreter (Shell); further, the first control command is used to control a second computer device of a Unix-like system. The first control command can also be implemented as a Command Prompt Command (CMD); further, the first control command is used to control a second computer device operating a Windows operating system.
[0158] For example, the control feedback information is provided by a second computer device; in one design of this application, the first computer device and the second computer device have data transmission capabilities, such as communicating via a network (e.g., wired or wireless network). The first computer device provides a first control command to the second computer device via the network, and the second computer device provides control feedback information to the first computer device via the network, that is, feedback on the execution result of the first control command.
[0159] In summary, the method provided in this embodiment offers a functional entry point for controlling a second computer device using natural language information input. It displays the corresponding command-line interface command and the execution result of the command-line interface command by the second computer device based on the input natural language information. This achieves control of the second computer device using natural language by extracting the intent from the spoken language expression of the natural language information and predicting the corresponding command-line interface command through the prediction of the intent statement and the first control command using a language model. This improves the efficiency of human-computer interaction.
[0160] Figure 5 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. This method can be executed by a first computer device. That is, in Figure 3 In the illustrated embodiment, step 520 can be implemented as steps 522, 524, and 526:
[0161] Step 522: Receive the first input operation of the first sub-statement;
[0162] In this embodiment, the natural language information includes a first sub-statement and a second sub-statement; wherein the first sub-statement and the second sub-statement are entered sequentially. The first input operation is used to enter the first sub-statement, and the first sub-statement is used to control the second computer device.
[0163] For example, either the first sub-statement or the second sub-statement can be a sentence, a short phrase, or a combination of words, and there are no restrictive rules on the grammatical requirements of the sub-statements.
[0164] Step 524: In response to the first input operation, display supplementary guiding statements;
[0165] For example, the first substatement contains missing semantic elements, and for example, the first substatement cannot accurately indicate the method of control over the second computer device.
[0166] For example, supplementary guidance statements are used to guide the supplementation of semantically missing elements in the control of the second computer device; for example, supplementary guidance statements are provided to the user of the first computer device to guide the supplementation of semantically missing elements in the first sub-statement based on human-computer interaction operations.
[0167] In one alternative implementation of this application, this step can be implemented as the following two sub-steps:
[0168] • Sub-step 1: In response to the first input operation, call the language model to perform prediction on the first sub-statement and the third preset statement to obtain the first reference label and supplementary guiding statement;
[0169] For example, the language model has the ability to predict reference labels and the ability to predict supplementary guiding statements; the reference labels are used to indicate whether there are missing elements in the first sub-statement, specifically, the first reference label is used to indicate that there are missing elements in the first sub-statement.
[0170] In one implementation, the language model in this embodiment and the one described above... Figure 4 The language models in the corresponding embodiments have the same model parameters; furthermore, the language model in this embodiment and the one described above... Figure 4 The language model in the corresponding embodiments is the same language model. This application does not limit the language model in each embodiment or each step to be run by the same computer device.
[0171] For example, the third preset statement is used to instruct the language model to predict whether the statement intent of the first sub-statement is missing an element, and to predict the guiding statement for the semantically missing element.
[0172] Sub-step two: Display supplementary guiding statements;
[0173] For example, the supplementary guiding statement is predicted by the language model based on the first sub-statement, given that the first reference label has been predicted.
[0174] In one implementation, if the first reference label is predicted and the first sub-statement has missing elements, the language model also predicts supplementary guiding statements based on the first sub-statement.
[0175] In one example, the third preset statement includes:
[0176] "Imagine you are a command-based intelligent assistant, and you need to parse and extract commands. Given [historical messages] and [current message], parse the commands based on the [historical messages] and [current message] and output them according to the [output requirements]."
[0177] [Output Requirements] = """Analyze the <user's command> based on the [historical messages] and [current message]. If the <user's command> is missing, output a follow-up question to prompt the user to fill in the missing information; if the <user's command> is complete, output a rewrite question without generating additional information. If the <user's command> is unclear, ambiguous, or unexecutable, output a follow-up question to prompt the user to enter a clear command. [Historical messages] are the context information preceding the [current message], and understanding requires the information in [historical messages] and [current message]. Please refer to the [example]. When follow-up questions are needed, need_ask is True, and the follow-up question is output. When the <user's command> is complete and clear and executable, need_ask is False, and the dialogue tone should be more lively and natural, like an assistant.""
[0178] [Current User Message] = """{query}"""
[0179] [User Message History] = """{user_talk_history}"""
[0180] [Example] = """
[0181] <Dialogue 1>
[0182] <User's Current Message 1>: I need to view the files in the current directory.
[0183] <User History Message 1>:
[0184] Output 1: {{"need_ask":"False","query":"The user's command is to view files in the current directory"}}
[0185] <Dialogue 2>
[0186] <Current User Message 1>: Executing the free-h command
[0187] <User History Message 1>:
[0188] Output 1: {{"need_ask":"False","query":"The user's command was to execute the free-h command"}}
[0189] <Dialogue 3>
[0190] <Current User Message 1>: Do I need to kill a process?
[0191] <User History Message 1>:
[0192] Output 1: {{"need_ask":"True","query":"Killing a process requires first querying the process's PID"}}
[0193] <User Current Message 2>: Please help me find the PID of the nginx process.
[0194] <User History Message 2>:\nuser: I need to kill a process?\nassistant: To kill a process, you need to first query the process's PID.
[0195] Output 2: {{"need_ask":"False","query":"The user's command was to query the nginx process PID"}}
[0196] """"
[0197] The text preceding "[Output Requirements]" is a requirement statement, indicating at least one of the following: the basis of the expected natural language statement output by the language model, the sentence order, and the tone / emotion. For further details on the requirement statement, refer to step 532 above. The "[Example]" section contains prediction samples, used as the first prediction sample to guide the correspondence between the language model's reference sample input statement and the sample's intended statement. For further details on the prediction samples, refer to step 532 above.
[0198] Step 526: Receive the second input operation of the second sub-statement;
[0199] For example, the second sub-statement has semantically missing elements that are missing in the first sub-statement; the second sub-statement is a supplement to the first sub-statement and is prompted by a supplementary guiding statement from the user of the first computer device. For example, the execution sequence of the second input operation is after the first input operation.
[0200] For example, the first control command and control feedback information are displayed in response to the second input operation. In this embodiment, step 530 can be implemented as displaying the first control command for the second computer device and the control feedback information for the second computer device in response to the second input operation.
[0201] Furthermore, in some examples, a subset of the third preset statement includes the first preset statement, which is used to instruct the language model to predict the statement intent of natural language information; for a further explanation of the first preset statement, please refer to step 532 above.
[0202] For example, the first control command for the second computer device is obtained based on an intent statement, which is predicted by a language model when there are no missing elements in the union of the first and second substatements.
[0203] For example, the language model prioritizes predicting whether a statement has missing elements. Taking the first sub-statement as an example, if the first sub-statement corresponds to a first reference label, the language model predicts the supplementary guiding statement based on the first sub-statement. After supplementing the second sub-statement, if the first and second sub-statements correspond to a second reference label (the second reference label indicates that the union of the first and second sub-statements does not have missing elements), the language model predicts the intent statement and the first control command based on the first and second sub-statements.
[0204] In summary, the method provided in this embodiment offers a functional entry point for controlling a second computer device using natural language information input. It displays the corresponding command-line interface command and the execution result of the command-line interface command by the second computer device based on the input natural language information. This enables control of the second computer device using natural language. Furthermore, by supplementing the guidance statement, a second sub-statement is provided to supplement the user's input if an element is missing in the first sub-statement, ensuring that the user's input natural language information clearly and completely indicates how to control the second computer device, thus improving human-computer interaction efficiency.
[0205] Figure 6 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. This method can be executed by a first computer device. That is, in Figure 3 Based on the illustrated embodiment, step 540 is also included:
[0206] Step 510: Display the input field for natural language information;
[0207] For example, the input entry for natural language information provides a functional entry point for inputting natural language information in order to obtain natural language information with natural language semantics.
[0208] Step 520: Receive input operations at the input field;
[0209] For example, the input operation is a human-computer interaction operation targeting an input interface; for example, the user of the first computer device types natural language information into the first computer device through the input operation. The natural language information is used to control the second computer device.
[0210] Step 530: In response to the input operation, display the first control command for the second computer device and the control feedback information of the second computer device;
[0211] In this embodiment, the first control command in step 530 does not belong to the set of candidate commands for rejecting the execution of the second computer device. In this embodiment, the natural language information input in step 520 is limited to information used to control the second computer device, but there is no restriction on what kind of semantic control the natural language information carries over the second computer device. In one case, as described in step 530, the first control command does not belong to the set of candidate commands for rejecting the execution of the second computer device, and the semantics carried by the natural language information correspond to the first control command; while in another case, as described below in step 540, the second control command belongs to the set of candidate commands for rejecting the execution of the second computer device, and the semantics carried by the natural language information correspond to the second control command.
[0212] Step 540: In response to the input operation, display a second control command and rejection information for the second computer device;
[0213] For example, the rejection message is used to indicate that a second control command for a second computer device, which belongs to a set of candidate commands, is refused to be executed. Refusing to execute a second control command for a second computer device can be used to indicate that the second control command is refused to be provided to the second computer device, or it can be used to indicate that the second computer device refuses to execute the second control command if it has already received it.
[0214] In one alternative implementation, step 540 can be implemented as the following sub-steps:
[0215] • Sub-step 3: In response to the input operation, the language model is invoked to perform prediction on the natural language information and the fourth preset statement to obtain the second control command and the first execution label;
[0216] For example, the language model has the ability to predict execution labels, which are used to indicate whether the control command corresponding to the natural language information belongs to the candidate command set. Specifically, the first execution label indicates that the corresponding control command belongs to the candidate command set. Further, in step 530, the natural language information corresponds to a second control command, and the execution label of the second control command is a second execution label, which indicates that the corresponding control command does not belong to the candidate command set.
[0217] For example, the fourth preset statement is used to instruct the language model to predict the command line interface command corresponding to the natural language information, and to determine whether the command line interface command corresponding to the natural language information belongs to the candidate command set.
[0218] In one example, the fourth preset statement includes:
[0219] "Assuming you are a command-line assistant, please translate the user's natural language commands into shell commands. Please output based on [User Input] and refer to [Output Requirements]."
[0220] [Output Requirements] = """Please refer to the [Example] output. Furthermore, for the security of computer equipment, it is necessary to refuse the generation of any high-risk commands. High-risk commands include, but are not limited to, the following: 1) Commands that delete system files or directories, such as: rm -rf; 2) Commands that modify critical system configuration files, such as: vi / etc / passwd; 3) Commands that shut down or restart the system, such as: shutdown, reboot; 4) Commands that modify user permissions, such as: chmod 777 / ; 5) Any command that may cause data loss or system crash. When a user enters a high-risk command, please set can_execute to False in the output; otherwise, set it to True.
[0221] [User Input] = "'{query}"
[0222] [Example] = """
[0223] <Input Example 1>: The user's command is to view the files in the current directory.
[0224] <Output Example 1>: {{"can_execute":"True","usr_command":"ls"}}
[0225] <Input Example 2>: The user's command is to execute the free-h command.
[0226] <Output Example 2>: {{"can_execute":"True","usr_command":"free-h"}}
[0227] <Input Example 3>: The user's command is to query the PID of the nginx process.
[0228] <Output Example 3>: {{"can_execute":"True","usr_command":"ps aux|grepnginx"}}
[0229] <Input Example 4>: The user's command is to check the system's disk usage.
[0230] <Output Example 4>: {{"can_execute":"True","usr_command":"df-h"}}
[0231] <Input Example 5>: The user's command is to restart the server.
[0232] <Output Example 5>: {{"can_execute":"False","usr_command":"reboot"}}
[0233] """"
[0234] It should be noted that the fourth preset statement in this embodiment is used to instruct the language model to predict the command line interface command corresponding to the natural language information, and whether the command line interface command corresponding to the natural language information belongs to the candidate command set of label information.
[0235] Among them, the command-line interface command corresponding to the natural language information predicted by the instruction language model, "Assuming you are a command-line intelligent assistant, please translate the user's natural language command into a shell command." is a requirement statement, that is... Figure 4 The second requirement statement in the corresponding embodiment; the [example] part is the predicted sample, that is... Figure 4 The second predicted sample in the corresponding embodiment. It should be noted that, regarding the command-line interface command corresponding to the natural language information predicted by the instruction language model, "usr_command" in the [Example] section serves as an example to guide the correspondence between the intent statement and the output command of the language model reference sample, predicting the command-line interface command corresponding to the intent statement. As described above, the subset of the fourth preset statement is... Figure 4 The second preset statement described in the corresponding embodiment. For example, in step 530, the first control command and control feedback information displayed can also be predicted after replacing the second preset statement with the fourth preset statement.
[0236] The label information for predicting whether the command line interface command corresponding to the natural language information belongs to the candidate command set; the description of high-risk commands in [Output Requirements] is a requirement statement; "can_execute" in the [Example] section serves as an example to guide the language model to refer to the correspondence between the sample intent statement and the sample output command, and to predict whether the command line interface command belongs to the candidate command set.
[0237] As described above, in one example, further, the fourth preset statement carries a set of candidate commands including at least one of the following:
[0238] The commands are as follows: First command to delete the storage files of the second computer device; second command to modify the configuration file of the second computer device; third command to shut down or restart the second computer device; fourth command to modify the operating permissions of the second computer device; and fifth command to exceed the current operating permissions of the second computer device.
[0239] For example, the current operating permission is the operating permission of the user of the device that provides control commands to the second computer device (such as the first computer device or other computer devices that have established a communication connection with the first computer device) to the second computer device.
[0240] • Sub-step four: Based on the first execution label, display the rejection information corresponding to the second control command and the first execution label;
[0241] For example, the second control command and the rejection information are displayed in response to the first execution label. The rejection information can be generated by language model prediction or it can be preset. This application does not limit the way the rejection information is generated.
[0242] In summary, the method provided in this embodiment provides a functional entry point for controlling a second computer device in a natural language manner through the input of natural language information. It realizes the display of the command line interface command corresponding to the input natural language information and the execution result of the command line interface command by the second computer device based on the input natural language information; it realizes the control of the second computer device in a natural language manner; and it displays the refusal to execute the second control command corresponding to the natural language information, so as to refuse to execute high-risk commands and avoid damage to the second computer device.
[0243] Figure 7 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. This method can be executed by a first computer device. That is, in Figure 3 Based on the illustrated embodiment, steps 552 and 554 are also included:
[0244] Step 552: Call the language model to perform prediction on the first control command, control feedback information and the fifth preset statement to obtain analysis information;
[0245] For example, the language model has the ability to predict and control feedback information; for example, the language model is pre-trained and has the ability to process natural language information.
[0246] In one implementation, the language model in this embodiment has the same model parameters as the language models in the various embodiments above, and the language model has multiple processing capabilities for natural language information.
[0247] The fifth predefined statement is used to instruct the language model to predict the control feedback information obtained based on the first control command. The fifth predefined statement instructs the language model to utilize its ability to analyze control feedback information, among its various natural language information processing capabilities, to perform predictions on the first control command and control feedback information to obtain the analyzed information.
[0248] In one example, the fifth preset statement includes:
[0249] "Imagine you are a command-based intelligent assistant, and you need to parse and extract commands. Given [historical messages] and [current message], parse the commands based on the [historical messages] and [current message] and output them according to the [output requirements]."
[0250] [Output Requirements] = """The output should include [return information] and [commands], presented as code blocks. Use appropriate tabs or other symbols to make the output easy to read. Please interpret the execution results in an easy-to-understand manner.""
[0251] [Execution result] = """{cmdout}"""
[0252] [command] = """{usr_command}"""
[0253] In one alternative implementation of this application, a first control command is provided to a second computer device and control feedback information is obtained based on the execution plug-in.
[0254] For example, the execution plugin (also known as an SSH plugin) is used to provide a first control command to the second computer device and instruct it to execute the first control command. After the second computer device executes the first control command, it obtains control feedback information. After receiving the control feedback information, it closes the connection between the first and second computer devices.
[0255] Furthermore, the control commands provided by the execution plugin to the second computer device are obtained based on log records, which are execution records of the language model. Even further, the construction process of the execution plugin is based on language model-assisted development. By providing development guide words to the language model, the construction code of the execution plugin is obtained. In one example, the development guide words include: "We need to write an SSH plugin for a large model to connect to a second computer device (such as a server), execute commands, and return results. Please help rewrite it so that the server connection data is obtained under input["input"] instead of being initialized in the _init function. # Plugin interface class example example_tool.py". Here, example_tool.py is a provided example.
[0256] Step 554: Display the analysis information of the control feedback information;
[0257] For example, the analysis information is used to interpret the control feedback information in natural language. The control feedback information may indicate at least one of the following: the second computer device successfully or unsuccessfully executed the first control command, or the return information of the second computer device executing the first control command. This information is typically fed back in code form. Since the control of the second computer device is based on natural language control, to avoid the user being unable to understand the code-presented return information, or the difficulty in understanding the code-presented return information, this embodiment implements the display of analysis information, interpreting the control feedback information in natural language. This reduces the difficulty of understanding the information provided by the first computer device to the user and improves the efficiency of human-computer interaction.
[0258] In one implementation, step 554 in this embodiment can be combined with... Figure 3 Steps 510 to 530 can be combined into a new embodiment and implemented separately, and this application does not impose any limiting provisions on this.
[0259] Figure 8 A diagram illustrating an interface for processing natural language information provided in an exemplary embodiment of this application is shown.
[0260] The attribute interface 350 displays attribute information of the natural language information processing process. The attribute interface 350 includes request identifier 352, time consumption status 354, input information 356, and output information 358.
[0261] Request identifier 352 is a unique identifier for performing natural language information processing on the input information; time consumption 354 is the total time spent processing the input information, as well as the time consumption of each stage of the processing, such as obtaining historical conversations, calling the language model, and obtaining preset statements. Input information 356 is the natural language information input by the user; output information 358 includes the result information of controlling the second computer device based on the natural language information input by the user, including the control commands, control feedback information, and analysis information corresponding to the natural language information input by the user. For details not described above, please refer to [link to relevant documentation]. Figure 2 Corresponding implementation examples.
[0262] In summary, the method provided in this embodiment offers a functional entry point for controlling a second computer device in a natural language manner through a natural language information input entry point. It displays the corresponding command-line interface commands and the execution results of the second computer device on the command-line interface commands based on the input natural language information; it enables control of the second computer device in a natural language manner; and by displaying analysis information of the control feedback information and interpreting the control feedback information in a natural language manner, it reduces the difficulty of understanding the information provided by the first computer device to the user and improves the efficiency of human-computer interaction.
[0263] Figure 9 A flowchart illustrating a natural language information processing method provided in an exemplary embodiment of this application is shown. This method can be executed by a first computer device. That is, in Figure 3 Based on the illustrated embodiment, steps 560 and 570 are also included:
[0264] Step 560: Receive chat message input.
[0265] For example, an input operation is a human-computer interaction operation targeting an input entry point; for example, the user of the first computer device types natural language information into the first computer device through an input operation.
[0266] For example, the chat statement information has chat semantics of natural language dialogue; for example, both the two statement information and the natural language information in step 520 are information presented in natural language form, but they carry different semantics. The chat statement information has chat semantics of natural language dialogue and is used to initiate or continue a casual chat session; while as described above, the natural language information is used to control the second computer device; it is a control information with the semantics of controlling the second computer device.
[0267] Step 570: In response to the input of chat message, display the chat reply message;
[0268] For example, a chat reply statement is a response to a chat message. The chat reply statement can be predicted based on an artificial neural network model or it can be a pre-set reply statement. This embodiment does not limit the way the chat reply statement is generated.
[0269] In one alternative implementation, this step can be implemented as follows:
[0270] • In response to the input of chat message, the language model is invoked to predict the chat message and the sixth preset message to obtain the first intent label of the chat message;
[0271] For example, the language model has the ability to respond to chat messages and predict the intent type of natural language information. A sixth preset statement is used to instruct the language model to predict the intent type of the natural language information;
[0272] • Based on the first intent tag, obtain the chat response statement according to the chat statement information, and display the chat response statement;
[0273] For example, the first intent label is used to indicate that the intent type of the chat statement information is casual conversation. When the language model predicts the first intent label, the chat response statement obtained based on the chat statement information is a reply to the chat statement information.
[0274] In one example, the sixth preset statement includes:
[0275] "Imagine you are a command-based intelligent assistant, and you need to parse and extract commands. Given [historical messages] and [current message], parse the commands based on the [historical messages] and [current message], and output them according to [output requirements]. You can refer to the [example].
[0276] [Current User Message] = """{query}"""
[0277] [User Message History] = """{user_talk_history}"""
[0278] [Intent] = """Execute command, other dialogue"""
[0279] [Output Requirements] = """You must only output one item from the [Intent], and do not output any other extra content or explanations.""
[0280] [example]
[0281] <Input Example 1>: I need to view the files in the current directory.
[0282] <Output Example 1>: Executing the command
[0283] <Input Example 2>: Execute the free-h command.
[0284] <Output Example 2>: Executing the command
[0285] <Input Example 3>: I need to kill a process.
[0286] <Output Example 3>: Executing the command
[0287] <Input Example 4>: What programming language do you like?
[0288] <Output Example 4>: Other Dialogues
[0289] <Input Example 5>: How do you feel about the weather today?
[0290] <Output Example 5>: Other Dialogues
[0291] <Input Example 6>: Have you seen the latest movie?
[0292] <Output Example 6>: Other Dialogues
[0293] For example, if the output result is other dialogue, the first intent label indicates that the intent type of the input natural language statement is chat; if the output result is execute a command, the second intent label indicates that the intent type of the input natural language statement is control of a second computer device.
[0294] Furthermore, it also includes:
[0295] • In response to input operations, the language model is invoked to perform predictions on the natural language information and the sixth preset statement, thereby obtaining the second intent label of the natural language information;
[0296] For example, in step 520 of this embodiment, the language model's prediction result of the intent type of the natural language information is a second intent label, which indicates that the intent type of the natural language information is to control the second computer device. For example, the first control command and control feedback information are displayed when the natural language information corresponds to the second intent label.
[0297] In summary, the method provided in this embodiment offers a functional entry point for controlling a second computer device using natural language information input. It displays the corresponding command-line interface command and the execution result of the command-line interface command by the second computer device based on the input natural language information; it enables control of the second computer device using natural language; by displaying chat reply statements, it displays the chat reply statement entered by the user even when the input statement does not have the semantic meaning of controlling the second computer device; and it displays the corresponding reply information based on the intent of the input statement, thus expanding the applicability of the natural language information processing method.
[0298] Figure 10 A schematic diagram of a language model provided in an exemplary embodiment of this application is shown.
[0299] In various embodiments of this application, the language model may be invoked by a first computer device through an application programming interface (API).
[0300] The input information 602 obtained by the language model is a natural language statement entered by the user of the first computer device at the input port. The intent recognition preset statement 604 is used to instruct the language model to predict the intent type corresponding to the input information 602, that is, to instruct the language model to perform the intent recognition task 610 to obtain the intent type corresponding to the input information 602, which is other dialogue or execution command.
[0301] In cases where the intent type is other dialogues, input information 602 is information used for small talk. Further, the language model performs a chat session task 615, obtaining output information 652 for input information 602. Output information 652 is a small talk response to input information 602 obtained from performing the chat session task 615.
[0302] For an example, regarding the unfinished description of intent recognition task 610 and intent recognition preset statement 604, please refer to the above text. Figure 9 The corresponding embodiments, and the sixth preset statement in the embodiments, will not be repeated here.
[0303] When the intent type is to execute a command, the input information 602 is used to control a second computer device, which needs to be controlled in a natural language manner (such as controlling a server). The language model performs a follow-up questioning task 620 to determine whether the elements in the input information 602 are complete, that is, to determine whether the input information 602 can clearly and completely indicate how to control the second computer device.
[0304] If the prediction result of the follow-up questioning task 620 indicates missing elements, the input information 602 cannot clearly and completely indicate how to control the second computer device, and it is necessary to guide the user to supplement more information. By obtaining the follow-up question preset statement 622, the language model predicts the guiding statement for the semantically missing elements in the input information 602. The output information 652 obtained by the language model in performing the follow-up question statement prediction task 625 is the guiding statement to guide the user to supplement more information to control the second computer device.
[0305] For example, please refer to the above text for further details regarding follow-up question judgment task 620, follow-up question preset statement 622, and follow-up question statement prediction task 625. Figure 5 The corresponding embodiments and the third preset statements in the embodiments will not be repeated here.
[0306] If the prediction result of the follow-up judgment task 620 is that the elements are complete, the input information 602 can clearly and completely indicate how to control the second computer device. The language model executes the command translation task 630 to obtain the control command corresponding to the input information 602. The control command is a command line interface command for controlling the second computer device based on the semantics of natural language information.
[0307] It should be noted that if the control command corresponding to input information 602 belongs to the candidate command set, the control command corresponding to input information 602 is an unexecutable command. The language model executes the rejection statement generation task 635, and the output information 652 is a rejection message. The rejection message is used to indicate that the control command for the second computer device is refused to be executed. Refusing to execute the second control command for the second computer device can be used to indicate that the second control command is refused to be provided to the second computer device, or it can be used to indicate that the second computer device refuses to execute the second control command if it has already obtained it.
[0308] If the control command corresponding to input information 602 does not belong to the candidate command set, the control command corresponding to input information 602 is an executable command. The language model performs analysis task 640, which analyzes and predicts the execution results of the executable command and the second computer device. The output information 652 obtained is analysis information, which is used to interpret the execution results of the second computer device in natural language.
[0309] Figure 11 A schematic diagram of a natural language information processing method provided in an exemplary embodiment of this application is shown.
[0310] The system retrieves the current dialogue statement 702 and the historical dialogue statement 704; and retrieves the intent recognition preset statement 722. The intent recognition preset statement 722 is used to indicate the intent type corresponding to the natural language statement (i.e., the current dialogue statement 702 and the historical dialogue statement 704) predicted by the language model. For further details regarding the intent recognition preset statement 722, please refer to the above text. Figure 9 Corresponding implementation examples.
[0311] The language model calls interface 700 to predict the intent type of the input natural language statement; first conditional splitting 712 is used to perform splitting according to the intent type. If the intent type is "other dialogue," the input natural language statement is information for casual conversation. By obtaining the pre-defined casual conversation statement 724, the language model is instructed to perform a chat session task, predicting the casual conversation response statement 732 for the input natural language statement.
[0312] When the intent type is to execute a command, the input natural language statement is used to control a second computer device, and it is necessary to implement the control of the second computer device (such as a control server) in a natural language manner.
[0313] For example, a pre-defined query statement 726 is obtained, which indicates whether the elements in the predicted statement are complete; the language model calls the interface 700 to predict whether the elements in the input natural language statement are complete, that is, to determine whether the input natural language statement can clearly and completely indicate how to control the second computer device.
[0314] The second conditional routing 714 is used to perform routing based on whether the feature is complete. In the case of missing features, the language model invocation interface 700 also predicts supplementary guidance statements 734 to guide the user to provide more information. In the case of complete features, the language model invocation interface 700 also predicts intent statements 736 to execute the control type for controlling the second computer device.
[0315] For example, after predicting the intent statement 736, a command translation preset statement 728 is obtained; the command translation preset statement 728 indicates the command line interface command corresponding to the statement predicted by the language model. The command line interface command corresponding to the input natural language statement is predicted by calling interface 700 through the language model.
[0316] The third conditional routing 716 is used to perform routing based on whether the command-line interface command is executable. If the command-line interface command is not executable, the language model provides a rejection statement 738 to indicate that the control command for the second computer device is not to be executed. If the command-line interface command is executable, control feedback information 740 is obtained based on the execution plug-in 700a. The control feedback information 740 is the execution result of the command-line interface command by the second computer device.
[0317] Furthermore, the fourth conditional traffic splitting 718 performs traffic splitting based on whether the command-line interface command, fed back by the control feedback information 740, was successfully executed. If execution is successful, it obtains the successful analysis preset statement 729a, and through the language model call interface 700, predicts the result of the successful execution of the command-line interface command as easily understandable natural language explanation information, i.e., the first analysis information 742. For example, the conditional traffic splitting in this embodiment is also called logical traffic splitting.
[0318] In the event of execution failure, the default statement 729b for failure analysis is obtained, and the reason for the failure of the command line interface command is predicted through the language model call interface 700, and the analysis result, namely the second analysis information 744, is obtained.
[0319] In one optional implementation of this application, the preset statements described in the various embodiments above include prediction samples and / or demand statements; wherein, the prediction samples include, for example, the first prediction sample, the second prediction sample, and the bytes of the “[example]” part in the example of the preset statement.
[0320] The above preset statements can be written by developers themselves or generated through a language model.
[0321] • In one example, the guiding statement for the language model to generate preset statements is: "Please write a prompt that causes the large model to refuse to output high-risk commands."
[0322] The default statement generated by the language model is: "You are an intelligent assistant capable of translating users' natural language commands into shel commands. However, for security reasons, you must refuse to generate any high-risk commands. High-risk commands include, but are not limited to, the following:"
[0323] Commands that delete system files or directories, such as: rm -rf / ; commands that modify critical system configuration files, such as: vi / etc / passwd; commands that shut down or restart the system, such as: shutdown, reboot; commands that modify user permissions, such as: chmod 777 / ; any commands that may cause data loss or system crash;
[0324] When a user enters a high-risk command, please reply with: "Sorry, I cannot execute this command because it may harm the system."
[0325] Here are some example dialogues:
[0326] Example dialogue 1: User: Please list all files in the current directory. Assistant: Ls
[0327] Example dialogue 2: User: Please delete all files in the root directory. Assistant: I'm sorry, I cannot execute this command because it may harm the system.
[0328] Example dialogue 3: User: Could you tell me what the current working directory is? Assistant: pwd
[0329] Example dialogue 4: User: Please restart the server. Assistant: I'm sorry, I cannot execute this command because it may harm the system.
[0330] Example dialogue 5: User: Please create a directory named "test". Assistant: mkdir test
[0331] Example dialogue 6: User: Please modify the / etc / passwd file. Assistant: I'm sorry, I cannot execute this command because it may harm the system.
[0332] Example dialogue 7: User: Please rename the file "file1.txt" to "file2.txt". Assistant: mV file1.txt file2.txt
[0333] Example dialogue 8: User: Please delete the file named "ldfile.txt". Assistant: ldfile.txt
[0334] Example dialogue 9: User: Please display the contents of the file "example.txt". Assistant: cat example.txt
[0335] Example dialogue 10: User: Please copy the file "data.txt" to the directory "backup". Assistant: cp data.txtbackup /
[0336] Example dialogue 11: User: Please find all files containing "error" in the current directory and its subdirectories. Assistant: grep -r "error"
[0337] Example dialogue 12: User: Please display the current system memory usage. Assistant: free -h
[0338] • In another example, the guiding statement for the language model to generate preset statements is: "Please generate some similar examples for me based on these examples, to be used as prompts for the large model."
[0339] <Input Example 1>: Server IP address 127.0.0.1, port number 22, username root, password testpassword, the user's command is to view the files in the current directory.
[0340] <Example Output 1>: {'usr command': "ls", "server': "127.0.0.1", "port': 22, "user': "oo", "password': "testpassword"}}
[0341] <Input Example 2>: Server address 168.0.0.2, port number 22, username root, password mypaasword@, user's command is to execute the free -h command.
[0342] <Example Output 2> {'usr command": free-h", "server": 168.0.0.2", "port": 22, "user": "root", "password": "mypaasword@"}
[0343] <Input Example 3>: Server address 23.6.8.1, port number 22, username root, password @helloworld), the user's command is to query the PID of the nginx process.
[0344] <Example Output 3>{f"usr command":"ps aux I grep nginx","server'":"23.6.8.1","port":22","user'":"root","password":"@helloworld\"}}”
[0345] The language model generates the following default statement: "Okay, here are some similar examples generated based on the format you provided:"
[0346] <Input Example 4>: Server IP address 192.168.1.10, port number 22, username admin, password admin123, the user's command is to check the system's disk usage. <Output Example 4>: {"usr.command"."df -h",
[0347] "server":"192.168.1.10","port:22,"user:"admin","password":"admin123"}}
[0348] <Input Example 5>: Server IP address 10.0.0.5, port number 22, username user, password userpass, user's command is to view currently running processes. <Output Example 5>: {"usr,command":"top","server":"10.0.0.5",
[0349] "port": 22, "user": "user", "password": "userpass"}}
[0350] <Input Example 6>: Server address 172.16.0.2, port number 22, username root, password securepass, user's command is to restart the server. <Output Example 6>: {"usr.command"reboot","servr"172.16.0.2","port":22,
[0351] "user'": "root", "password": "securepass"}}
[0352] <Input Example 7>: Server IP address 2030113.5, port number 22, username admin, password passwOrd, user's command is to view system logs. <Output Example 7>: ({"usr_comand"."tail -f / varlog / syslog",
[0353] "server": "203.0.113.5", "port": 22, "user*": "admin", "password": "passw0rd}}
[0354] <Input Example 8>: Server IP address 198.51.100.7, port number 22, username root, password rootpass, user's command is to update system packages. <Output Example 8>: {"usr.command'": *apt-get update && apt-get upgrade}
[0355] y", "server": "198.51.100.7", "port: 22, "user": "root", "password": "rootpass"}}
[0356] <Input Example 9>: Server IP address 192.0.2.8, port number 22, username user, password mypassword, user's command is to create a directory named "backup" <Output Example 9>: {{"usr_command": "mkdir backup"}
[0357] "server":"192.0.2.8""port:22,"user'":"user","password":"mypassword"}}
[0358] <Input Example 10>: Server IP address 203.0.113.9, port number 22, username admin, password adminpass, user's command is to delete the file named "tempfile" <Output Example 10>: {"usr command": "rmtempfile",
[0359] "server": "203.0.113.9", "port": 22, "user": "admin", "password": "adminpass"}}
[0360] <Input Example 11>: Server IP address 198.51.100.10, port number 22, username root, password oot1234, user's command is to view network interface information. <Output Example 11>: {"usr command"ifconfig"}
[0361] "server"."198.51.100.10""port":22,"user":"root","password":"root1234"}}"
[0362] Those skilled in the art will understand that the above embodiments can be implemented independently, or the above embodiments can be freely combined to create new embodiments to implement the natural language information processing method of this application.
[0363] Figure 12 A structural block diagram of a natural language information processing apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes:
[0364] Display module 810 is used to display the input entry point for natural language information;
[0365] The receiving module 820 is used to receive input operations on the input port, the input operations being used to input natural language information, and the natural language information being used to control the second computer device;
[0366] The processing module 830 is configured to respond to the input operation by displaying a first control command for the second computer device and control feedback information for the second computer device. The first control command is a command-line interface command for semantically controlling the second computer device based on the natural language information. The control feedback information is used to indicate the execution result of the first control command by the second computer device.
[0367] In an optional implementation of this embodiment, the processing module 830 is further configured to:
[0368] In response to the input operation, a language model is invoked to perform prediction on the natural language information and a first preset statement to obtain the intention statement of the natural language information. The first preset statement is used to instruct the language model to predict the statement intention of the natural language information.
[0369] The language model is invoked to predict the intent statement and the second preset statement to obtain the first control command. The second preset statement is used to instruct the language model to predict the command line interface command corresponding to the intent statement.
[0370] Based on the first control command, the control feedback information is obtained, and the first control command and the control feedback information are displayed.
[0371] In an optional implementation of this embodiment, the first preset statement includes a first demand statement and / or a first prediction sample;
[0372] The first requirement statement is used to indicate at least one of the statement basis, statement order, and tone of the natural language statement expected to be output by the language model;
[0373] The first prediction sample includes a sample input statement and a sample intent statement. The first prediction sample is used to guide the language model to predict a natural language statement that describes the intent of the natural language information by referring to the correspondence between the sample input statement and the sample intent statement.
[0374] In an optional implementation of this embodiment, the second preset statement includes a second demand statement and / or a second prediction sample;
[0375] The second requirement statement is used to indicate the command language type of the first control command that is expected to be output by the language model;
[0376] The second prediction sample includes a sample intent statement and a sample output command. The second prediction sample is used to guide the language model to predict the command line interface command corresponding to the intent statement by referring to the correspondence between the sample intent statement and the sample output command.
[0377] In an optional implementation of this embodiment, the natural language information includes a first sub-statement and a second sub-statement; the receiving module 820 is further configured to:
[0378] Receive the first input operation of the first sub-statement, the first sub-statement being used to control the second computer device;
[0379] In response to the first input operation, a supplementary guidance statement is displayed, which is used to guide the supplementary control of the semantically missing elements of the second computer device;
[0380] Receive a second input operation for the second sub-statement, the second sub-statement having the semantic missing element that is missing in the first sub-statement;
[0381] The first control command and the control feedback information are displayed in response to the second input operation.
[0382] In an optional implementation of this embodiment, the receiving module 820 is further configured to:
[0383] In response to the first input operation, the language model is invoked to perform prediction on the first sub-statement and the third preset statement to obtain the first reference label and the supplementary guidance statement. The third preset statement is used to instruct the language model to predict whether there are missing elements in the statement intent of the first sub-statement, and to predict the guidance statement for the semantically missing elements.
[0384] The supplementary guiding statement is displayed, and the first reference label is used to indicate that the first sub-statement has missing elements;
[0385] The supplementary guiding statement is obtained by the language model based on the first sub-statement, given that the first reference label has been predicted.
[0386] In an optional implementation of this embodiment, the subset of the third preset statement includes the first preset statement, which is used to instruct the language model to predict the statement intent of natural language information;
[0387] The first control command for the second computer device is obtained based on an intent statement, which is predicted by the language model when there are no missing elements in the union of the first and second sub-statements.
[0388] In an optional implementation of this embodiment, the first control command does not belong to the set of candidate commands to be rejected by the second computer device; the processing module 830 is further configured to:
[0389] In response to the input operation, a second control command and a rejection message are displayed for the second computer device, the rejection message indicating that the execution of the second control command for the second computer device is refused, the second control command belonging to the candidate command set.
[0390] In an optional implementation of this embodiment, the processing module 830 is further configured to:
[0391] In response to the input operation, the language model is invoked to perform prediction on the natural language information and the fourth preset statement to obtain the second control command and the first execution label. The fourth preset statement is used to instruct the language model to predict the command line interface command corresponding to the natural language information, and to predict whether the command line interface command corresponding to the natural language information belongs to the candidate command set.
[0392] Based on the first execution label, the rejection information corresponding to the second control command and the first execution label is displayed; the first execution label is used to indicate that the second control command belongs to the candidate command set.
[0393] In an optional implementation of this embodiment, the set of candidate commands carried by the fourth preset statement includes at least one of the following:
[0394] The commands include: a first command to delete the storage files of the second computer device; a second command to modify the configuration file of the second computer device; a third command to shut down or restart the second computer device; a fourth command to modify the operating permissions of the second computer device; and a fifth command that exceeds the current operating permissions of the second computer device.
[0395] In an optional implementation of this embodiment, the display module 810 is further configured to:
[0396] The analysis information displayed is used to interpret the control feedback information in natural language.
[0397] In an optional implementation of this embodiment, the processing module 830 is further configured to:
[0398] The language model is invoked to perform prediction on the first control command, the control feedback information, and the fifth preset statement to obtain the analysis information. The fifth preset statement is used to instruct the language model to predict the reason for obtaining the control feedback information based on the first control command.
[0399] In an optional implementation of this embodiment, the receiving module 820 is further configured to acquire input operations for chat statement information, wherein the chat statement information has chat semantics in natural language dialogue.
[0400] The processing module 830 is further configured to respond to the input operation of the chat statement information by displaying a chat reply statement, wherein the chat reply statement is a response to the chat statement information.
[0401] In an optional implementation of this embodiment, the processing module 830 is further configured to:
[0402] In response to the input operation of the chat statement information, the language model is invoked to perform prediction on the chat statement information and the sixth preset statement to obtain the first intent label of the chat statement information. The sixth preset statement is used to instruct the language model to predict the intent type of the natural language information.
[0403] Based on the first intent tag, the chat reply statement is obtained according to the chat statement information, and the chat reply statement is displayed. The first intent tag is used to indicate that the intent type of the chat statement information is casual conversation.
[0404] In an optional implementation of this embodiment, the processing module 830 is further configured to:
[0405] In response to the input operation, a language model is invoked to perform prediction on the natural language information and the sixth preset statement to obtain a second intent label for the natural language information;
[0406] The second intent label is used to indicate that the intent type of the natural language information is to control the second computer device, and the first control command and the control feedback information are displayed when the natural language information corresponds to the second intent label.
[0407] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0408] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments of the relevant method; the technical effects achieved by each module performing its operation are the same as the technical effects in the embodiments of the relevant method, and will not be elaborated here.
[0409] This application also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program; the processor is used to execute the computer program in the memory to implement the natural language information processing method provided in the above method embodiments.
[0410] Alternatively, the computer device is a server. For example, Figure 13 This is a structural block diagram of a server provided in an exemplary embodiment of this application.
[0411] Typically, server 2300 includes a processor 2301 and memory 2302.
[0412] Processor 2301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2301 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 2301 may also include a main processor and a coprocessor. The main processor, also known as a central processing unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2301 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 2301 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0413] The memory 2302 may include one or more computer-readable storage media, which may be non-transitory. The memory 2302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2302 are used to store at least one instruction, which is executed by the processor 2301 to implement the natural language information processing method provided in the method embodiments of this application.
[0414] In some embodiments, the server 2300 may optionally include an input interface 2303 and an output interface 2304. The processor 2301, memory 2302, and input interfaces 2303 and 2304 can be connected via a bus or signal lines. Various peripheral devices can be connected to the input interfaces 2303 and 2304 via a bus, signal lines, or a circuit board. The input interfaces 2303 and 2304 can be used to connect at least one input / output (I / O) related peripheral device to the processor 2301 and memory 2302. In some embodiments, the processor 2301, memory 2302, and input interfaces 2303 and 2304 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, memory 2302, and input interfaces 2303 and 2304 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.
[0415] Those skilled in the art will understand that the structure shown above does not constitute a limitation on server 2300, and may include more or fewer components than shown, or combine certain components, or employ different component arrangements.
[0416] In an exemplary embodiment, a chip is also provided, the chip including programmable logic circuits and / or program instructions, which, when the chip is run on a computer device, are used to implement the natural language information processing method described above.
[0417] In an exemplary embodiment, a computer program product is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the natural language information processing methods provided in the above-described method embodiments.
[0418] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores a computer program that is loaded and executed by a processor to implement the natural language information processing method provided in the above-described method embodiments.
[0419] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0420] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0421] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for processing natural language information, characterized in that, The method is performed by a first computer device, and the method includes: The input field for displaying natural language information; Receive input operations from the input port, the input operations being used to input natural language information, the natural language information being used to control the second computer device; In response to the input operation, a first control command for the second computer device and control feedback information for the second computer device are displayed. The first control command is a command-line interface command for semantically controlling the second computer device based on the natural language information. The control feedback information is used to indicate the execution result of the first control command by the second computer device.
2. The method according to claim 1, characterized in that, The first control command is used to instruct the second computer device to view a file, edit a file, modify the file save path, search for a file, view memory usage, view disk usage, terminate a process, query the process identity, start a process, or create a file directory, at least one of the following:
3. The method according to claim 1, characterized in that, The response to the input operation, displaying a first control command for the second computer device and control feedback information for the second computer device, includes: In response to the input operation, a language model is invoked to perform prediction on the natural language information and a first preset statement to obtain the intention statement of the natural language information. The first preset statement is used to instruct the language model to predict the statement intention of the natural language information. The language model is invoked to predict the intent statement and the second preset statement to obtain the first control command. The second preset statement is used to instruct the language model to predict the command line interface command corresponding to the intent statement. Based on the first control command, the control feedback information is obtained, and the first control command and the control feedback information are displayed.
4. The method according to claim 3, characterized in that, The first preset statement includes a first demand statement and / or a first prediction sample; The first requirement statement is used to indicate at least one of the statement basis, statement order, and tone of the natural language statement expected to be output by the language model; The first prediction sample includes a sample input statement and a sample intent statement. The first prediction sample is used to guide the language model to predict a natural language statement that describes the intent of the natural language information by referring to the correspondence between the sample input statement and the sample intent statement.
5. The method according to claim 3, characterized in that, The second preset statement includes a second demand statement and / or a second prediction sample; The second requirement statement is used to indicate the command language type of the first control command that is expected to be output by the language model; The second prediction sample includes a sample intent statement and a sample output command. The second prediction sample is used to guide the language model to predict the command line interface command corresponding to the intent statement by referring to the correspondence between the sample intent statement and the sample output command.
6. The method according to any one of claims 1 to 5, characterized in that, The natural language information includes a first sub-statement and a second sub-statement; the receiving of input operations at the input port includes: Receive the first input operation of the first sub-statement, the first sub-statement being used to control the second computer device; In response to the first input operation, a supplementary guidance statement is displayed, which is used to guide the supplementary control of the semantically missing elements of the second computer device; Receive a second input operation for the second sub-statement, the second sub-statement having the semantic missing element that is missing in the first sub-statement; The first control command and the control feedback information are displayed in response to the second input operation.
7. The method according to claim 6, characterized in that, The step of displaying supplementary guidance statements in response to the first input operation includes: In response to the first input operation, the language model is invoked to perform prediction on the first sub-statement and the third preset statement to obtain the first reference label and the supplementary guidance statement. The third preset statement is used to instruct the language model to predict whether there are missing elements in the statement intent of the first sub-statement, and to predict the guidance statement for the semantically missing elements. The supplementary guiding statement is displayed, and the first reference label is used to indicate that the first sub-statement has missing elements; The supplementary guiding statement is obtained by the language model based on the first sub-statement, given that the first reference label has been predicted.
8. The method according to claim 7, characterized in that, The subset of the third preset statement includes the first preset statement, which is used to instruct the language model to predict the statement intent of natural language information. The first control command for the second computer device is obtained based on an intent statement, which is predicted by the language model when there are no missing elements in the union of the first and second sub-statements.
9. The method according to any one of claims 1 to 5, characterized in that, The first control command does not belong to the set of candidate commands for rejecting execution by the second computer device; the method further includes: In response to the input operation, a second control command and a rejection message are displayed for the second computer device, the rejection message indicating that the execution of the second control command for the second computer device is refused, the second control command belonging to the candidate command set.
10. The method according to claim 9, characterized in that, The response to the input operation, displaying a second control command and rejection information for the second computer device, includes: In response to the input operation, the language model is invoked to perform prediction on the natural language information and the fourth preset statement to obtain the second control command and the first execution label. The fourth preset statement is used to instruct the language model to predict the command line interface command corresponding to the natural language information, and to predict whether the command line interface command corresponding to the natural language information belongs to the candidate command set. Based on the first execution label, the rejection information corresponding to the second control command and the first execution label is displayed; the first execution label is used to indicate that the second control command belongs to the candidate command set.
11. The method according to claim 10, characterized in that, The set of candidate commands carried by the fourth preset statement includes at least one of the following: The commands include: a first command to delete the storage files of the second computer device; a second command to modify the configuration file of the second computer device; a third command to shut down or restart the second computer device; a fourth command to modify the operating permissions of the second computer device; and a fifth command that exceeds the current operating permissions of the second computer device.
12. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The analysis information displayed is used to interpret the control feedback information in natural language.
13. The method according to claim 12, characterized in that, The method further includes: The language model is invoked to perform prediction on the first control command, the control feedback information, and the fifth preset statement to obtain the analysis information. The fifth preset statement is used to instruct the language model to predict the reason for obtaining the control feedback information based on the first control command.
14. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The input operation of receiving chat statement information, wherein the chat statement information has chat semantics in natural language dialogue; In response to the input of the chat statement, a chat reply statement is displayed, which is a response to the chat statement.
15. The method according to claim 14, characterized in that, The step of displaying a chat reply in response to the input of the chat message includes: In response to the input operation of the chat statement information, the language model is invoked to perform prediction on the chat statement information and the sixth preset statement to obtain the first intent label of the chat statement information. The sixth preset statement is used to instruct the language model to predict the intent type of the natural language information. Based on the first intent tag, the chat reply statement is obtained according to the chat statement information, and the chat reply statement is displayed. The first intent tag is used to indicate that the intent type of the chat statement information is casual conversation.
16. The method according to claim 15, characterized in that, The method further includes: In response to the input operation, a language model is invoked to perform prediction on the natural language information and the sixth preset statement to obtain a second intent label for the natural language information; The second intent label is used to indicate that the intent type of the natural language information is to control the second computer device, and the first control command and the control feedback information are displayed when the natural language information corresponds to the second intent label.
17. A natural language information processing device, characterized in that, The device includes: The display module is used to display the input entry point for natural language information. The receiving module is used to receive input operations on the input port, the input operations being used to input natural language information, and the natural language information being used to control the second computer device; A processing module is configured to respond to the input operation by displaying a first control command for the second computer device and control feedback information for the second computer device. The first control command is a command-line interface command for semantically controlling the second computer device based on the natural language information. The control feedback information is used to indicate the execution result of the first control command by the second computer device.
18. A computer device, characterized in that, The computer device includes: a processor and a memory, wherein the memory stores at least one program; the processor is configured to execute the at least one program in the memory to implement the natural language information processing method as described in any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that, The readable storage medium stores executable instructions, which are loaded and executed by a processor to implement the natural language information processing method as described in any one of claims 1 to 16.
20. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the natural language information processing method as described in any one of claims 1 to 16.