Method and apparatus for converting natural language to command and dispatch instruction

By combining the BERT model and the CNN encoder, an automated conversion from natural language text to command and dispatch instructions is achieved, solving the problems of time-consuming, labor-intensive, and error-prone traditional command and dispatch systems, improving the accuracy and efficiency of the conversion, and adapting to various application scenarios.

WO2026144085A1PCT designated stage Publication Date: 2026-07-09SHANGHAI SHUGUO TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SHANGHAI SHUGUO TECH CO LTD
Filing Date
2025-07-08
Publication Date
2026-07-09

AI Technical Summary

Technical Problem

Traditional command and dispatch systems rely on manual operation, which is time-consuming, labor-intensive, and prone to errors, making it difficult to meet the modern needs for efficient and precise command and dispatch.

Method used

By combining the BERT model and CNN encoder, text information is extracted through natural language text processing, and feature vectors are mapped to the command and dispatch instruction set to determine the target command and dispatch instructions, thereby achieving automated conversion.

Benefits of technology

It improves the accuracy and efficiency of instruction conversion, reduces manual intervention and error rate, meets real-time requirements, and adapts to the instruction conversion needs of different fields and scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025107448_09072026_PF_FP_ABST
    Figure CN2025107448_09072026_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for converting natural language to a command and dispatch instruction, relating to the field of data processing. The method comprises: when a natural language text is received, processing the natural language text by means of a preset Bert model to extract text information in the natural language text; processing the text information by means of a preset CNN encoder to extract a feature vector, and mapping the feature vector into a command and dispatch instruction set to determine a target command and dispatch instruction; and outputting the target command and dispatch instruction to a target object. Implementing the technical solution provided in the present application improves the accuracy and real-time performance of converting a natural language text into a command and dispatch instruction.
Need to check novelty before this filing date? Find Prior Art

Description

A method and apparatus for converting natural language into command and dispatch instructions. Technical Field

[0001] This application relates to the technical field of data processing, specifically to a method and apparatus for converting natural language into command and dispatch instructions. Background Technology

[0002] With the rapid development of information technology, natural language processing (NLP) technology has been widely applied in various fields. Especially in command and dispatch systems, NLP technology can effectively improve work efficiency and decision-making accuracy.

[0003] Traditional command and dispatch systems typically rely on manual operation, requiring professionals to manually input instructions or navigate through complex menus to complete tasks. This approach is not only time-consuming and labor-intensive but also prone to errors, making it difficult to meet the demands of modern, efficient, and precise command and dispatch systems.

[0004] Therefore, there is an urgent need for a more flexible and efficient method for converting natural language into command and dispatch instructions. Summary of the Invention

[0005] This application provides a method and apparatus for converting natural language into command and dispatch instructions. By combining the advantages of the BERT model and the CNN encoder, it achieves efficient, accurate, intelligent and real-time conversion from natural language text to command and dispatch instructions.

[0006] The first aspect of this application provides a method for converting natural language into command and dispatch instructions, characterized in that it is applied to an instruction conversion platform, the method comprising:

[0007] When natural language text is received, the natural language text is processed by a preset BERT model to extract text information from the natural language text;

[0008] The text information is processed by a preset CNN encoder to extract feature vectors, and the feature vectors are mapped to a set of command and dispatch instructions to determine the target command and dispatch instructions.

[0009] The target command and dispatch instructions are output to the target object.

[0010] Optionally, the step of processing the natural language text using a preset BERT model to extract textual information from the natural language text includes:

[0011] The natural language text is segmented using the preset Bert model to obtain multiple text information units, which include words, phrases, or punctuation marks.

[0012] Each text information unit is converted into a corresponding numerical vector, and the numerical vector is processed using a multi-layer Transformer encoder in the preset BERT model to extract text information from the natural language text. The text information includes entity name, entity relationship, context information, and semantic role.

[0013] Optionally, the step of processing the text information using a preset CNN encoder to extract feature vectors includes:

[0014] The text information is input into the preset CNN encoder, and the text information is convolved by the convolutional layer of the preset CNN encoder to extract local features;

[0015] Pooling layers are used to downsample the local features after the convolution operation to obtain sampling results, and the sampling results are processed through fully connected layers to obtain feature vectors.

[0016] Optionally, processing the sampling result through a fully connected layer to obtain a feature vector includes:

[0017] The feature maps output by multiple pooling layers are flattened into one-dimensional vectors, and the one-dimensional vectors are concatenated together to form a high-dimensional feature representation.

[0018] The high-dimensional feature representation is input into one or more fully connected layers, and linear transformation and nonlinear activation are performed through weight matrices and bias terms to obtain the feature vector.

[0019] Optionally, the step of processing the text information using a preset CNN encoder to extract feature vectors further includes:

[0020] Calculate the attention weight for each text information unit, and then perform a weighted summation of the attention weights and the corresponding text information units to obtain a new text information representation;

[0021] The new text information representation is processed through the fully connected layer of the preset CNN encoder to obtain a feature vector.

[0022] Optionally, mapping the feature vector to a set of command and dispatch instructions to determine the target command and dispatch instructions includes:

[0023] The feature vector is input into a softmax layer to map the feature vector into a probability distribution, where each probability value in the probability distribution corresponds to an instruction in the command and dispatch instruction set;

[0024] The instruction with the highest probability value in the probability distribution is selected as the target command and dispatch instruction.

[0025] Optionally, inputting the feature vector into the softmax layer to map the feature vector to a probability distribution includes:

[0026] The feature vector is used as the input to the softmax layer, wherein the number of input nodes of the softmax layer matches the dimension of the feature vector;

[0027] The feature vector is linearly transformed by the weight matrix of the softmax layer to obtain the transformed vector.

[0028] Apply the softmax function to the transformed vector to convert each component of the transformed vector into a probability value.

[0029] A second aspect of this application provides a natural language to command and dispatch instruction conversion system, characterized in that it includes a text module, an instruction module, and an output module, wherein:

[0030] The text module is configured to process natural language text using a preset BERT model to extract text information when natural language text is received.

[0031] The instruction module is configured to process the text information through a preset CNN encoder to extract feature vectors, and map the feature vectors to a set of command and dispatch instructions to determine the target command and dispatch instructions.

[0032] The output module is configured to output the target command and dispatch instructions to the target object.

[0033] A third aspect of this application provides an electronic device including a processor, a memory, a user interface, and a network interface, wherein the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method as described in any of the foregoing.

[0034] A fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed, perform the method described in any of the preceding descriptions.

[0035] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0036] 1. The system processes natural language text using a pre-defined BERT model. With its powerful natural language processing capabilities, the BERT model can deeply understand the semantic content of the text, thereby accurately extracting key information. This provides a solid foundation for subsequent instruction conversion, ensuring the accuracy and efficiency of the conversion results.

[0037] 2. The extracted text information is processed by a pre-set CNN (Convolutional Neural Networks) encoder to further extract feature vectors. CNNs perform excellently in processing both structured and unstructured data, effectively capturing key features in the text. These feature vectors are then mapped to a set of command and dispatch instructions, and a smart matching algorithm determines the target command and dispatch instructions. This process not only improves the intelligence level of instruction conversion but also makes the conversion results more in line with actual needs.

[0038] 3. It achieves automated conversion from natural language text to command and dispatch instructions, significantly reducing manual intervention and error rates. Furthermore, due to the high processing speed of the BERT model and CNN encoder, instruction conversion can be completed quickly, meeting real-time requirements. This is particularly important for command and dispatch scenarios requiring rapid response.

[0039] 4. It can be applied to various scenarios requiring instruction conversion, such as military command, emergency dispatch, and logistics management. By optimizing and adjusting the preset BERT model and CNN encoder, it can adapt to the instruction conversion needs of different fields and scenarios, and has broad application prospects and market value. Attached Figure Description

[0040] Figure 1 is a flowchart illustrating the method for converting natural language into command and dispatch instructions disclosed in an embodiment of this application;

[0041] Figure 2 is a schematic diagram illustrating the principle of the natural language to command and dispatch instructions conversion method disclosed in the embodiments of this application;

[0042] Figure 3 is a schematic diagram of the model training process for the natural language to command and dispatch instructions conversion method disclosed in the embodiments of this application;

[0043] Figure 4 is another flowchart illustrating the method for converting natural language into command and dispatch instructions disclosed in an embodiment of this application;

[0044] Figure 5 is a schematic diagram of the modules of the natural language to command and dispatch instruction conversion system disclosed in the embodiments of this application;

[0045] Figure 6 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application.

[0046] Explanation of reference numerals in the attached figures: 501, text module; 502, instruction module; 503, output module; 601, processor; 602, communication bus; 603, user interface; 604, network interface; 605, memory. Detailed Implementation

[0047] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0048] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0049] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0050] This embodiment discloses a method for converting natural language into command and dispatch instructions, applied to an instruction conversion platform. Figure 1 is a flowchart illustrating the method for converting natural language into command and dispatch instructions disclosed in this embodiment. As shown in Figure 1, the method includes the following steps:

[0051] S101. When natural language text is received, the natural language text is processed by a preset BERT model to extract text information from the natural language text.

[0052] S102. The text information is processed by a preset CNN encoder to extract feature vectors, and the feature vectors are mapped to a set of command and dispatch instructions to determine the target command and dispatch instructions.

[0053] S103. Output the target command and dispatch instructions to the target object.

[0054] The instruction conversion platform comprises a command and dispatch platform client, a BERT model server, and a CNN encoder. Information is sequentially transmitted between the command and dispatch platform client, the BERT model server, and the CNN encoder to convert natural language into command and dispatch instructions. Data transmission between the command and dispatch platform client and the BERT model server is achieved via an HTTP interface. Before the BERT model server processes the natural language text, it is necessary to ensure that the HTTP interface between the command and dispatch client and the BERT model server is interoperable. Successful transmission of natural language text to the BERT model server via the HTTP interface is a prerequisite for the conversion of natural language text into command and dispatch instructions.

[0055] The platform receives a piece of natural language text. Natural language text may come from various sources, such as user input, speech conversion, or sensor data, and it contains information that needs to be understood and processed. The natural language text is fed into a pre-trained BERT (Bidirectional Encoder Representations from Transformers) model. The BERT model is a powerful language representation model that accurately captures semantic information in text by understanding its contextual relationships. In this step, the BERT model transforms the text into a series of vector representations that capture the meaning and contextual relationships of each word or phrase in the text. Through the processing of the BERT model, the vector representations of the text are obtained, containing important information. This information is extracted and prepared for the next step of processing. The extracted text information (i.e., the vectors output by the BERT model) is fed into a pre-trained CNN (Convolutional Neural Network) encoder. CNN encoders excel at extracting local features from data and combining these features through convolutional operations to form higher-level feature representations. In this step, the CNN encoder transforms the vectors output by the BERT model into a series of feature vectors that better represent the key information and patterns in the text. After obtaining the feature vectors, the system maps them to a predefined set of command and dispatch instructions. This set contains all possible command and dispatch instructions, each associated with a specific feature vector pattern. By comparing the feature vectors with the patterns in the instruction set, the system can determine the target command and dispatch instruction that best matches the current text information. Finally, the system outputs the determined target command and dispatch instruction to the target object. This target object could be a person (such as a commander or operator) or another automated system (such as a drone or robot). In this way, the system can quickly generate and output corresponding command and dispatch instructions based on the received natural language text.

[0056] By processing natural language text using a pre-defined BERT model, key information can be automatically extracted without human intervention. A CNN encoder further enhances the intelligence of information processing by extracting features from the extracted text. The BERT model excels in natural language understanding tasks, accurately capturing semantic information in text and providing a solid foundation for subsequent instruction determination. The CNN encoder effectively extracts feature vectors through convolutional operations, transforming complex text information into a form easily classified and recognized, thus improving the accuracy of instruction determination. Mapping these feature vectors to a command and dispatch instruction set allows for the rapid identification of the instruction best matching the target text, improving processing efficiency. The parameters of the BERT model and CNN encoder can be adjusted as needed to adapt to different application scenarios and text types. The command and dispatch instruction set can be expanded and updated according to actual needs to adapt to constantly changing command and dispatch requirements. Through automated and intelligent processing, target command and dispatch instructions can be generated quickly, reducing the time and cost of manual decision-making. Accurate instruction generation helps improve decision-making quality, ensuring the accuracy and effectiveness of command and dispatch. In emergency situations, it can quickly respond and generate corresponding command and dispatch instructions, providing strong support for emergency response and crisis management.

[0057] Figure 2 is a schematic diagram of the principle of the natural language to command and dispatch instructions conversion method disclosed in the embodiments of this application. As shown in Figure 2, the conversion method includes the following steps: S201, inputting natural language text into the client; S202, performing text segmentation processing in the BERT model; S203, capturing text information and contextual semantics; S204, performing feature capture and semantic extraction in the CNN encoder; S205, generating specific instructions and sending them to the client.

[0058] Figure 3 is a schematic flowchart of the model training process for the natural language to command and dispatch instructions conversion method disclosed in this application. As shown in Figure 3, the model training includes the following steps: S301, dataset generation; S302, model training; S303, model testing; S304, token conversion; S305, token serialization; S306, transformers extract key information; S307, CNN encoder further extracts features and spatial relationships; S308, mapping specific command and dispatch instructions; when the instruction recognition does not meet expectations, the model is fine-tuned and step S302 is repeated; training ends when the instruction recognition meets expectations.

[0059] Specifically, a comprehensive statistical analysis of all relevant instructions potentially used in the command and dispatch platform is conducted to ensure that these instructions cover all the platform's required functions. This can be achieved by analyzing existing system operation logs, user manuals, and communication with platform users. Based on the statistically obtained instruction set, a command dataset usable by the BERT model is generated manually or automatically using scripts. The dataset should include various possible natural language representations that can accurately map to specific instructions in the instruction set. Simultaneously, to enhance the model's generalization ability, the dataset should also include some negative samples related to the instructions but not in the instruction set. Before training the BERT model, the dataset needs to be preprocessed, including text cleaning, word segmentation, and stop word removal, to ensure the quality of the text data input into the model. The BERT model is trained using the preprocessed dataset, with the training objective being to enable the model to accurately convert natural language text into corresponding command and dispatch instructions. During training, strategies such as cross-validation and early stopping can be used to prevent overfitting. Single instruction conversion tests are conducted by manually inputting natural language text into the BERT model server to verify the model's basic functionality. Multiple natural language texts were written to files for batch conversion into command and dispatch instructions to test the model's performance and accuracy when processing large amounts of data. After testing, the conversion results were carefully reviewed to ensure they met expectations. Model performance can be quantified by calculating metrics such as accuracy, recall, and F1 score. If the accuracy of instruction recognition did not meet expectations, the BERT model needed fine-tuning. This could be achieved by adding more manual datasets, augmenting the dataset (e.g., using data augmentation techniques to generate more diverse training samples), and adjusting model parameters. After fine-tuning, the BERT model was trained again until the expected results in instruction recognition were achieved. This process may require multiple iterations, with model performance re-evaluated after each iteration. The trained BERT model was then deployed to the server of the command and dispatch platform for practical application. During operation, the model's performance, including processing speed and accuracy, was continuously monitored. If performance degradation or other problems were detected, timely investigation and repair were necessary. As the command and dispatch platform evolved and user needs changed, the BERT model needed continuous updates and optimizations to adapt to new application scenarios and instruction requirements.

[0060] Figure 4 is another flowchart illustrating the method for converting natural language into command and dispatch instructions disclosed in this application. As shown in Figure 4, the method includes the following steps: S401, inputting natural language text into the client; S402, segmenting the text into tokens using the BERT model; S403, token conversion; S404, token serialization; S405, extracting key information using transformers; S406, further extracting features and spatial relationships using a CNN encoder; S407, mapping specific command and dispatch instructions and sending them to the client.

[0061] Optionally, the step of processing the natural language text using a preset BERT model to extract textual information from the natural language text includes:

[0062] The natural language text is segmented using the preset Bert model to obtain multiple text information units, which include words, phrases, or punctuation marks.

[0063] Each text information unit is converted into a corresponding numerical vector, and the numerical vector is processed using a multi-layer Transformer encoder in the preset BERT model to extract text information from the natural language text. The text information includes entity name, entity relationship, context information, and semantic role.

[0064] The BERT model is used to segment natural language text. Segmentation is the process of dividing continuous natural language text into individual text information units (tokens). These tokens can be words, phrases, or punctuation marks, depending on the tokenizer used by the BERT model. Words are the basic units that make up sentences, such as "cat" or "dog". Phrases are combinations of multiple characters or words with specific meanings, such as "natural language processing" or "computer". Punctuation marks are used to separate sentences, phrases, or words, such as periods, commas, and quotation marks. The result of the segmentation process is a list containing multiple tokens, each representing an independent information unit in the original text. Each token is then converted into a corresponding numerical vector. This step is achieved through the word embedding layer of the BERT model. Word embedding is a technique that maps words or phrases in a vocabulary to a high-dimensional vector space, making semantically similar words closer together in the vector space. Each token is converted into a fixed-length numerical vector that captures the semantic information of the token. Numerical vectors can be directly input into machine learning models for computation and inference. These numerical vectors are processed using multi-layered Transformer encoders in the BERT model. Transformer is a neural network architecture based on self-attention, capable of efficiently processing sequential data. By stacking multiple Transformer encoders, deep features in the text can be extracted progressively. The BERT model uses a bidirectional Transformer encoder, which can simultaneously consider the left and right contextual information of each token in the text, thus more accurately understanding the meaning of the text. Key textual information from the processed numerical vectors is extracted. This information includes entity names, entity relationships, contextual information, and semantic roles. Entity names: Specific objects or concepts mentioned in the text, such as names of people, places, and organizations. Entity relationships: Associations or relationships between entities, such as "Zhang San" being a friend of "Li Si". Contextual information: The context in which each token exists in the text, which helps in understanding the specific meaning of the token. Semantic roles: The semantic role played by each token in the sentence, such as subject, predicate, and object.

[0065] By segmenting natural language text using the BERT model, text can be accurately divided into multiple textual information units (such as words, phrases, or punctuation marks), which forms the basis for subsequent information extraction. The accuracy of the segmentation results is crucial for subsequent information extraction. The BERT model, with its powerful contextual understanding capabilities, can better consider the overall semantics of the text during segmentation, thereby improving accuracy. Converting each textual information unit into a corresponding numerical vector is a common method used by machine learning models to process text data. By converting textual information into numerical form, the model can perform calculations and inferences more efficiently. Using the multi-layer Transformer encoder in the BERT model to process these numerical vectors, deep-level features in the text can be captured, including syntactic structure and semantic relationships. Through the processing of the BERT model, various textual information can be extracted from natural language text, such as entity names, entity relationships, contextual information, and semantic roles. This information is of great value for tasks such as understanding text content, performing text analysis, and constructing knowledge graphs. Extracting entity names and entity relationships helps identify key entities in a text and their interrelationships; extracting contextual information helps understand the overall semantics and background of the text; and extracting semantic roles helps reveal the grammatical and semantic relationships between the various components of the text.

[0066] Optionally, the step of processing the text information using a preset CNN encoder to extract feature vectors includes:

[0067] The text information is input into the preset CNN encoder, and the text information is convolved by the convolutional layer of the preset CNN encoder to extract local features;

[0068] Pooling layers are used to downsample the local features after the convolution operation to obtain sampling results, and the sampling results are processed through fully connected layers to obtain feature vectors.

[0069] Textual information (such as entity names, entity relationships, contextual information, and semantic roles) processed by the BERT model is input into a pre-defined CNN encoder. This textual information has typically been converted into numerical vectors for processing by the CNN encoder. The convolutional layers of the CNN encoder are the key part for extracting textual features. Convolutional layers perform convolution operations on the input numerical vector using multiple convolutional kernels, thereby extracting local features from the text. These local features typically correspond to keywords, phrases, or specific semantic patterns in the text. In the convolution operation, each convolutional kernel covers a portion of the input vector and calculates a weighted sum of that portion and the kernel. By sliding the convolutional kernels and repeating this process, local features at different locations in the input vector can be extracted. Convolutional layers typically use multiple convolutional kernels of different sizes to capture features at different scales. Pooling layers follow the convolutional layers and are used to downsample the local features after the convolution operation. The purpose of downsampling is to reduce the dimensionality of the features, thereby reducing computational cost and improving the model's generalization ability. Pooling layers typically use methods such as max pooling or average pooling to divide the feature map output by the convolutional layer into multiple small regions, and select the maximum or average value from each small region as the representative feature of that region. Through the downsampling operation of the pooling layer, more compact and robust feature representations can be obtained, which are of great value for subsequent tasks such as text classification, sentiment analysis, and information extraction. After downsampling by the pooling layer, the sampled result is flattened into a one-dimensional vector and input into a fully connected layer for processing. A fully connected layer typically contains multiple neurons, each connected to every element in the sampled result. The role of the fully connected layer is to combine and transform the features in the sampled result to obtain the final feature vector. During the feature vector extraction process, the fully connected layer can optimize the feature representation by learning weights and bias parameters. These parameters are updated and adjusted during training using the backpropagation algorithm to allow the model to better adapt to the distribution and features of the input data. The feature vector processed by the fully connected layer is output as the output of the CNN encoder. This feature vector contains rich feature representations of the input text information and can be used in subsequent tasks such as text classification, sentiment analysis, and information extraction.

[0070] The convolutional layers of a CNN encoder efficiently extract local features from text information through convolutional operations. These local features typically correspond to specific patterns or structures in the text, such as keywords, phrases, or specific grammatical structures. The convolutional operation applies multiple kernels to the text information using a sliding window approach, with each kernel capturing different features. This method of local feature extraction makes CNNs highly efficient and accurate when processing text data. Pooling layers downsample the local features after the convolutional operation to obtain the sampled results. The main purpose of this step is to reduce the number of features (i.e., dimensionality reduction), thereby reducing the complexity of subsequent computations. Through pooling, CNNs can retain the most important feature information while removing redundancy and noise, which helps improve the model's generalization ability and robustness. The sampled results are processed through fully connected layers to obtain feature vectors. The fully connected layers integrate the local features output by the pooling layers into global features, forming a comprehensive representation of the text information. The feature vectors, as the output of the CNN encoder, contain the main features and semantic information of the text information and can be used for subsequent tasks such as classification, clustering, and retrieval. As a general-purpose feature extractor, the CNN encoder can adapt to different types of text data. By adjusting parameters such as the size and number of convolutional kernels and the pooling method, CNN encoders can be optimized to adapt to specific tasks and datasets. Furthermore, CNN encoders can be combined with other deep learning models (such as RNNs, LSTMs, and BERTs) to form more complex hybrid models, further improving the performance of text processing tasks.

[0071] Optionally, processing the sampling result through a fully connected layer to obtain a feature vector includes:

[0072] The feature maps output by multiple pooling layers are flattened into one-dimensional vectors, and the one-dimensional vectors are concatenated together to form a high-dimensional feature representation.

[0073] The high-dimensional feature representation is input into one or more fully connected layers, and linear transformation and nonlinear activation are performed through weight matrices and bias terms to obtain the feature vector.

[0074] The feature maps output by each pooling layer need to be flattened into one-dimensional vectors. This step converts the two-dimensional feature maps into one-dimensional vectors for subsequent processing. Specifically, the flattening operation involves arranging each element of the feature map in a certain order (e.g., row-major or column-major) into a one-dimensional array. Next, the flattened one-dimensional vectors from multiple pooling layers are concatenated to form a high-dimensional feature representation. The purpose of this step is to fuse the features extracted by different pooling layers to form a more comprehensive and richer feature representation of the input data. The high-dimensional feature representation is then fed into one or more fully connected layers (FC layers) for processing to obtain feature vectors. In the fully connected layer, the input high-dimensional feature representation is first linearly transformed using a weight matrix and bias terms. Each element of the weight matrix is ​​a learned parameter that determines the importance of the input features to the output features. The bias terms are used to adjust the range and offset of the output features. After the linear transformation, a non-linear transformation is usually performed on the output using a non-linear activation function. Commonly used nonlinear activation functions include ReLU (Rectified Linear Unit), Sigmoid, and Tanh. The introduction of nonlinear activation functions allows neural networks to fit more complex nonlinear patterns, improving the model's expressive power. In some complex tasks, multiple fully connected layers may be needed for feature extraction and transformation. Each fully connected layer receives the output of the previous layer as input and outputs a new feature representation. Through multi-layer processing, higher-level and more abstract features can be extracted progressively to better perform tasks such as classification and regression. After processing by one or more fully connected layers, a feature vector is finally output. This feature vector contains global features and semantic information of the input data and can be used for subsequent tasks such as classification, clustering, and retrieval.

[0075] Flattening the feature maps output by multiple pooling layers into one-dimensional vectors and concatenating these vectors creates a high-dimensional feature representation. This step integrates local features, bringing together information scattered across different feature maps and providing comprehensive input for subsequent feature extraction and classification tasks. While the high-dimensional feature representation formed through concatenation may contain significant redundancy and noise, the introduction of fully connected layers allows for further dimensionality reduction and filtering of features through linear transformations of the weight matrix and bias terms, preserving the most important feature information and improving the model's generalization ability. Fully connected layers are typically used in conjunction with non-linear activation functions (such as ReLU, Sigmoid, Tanh, etc.) to introduce non-linearity, enabling the network to learn more complex and abstract feature combinations. This is crucial for capturing non-linear features in text data, contributing to improved model accuracy and robustness. Fully connected layers can adjust their output dimension according to task requirements, resulting in feature vectors of different lengths. This flexibility allows fully connected layers to adapt to different application scenarios and task requirements, such as text classification, sentiment analysis, and information retrieval. Inputting high-dimensional feature representations into one or more fully connected layers allows for full utilization of the feature integration and learning capabilities of fully connected layers, extracting more comprehensive and effective feature information. This helps improve the model's performance in text processing tasks, such as accuracy and recall. The feature vectors obtained after processing by fully connected layers typically have fixed length and dimensions, which facilitates subsequent processing and classification tasks. For example, the feature vectors can be input into classifiers (such as softmax classifiers) for text classification, or used for tasks such as text similarity calculation and clustering.

[0076] Optionally, the step of processing the text information using a preset CNN encoder to extract feature vectors further includes:

[0077] Calculate the attention weight for each text information unit, and then perform a weighted summation of the attention weights and the corresponding text information units to obtain a new text information representation;

[0078] The new text information representation is processed through the fully connected layer of the preset CNN encoder to obtain a feature vector.

[0079] The CNN encoder first extracts feature maps from the input text. These feature maps typically contain abstract representations of various parts of the text (such as words, phrases, or sentences). Based on the extracted feature maps, the CNN encoder calculates attention weights for each text unit. The calculation of attention weights usually depends on the content of the feature maps and possible additional contextual information. The purpose of attention weights is to determine the importance of different text units (or features). In text processing, certain words or phrases may be more helpful than other parts in understanding the overall meaning of the text or in subsequent classification tasks. The calculated attention weights are then weighted and summed with the corresponding text units to obtain a new text representation. This step essentially re-weights or "filters" the original text information, giving more attention to more important information. The new text representation obtained after the attention mechanism weights are fed into the fully connected layers of the CNN encoder. The main function of the fully connected layers is to further integrate and transform this information to extract more abstract and useful feature vectors. In the fully connected layers, the new input text representation undergoes a linear transformation through a weight matrix. This weight matrix is ​​a learnable parameter that determines how the input information is mapped to a new feature space. After the linear transformation, a non-linear activation function (such as ReLU, Sigmoid, etc.) is typically used to activate the model, introducing non-linearity and increasing its expressive power. After processing by the fully connected layers, a feature vector is finally output. This feature vector usually has a fixed length and dimension; it contains the key features extracted from the original text information and can be used for subsequent classification, clustering, or other tasks.

[0080] By calculating the attention weight of each text information unit, it becomes clear which text information is more important for feature extraction. This helps the model focus more on key information when extracting features, thereby improving the accuracy and efficiency of feature extraction. The introduction of attention weights allows the model to clearly identify which text information is assigned higher weight when extracting features, which helps explain the model's behavior and decision-making process. In practical applications, this can increase user trust and acceptance of the model's output. Since the attention mechanism can dynamically adjust according to the importance of different text information, it helps the model maintain good generalization ability when processing different texts. This means that the model can better adapt to different datasets and task requirements, thereby improving overall performance. By weighted summing of the attention weights with the corresponding text information units, a new text information representation can be obtained. This representation focuses more on key information, thus helping to generate more representative feature vectors. These feature vectors can play a better role in subsequent text processing tasks, improving the accuracy and efficiency of the task. The attention mechanism is often combined with convolution operations to jointly process text information. Since convolution operations are inherently efficient, models combined with attention mechanisms can still maintain high computational efficiency when processing large-scale text data.

[0081] Optionally, mapping the feature vector to a set of command and dispatch instructions to determine the target command and dispatch instructions includes:

[0082] The feature vector is input into a softmax layer to map the feature vector into a probability distribution, where each probability value in the probability distribution corresponds to an instruction in the command and dispatch instruction set;

[0083] The instruction with the highest probability value in the probability distribution is selected as the target command and dispatch instruction.

[0084] The feature vectors extracted by the CNN encoder are input into the softmax layer. The softmax layer is a commonly used multi-class classification output layer that transforms the input feature vectors into a probability distribution. Each probability value in this distribution corresponds to an instruction in the command and dispatch instruction set. The softmax layer calculates the dot product between the input feature vector and the weight vector corresponding to each instruction, and applies the softmax function to convert the dot product result into a probability value. Thus, each instruction has a corresponding probability value, and the sum of these probabilities is 1. This probability distribution reflects the model's confidence or likelihood for each instruction. The instruction with the highest probability value is selected from the probability distribution output by the softmax layer as the target command and dispatch instruction. This instruction is considered the most likely correct decision made by the model based on the input text information.

[0085] The feature vector is input into the softmax layer, which efficiently maps the feature vector to a probability distribution. Each probability value in this distribution corresponds to an instruction in the command and dispatch instruction set, giving each instruction a specific probability value. This probability distribution is highly interpretable and can be intuitively understood as the model's confidence or likelihood for each instruction. In practical applications, this helps decision-makers evaluate the rationality and feasibility of different instructions based on the magnitude of the probability values. By selecting the instruction with the highest probability value in the probability distribution as the target command and dispatch instruction, it can be ensured that the selected instruction is the one the model considers most likely to be correct. This determination method is based on the principle of probability maximization, which can reduce the risk of incorrect decisions to some extent. Furthermore, since the probability distribution output by the softmax layer is continuous, even if there are multiple highly similar instructions, the model can accurately distinguish and select them based on the magnitude of the probability values. As a general classifier, the softmax layer can adapt to different command and dispatch instruction sets and feature vector representations. This means that whether the instruction set changes or the feature vector is updated, the model can adapt to new task requirements by adjusting the parameters of the softmax layer. Furthermore, the Softmax layer can be combined with other deep learning models (such as CNNs and RNNs) to form more complex hybrid models, further improving the model's performance in command and scheduling tasks. The computation process of the Softmax layer is relatively simple and efficient, capable of mapping feature vectors to probability distributions in a short time. This helps achieve rapid response and real-time decision-making in practical applications. Simultaneously, the softmax layer also exhibits good numerical stability, avoiding numerical overflow or underflow issues during computation. This helps ensure the stability and reliability of the model.

[0086] Optionally, inputting the feature vector into the softmax layer to map the feature vector to a probability distribution includes:

[0087] The feature vector is used as the input to the softmax layer, wherein the number of input nodes of the softmax layer matches the dimension of the feature vector;

[0088] The feature vector is linearly transformed by the weight matrix of the softmax layer to obtain the transformed vector.

[0089] Apply the softmax function to the transformed vector to convert each component of the transformed vector into a probability value.

[0090] The dimension of the feature vector determines the number of input nodes in the softmax layer. The number of input nodes in the softmax layer needs to match the dimension of the feature vector. This means that if the feature vector is an n-dimensional vector, then the softmax layer needs n input nodes. The softmax layer contains a weight matrix with dimensions (number of output nodes, number of input nodes). In this scenario, the number of output nodes is usually equal to the number of instructions in the command and dispatch instruction set, while the number of input nodes is equal to the dimension of the feature vector. The feature vector undergoes a linear transformation through the weight matrix of the softmax layer. The formula for the linear transformation is: y = Wx + b, where W is the weight matrix, x is the feature vector, and b is a bias term (which may not be included in some embodiments). The dimension of the transformed vector y is the same as the number of output nodes in the softmax layer. The softmax function is a function that transforms a real vector into a probability distribution. The linearly transformed vector y is used as the input to the softmax function. Applying the softmax function to each component of y yields a new vector p, where each component of p is a probability value between 0 and 1. The vector p forms a probability distribution, where each probability value corresponds to one instruction in the set of command and dispatch instructions. The sum of the probability distributions equals 1. From the resulting probability distribution, the instruction with the highest probability value is selected as the target command and dispatch instruction. This means the model considers this instruction to be the most likely correct instruction. The determination of the target instruction is based on the principle of probability maximization, which helps reduce the risk of erroneous decisions. Furthermore, since the probability distribution output by the softmax function is interpretable, decision-makers can evaluate the rationality and feasibility of different instructions based on the magnitude of the probability values.

[0091] This embodiment also discloses a natural language to command and dispatch instruction conversion system. Figure 5 is a schematic diagram of the modules of the natural language to command and dispatch instruction conversion system disclosed in this application embodiment. As shown in Figure 5, the system includes a text module 501, an instruction module 502, and an output module 503, wherein:

[0092] The text module 501 is configured to process the natural language text using a preset BERT model to extract text information when natural language text is received.

[0093] Instruction module 502 is configured to process the text information through a preset CNN encoder to extract feature vectors, and map the feature vectors to a set of command and dispatch instructions to determine target command and dispatch instructions;

[0094] Output module 503 is configured to output the target command and dispatch instructions to the target object.

[0095] Optionally, the text module 501 is configured to:

[0096] The natural language text is segmented using the preset Bert model to obtain multiple text information units, which include words, phrases, or punctuation marks.

[0097] Each text information unit is converted into a corresponding numerical vector, and the numerical vector is processed using a multi-layer Transformer encoder in the preset BERT model to extract text information from the natural language text. The text information includes entity name, entity relationship, context information, and semantic role.

[0098] Optionally, the instruction module 502 is configured to:

[0099] The text information is input into the preset CNN encoder, and the text information is convolved by the convolutional layer of the preset CNN encoder to extract local features;

[0100] Pooling layers are used to downsample the local features after the convolution operation to obtain sampling results, and the sampling results are processed through fully connected layers to obtain feature vectors.

[0101] Optionally, the instruction module 502 is configured to:

[0102] The feature maps output by multiple pooling layers are flattened into one-dimensional vectors, and the one-dimensional vectors are concatenated together to form a high-dimensional feature representation.

[0103] The high-dimensional feature representation is input into one or more fully connected layers, and linear transformation and nonlinear activation are performed through weight matrices and bias terms to obtain the feature vector.

[0104] Optionally, the instruction module 502 is configured to:

[0105] Calculate the attention weight for each text information unit, and then perform a weighted summation of the attention weights and the corresponding text information units to obtain a new text information representation;

[0106] The new text information representation is processed through the fully connected layer of the preset CNN encoder to obtain a feature vector.

[0107] Optionally, the instruction module 502 is configured to:

[0108] The feature vector is input into a softmax layer to map the feature vector into a probability distribution, where each probability value in the probability distribution corresponds to an instruction in the command and dispatch instruction set;

[0109] The instruction with the highest probability value in the probability distribution is selected as the target command and dispatch instruction.

[0110] Optionally, the instruction module 502 is configured to:

[0111] The feature vector is used as the input to the softmax layer, wherein the number of input nodes of the softmax layer matches the dimension of the feature vector;

[0112] The feature vector is linearly transformed by the weight matrix of the softmax layer to obtain the transformed vector.

[0113] Apply the softmax function to the transformed vector to convert each component of the transformed vector into a probability value.

[0114] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0115] This embodiment also discloses an electronic device. Referring to FIG6, the electronic device may include: at least one processor 601, at least one communication bus 602, user interface 603, network interface 604, and at least one memory 605.

[0116] The communication bus 602 is used to enable communication between these components.

[0117] The user interface 603 may include a display screen and a camera. Optionally, the user interface 603 may also include a standard wired interface and a wireless interface.

[0118] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0119] The processor 601 may include one or more processing cores. The processor 601 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 605, and by calling data stored in the memory 605. Optionally, the processor 601 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 601 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 601.

[0120] The memory 605 may include random access memory (RAM) or read-only memory. Optionally, the memory 605 may include a non-transitory computer-readable storage medium. The memory 605 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 605 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data involved in the various method embodiments described above, etc. Optionally, the memory 605 may also be at least one storage device located remotely from the aforementioned processor 601. As shown in FIG6, the memory 605, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for converting natural language into command and dispatch instructions.

[0121] In the electronic device shown in Figure 6, the user interface 603 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 601 can be used to call the application program stored in the memory 605 that converts natural language into command and dispatch instructions. When executed by one or more processors 601, the electronic device executes one or more methods as described in the above embodiments.

[0122] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0123] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings or direct couplings or communication connections may be through some service interfaces; indirect couplings or communication connections between apparatuses or units may be electrical or other forms.

[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0127] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory 605 and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory 605 includes various media capable of storing program code, such as a USB flash drive, external hard drive, magnetic disk, or optical disk.

[0128] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the disclosure in this specification. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A method for converting natural language into command and dispatch instructions, characterized in that, Applied to an instruction conversion platform, the method includes: When natural language text is received, the natural language text is processed by a preset BERT model to extract text information from the natural language text; The text information is processed by a preset CNN encoder to extract feature vectors, and the feature vectors are mapped to a set of command and dispatch instructions to determine the target command and dispatch instructions. The target command and dispatch instructions are output to the target object.

2. The method for converting natural language into command and dispatch instructions according to claim 1, characterized in that, The step of processing the natural language text using a preset BERT model to extract textual information from the natural language text includes: The natural language text is segmented using the preset Bert model to obtain multiple text information units, which include words, phrases, or punctuation marks. Each text information unit is converted into a corresponding numerical vector, and the numerical vector is processed using a multi-layer Transformer encoder in the preset BERT model to extract text information from the natural language text. The text information includes entity name, entity relationship, context information, and semantic role.

3. The method for converting natural language into command and dispatch instructions according to claim 1, characterized in that, The step of processing the text information using a preset CNN encoder to extract feature vectors includes: The text information is input into the preset CNN encoder, and the text information is convolved by the convolutional layer of the preset CNN encoder to extract local features; Pooling layers are used to downsample the local features after the convolution operation to obtain sampling results, and the sampling results are processed through fully connected layers to obtain feature vectors.

4. The method for converting natural language into command and dispatch instructions according to claim 3, characterized in that, The step of processing the sampling results through a fully connected layer to obtain a feature vector includes: The feature maps output by multiple pooling layers are flattened into one-dimensional vectors, and the one-dimensional vectors are concatenated together to form a high-dimensional feature representation. The high-dimensional feature representation is input into one or more fully connected layers, and linear transformation and nonlinear activation are performed through weight matrices and bias terms to obtain the feature vector.

5. The method for converting natural language into command and dispatch instructions according to claim 1, characterized in that, The step of processing the text information using a preset CNN encoder to extract feature vectors also includes: Calculate the attention weight for each text information unit, and then perform a weighted summation of the attention weights and the corresponding text information units to obtain a new text information representation; The new text information representation is processed through the fully connected layer of the preset CNN encoder to obtain a feature vector.

6. The method for converting natural language into command and dispatch instructions according to claim 1, characterized in that, The step of mapping the feature vector to a set of command and dispatch instructions to determine the target command and dispatch instructions includes: The feature vector is input into a softmax layer to map the feature vector into a probability distribution, where each probability value in the probability distribution corresponds to an instruction in the command and dispatch instruction set; The instruction with the highest probability value in the probability distribution is selected as the target command and dispatch instruction.

7. The method for converting natural language into command and dispatch instructions according to claim 6, characterized in that, The step of inputting the feature vector into the softmax layer to map the feature vector into a probability distribution includes: The feature vector is used as the input to the softmax layer, wherein the number of input nodes of the softmax layer matches the dimension of the feature vector; The feature vector is linearly transformed by the weight matrix of the softmax layer to obtain the transformed vector. Apply the softmax function to the transformed vector to convert each component of the transformed vector into a probability value.

8. A natural language to command and dispatch instruction conversion system, characterized in that, It includes a text module, an instruction module, and an output module, among which: The text module is configured to process natural language text using a preset BERT model to extract text information when natural language text is received. The instruction module is configured to process the text information through a preset CNN encoder to extract feature vectors, and map the feature vectors to a set of command and dispatch instructions to determine the target command and dispatch instructions. The output module is configured to output the target command and dispatch instructions to the target object.

9. An electronic device, characterized in that, The device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions. The user interface and the network interface are both used to communicate with other devices. The processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the method as described in any one of claims 1-7.