Data processing method and device, electronic equipment and readable medium
Through the method of combining natural language processing and timing prediction model, prediction element information is extracted and natural language reply is generated, which solves the problems of high difficulty in use and poor interaction experience in the existing technology, and achieves a more intuitive and efficient timing prediction process.
Patent Information
- Application Number
- CN202411982374.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-06
AI Technical Summary
Existing timing prediction technologies require professional knowledge in parameter selection, data processing and input and output interpretation, which is difficult to use and poor interactive experience, which affects the actual application scope and user experience.
The natural language processing model extracts prediction element information from the pending problem text input by the client, combines the time series prediction model to predict data, and generates natural language reply through text content arrangement to simplify the input format and interpretation process.
It reduces the difficulty of use, improves the interactive experience, makes timing prediction more intuitive and clear, expands the scope of actual application and user experience, and improves overall execution efficiency.
Smart Images

Figure CN119938878A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device and readable medium. Background Art
[0002] With the development of computer technology and artificial intelligence technology, more and more intelligent technologies have begun to be applied to the field of time series forecasting. Time series forecasting refers to the process of estimating the value of a certain period of time in the future based on historical data. It is widely used in finance, meteorology, sales and other fields.
[0003] In related technologies, time series prediction usually requires selecting appropriate parameters for the model or data and performing data preprocessing, and then inputting it into a machine learning model, neural network or large model according to a predetermined format or parameter requirements to obtain the output prediction data.
[0004] However, in such solutions, parameter selection, data processing and input, and the interpretation of output data all require relevant professional knowledge and need to follow a predetermined format. The output data is usually numerical output. The entire data processing process is not intuitive and clear enough, and is difficult to use and has a poor interactive experience, which affects the actual application scope of the solution and user experience, and is not conducive to the overall execution efficiency of time series prediction. Summary of the invention
[0005] Based on the above technical problems, the present application provides a data processing method, device, electronic device and readable medium to reduce the difficulty of use and improve the interactive experience, thereby improving the overall execution efficiency of time series prediction.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a data processing method is provided, including:
[0008] Get the text of the pending question entered by the client;
[0009] Extracting prediction factor information from the problem text to be processed by a natural language processing model, wherein the prediction factor information includes a target time interval and a target indicator;
[0010] Performing data forecasting based on the forecast factor information and the historical data of the target indicator through a time series forecasting model to obtain the forecast data result of the target indicator within the target time interval;
[0011] The text content is arranged according to the predicted data result and the text content of the question text to be processed to obtain natural language response content corresponding to the question text to be processed.
[0012] According to one aspect of an embodiment of the present application, there is provided a data processing device, including:
[0013] A text acquisition module, configured to acquire the text of the question to be processed input by the client;
[0014] An information extraction module is configured to extract prediction element information from the problem text to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator;
[0015] A data prediction module is configured to perform data prediction based on the prediction factor information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval;
[0016] The text arrangement model is configured to arrange text content according to the prediction data result and the text content of the question text to be processed, so as to obtain natural language response content corresponding to the question text to be processed.
[0017] In some embodiments of the present application, based on the above technical solution, the data prediction module is specifically configured as follows: according to the target time interval in the prediction element information, obtaining the prediction basis data corresponding to the target indicator from the historical data of the target indicator; performing data prediction based on the prediction element information and the prediction basis data through a time series prediction model to obtain the prediction data result of the target indicator within the target time interval.
[0018] In some embodiments of the present application, based on the above technical solution, the data prediction module is specifically configured to: determine the duration of the reference interval corresponding to the target indicator according to the target indicator and the target time interval; determine the historical time interval corresponding to the target indicator according to the target time interval and the duration of the reference interval; obtain the historical data of the target indicator within the historical time interval as the prediction basis data.
[0019] In some embodiments of the present application, based on the above technical solution, the data prediction module is specifically configured as: according to a preset interval strategy and the target indicator, determining the target basic duration and the target mapping factor corresponding to the target indicator, wherein the interval strategy includes the correspondence between the target indicator and the basic duration and the mapping factor, and the mapping factor is used to represent the mapping relationship between the target time interval and the basic duration; according to the target mapping factor and the target time interval, the target basic duration is interval scaled to obtain the basis interval duration corresponding to the target indicator.
[0020] In some embodiments of the present application, based on the above technical solution, the information extraction module is specifically configured as follows: through a natural language processing model, information extraction is performed on the target element in the problem text to be processed to obtain a first extraction result, and the target element includes at least one of a target time interval and a target indicator; if the information extraction is successful, prediction factor information is generated according to the target time interval and target indicator in the first extraction result.
[0021] In some embodiments of the present application, based on the above technical solution, the information extraction module is also configured to: if there is a missing target element in the question text to be processed, then based on the missing target element and the question text to be processed, generate a follow-up question prompt text corresponding to the missing target element through the natural language processing model, and display the follow-up question prompt text through the client; receive additional information input through the client for the follow-up question prompt text; extract information from the additional information through the natural language processing model to obtain a second extraction result; and merge the first extraction result and the second extraction result to obtain predicted element information.
[0022] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a data processing method as in the above technical solution by executing the executable instructions.
[0023] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method in the above technical solution is implemented.
[0024] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method provided in the above-mentioned various optional implementations.
[0025] In an embodiment of the present application, the server obtains the text of the problem to be processed input by the client, and then extracts prediction element information from the text of the problem to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator, and then performs data prediction based on the prediction element information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval, and finally arranges the text content based on the prediction data result and the text content of the text of the problem to be processed to obtain a natural language reply content corresponding to the text of the problem to be processed. In this way, the server can predict relevant information and receive prediction results through natural language input without the need for relevant professional knowledge or a predetermined input format, and makes the interaction process more intuitive and clear through natural language interaction, reduces the difficulty of use and improves the interactive experience, thereby expanding the actual application scope and user experience of the solution and improving the overall execution efficiency of time series prediction.
[0026] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 The data processing method of the embodiment of the present application is applied to the system structure of the data processing system.
[0029] Figure 2 Flow chart of a data processing method according to an embodiment of the present application.
[0030] Figure 3 Flow chart of a data processing method according to an embodiment of the present application.
[0031] Figure 4 Flow chart of a data processing method according to an embodiment of the present application.
[0032] Figure 5 It is a schematic flow chart of the timing prediction agent system in an embodiment of the present application.
[0033] Figure 6 The block diagram schematically shows the composition of the data processing device in the embodiment of the present application.
[0034] Figure 7A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0036] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0037] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function, and works together with other related parts to achieve the predetermined function, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0040] It should be understood that the solution of the present application can be applied in the scenario of time series prediction based on historical data, and is specifically applied in the time series prediction process interacting with the end user. Time series prediction refers to the process of estimating the value in a certain time period in the future based on historical data. It is widely used in the fields of finance, meteorology, sales, etc. In the field of time series prediction, the usual prediction method mainly relies on statistical models and machine learning algorithms, machine learning models, neural network models or large models of time series prediction. Exemplarily, the method of the present application can be applied in predicting business data, such as predicting data such as passenger flow, vehicle flow or sales volume in the next few days. Taking passenger flow as an example, passenger flow is a kind of data that changes over time and belongs to a kind of time series data, referred to as time series data. In the solution of the present application, the user can describe the target to be predicted in natural language. For example, the user can enter "predict the daily passenger flow of the store in the next 3 days". The solution of the present application will predict the future data based on the data in a certain time period in the past, for example, based on the passenger flow data in the past two weeks to predict the passenger flow in the next 3 days. The prediction results will be displayed to the user through the client in the form of natural language description, which is convenient for direct and clean display of results and easy for users to understand.
[0041] With the development of computer technology and artificial intelligence technology, more and more intelligent technologies have begun to be applied to the field of time series prediction. In related technologies, time series prediction usually requires selecting suitable parameters for the model or data and performing data preprocessing, and then inputting it into the machine learning model, neural network or large model according to the predetermined format or parameter requirements to obtain the output prediction data. However, in such solutions, parameter selection, data processing and input, and interpretation of output data all require relevant professional knowledge and need to be in a predetermined format. The output data is usually also numerical output. The entire data processing process is not intuitive and clear enough, and the use difficulty is high and the interactive experience is poor, which affects the actual application scope of the solution and user experience, and is not conducive to the overall execution efficiency of time series prediction.
[0042] Based on this, the technical solution of the embodiment of the present application proposes a data processing solution. Figure 1According to the data processing method of the embodiment of the present application, the system structure of the data processing system can mainly include two parts, namely the user terminal 110 and the server 130. Among them, the devices of each part in the system structure can include smart phones, tablet computers, laptops, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The device of the blockchain can also be a server that provides various services. It can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms. The user terminal 110 and the server 130 communicate through the network 120. The network 120 can be a communication medium of various connection types of communication links, for example, it can be a wired communication link or a wireless communication link.
[0043] According to the implementation requirements, the system architecture in the embodiment of the present application can have any number of terminal devices and servers. For example, the devices of the server 130 and other parts can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to a computing platform, or can be implemented by various parts in the system, and the present application does not make any special restrictions on this.
[0044] like Figure 1 As shown, the server 130 is deployed with trained natural language models and time series big models, and the server 130 runs a data prediction service, which schedules the natural language model and time series big model according to the user's request to perform data prediction according to the user's requirements. The terminal device 110 is installed with a client for accessing the service on the server 130. The user sends the target to be predicted to the server 130 through the client on the terminal device 110, and the server 130 uses the natural language model to communicate with the user through the terminal device 110 to obtain the required data, and extracts the input data provided by the user from the reply provided by the user. The server 130 uses the current historical data as a basis, uses the time series big model to perform data prediction, and arranges the prediction results into natural language reply content that is easy for the user to understand through the natural language model and provides it to the user.
[0045] The implementation details of the technical solution of the embodiment of the present application are described in detail below: Figure 2 A flow chart of a data processing method according to an embodiment of the present application is shown. The data processing method can be executed by a device having a computing and processing function, such as a server or a terminal device of a data processing system. Figure 2 As shown, the data processing includes at least steps S210 to S240, which are described in detail as follows:
[0046] Step S210, obtaining the text of the question to be processed input by the client.
[0047] In this embodiment, the client can interact with the user in the form of a graphical interface. The user enters the question content to be predicted in the client interface to form a pending question text. Usually, the pending question text is the content described by the user in natural language. The client can use various input methods, such as inputting text, inputting pictures, audio or video, and the client or server performs picture text recognition or sound to text conversion for input. The client will send the input content to the server, so that the server obtains the input pending question text.
[0048] Step S220, extracting prediction factor information from the problem text to be processed through a natural language processing model, wherein the prediction factor information includes a target time interval and a target indicator.
[0049] A trained natural language processing model will be pre-deployed in the server. The natural language processing model is used to extract the prediction element information required for time series prediction from the question text entered by the user. The prediction element information will at least include a target time interval and a target indicator. The target time interval refers to the time range of the data to be predicted, and the target indicator refers to the category of the data to be predicted. For example, the question text to be processed is "Predict the customer flow of XX store next week", and the target indicator in the extracted prediction element information is "the customer flow of XX store". Assuming that the current time of the question is Friday, December 13, the target time interval is "Monday, December 16 to Sunday, December 22". It can be understood that the target time interval can use different time units, such as various event units such as minutes, seconds, hours, days, weeks or months. It can be understood that the natural language processing model on the server is obtained after training based on real historical data, and the target indicator that can be extracted by the natural language processing model is associated with the number of trainings used for its training.
[0050] Step S230, performing data prediction based on the prediction factor information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval.
[0051] A trained time series prediction model will be pre-deployed in the server. The server calls the time series prediction model to perform data prediction based on the input prediction factor information. Specifically, the server retrieves the corresponding historical data based on the target indicator in the prediction factor information. The historical data can be saved in a database. Subsequently, the time series prediction model performs data prediction based on the input historical data and prediction factor information, thereby obtaining the prediction data results of the target data within the target time interval. For example, if the target indicator in the prediction factor information is "the customer flow of XX store" and the target time interval is "Monday, December 16 to Sunday, December 22", the predicted result may be an average value of 200, indicating "an average of 200 people / day" or outputting the predicted value for each day, "[200, 180, ..., 300]". It can be understood that the results output by the time series prediction model are usually numerical results, and the actual meaning of the numerical results is usually pre-defined during the training process of the time series prediction model.
[0052] Step S240, arranging text content according to the prediction data result and the text content of the question text to be processed, and obtaining natural language response content corresponding to the question text to be processed.
[0053] The server will combine the context provided by the text content of the problem text to be processed to arrange the text content of the predicted data results, so as to obtain a natural language reply that is easy to understand. Specifically, the server will generate corresponding reply information according to the specific meaning of the data in the predicted data results and the context in the problem text to be processed. For example, the predicted result is the average value of the passenger flow in the next 7 days, and the language used in the problem text to be processed is Chinese and the relevant descriptions in the context are "next week" and "number of customers", then the generated reply result may be "the average number of customers per day next week is expected to be 200 people". In some embodiments, the server generates the reply content by calling the natural language processing model, and the meaning of the predicted data results and other information will be input into the natural language processing model during the model training process. In some embodiments, the server will also add supplementary explanatory content to the reply content, for example, explanatory descriptions or suggestions for the reply content, for example, explaining the floating space in the predicted results of passenger flow or providing suggestions on how to increase passenger flow.
[0054] In an embodiment of the present application, the server obtains the text of the problem to be processed input by the client, and then extracts prediction element information from the text of the problem to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator, and then performs data prediction based on the prediction element information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval, and finally arranges the text content based on the prediction data result and the text content of the text of the problem to be processed to obtain a natural language reply content corresponding to the text of the problem to be processed. In this way, the server can predict relevant information and receive prediction results through natural language input without the need for relevant professional knowledge or a predetermined input format, and makes the interaction process more intuitive and clear through natural language interaction, reduces the difficulty of use and improves the interactive experience, thereby expanding the actual application scope and user experience of the solution and improving the overall execution efficiency of time series prediction.
[0055] In the embodiments of the present application, it is also proposed to Figure 2 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 3 As shown, the semantic dictionary includes a global dictionary. In a method for processing speech data in an embodiment of the present application, the following steps may be included:
[0056] Step S310, obtaining the text of the question to be processed input by the client.
[0057] Optionally, the implementation details of step S310 are the same as Figure 2 The step S210 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0058] Step S320, extracting prediction factor information from the problem text to be processed through a natural language processing model, wherein the prediction factor information includes a target time interval and a target indicator.
[0059] Optionally, the implementation details of step S320 are the same as Figure 2 The step S220 shown in FIG. 1 is consistent with the step S220 shown in FIG. 1 and will not be
[0060] Step S330, acquiring prediction basis data corresponding to the target indicator from historical data of the target indicator according to the target time interval in the prediction factor information;
[0061] Step S340: Perform data prediction based on the prediction factor information and the prediction basis data through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval.
[0062] In this embodiment, the server selects part of the data from the historical data of the target indicator as the prediction basis data. There is a dependency between the standard for obtaining the prediction basis data and the target time interval. The time range of the prediction basis data obtained is usually a time range earlier than the target time interval and is closely related to the target time interval, such as an interval that is continuous with the target time interval or an interval that is closest to the target time interval in time. For example, if the earliest time of the target time interval is the 15th, the latest time of the time range of the prediction basis data is the 14th. In some embodiments, the target time interval is discontinuous with the current time, for example, the target time interval starts on the 17th, and the current time is the 15th, and the prediction basis data will also obtain data before the 15th. In addition, the time range of the prediction basis data is also related to the time length of the target time interval, for example, the time range of the prediction basis data will be in a predetermined ratio with the target time interval, so as to calculate the length of the time range of the prediction basis data according to the length of the target time interval. After determining the relevant constraints for obtaining the prediction basis data, the server will obtain data that meets the constraints from the historical data of the target indicator as the prediction basis data. The prediction basis data and prediction factor information will be input into the time series prediction model for data prediction, so as to obtain the prediction data results of the target indicator within the target time interval. In the above way, the solution will first filter out the prediction basis data according to the target time interval, and then predict the data results within the target time interval based on the prediction basis data, so that the adopted data is more timely and more closely related to the target time interval, thereby improving the accuracy of the prediction results.
[0063] Step S350, arranging text content according to the prediction data result and the text content of the question text to be processed, and obtaining natural language response content corresponding to the question text to be processed.
[0064] Optionally, the implementation details of step S350 are the same as Figure 2 The step S240 shown in FIG. 1 is consistent with the step S240 shown in FIG. 1 and will not be
[0065] In an embodiment of the present application, the server obtains the text of the problem to be processed input by the client, and then extracts the prediction element information from the text of the problem to be processed through the natural language processing model, the prediction element information includes the target time interval and the target indicator, and then obtains the prediction basis data corresponding to the target indicator from the historical data of the target indicator according to the target time interval in the prediction element information, and then performs data prediction according to the prediction element information and the prediction basis data through the time series prediction model to obtain the prediction data result of the target indicator within the target time interval, and finally arranges the text content according to the prediction data result and the text content of the text of the problem to be processed to obtain the natural language reply content corresponding to the text of the problem to be processed. In this way, the server can predict relevant information and receive prediction results through natural language input without the need for relevant professional knowledge or a predetermined input format, and makes the interaction process more intuitive and clear through natural language interaction, reduces the difficulty of use and improves the interactive experience, thereby expanding the actual application scope and user experience of the solution and improving the overall execution efficiency of time series prediction.
[0066] In some embodiments of the present application, based on the technical solution in the present application, in the process of obtaining the prediction basis data corresponding to the target indicator from the historical data of the target indicator according to the target time interval in the prediction element information, the server will determine the duration of the basis interval corresponding to the target indicator according to the target indicator and the target time interval, and then determine the historical time interval corresponding to the target indicator according to the target time interval and the duration of the basis interval, and then obtain the historical data of the target indicator in the historical time interval as the prediction basis data. In this embodiment, the server will determine the duration of the basis interval corresponding to the target indicator according to the target indicator and the target time interval. Specifically, different target indicators can correspond to the duration of the basis interval of different time interval units. For example, the passenger flow indicator can be in days or hours, and when it is in days, the default duration of the basis interval is 10 days, and when it is in hours, the default duration of the basis interval is 48 hours. The server will select the duration of the basis interval of the same time unit for the target indicator according to the time unit of the target time interval. Then, the server determines the historical time interval corresponding to the target indicator according to the target time interval and the duration of the basis interval. For example, if the current date is November 15, the target time interval is after November 16, and the time interval is 10 days, then the historical time interval is from November 4 to November 14. After determining the historical time interval, the server selects historical data that matches the historical time interval as the prediction basis data. Through the above scheme, the server can flexibly adjust the process of obtaining the prediction basis data according to the input prediction factor information, so that the obtained prediction basis data matches the prediction factor information, which is conducive to improving the accuracy of the prediction results.
[0067] In some embodiments of the present application, based on the technical solution in the present application, in the process of determining the reference interval duration corresponding to the target indicator according to the target indicator and the target time interval, the server will determine the target basic duration and target mapping factor corresponding to the target indicator according to the preset interval strategy and the target indicator, wherein the interval strategy contains the corresponding relationship between the target indicator and the basic duration and the mapping factor, and the mapping factor is used to represent the mapping relationship between the target time interval and the basic duration, and then the target basic duration is interval-scaled according to the target mapping factor and the target time interval to obtain the reference interval duration corresponding to the target indicator. Specifically, in this embodiment, the server can scale the length of the target basic duration according to the target time interval. Specifically, each target indicator has a corresponding interval strategy, which contains the corresponding relationship between the target indicator and the basic duration and the mapping factor. Different target time interval lengths correspond to different target mapping factors, and the mapping factor is used to represent the mapping relationship between the target time interval and the basic duration. For example, the longer the target time interval length, the larger the target mapping factor. For example, when the passenger flow index is in days, the target basic duration is 3 days. When the target time interval length is less than or equal to 3 days, the target mapping factor is 2. When the target time interval is longer than 3 days, the coefficient will also increase. For example, if the input target time interval is 4 days, the target mapping factor will increase to 2.5. The server will amplify the basic duration according to the target mapping factor to obtain the reference interval duration. Specifically, the basic duration can be multiplied by the target mapping factor. For example, the target time interval length of 3 days corresponds to a target mapping factor of 2. When the user inputs a predicted time length of 6 days, the corresponding target mapping factor is 3, and the reference interval duration is 18 days. In the above manner, the reference interval duration can be adjusted according to the length of the target time interval, which is conducive to improving the flexibility of the solution.
[0068] In the embodiments of the present application, it is also proposed to Figure 2 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 4 As shown, the semantic dictionary includes a global dictionary. In a method for processing speech data in an embodiment of the present application, the following steps may be included:
[0069] Step S410, obtaining the text of the question to be processed input by the client.
[0070] Optionally, the implementation details of step S410 are the same as Figure 2 The step S210 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0071] Step S420, extracting information from a target element in the question text to be processed by a natural language processing model to obtain a first extraction result, wherein the target element includes at least one of a target time interval and a target indicator;
[0072] Step S430: If the information extraction is successful, then generate prediction factor information according to the target time interval and target index in the first extraction result.
[0073] Specifically, in an embodiment, the server analyzes the target elements in the problem text to be processed during the process of extracting information through the natural language processing model. The problem text to be processed usually needs to contain at least two target elements, namely, the target time interval and the target index. The target time interval may, for example, include the start time and the end time, or the duration and one of the start time or the end time. For example, the problem text to be processed may be "predict the passenger flow every day before Friday". If the current time is Monday, the start time in the first extraction result is Monday and the end time is Friday. The target index is the target to be predicted, such as the "passenger flow" in the above example. In some embodiments, the target element may also include some predetermined description content, such as "prediction", "prediction" and other information that can identify the requirements for time series prediction. The problem text to be processed needs to contain at least one target element, so as to allow the natural language processing model to confirm that the input problem text to be processed does need to be predicted for time series. When the natural language processing model extracts all necessary target elements from the problem text to be processed, it is considered that the information extraction is successful, for example, at least the target time interval and the target index are extracted. In the above manner, a specific method for information extraction is provided, which is conducive to the operability of the scheme.
[0074] Step S440: Perform data prediction based on the prediction factor information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval.
[0075] Optionally, the implementation details of step S440 are the same as Figure 2 The step S230 shown in FIG. 1 is consistent with the step S230 shown in FIG. 1 and will not be
[0076] Step S450, arranging text content according to the prediction data result and the text content of the question text to be processed, and obtaining natural language response content corresponding to the question text to be processed.
[0077] Optionally, the implementation details of step S450 are the same as Figure 2 The step S240 shown in FIG. 1 is consistent with the step S240 shown in FIG. 1 and will not be
[0078] In an embodiment of the present application, the server obtains the text of the problem to be processed input by the client, and then extracts prediction element information from the text of the problem to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator, and then performs data prediction based on the prediction element information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval, and finally arranges the text content based on the prediction data result and the text content of the text of the problem to be processed to obtain a natural language reply content corresponding to the text of the problem to be processed. In this way, the server can predict relevant information and receive prediction results through natural language input without the need for relevant professional knowledge or a predetermined input format, and makes the interaction process more intuitive and clear through natural language interaction, reduces the difficulty of use and improves the interactive experience, thereby expanding the actual application scope and user experience of the solution and improving the overall execution efficiency of time series prediction.
[0079] In some embodiments of the present application, based on the technical solution in the present application, if there is a missing target element in the text of the problem to be processed, the server generates a follow-up prompt text corresponding to the missing target element through the natural language processing model according to the missing target element and the text of the problem to be processed, and displays the follow-up prompt text through the client, and then receives the additional information input by the client for the follow-up prompt text. The server extracts the additional information through the natural language processing model to obtain a second extraction result, and then merges the first extraction result and the second extraction result to obtain the prediction element information. In this embodiment, when the natural language processing model identifies that there is a missing target element in the text of the problem to be processed, the server generates a follow-up prompt text for the missing target element and displays it to the user. The follow-up prompt text is also generated based on natural language. For example, when the target indicator is missing, the generated follow-up prompt text can be "What data do you want to predict before next Friday?", or when the target time interval is missing, the generated follow-up prompt text can be "What time do you want to predict the passenger flow?" The server will conduct multiple rounds of dialogue with the user through the client until all the required target elements are obtained. Subsequently, the server inputs the additional information obtained by asking the prompt text into the natural language processing model for information extraction, and merges all the target elements finally extracted to obtain the predicted element information. In this way, the server can obtain the required information through natural language dialogue, so as to accurately obtain the actual intention of the prediction and improve the accuracy and processing ability of the solution.
[0080] The following is an illustrative example of the implementation details of the technical solution of the present application. Figure 5 , Figure 5 FIG. 1 is a schematic flow chart of the time series prediction agent system in the embodiment of the present application. Figure 5 As shown in the figure, the system generally consists of five modules: scheduling module, entity extraction module, query module, time series prediction module and content arrangement module. Among them, the scheduling module is the core controller of the system, which is responsible for coordinating the operations of all other modules and ensuring that information flows between modules in the correct order. The scheduling module receives user requests from the client and determines which module the information should be passed to for processing according to preset rules or algorithms. In addition, the scheduling module is also responsible for collecting the output results of each module and finally returning the complete reply information to the user. The entity extraction module uses a large language model to parse the user's question text. Its main task is to extract key elements such as the start time, end time and indicator name of the target prediction from the user's question. In order to improve accuracy, the entity extraction module not only relies on the information of a single question, but also can ask users questions through multiple rounds of dialogue to complete the missing data. The data query module is connected to the historical database stored in the background, and retrieves the required time series data from it according to the indicator name and time information. Since different indicators may have different characteristics (such as seasonal fluctuations), the time period for querying different indicators will be pre-defined in the data query module to provide the most suitable input data for the time series prediction module. The time series prediction module uses a time series big model to provide time series prediction capabilities. After being trained with a large amount of real historical data, the model has strong generalization ability and prediction accuracy. The time series prediction module receives historical data prepared by the data query module as input and generates prediction values for a period of time in the future. The content editing module is also based on the big language model and focuses on converting pure numerical prediction results into easy-to-understand natural language expressions. The content editing module will write the answer text based on the user's original question and the predicted data. Figure 5As shown in the figure, the overall process of the system starts with receiving user input. The user initiates a request through the client to send the question text to the scheduling module. After receiving the user request, the scheduling module first performs a preliminary analysis of the request to confirm its format correctness, and then sends the text to the entity extraction module. The entity extraction module uses a pre-trained large language model to analyze the user's question, identify and classify the key elements, including the start time, end time, and indicator name (such as sales, customer flow, etc.) of the prediction. If it is found that the information provided by the user is incomplete or unclear, such as not clearly indicating a specific date range, the entity extraction module will generate a follow-up prompt, such as: "Do you want to predict sales from which day to which day?" Then return this prompt to the user through the scheduling module. After the user provides more information according to the prompt, the system will repeat the above process until all necessary information is successfully extracted. After obtaining the complete information required for the prediction (i.e., the start time, end time and indicator name), the data query module constructs a query statement based on this information, connects to the historical database stored in the background to perform the query operation, and obtains the historical data of the indicator from the start time to a period of time before. The length of this time period needs to be pre-set according to the characteristics of different indicators, covering enough historical background and avoiding being too long to affect efficiency. Finally, the retrieved data is cleaned to remove outliers and missing values, and sorted and formatted according to predetermined rules to prepare for subsequent predictions. The time series prediction module receives the historical data prepared by the data query module as input, calls the pre-trained time series large model based on the input historical data, calculates and outputs the expected value within the target time period. When arranging the reply content, the content arrangement module uses the pre-trained large-scale language model to generate a natural language text that is easy to understand and in context based on the prediction results and the user's initial question. This text not only contains the specific predicted values, but may also include some explanatory instructions or suggestions. Finally, the system sends the generated reply content to the client, and the task is completed.
[0081] The following examples introduce specific embodiments of the present application. An example embodiment is as follows: Assume that the current time is June 1st, and the user asks: "I want to predict the passenger flow in the next 3 days." After receiving the question, the scheduling module confirms the correctness of its format and forwards the user's question directly to the entity extraction module. The entity extraction module analyzes the text and determines the start time as June 2nd and the end time as June 4th based on the current time and the user's question. The indicator name is "passenger flow." The data query module searches the database for relevant historical data based on the extracted information. According to the pre-defined rules, it is known that the time period required to query "passenger flow" is 7 days. Therefore, it will retrieve the data for the 7 days before June 1st from the database, that is, the data for the seven days from May 26th to June 1st. The time series prediction module uses the data of these 7 days as input, calls the trained time series large model, and outputs the passenger flow prediction value for the three days from June 2nd to June 4th. The content arrangement module combines the user's original question "I want to predict the passenger flow in the next three days" and the prediction results to generate a reply text: "Hello, through analysis of historical data, the passenger flow in the next three days is predicted to be 100, 132, and 98 respectively." It is then returned to the client through the scheduling module, and the prediction results are displayed to the user, and the task is completed.
[0082] Another example embodiment is as follows: Assuming that the current moment is June 1, if the user asks: "I want to predict future sales". After receiving the question forwarded by the scheduling module, the entity extraction module uses the pre-trained large language model to analyze the user's question and identifies the keyword "sales", but fails to extract a clear time interval (start time and end time). Therefore, the entity extraction module generates a follow-up prompt: "Do you want to predict sales from which day to which day?" and returns this prompt to the user through the scheduling module. The user provides more information based on the prompt, such as answering: "In the next week". The entity extraction module extracts information again, and the entity extraction module re-analyzes the user's new input, combines the current date (June 1), determines that the start time is June 2, and the end time is June 8, and combines the indicator name "sales" extracted in the previous round to complete the acquisition of all information. The data query module searches for relevant historical data in the database based on the extracted information. According to the pre-defined rules, it is known that the time period required to query "sales" is 30 days. Therefore, it retrieves the data for the 30 days before June 2 from the database, that is, the data for the 30 days from May 3 to June 1. The time series prediction module uses the data of these 30 days as input, calls the trained time series model, and outputs the sales forecast for the seven days from June 2 to June 8. The content arrangement module combines the user's original question "I want to predict future sales" and the prediction results to generate a reply text: "Hello, by analyzing historical data, the sales forecast for the next week (June 2 to June 8) is 5,000 yuan, 5,500 yuan, 6,000 yuan, 6,200 yuan, 6,500 yuan, 6,800 yuan, and 7,000 yuan respectively." It is then returned to the client through the scheduling module to show the prediction results to the user, and the task is completed.
[0083] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0084] The following introduces the device implementation of the present application, which can be used to execute the data processing method in the above embodiments of the present application. Figure 6 The block diagram schematically shows the composition of the data processing device in the embodiment of the present application. Figure 6 As shown, the data processing device 600 may mainly include:
[0085] The text acquisition module 610 is configured to acquire the text of the question to be processed input by the client;
[0086] An information extraction module 620 is configured to extract prediction element information from the problem text to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator;
[0087] The data prediction module 630 is configured to perform data prediction based on the prediction factor information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval;
[0088] The text arrangement model 640 is configured to arrange text content according to the prediction data result and the text content of the question text to be processed, so as to obtain natural language response content corresponding to the question text to be processed.
[0089] In some embodiments of the present application, based on the above technical solution, the data prediction module 630 is specifically configured as: according to the target time interval in the prediction element information, obtaining the prediction basis data corresponding to the target indicator from the historical data of the target indicator; performing data prediction according to the prediction element information and the prediction basis data through a time series prediction model to obtain the prediction data result of the target indicator within the target time interval.
[0090] In some embodiments of the present application, based on the above technical solution, the data prediction module 630 is specifically configured to: determine the duration of the reference interval corresponding to the target indicator according to the target indicator and the target time interval; determine the historical time interval corresponding to the target indicator according to the target time interval and the duration of the reference interval; obtain the historical data of the target indicator within the historical time interval as the prediction basis data.
[0091] In some embodiments of the present application, based on the above technical solution, the data prediction module 630 is specifically configured as: according to a preset interval strategy and the target indicator, determine the target basic duration and target mapping factor corresponding to the target indicator, wherein the interval strategy includes the correspondence between the target indicator and the basic duration and the mapping factor, and the mapping factor is used to represent the mapping relationship between the target time interval and the basic duration; according to the target mapping factor and the target time interval, perform interval scaling on the target basic duration to obtain the basis interval duration corresponding to the target indicator.
[0092] In some embodiments of the present application, based on the above technical solution, the information extraction module 620 is specifically configured as follows: through a natural language processing model, information is extracted from the target element in the problem text to be processed to obtain a first extraction result, and the target element includes at least one of a target time interval and a target indicator; if the information extraction is successful, prediction factor information is generated according to the target time interval and target indicator in the first extraction result.
[0093] In some embodiments of the present application, based on the above technical solution, the information extraction module 620 is also configured to: if there is a missing target element in the question text to be processed, then based on the missing target element and the question text to be processed, generate a follow-up question prompt text corresponding to the missing target element through the natural language processing model, and display the follow-up question prompt text through the client; receive additional information input for the follow-up question prompt text through the client; extract information from the additional information through the natural language processing model to obtain a second extraction result; and merge the first extraction result and the second extraction result to obtain predicted element information.
[0094] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0095] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0096] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0097] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. Various programs and data required for system operation are also stored in the RAM 703. The CPU 701, the ROM 702 and the RAM 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.
[0098] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0099] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0100] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CompactDisc Read-OnlyMemory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0102] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0103] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0104] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0105] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: include: Get the text of the pending question entered by the client; Extracting prediction factor information from the problem text to be processed by a natural language processing model, wherein the prediction factor information includes a target time interval and a target indicator; Performing data forecasting based on the forecast factor information and the historical data of the target indicator through a time series forecasting model to obtain the forecast data result of the target indicator within the target time interval; The text content is arranged according to the predicted data result and the text content of the question text to be processed to obtain natural language response content corresponding to the question text to be processed.
2. The method according to claim 1, characterized in that The step of performing data forecasting according to the forecast factor information and the historical data of the target indicator through the time series forecasting model to obtain the forecast data result of the target indicator within the target time interval includes: According to the target time interval in the forecast factor information, obtaining forecast basis data corresponding to the target indicator from the historical data of the target indicator; The time series prediction model is used to perform data prediction based on the prediction factor information and the prediction basis data to obtain the prediction data result of the target indicator within the target time interval.
3. The method according to claim 2, characterized in that The acquiring prediction basis data corresponding to the target indicator from historical data of the target indicator according to the target time interval in the prediction factor information includes: According to the target indicator and the target time interval, determine the duration of the reference interval corresponding to the target indicator; Determine the historical time interval corresponding to the target indicator according to the target time interval and the reference interval duration; Obtain historical data of the target indicator within the historical time interval as the prediction basis data.
4. The method according to claim 3, characterized in that Determining the duration of the reference interval corresponding to the target indicator according to the target indicator and the target time interval includes: Determine the target basic duration and the target mapping factor corresponding to the target indicator according to the preset interval strategy and the target indicator, wherein the interval strategy includes the corresponding relationship between the target indicator and the basic duration and the mapping factor, and the mapping factor is used to represent the mapping relationship between the target time interval and the basic duration; According to the target mapping factor and the target time interval, the target basic duration is interval-scaled to obtain the basis interval duration corresponding to the target indicator.
5. The method according to claim 1, characterized in that The extracting prediction element information from the problem text to be processed by a natural language processing model includes: By using a natural language processing model, information extraction is performed on a target element in the problem text to be processed to obtain a first extraction result, wherein the target element includes at least one of a target time interval and a target indicator; If the information extraction is successful, the prediction factor information is generated according to the target time interval and target index in the first extraction result.
6. The method according to claim 5, characterized in that The method further comprises: If there is a missing target element in the question text to be processed, then according to the missing target element and the question text to be processed, generate a follow-up question prompt text corresponding to the missing target element through the natural language processing model, and display the follow-up question prompt text through the client; Receiving additional information inputted by the client for the follow-up question prompt text; Extracting information from the additional information using the natural language processing model to obtain a second extraction result; The first extraction result and the second extraction result are combined to obtain prediction factor information.
7. A data processing device, characterized in that: include: A text acquisition module, configured to acquire the text of the question to be processed input by the client; An information extraction module is configured to extract prediction element information from the problem text to be processed through a natural language processing model, wherein the prediction element information includes a target time interval and a target indicator; A data prediction module is configured to perform data prediction based on the prediction factor information and the historical data of the target indicator through a time series prediction model to obtain a prediction data result of the target indicator within the target time interval; The text arrangement model is configured to arrange text content according to the prediction data result and the text content of the question text to be processed, so as to obtain natural language response content corresponding to the question text to be processed.
8. The device according to claim 7, characterized in that The data prediction module is specifically configured as follows: According to the target time interval in the forecast factor information, obtaining forecast basis data corresponding to the target indicator from the historical data of the target indicator; The time series prediction model is used to perform data prediction based on the prediction factor information and the prediction basis data to obtain the prediction data result of the target indicator within the target time interval.
9. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to execute the data processing method according to any one of claims 1 to 6 by executing the executable instructions.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 6 is implemented.