Business query method and device, electronic equipment, storage medium and computer program product

By using a customized slot extraction method and utilizing slot prediction models and target automata to extract information from target data, the problem of low accuracy of business queries by voice assistants in multilingual scenarios is solved, achieving more efficient information processing and accurate business queries.

CN120670544APending Publication Date: 2025-09-19SHENZHEN LUMIUNITED TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510584188.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the existing technology, when voice assistants process complex and information-intensive natural language input, the accuracy of business queries is not high, especially in multilingual scenarios, the generalization ability is weak, resulting in inaccurate understanding of intent.

Method used

A custom slot extraction method is adopted, and the slot prediction model and target automaton are used to extract information from the target data. The attribute category and time category information are obtained through the slot prediction model, and the location category and holiday category information are obtained using the target automaton. Business queries are performed in combination with the custom slot information.

Benefits of technology

It improves the accuracy of slot information prediction and information processing efficiency, improves the accuracy of business queries, and ensures a consistent user experience in a multilingual environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670544A_ABST
    Figure CN120670544A_ABST
Patent Text Reader

Abstract

The invention provides a business query method and device, electronic equipment, a storage medium and a computer program product, and relates to the technical field of computers. The method comprises the steps that target data are acquired, and the target data are used for expressing business query requirements; performing information extraction on the target data based on a user-defined slot position to obtain target slot position information; the custom slot position corresponds to an information category related to the business query; and performing business query based on the target slot position information to obtain a business query result. According to the method and the device, the problem of low business query accuracy in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a service query method, device, electronic device, storage medium, and computer program product. Background Art

[0002] In voice assistants, the core of performing tasks is to understand the user's intentions and accurately perform corresponding operations.

[0003] Business queries are a common feature. In reality, users often don't express their queries in clear, concise sentences. Instead, they submit complex, information-intensive, and diverse natural language inputs. These complex queries place higher demands on understanding user intent, which in turn affects the accuracy of business queries.

[0004] From the above, we can see that how to improve the accuracy of business queries still needs to be solved. Summary of the Invention

[0005] This application provides a service query method, device, electronic device, and storage medium, which can solve the problem of low accuracy of service query in related technologies. The technical solution is as follows:

[0006] According to one aspect of the present application, a business query method includes: obtaining target data, wherein the target data is used to express business query requirements; extracting information from the target data based on custom slots to obtain target slot information; the custom slots correspond to information categories related to the business query; and performing a business query based on the target slot information to obtain a business query result.

[0007] According to one aspect of the present application, a business query device includes: a corpus acquisition module for acquiring target data, wherein the target data is used to express business query requirements; an information extraction module for extracting information from the target data based on custom slots to obtain target slot information; the custom slots correspond to information categories related to the business query; and a business query module for performing business queries based on the target slot information to obtain business query results.

[0008] In an exemplary embodiment, the information extraction module is also used to perform a first slot prediction on the target data through a slot prediction model to obtain first slot information; the first slot information includes attribute category information and / or time category information; the slot prediction model is a trained machine learning model that has the ability to predict the first slot information of the target data; the target data is predicted for a second slot using a target automaton to obtain second slot information; the second slot information includes location category information and / or festival category information; the target automaton has the ability to identify category information related to the target slot dictionary in the target data; the target slot information is obtained based on the first slot information and / or the second slot information.

[0009] In an exemplary embodiment, the information extraction module is also used to perform multi-task slot prediction on the category to which the information in the target data belongs through the slot prediction model to obtain a prediction result; the prediction result is used to indicate the category to which the information in the target data belongs; the multi-task slot prediction refers to the process of synchronously extracting and identifying multiple semantic category slots from the target data; based on the category to which the information indicated by the prediction result belongs, information is extracted from the target data to obtain the first slot information.

[0010] In an exemplary embodiment, the information extraction module is also used to calculate the category probabilities corresponding to the information in the target data belonging to different categories; the category probabilities are used to indicate the possibility that the information in the target data belongs to the corresponding category; based on each of the category probabilities, the category to which the information in the target data belongs is determined to obtain the prediction result.

[0011] In an exemplary embodiment, the information extraction module is further configured to select, from the category probabilities, a category corresponding to a category probability that meets a set condition as the category to which the information in the target data belongs.

[0012] In an exemplary embodiment, the information extraction module is further configured to extract category information from the target data according to the target slot dictionary included in the target automaton, to obtain the second slot information that conforms to the target slot dictionary.

[0013] In an exemplary embodiment, the slot prediction model includes an input layer, an encoding layer and an output layer; the business query device also includes a model training module, which is used to train the slot prediction model. The training process includes: obtaining training information, which is multilingual information carrying slot labels; the slot labels are used to indicate the categories corresponding to each information in the training information; transmitting the training information to the input layer for training, and performing feature learning on the training information in the encoding layer to obtain training features; transmitting the training features to the output layer for multi-task learning prediction to obtain training results; the training results include at least one prediction label of the training information; and using the prediction labels in the training results and the slot labels in the training information to train the slot prediction model until a trained slot prediction model is obtained.

[0014] In an exemplary embodiment, the model training module is also used to obtain original data; the original data is multilingual information that does not carry slot labels; the original data is annotated with respect to slot labels by manual labeling; or, the original data is annotated with respect to slot labels by template labeling; or, the original data is annotated with respect to slot labels by a natural language model to obtain the training data.

[0015] In an exemplary embodiment, the model training module is also used to configure corresponding loss functions for multiple prediction tasks of the slot prediction model based on each of the prediction labels and each of the slot labels; based on the weighted average method of each of the loss functions, the slot prediction model is subjected to back-propagation multi-task learning until each of the loss functions indicates that the training is completed, thereby obtaining the slot prediction model.

[0016] In an exemplary embodiment, the slot prediction model includes an input layer, an encoding layer, and an output layer; the business query device also includes an automaton construction module, which is used to obtain multilingual dictionary information related to location categories and festival categories; construct a target slot dictionary based on the multilingual dictionary information, and construct an AC automaton based on the target slot dictionary to obtain the target automaton.

[0017] According to one aspect of the present application, an electronic device includes at least one processor and at least one memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the business query method described above is implemented.

[0018] According to one aspect of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by one or more processors, the service query method described above is implemented.

[0019] According to one aspect of the present application, a computer program product includes a computer program, and when the computer program is executed by one or more processors, the service query method described above is implemented.

[0020] The beneficial effects of the technical solution provided by this application are:

[0021] In the above technical solution, according to the characteristics of the first slot information and the second slot information, the slot prediction model and the target automaton are used to predict the target data respectively, so as to obtain the first slot information and the second slot information. This can not only improve the accuracy of the slot information prediction, but also extract different categories of information in the target data at the same time, which can improve the information processing efficiency, thereby effectively solving the problem of low accuracy of business queries existing in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts.

[0023] Figure 1 It is a schematic diagram of the implementation environment involved in this application;

[0024] Figure 2 is a hardware structure diagram of a terminal according to an exemplary embodiment;

[0025] Figure 3 is a flow chart showing a business query method according to an exemplary embodiment;

[0026] Figure 4 yes Figure 3 A flowchart of step 330 in one embodiment corresponding to the embodiment;

[0027] Figure 5 yes Figure 4 The flowchart of step 331 in one embodiment corresponds to the embodiment;

[0028] Figure 6 yes Figure 4 A flowchart of an embodiment of the training process of the slot prediction model involved in the corresponding embodiment;

[0029] Figure 7 yes Figure 6 A flowchart of an embodiment corresponding to step 470 in one embodiment;

[0030] Figure 8 yes Figure 4 A flowchart of a process for constructing a target automaton involved in a corresponding embodiment;

[0031] Figures 9a to 9b This is a schematic diagram of a specific implementation of a business query method in an application scenario;

[0032] Figure 10 is a structural block diagram of a service query device according to an exemplary embodiment;

[0033] Figure 11 The figure is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0034] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limiting the present application.

[0035] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0036] As mentioned earlier, complex queries place higher demands on understanding user intent, which in turn affects the accuracy of business queries.

[0037] Specifically, slot extraction plays a crucial role in this business query process. Taking weather queries as an example, the purpose of slot extraction is to identify key information (slots) from the user's natural language input, such as location, date and time, and the weather attributes to be queried. This information is essential for providing accurate weather forecasts.

[0038] Fast and accurate slot extraction can reduce repetitive user input, improve interaction efficiency, and enhance the user experience. Some users may ask complex queries, such as "What's the weather like in New York tomorrow?" or "What's the weather forecast for Paris this weekend?" Slot extraction can help voice assistants handle these complex queries.

[0039] Control intent recognition is a fundamental and crucial function in smart home voice assistants. Currently, the mainstream approach to intent recognition is to build deep learning models, training them on large amounts of data to extract slot information. However, these models still have some issues, particularly poor generalization in multilingual scenarios. For example, for a time slot like "What's the weather like at 3 PM today?", expressions of time vary across languages, necessitating thorough annotation for each language.

[0040] Language diversity presents additional challenges. Different languages ​​have different grammatical structures and expressions, particularly when it comes to expressing dates and times. This complicates slot extraction. Furthermore, polysemy and contextual dependencies cannot be ignored. For example, the word "tomorrow" can have multiple meanings or be expressed in different positions in different languages. Achieving consistent slot extraction across multiple languages ​​is also a challenge. Models in different languages ​​must work under unified standards to ensure a consistent user experience.

[0041] As can be seen from the above, the related technology still has the defect of low accuracy of business query.

[0042] To this end, the business query method provided in this application can effectively improve the accuracy of business queries. Accordingly, the business query method is applicable to a business query device, which can be deployed on an electronic device. The electronic device can be a computer device configured with a von Neumann architecture, for example, the computer device includes a desktop computer, a laptop computer, a server, etc.; the electronic device can also be an electronic device with a central control function.

[0043] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0044] Figure 1 The implementation environment of a business query method is shown in FIG. The implementation environment includes at least a user terminal 110, a smart device 130, a server 170, and a network device. Figure 1 In the embodiment, the network devices include a gateway 150 and a router 190, which is not specifically limited here.

[0045] Among them, the user terminal 110, which can also be considered as a user end or terminal, can deploy (also understood as install) the client associated with the smart device 130. This user terminal 110 can be an electronic device such as a smart phone, tablet computer, laptop computer, desktop computer, smart control panel, other devices with display and control functions, etc., which are not limited here.

[0046] Among them, the client is associated with the smart device 130. In essence, the user registers an account in the client and configures the smart device 130 in the client. For example, the configuration includes adding a device identifier to the smart device 130, so that when the client is run in the user terminal 110, it can provide the user with device display, device control and other functions about the smart device 130. This client can be in the form of an application or a web page. Accordingly, the interface for device display on the client can be in the form of a program window or a web page, which is not limited here.

[0047] The smart device 130 is deployed in the gateway 150, and communicates with the gateway 150 through its own configured communication module, and is thereby controlled by the gateway 150. It should be understood that the smart device 130 generally refers to one of a plurality of smart devices 130, and the embodiment of the present application only takes the smart device 130 as an example, that is, the embodiment of the present application does not limit the number and device types of smart devices deployed in the gateway 150. In an application scenario, the smart device 130 accesses the gateway 150 through a local area network, and is thereby deployed in the gateway 150. The process of the smart device 130 accessing the gateway 150 through the local area network includes: the gateway 150 first establishes a local area network, and the smart device 130 joins the local area network established by the gateway 150 by connecting to the gateway 150. This local area network includes but is not limited to: ZIGBEE or Bluetooth. Among them, the smart device 130 can be a smart printer, a smart fax machine, a smart camera, a smart air conditioner, a smart door lock, a smart light, or a human body sensor equipped with a communication module, a door and window sensor, a temperature and humidity sensor, a water immersion sensor, a natural gas alarm, a smoke alarm, a wall switch, a wall socket, a wireless switch, a wireless wall sticker switch, a Rubik's Cube controller, a curtain motor, a millimeter wave radar, etc.

[0048] The interaction between the user terminal 110 and the smart device 130 can be achieved through a local area network or a wide area network. In one application scenario, the user terminal 110 establishes a communication connection between the router 190 and the gateway 150 by means of a wired or wireless method. For example, the wired or wireless method includes but is not limited to WIFI, so that the user terminal 110 and the gateway 150 are deployed in the same local area network, thereby enabling the user terminal 110 to interact with the smart device 130 through the local area network path. In another application scenario, the user terminal 110 establishes a communication connection between the server 170 and the gateway 150 by means of a wired or wireless method. For example, the wired or wireless method includes but is not limited to 2G, 3G, 4G, 5G, WIFI, etc., so that the user terminal 110 and the gateway 150 are deployed in the same wide area network, thereby enabling the user terminal 110 to interact with the smart device 130 through the wide area network path.

[0049] The server end 170 can also be considered as a cloud, cloud platform, platform end, service end, etc. The server end 170 can be a single server, a server cluster composed of multiple servers, or a cloud computing center composed of multiple servers, so as to better provide backend services to a large number of user terminals 110. For example, the backend service includes a business query service.

[0050] In an application scenario, the smart device 130 may include an intelligent control panel, which collects the user's voice to obtain target data, and the target data is used to express business query requirements; information is extracted from the target data based on custom slots to obtain target slot information; the custom slots correspond to information categories related to business queries; business queries are performed based on the target slot information to obtain business query results.

[0051] In addition, the intelligent control panel can also send the target data to the server side 170, so that the server side 170 extracts information from the target data based on the custom slot to obtain the target slot information; the custom slot corresponds to the information category related to the business query; based on the target slot information, a business query is performed to obtain the business query result, and the business query result is returned to the intelligent control panel, so that the intelligent control panel displays the business query result in the form of voice playback or page display.

[0052] It should be noted that the service query method implemented by the above-mentioned smart device 130 can also be implemented by the user terminal 110 (such as a smart phone).

[0053] See also Figure 2 , Figure 2 This is a hardware structure diagram of a terminal according to an exemplary embodiment. Figure 1 A smart device 130 and a user terminal 110 are shown in an implementation environment.

[0054] It should be noted that the terminal is only an example adapted for this application and cannot be considered to provide any limitation on the scope of use of this application. The terminal cannot be interpreted as needing to rely on or must have Figure 2 One or more components of the exemplary terminal 100 shown in FIG.

[0055] like Figure 2 As shown, the terminal 100 includes a memory 101, a storage controller 103, one or more ( Figure 2 The processor 105 (only one is shown), the peripheral interface 107, the radio frequency module 109, the positioning module 111, the camera module 113, the audio module 115, the touch screen 117 and the key module 119. These components communicate with each other via one or more communication buses / signal lines 121.

[0056] Among them, the memory 101 can be used to store computer programs, such as the computer programs corresponding to the business query method and device in the exemplary embodiment of the present application. The processor 105 reads the computer programs stored in the memory 101 to execute various functions and data processing, thereby completing the business query method.

[0057] The memory 101 is a carrier for resource storage and can be a random access memory, such as a high-speed random access memory, a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other solid-state memory. The storage method can be temporary storage or permanent storage.

[0058] The peripheral interface 107 may include at least one wired or wireless network interface, at least one serial-parallel conversion interface, at least one input / output interface, and at least one USB interface, etc., for coupling various external input / output devices to the memory 101 and the processor 105 to achieve communication with various external input / output devices.

[0059] The RF module 109 is used to transmit and receive electromagnetic waves, converting electromagnetic waves into electrical signals, thereby communicating with other devices via a communication network. The communication network includes a cellular telephone network, a wireless local area network, or a metropolitan area network. The above communication networks can use various communication standards, protocols, and technologies.

[0060] The positioning module 111 is used to obtain the current geographical location of the terminal 100. Examples of the positioning module 111 include, but are not limited to, a global positioning system (GPS) and positioning technologies based on a wireless local area network or a mobile communication network.

[0061] The camera module 113 is a camera that is used to take pictures or videos. The pictures or videos taken can be stored in the memory 101 and can also be sent to the host computer through the radio frequency module 109.

[0062] The audio module 115 provides an audio interface to the user, which may include one or more microphone interfaces, one or more speaker interfaces, and one or more headphone interfaces. The audio data is interacted with other devices through the audio interface. The audio data can be stored in the memory 101 and can also be sent through the radio frequency module 109.

[0063] The touch screen 117 provides an input / output interface between the terminal 100 and the user. Specifically, the user can use touch screen 117 to perform input operations, such as clicks, touches, and swipes, to cause the terminal 100 to respond to the input operations. The terminal 100 then displays output content, such as text, images, or videos, in any form or combination thereof, to the user via the touch screen 117.

[0064] The key module 119 includes at least one key to provide an interface for the user to input to the terminal 100. The user can press different keys to make the terminal 100 perform different functions. For example, the sound adjustment key allows the user to adjust the volume of the sound played by the terminal 100.

[0065] I understand. Figure 2 The structure shown is for illustration only. The terminal 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different components are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0066] See also Figure 3 The embodiment of the present application provides a service query method, which is applicable to an electronic device, for example, the electronic device may be Figure 1 The smart device 130 in the implementation environment shown may also be a user terminal 110. The hardware structure of the electronic device may be as follows: Figure 2 shown.

[0067] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0068] like Figure 3 As shown, the method may include the following steps:

[0069] Step 310: Acquire target data.

[0070] The target data is used to express business query requirements. Business query requirements refer to user query requirements for a certain business, such as information query requirements, weather query requirements, etc., which are not limited here.

[0071] Regarding the acquisition of target data, the user can input business query requirements using the keyboard component provided by the smart device, and the smart device obtains the target data by obtaining the text input by the user. The user can also input business query requirements through the voice recognition component of the smart device, and the smart device obtains the target data by obtaining the user's voice. There is no limitation here.

[0072] For example, if a user says "check the weather in Shenzhen in the past three days" on the voice assistant of a smartphone, the smartphone can obtain the user's weather query needs and obtain the target data.

[0073] Step 330: extract information from the target data based on the custom slot to obtain target slot information.

[0074] Among them, the custom slot corresponds to the information category related to the business query. The information category can be the category of information related to the business. For example, if the business is weather query, then the information category can include location category, attribute category, time category, holiday category, etc., which is not specifically limited here.

[0075] It should be noted that different business queries may include different custom slots, which may be set by the user according to the characteristics of the business query or pre-set by the manufacturer, and are not limited here.

[0076] For example, if the business query is a weather query, it can be understood that the weather query needs to include at least information categories such as location and time. Then, the custom slots can include location category slots and time category slots. Based on this, location slots and time slots can be set for business queries.

[0077] In addition, business queries can also be travel reservation queries, e-commerce logistics queries, etc. If the business query is a travel reservation query, then the travel reservation query can include information categories such as transportation reservations, hotel reservations, and attraction tickets. Then, the custom slots can include transportation reservation category slots, hotel reservation category slots, and attraction ticket category slots. Based on this, transportation reservation slots, hotel reservation slots, and attraction ticket slots can be set for the travel reservation category.

[0078] Furthermore, custom slots provide a more flexible information extraction method for business queries. Specifically, when adding a new business query requirement, you only need to define the mapping rules between the custom slots and category information, eliminating the need to restructure the core business query logic. Of course, you can also adjust existing business query requirements by adding, removing, or modifying custom slots.

[0079] For example, a new custom slot can be added for the weather query service: time point category. Then, when the user wants to perform a weather query, the custom slot corresponding to the time point category (time point slot) will be used to extract information from the target data.

[0080] As mentioned above, the target data is used to express business query requirements. Business query requirements are users' query requirements for a certain business. Therefore, based on custom slots, different information in the target data can be extracted, so as to extract information corresponding to the custom slots from the target data, thereby obtaining the target slot information.

[0081] Taking the aforementioned business query as a weather query as an example, the target data may be "query the weather in Shenzhen in the past three days". Then, the smart device may first perform semantic recognition on the target data to determine that the user's business query requirement is a weather query, and then determine the custom slots based on the weather query requirement: location slot and time slot, thereby extracting the location where the user needs to query the weather (for example, Shenzhen) and the time when the user needs to query (for example, April 15, April 16, and April 17, 2025), thereby obtaining the target slot information: location slot - Shenzhen, time slot - April 15, April 16, and April 17, 2025.

[0082] It can be understood that the target slot information may refer to a parameterized representation of the user's business query requirements, which can convert the fuzzy expressions in the user's natural language into precise parameters, thereby providing standardized input for the business query.

[0083] Step 350: Perform a service query based on the target slot information to obtain a service query result.

[0084] First of all, it should be noted that the target slot information can be regarded as the query condition in the business query. Then, based on the target slot information and specific business query requirements (for example, information query, weather query), relevant information can be queried from the database, or the business query interface can be called to obtain the business query results.

[0085] Among them, the business query results include information corresponding to the business that the user expects to query. Taking the aforementioned business query as a weather query as an example, a weather query is performed based on the target slot information: location slot-Shenzhen, time slot-April 15, April 16 and April 17, 2025, and the weather business query results obtained may include that the weather on April 15, 2025 is cloudy, the weather on April 16, 2025 is cloudy to light rain, and the weather on April 17, 2025 is sunny.

[0086] Through the above process, information is extracted from the target data based on the custom slots to obtain the target slot information. The custom slots can provide a mapping between different slots and information, thereby extracting category information related to the business query in the target data. The target slot information can convert the fuzzy expressions in the user's natural language into precise parameters, thereby performing business queries and obtaining business query results.

[0087] See also Figure 4 In an exemplary embodiment, step 330 may further include the following steps:

[0088] Step 331: Perform a first slot prediction on the target data using a slot prediction model to obtain first slot information.

[0089] The slot prediction model is a machine learning model that has been trained and has the ability to predict the first slot information of the target data.

[0090] The first slot information includes attribute category information and / or time category information. The attribute category information may be the attribute involved in the service query, and the time category information may be the time involved in the service query. Furthermore, the time category information may include time information and time point information.

[0091] For example, if the business query is a weather query, then the weather attribute category information may include air quality query (air), weather temperature query (temperature), sunrise and sunset query (sun), moonrise and moonset query (moon), and general attribute query (general attribute refers to the general indicators of weather query, which is represented by normal).

[0092] For another example, specific time point information includes the extraction of hours, minutes, and seconds, and specific time information includes the month and a specific day. Time information categories include now, today, tomorrow, the day after tomorrow, week, and next_X_time, where x represents a number. In this embodiment, a two-digit numerical expression (range_num) is extracted, which is the tens digit (range_ten) and the units digit (range_unit), both in the range of [0-9]. Time point information (time_unit) can distinguish the unit of the numerical expression; time point information categories can also include morning, afternoon, and evening.

[0093] Based on this, the slot prediction model can be used to extract attribute category information and / or time category information in the target data, thereby obtaining the first slot information.

[0094] For example, a user queries: "Will the temperature in Shenzhen be high tomorrow?" The query is first input into the trained slot prediction model. The slot prediction model then outputs the prediction results for each attribute, that is, it infers the probability distribution of the prediction results for each custom slot, and takes the one with the highest probability as the final prediction result. The prediction result for "[weather_attr]" (weather attribute slot) is "temperature" (weather temperature query), and the prediction result for "[time_range]" (time slot) is "tomorrow". The predictions for other custom slots are empty.

[0095] Step 333: Use the target automaton to predict the second slot of the target data to obtain the second slot information.

[0096] The second slot information includes location category information and / or holiday category information. The location category information is the location involved in the business query, and the holiday category information is the holiday involved in the business query.

[0097] For example, a user queries: "Is the temperature high in Shenzhen during National Day?" Based on the target automaton, the "location" (location slot): "Shenzhen"; "festival" (festival slot): "National Day". If there is no corresponding information in the location slot or the festival slot, the prediction is empty.

[0098] It should be noted that the first slot information can have the characteristics of an open expression form, for example, fuzzy time expression: 5 minutes can be expressed as one word (such as 15 minutes is 3 words), 30 minutes can be expressed as half an hour, and so on; different from the first slot information, the second slot information has the characteristics of a fixed expression form. It can be understood that the expression of places and festivals around the world is unique. Based on this, in order to extract location category information and festival category information more quickly and accurately, the target automaton can be used to predict the second slot.

[0099] The target automaton has the ability to identify category information related to the target slot dictionary in the target data. The target automaton can be an AC automaton built based on the AC automaton and related to specific business query requirements. It is understood that different business requirements may contain category information with unique expression characteristics. Therefore, the target automaton can be constructed based on such category information with unique expression characteristics.

[0100] The target slot dictionary can refer to a vocabulary of predefined location category information / festival category information. Similar to the target automaton, the target slot information is also related to category information with unique expression characteristics. Category information related to business needs and with unique expression characteristics can be collected through various methods (such as public databases) to construct the target slot dictionary.

[0101] It should be noted that, unlike the slot prediction dictionary, when adding location category information / festival category information, it is only necessary to expand the target slot dictionary without retraining the model, thereby simplifying the slot prediction process.

[0102] Then, the target automaton can be used to identify the location category information and / or festival category information in the target data, thereby obtaining the second slot information.

[0103] Step 335: Obtain target slot information based on the first slot information and / or the second slot information.

[0104] As mentioned above, based on the first slot information and / or the second slot information, the target slot information can be obtained according to the attribute category information and / or time category information included in the first slot information and the festival category information and / or location category information included in the second attribute category information.

[0105] Under the influence of the above-mentioned embodiment, according to the characteristics of the first slot information and the second slot information, the slot prediction model and the target automaton are used to predict the target data respectively, so as to obtain the first slot information and the second slot information. This can not only improve the accuracy of the slot information prediction, but also extract different categories of information in the target data at the same time, thereby improving the information processing efficiency.

[0106] See also Figure 5 In an exemplary embodiment, step 331 may further include the following steps:

[0107] Step 3311: Perform multi-task slot prediction on the category to which the information in the target data belongs through the slot prediction model to obtain a prediction result.

[0108] Among them, the prediction result is used to indicate the category to which the information in the target data belongs. Multi-task slot prediction refers to the process of synchronously extracting and identifying multiple semantic category slots from the target data. The semantic category slots correspond to information categories with specific semantic meanings, such as time categories and attribute categories.

[0109] Then, in the process of multi-task slot prediction, semantic recognition can be performed on the information in the target data to determine the semantic category slot (for example, time slot, attribute slot) corresponding to the information in the target data.

[0110] Specifically, natural language processing can be performed on the target data, and the corresponding text language in the target data can be segmented to determine the semantic category slot corresponding to each word and the category to which it belongs, so as to predict the category to which the information in the target data belongs.

[0111] In other words, once the semantic category slot corresponding to each word in the target data and the category to which it belongs are determined, the category prediction is considered completed, and the prediction result can then indicate the category to which each word belongs.

[0112] Step 3313: Based on the category to which the information indicated by the prediction result belongs, information is extracted from the target data to obtain first slot information.

[0113] It can be understood that after confirming the category to which the information in the target data belongs, the multiple category types in the target data can be efficiently identified, and the category information in the target data can be extracted using the semantic category slot to obtain the first slot information.

[0114] For example, if the target data is "check the weather in Shenzhen tomorrow afternoon", then the corresponding word segmentation results can be "check", "Shenzhen", "tomorrow", "afternoon", and "weather". Furthermore, the categories to which each word belongs can be: tomorrow afternoon-time category, afternoon-time point category, weather-general category. By using the time slot, time point slot and attribute slot to process each word (category information) and the corresponding category, the first slot information can be obtained.

[0115] Under the effect of the above embodiment, multi-task slot prediction is performed on the category to which the information in the target data belongs through the slot prediction model, and category information corresponding to multiple custom slots can be extracted at the same time, thereby improving the information extraction rate of the first slot information.

[0116] In an exemplary embodiment, the above method may further include the following steps: calculating the category probabilities corresponding to different categories of information in the target data; determining the category to which the information in the target data belongs based on the category probabilities, and obtaining a prediction result.

[0117] Among them, the category probability is used to indicate the possibility that the information in the target data belongs to the corresponding category. It can be understood that the information corresponding to the same semantic category slot in the target data may belong to different categories. For example, the semantic category slot corresponds to the attribute category, then the information corresponding to the semantic category slot may belong to different attribute categories. Therefore, it needs to be determined.

[0118] For example, taking the weather attribute category slot as an example, according to the definition of the weather attribute category slot, there are 5 categories of weather attributes, namely ["normal","sun","moon","temperature","air"] (normal attributes, sunrise and sunset queries, moonrise and moonset queries, weather temperature queries, air quality queries), "[weather_attr]" represents the weather attribute category slot, and the model will calculate and predict the probability that "[weather_attr]" belongs to the 5 categories, and obtain the probability distribution p = [p_1,p_2,p_3,p_4,p_5], where p_(1~5) respectively represent the category probabilities that the model predicts that "[weather_attr] (weather attribute slot)" belongs to the 5 categories. Specifically, the information in the target data can be segmented, the segmentation results (basic unit tokens) can be encoded, and the vector corresponding to each token can be output, so that the fully connected layer can be used to calculate the score of each token, and then the Softmax normalization can be used to obtain the probability of each category. Then, the category corresponding to the maximum category probability can be taken as the prediction result. For example, for the query "What's the temperature today?", if the model correctly predicts, the p_4 probability is maximized, indicating the highest probability that the predicted weather attribute category is "temperature" (weather temperature query). Therefore, we can determine that the weather attribute slot corresponding to the information in the target data is the weather temperature query. Similarly, the principle for other semantic category slots is the same.

[0119] Through the above process, the category probabilities corresponding to different categories of information in the target data can be determined, thereby determining the category to which the information in the target data belongs, so as to facilitate the subsequent use of semantic category slots to extract information from the target data and obtain the first slot information.

[0120] In an exemplary embodiment, the above method may further include the following step: selecting, from among the various category probabilities, a category corresponding to a category probability that satisfies a set condition as the category to which the information in the target data belongs.

[0121] Among them, the setting condition is a condition used to determine the category to which the information in the target data belongs based on the category probability. The setting condition can be set according to the actual situation. For example, the category with the largest category probability is selected as the category to which the information belongs. There is no limitation here.

[0122] Taking the weather attribute category slot as an example, according to the definition of the weather attribute category slot, there are five categories of weather attributes, namely ["normal","sun","moon","temperature","air"] (normal attributes, sunrise and sunset queries, moonrise and moonset queries, weather temperature queries, and air quality queries). "[weather_attr]" represents the weather attribute category slot. The model will calculate and predict the probability that "[weather_attr]" belongs to the five categories, and obtain the probability distribution p = [p_1,p_2,p_3,p_4,p_5], where p_(1~5) respectively represent the category probabilities that the model predicts "[weather_attr] (weather attribute slot)" belongs to these five categories. Specifically, the information in the target data can be segmented, the segmentation results (basic unit tokens) can be encoded, and the vector corresponding to each token can be output. The fully connected layer can then be used to calculate the score of each token, and then Softmax normalization can be used to obtain the probability of each category. Then, the category corresponding to the maximum category probability can be taken as the prediction result. For example, for the query "What's the temperature today?", if the model correctly predicts, the p_4 probability will be the highest, indicating the highest probability that the predicted weather attribute category is "temperature" (weather temperature query). Therefore, the weather attribute slot corresponding to the information in the target data is determined to be the weather temperature query. The same principle applies to other semantic category slots. Through this process, the set conditions are used to determine the category of the information in the target data, allowing subsequent information extraction using the semantic category slot to obtain the first slot information.

[0123] In an exemplary embodiment, the above method may further include the following steps: extracting category information from the target data according to the target slot dictionary included in the target automaton to obtain second slot information that conforms to the target slot dictionary.

[0124] As mentioned above, the second slot information includes location category information and / or festival category information. The location category information is the location involved in the business query, and the festival category information is the festival involved in the business query. The target slot dictionary can refer to a predefined vocabulary of location category information / festival category information. It can be understood that the location category information corresponds to the location slot, and the festival category information corresponds to the festival slot.

[0125] Then, the process of category information extraction can include using the target automaton to quickly scan the text of the target data, calculating the semantic similarity of the unmatched fragments, and using the familiarity to determine the information in the target data that meets the target slot dictionary to achieve category information extraction.

[0126] For example, if the target data is "check the weather in Shenzhen tomorrow afternoon", then the target automaton will quickly scan the target data to determine whether "Shenzhen" meets the location category of the target slot dictionary. If it does, it will get the second slot information: location slot - Shenzhen.

[0127] For example, the user query: "Is the temperature high in Shenzhen during the National Day?", based on the target automaton, "location" (location slot): "Shenzhen"; "festival" (festival slot): "National Day" are extracted.

[0128] Through the above process, the target automaton can be used to quickly extract the second slot information in the target data that meets the target slot dictionary.

[0129] See also Figure 6 In an exemplary embodiment, the slot prediction model includes an input layer, a coding layer, and an output layer. The training process of the slot prediction model may include the following steps:

[0130] Step 410: Obtain training information.

[0131] The training information is multilingual information carrying slot labels; the slot labels are used to indicate the categories corresponding to each piece of information in the training information.

[0132] It should be noted that the multilingual information may include different languages, such as Chinese, German, French, English, etc., which is not limited here.

[0133] In step 430 , the training information is transmitted to the input layer for training, and feature learning is performed on the training information in the encoding layer to obtain training features.

[0134] Among them, the encoding layer can be a multilingual pre-trained encoding area BERT (Bidirectional Encoder Representations from Transformers), which is used to perform feature learning and semantic understanding on the training information input by the input layer, and extract important semantic information for the output of the subsequent output layer. In other words, the training features can be the semantic representation features obtained after processing by the encoding layer.

[0135] In step 450 , the training features are transferred to the output layer for multi-task learning prediction to obtain training results.

[0136] The training result includes at least one prediction label of the training information, and the prediction label is used to indicate the prediction category corresponding to each information in the training information.

[0137] Regarding the output layer, the custom slots can be learned and predicted based on the training features to obtain the actual predicted prediction label of each custom slot.

[0138] For example, the weather attribute category slot defines five categories: ["normal", "sun", "moon", "temperature", and "air"]. "[weather_attr]" represents the weather attribute category slot. The model calculates the probability that "[weather_attr]" belongs to one of these five categories, resulting in a probability distribution p = [p_1, p_2, p_3, p_4, p_5], where p_(1-5) represent the model's predicted probability of "[weather_attr]" belonging to each of these five categories. The category with the highest probability is then selected as the prediction result. For example, for the query "What's the temperature today?", if the model correctly predicts, p_4 will have the highest probability, indicating that the predicted weather attribute category is "temperature." The same principle applies to other custom slots.

[0139] Step 470 , train the slot prediction model using the prediction labels in the training results and the slot labels in the training information until a trained slot prediction model is obtained.

[0140] It can be understood that based on the prediction labels in the training results and the slot labels in the training information, the difference between the true value and the predicted value can be determined, and the slot prediction model can be trained based on the difference to obtain a trained slot prediction model.

[0141] It should be noted that a validation set can be obtained, and the validation set can be obtained by separating a part from the training information separately, and the part separated from the training information does not participate in the training process; then, the validation set can be used to verify the slot prediction model and calculate the loss function. When the loss function converges, it indicates that the trained slot prediction model is obtained; or the performance index of the slot prediction model (for example, the f1 score) is calculated. When the performance index reaches the set threshold and is stable, it indicates that the trained slot prediction model is obtained, and so on. No specific limitation is made here.

[0142] In the above process, by training the slot prediction model's multi-language and multi-task learning prediction capabilities, the slot prediction model after training can support multi-language and multi-task learning predictions, and simultaneously perform slot predictions on multi-language information in the target data, thereby accelerating the prediction efficiency.

[0143] In an exemplary embodiment, before step 410, the method may further include the following steps: obtaining original data; annotating the original data with slot labels by manual annotation; or, annotating the original data with slot labels by template annotation; or, annotating the original data with slot labels by a natural language model to obtain training data.

[0144] The original data is multilingual information without slot labels.

[0145] Regarding raw data acquisition, you can collect large amounts of voice and text data. This data should encompass the various expressions users might use to query services. Sources of raw data can include public datasets and online user usage data (with due regard for privacy and data protection). Furthermore, you can generate large models based on sentence patterns and generate multilingual translation data.

[0146] The diversity of raw data ensures data diversity. The raw data includes data corresponding to each custom slot and is evenly distributed. Furthermore, for training sentences involving numerical expressions, for example, in "What's the weather like at 3 a.m. on October 5th?", 5, 3, etc. are both numerical expressions. When constructing the raw data, numerical expressions can be randomly generated to maintain diversity, allowing subsequent models to fully learn the numerical expressions of users. In addition, the LLM method can be used to generate training corpus based on similar sentences, making the raw data more generalizable and more consistent with normal human expression.

[0147] Manual labeling refers to manually labeling raw data with slot labels. This process extracts information corresponding to each piece of raw data based on the user's input and defined custom slots, such as time slots, time point slots, attribute slots, date slots, holiday slots, and location slots. For example, for the question "What's the weather like in Shenzhen on the morning of August 5th?", the labeling results are as follows:

[0148] {query: "What is the weather like in Shenzhen at 8:00 AM on August 5th?", "weather_attr": "normal"

[0149] "time_point":"morning-8:00""date":"8-5","time_range":"","location":"Shenzhen","festival":""}

[0150] As shown in the above annotation results, "weather_attr" represents the weather attribute slot, and "time_point" represents the time point slot. The annotation format is "str1-str2", where str1 represents morning, afternoon, and evening, and str2 represents the specific time description in the format of ××:××. "str1" and "str2" are connected by "-" to facilitate subsequent data processing into custom slots for training. The default part can be left blank. "date" represents the date slot annotation, with the annotation format of "××-××", representing the month and day, connected by "-". The default part can be left blank. "time_range" represents the time slot. For example, the last two days are labeled as "2-day", Tuesday represents "2-week", and the last three hours are labeled as "3-hour". The number and unit are separated by "-". The default is left blank. "location" represents the location slot. The location description mentioned in the query is left blank. Similarly, "festival" represents the festival slot. The festival description mentioned in the query is left blank by default. The specific date of the festival needs to be placed in "date".

[0151] Template annotation refers to constructing a template for commonly used sentences in business queries, using different data (such as location, time, etc.) to generate new sentences for the template, and annotating the generated sentences.

[0152] Specifically, template annotation is divided into two parts: slot dictionary and slot template. Slot template is used to build a general user expression template. For example, the template is as follows [time_range][weather_attr][how], where time_range, weather_attr, and how are all dictionary names. The dictionary consists of the dictionary name and the expression list, as shown below:

[0153] {time_range (time slot): ["Today", "Tomorrow", "The day after tomorrow", "Monday", ...], "air" (weather attribute slot): ["Air quality", "Carbon dioxide concentration", "Smog", ...], "how": ["How", "How", "Is it comfortable", ...]}

[0154] Using the above template and dictionary, we can generate various weather expressions by randomly selecting dictionary expressions and filling them into the template. For example, if we select "week" for time_range, "air" for air quality, and "how" for how, we can express the weather expression: "How is the air quality on Monday?" Finally, we annotate the generated sentences according to the template. The annotation results are as follows:

[0155] {query: "What's the air quality like on Monday?", "weather_attr" (weather attribute slot): "air" (air quality query), "time_point" (time point slot): "", "date": "" "time_range" (time range slot): "1-week", "location" (location slot): "", "festival" (festival slot): ""} Regarding natural language model annotation, it refers to the use of LLM to generate new generalized data, which can be automatically annotated by the large model to ultimately form training data. In the case of multiple languages, natural language model annotation can ensure that the slot labels remain unchanged and the corresponding Chinese corpus can be translated into other languages. The annotation results are as follows:

[0156] {"input_zh":"What's the weather like in Shenzhen at 8:00 am on October 5th?", / / Chinese expression

[0157] "input_en":"What is the weather like in Shenzhen at 8am on October 5th?" / / English expression" / / Other language expression

[0158] "slot":{"weather_attr":"temperature","time_range":"","range_num":{"range_ten":"","range_unit":""},"time_unit":"","time_point":"morning","time":{"hour_ten":"0","hour_unit":"8","min_ten":"0","min_uni t":"0"},"date":{"month":"Oct","day_ten":"0","da_unit":"5"},"location":"Shenzhen","festival":""}

[0159] Through the cooperation of the above embodiments, it is possible to obtain original data in multiple forms of expression and multiple languages, and three different annotation forms are provided to annotate the original data to obtain training data, so as to use the training data to train the slot prediction model, thereby improving the slot prediction model's recognition ability for multiple languages ​​and multiple expressions, and enhancing the generalization performance of the slot prediction model.

[0160] See also Figure 7 In an exemplary embodiment, step 470 may further include the following steps:

[0161] Step 471 : Based on each prediction label and each slot label, configure corresponding loss functions for multiple prediction tasks of the slot prediction model.

[0162] The prediction task is related to the custom slot. Specifically, one custom slot can correspond to one prediction task.

[0163] In one possible implementation, the loss function may be a cross entropy loss function.

[0164] Specifically, the cross entropy loss function is a commonly used loss function in machine learning and deep learning to measure the difference between the model's predicted value and the true value. Cross entropy loss is often used in multi-task classification problems where the model needs to predict one of multiple categories. It is defined as follows:

[0165] For a training data, assuming that the slot label is y and the distribution of the model prediction label is p, the cross entropy loss is as shown in formula (1):

[0166]

[0167] Where C is the number of categories, y_i is an indicator variable for slot label i (if slot label is i, then y_i = 1, otherwise y_i = 0), p_i is the probability that the model predicts label i, and n represents the nth task.

[0168] In step 473 , based on the weighted average of each loss function, back-propagation multi-task learning is performed on the slot prediction model until each loss function indicates that the training is completed, thereby obtaining the slot prediction model.

[0169] Specifically, the weighted average method is shown in formula (2):

[0170]

[0171] Among them, w represents the weight of each task.

[0172] Through the above process, corresponding loss functions are configured for multiple prediction tasks of the slot prediction model, which can accurately measure the prediction error of each task and is suitable for multi-classification scenarios. The use of weighted averaging can prevent high-frequency tasks from dominating training. Through backpropagation multi-task learning, the loss function can be quickly converged, thereby accelerating the training process and improving the model's prediction accuracy.

[0173] See also Figure 8 In an exemplary embodiment, the process of constructing the target automaton may include the following steps:

[0174] Step 510, obtaining multilingual dictionary information related to location categories and holiday categories;

[0175] Among them, AC automaton (Aho-Corasick automaton) is an efficient multi-mode string matching automaton structure suitable for multi-mode matching.

[0176] Multilingual dictionary information can include extracting words related to location categories (such as Shenzhen, Guangzhou, and Beijing) and holiday categories (such as Christmas, Spring Festival, and Thanksgiving) from multilingual corpora or external resources, and providing equivalent translations in multiple languages ​​(such as Chinese, English, French, and German). This ultimately forms multilingual dictionary information.

[0177] For example, category: Festival; Chinese: Spring Festival, Mid-Autumn Festival; English: Spring Festival, Mid-Autumn Festival; French: Nouvel An chinois, Fête de la mi-automne.

[0178] Then, the multilingual dictionary information can be organized according to custom slots, with each category (such as "location" or "holiday") corresponding to a slot, and all words belonging to the same category as the synonym set for that slot. Ultimately, a structured target slot dictionary is formed.

[0179] Step 530 : construct a target slot dictionary based on the multilingual dictionary information, and construct an AC automaton according to the target slot dictionary to obtain a target automaton.

[0180] Based on this, all the terms in the target slot dictionary can be regarded as “pattern strings” to construct an AC automaton to obtain the target automaton.

[0181] Through the above process, the target automaton can simultaneously support word matching in multiple languages, which is suitable for cross-cultural scenarios (such as multilingual voice assistants, chatbots, etc.); using the target slot dictionary for classification matching, it can not only determine whether it is a hit, but also identify the custom slot of the matching word (position slot / festival slot, etc.); using the AC automaton, a one-time scan matching of multi-modal terms is achieved, which greatly improves the efficiency compared to word-by-word regular or sequential search. In addition, the target slot dictionary can be expanded at any time without changing the algorithm logic, and only the automaton needs to be rebuilt.

[0182] Figures 9a to 9b This is a schematic diagram of a specific implementation of a service query method in an application scenario. This application scenario is a weather query service.

[0183] Step 1: Get the target data: "What was the temperature in Shenzhen at 10:00 AM in the past three days?" The target data is the user's voice data, used to express weather query needs.

[0184] Step 2: Extract target data based on the custom slot to obtain target slot information.

[0185] Now combined Figure 9a The extraction of target slot information is described, such as Figure 9a As shown, the following steps are included: first, multi-language and multi-task slot rules are defined according to the characteristics of weather query, thereby obtaining multiple custom slots.

[0186] Regarding custom slots, based on the characteristics of weather service queries, the slot rules that need to be extracted are defined. In view of the characteristics of weather query services in voice assistants, five major categories of custom slots are developed, namely weather attribute slots (weather_attr), time range slots (time_range), time point slots (time_point), specific time slots (time), and specific date slots (date).

[0187] The weather attribute slot (weather_attr) includes air quality query (air), weather temperature query (temperature), sunrise and sunset query (sun), moonrise and moonset query (moon), and general attribute query (general attribute refers to the general indicators of weather query, represented by "normal").

[0188] The time range slot (time_range) includes now (now), today (today), tomorrow (tomorrow), the day after tomorrow (day_after_tomorrow), week (week), and next x days (next_X_time). x represents a number. This application scenario extracts two-digit numerical expressions (range_num), including the tens digit (range_ten) and the units digit (range_unit), both in the range [0-9]. In addition, a time point slot (time_unit) is added to distinguish the units of the numerical expression; the time point slot (time_unit) includes morning (morning), afternoon (afternoon), and evening (evening).

[0189] The specific time slot also includes the extraction of hours, minutes, and seconds, and the specific date slot includes the month and the specific day. In order to more clearly express the extraction results, the custom slot is expressed in JSON format as follows:

[0190] {"weather_attr":"str"["normal","sun","moon","temperature","air"]

[0191] "time_range":"str"["now","today","tomorrow","day_after_tomorrow","week","next_X_time"]"time_unit":"str"["day","hour","minute"]"range_num":{"range_ten":"str",[0-9]"range_unit":"str",[0-9]}"time_point": "str"["morning","afternoon","evening",""]"time":{"hour_ten":"str",[0-2]"hour_unit":"str",[0-9]"min_t en":"str",[0-5]"min_unit":"str"[0-9]}"date":{"month":"str","day_ten":"str",[0-5]"da_unit":"str"[0-9]}

[0192] "location":"str" / / "English expression"

[0193] "festival":"str"}

[0194] At the same time, the training data of the slot prediction model is prepared in order to build the slot prediction model (introducing a custom slot token), and the slot prediction model is trained through multi-task learning to obtain a slot prediction model that has completed training.

[0195] Specifically, the preparation of training data includes: obtaining original data; annotating the original data with slot labels through manual labeling; or, annotating the original data with slot labels through template labeling; or, annotating the original data with slot labels through a natural language model to obtain training data.

[0196] Figure 9b The network result diagram of a slot prediction model is shown in the figure. Figure 9b The multi-task learning training of the slot prediction model is explained, such as Figure 9b As shown, the network architecture for this application scenario uses the transformer-based encoding model BERT. To better adapt to multilingual extraction, a BERT encoder trained on multiple languages ​​is used for feature extraction. Based on the multilingual encoder, a model suitable for weather slot query is further constructed. Finally, fine-tuning is performed on a large amount of training data to achieve the weather query slot extraction task. The slot prediction model consists of an input layer, an encoding layer, and an output layer.

[0197] Specifically, the input side of the slot prediction model consists of six main components. The first component is the user's expression. The remaining components represent five tasks: weather attribute extraction, time range extraction, time point extraction, specific time extraction, and specific date extraction. The user expression is the user's original sentence and is the object to be extracted. The other five tasks prompt the extraction of slots by adding corresponding custom tokens (custom slots). The specific customizations are as follows:

[0198] [weather_attr] represents a custom token for weather attributes, [time_range] represents a custom token for a time range, [time_unit] represents a custom token for a time unit, [time_point] represents a custom token for a time point, [range_ten] and [range_unit] represent the tens and minutes of a time range, [hour_ten], [hour_unit], [min_ten], [min_unit] represent the tens and minutes of an hour, and the tens and minutes of a minute, respectively; [month], [day_ten], [day_unit] represent the tens and minutes of a month and a specific day, respectively.

[0199] The encoder layer of the slot prediction model uses the multilingual pre-trained encoder BERT to perform feature learning and semantic understanding on the input side, extracting important semantic information for subsequent output on the output side.

[0200] The output of the slot prediction model learns and predicts the extracted custom tokens, obtaining the actual predicted slot label for each custom token. The model output is a probability distribution of the prediction results for each custom token, with the one with the highest probability being the final prediction result.

[0201] Taking weather attribute label recognition as an example, according to the definition of weather attribute category slots, there are five categories of weather attributes, namely ["normal","sun","moon","temperature","air"] (normal attributes, sunrise and sunset queries, moonrise and moonset queries, weather temperature queries, and air quality queries). "[weather_attr]" represents the weather attribute category slot. The model will calculate and predict the probability that "[weather_attr]" belongs to the five categories, and obtain the probability distribution p = [p_1,p_2,p_3,p_4,p_5], where p_(1~5) respectively represent the category probabilities that the model predicts that "[weather_attr] (weather attribute slot)" belongs to the five categories. Specifically, the information in the target data can be segmented, the segmentation results (basic unit tokens) can be encoded, and the vector corresponding to each token can be output. The fully connected layer can then be used to calculate the score of each token, and then Softmax normalization can be used to obtain the probability of each category. Then, the category corresponding to the maximum category probability can be taken as the prediction result. For example, for the query "What's the temperature today?", if the model correctly predicts, the p_4 probability is maximized, indicating the highest probability that the predicted weather attribute category is "temperature" (weather temperature query). Therefore, we can determine that the weather attribute slot corresponding to the information in the target data is the weather temperature query. Similarly, the principle for other semantic category slots is the same.

[0202] Among them, for the slot prediction model, this application scenario uses the cross-entropy loss (CrossEntropy Loss) loss function for each task. Finally, the loss function of each corresponding task is used for back-propagation multi-task learning using a weighted average method to obtain a slot prediction model that has completed training.

[0203] Then, the first slot prediction of the target data can be performed using the slot prediction model to obtain the first slot information.

[0204] Specifically, the slot prediction model extracts the user's expression (target data). This application scenario extracts each custom slot by first extracting the weather attribute slot, time range slot, time point slot, specific time slot and specific date slot through the slot prediction model.

[0205] The first slot information is as follows: {"weather_attr (weather attribute slot)":"temperature (temperature query)","time_range (time range slot)":"next_3_time","range_num":{"range_ten":"0", / / The tens digit of the time range (0 means the units digit is independent)"range_unit":"3" / / The units digit of the time range (total range = 0*10+3=3)},"time_unit":"day", / / Time unit: day"time_point":"mo rning", / / Time period: morning "time": {"hour_ten":"1", / / Tens digit of hour (1) "hour_unit":"0", / / Units digit of hour (0→10 o'clock) "min_ten":"0", / / Tens digit of minute (0) "min_unit":"0" / / Units digit of minute (0→00 minutes)},"date": {"month":"", / / Month (empty means unspecified) "day_ten":"", / / Tens digit of date (empty means unspecified) "day_unit":"" / / Units digit of date (empty means unspecified)}}.

[0206] In addition, it is necessary to build a target automaton based on the AC automaton to extract the information of the location slot and the festival slot and obtain the second slot information.

[0207] Specifically, the target data is subjected to category information extraction according to the target slot dictionary included in the target automaton to obtain the second slot information that conforms to the target slot dictionary. The second slot information includes {"location": Shenzhen"festival":""}

[0208] Then, the target slot information can be obtained based on the first slot information and / or the second slot information.

[0209] Specifically, the target slot information is as follows: {"weather_attr": "temperature", / / Weather attribute slot: temperature query "time_range": "next_X_time", / / Time range slot: the next X unit times (X needs to be replaced) "range_num": {"range_ten": "0", / / Tens digit of the time range (0 means the units digit is independent) "range_unit": "3"}, / / Units digit of the time range (total range = 0 * 10 + 3 = 3) "time_unit": "day", / / Time unit: day "time_point": "morning", / / Time period: morning "time": {"hour_ten": "1", / / Tens digit of the hour (1) "hour_unit": "0", / / Units digit of the hour (0 → 10 o'clock) "min_ten": "0", / / Tens digit of the minute (0) "min_unit": "0"}, / / Units digit of the minute (0 → 00 minutes) "date": {"month": "", / / Month (blank means not specified) "day_ten": "", / / Tens digit of the date (blank means not specified) "day_unit": ""}, / / Units digit of the date (blank means not specified) "location": "Shenzhen", / / Location: Shenzhen City "festival": ""} / / Festival (blank means not specified).

[0210] Step 3, perform a weather service query based on the target slot information to obtain the weather service query result.

[0211] Specifically, the weather service query result corresponding to "What is the temperature at 10 am in Shenzhen in the last 3 days" can include: The temperatures in Shenzhen at 10 am in the last three days (from April 7th to 9th, 2025) are as follows - At 10 am on April 7th (Monday): approximately 22.3°C; at 10 am on April 8th (Tuesday): approximately 22.9°C; at 10 am on April 9th (Wednesday): approximately 23.8°C.

[0212] In this application scenario, using the method of multi-task learning, the extraction tasks of key information such as time points, time ranges, specific dates, and weather attributes in weather queries are integrated and processed through a unified model; a multi-language version of the BERT pre-trained encoder is used to process the semantic feature extraction of different languages, effectively solving the difficulties of multi-language and fuzzy generalization problems in slot extraction; to better adapt to the multi-language extraction effect, custom slot Tokens such as "[weather_attr]" and "[time_range]" are introduced to prompt the model to perform specific slot extraction; the cross-entropy loss function is used for each task, and by weighted averaging the losses of different tasks, joint learning of multiple tasks is achieved.

[0213] In addition, the AC automatic calculation method is used to quickly and accurately extract locations and festivals to improve the efficiency and accuracy of slot extraction.

[0214] Based on this, a weather slot model was constructed to extract slot information such as weather attributes, time range, time point, specific time and specific date. Then, combined with the results of automatic extraction by the AC machine, the final multilingual slot extraction results were obtained. The solution was evaluated in multiple languages, with an overall accuracy rate of over 93%. Among them, the accuracy rate of Chinese, English, Russian, German and other languages ​​reached over 98%.

[0215] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0216] The following is an embodiment of the device of the present application, which can be used to execute the service query method involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the service query method involved in the present application.

[0217] See also Figure 10 In an embodiment of the present application, a business query device 900 is provided, including but not limited to: a corpus acquisition module 910, an information extraction module 930, and a business query module 950.

[0218] The corpus acquisition module 910 is used to acquire target data, which is used to express business query requirements.

[0219] The information extraction module 930 is used to extract information from the target data based on the custom slots to obtain target slot information; the custom slots correspond to information categories related to business queries.

[0220] The service query module 950 is used to perform service query based on the target slot information and obtain service query results.

[0221] In an exemplary embodiment, the information extraction module 930 is also used to perform a first slot prediction on the target data through a slot prediction model to obtain first slot information; the first slot information includes attribute category information and / or time category information; the slot prediction model is a machine learning model that has been trained and has the ability to predict the first slot information of the target data; the target automaton is used to perform a second slot prediction on the target data to obtain second slot information; the second slot information includes location category information and / or festival category information; the target automaton has the ability to identify category information related to the target slot dictionary in the target data; based on the first slot information and / or the second slot information, the target slot information is obtained.

[0222] In an exemplary embodiment, the information extraction module 930 is also used to perform multi-task slot prediction on the category to which the information in the target data belongs through a slot prediction model to obtain a prediction result; the prediction result is used to indicate the category to which the information in the target data belongs; multi-task slot prediction refers to the process of synchronously extracting and identifying multiple semantic category slots from the target data; based on the category to which the information indicated by the prediction result belongs, information is extracted from the target data to obtain the first slot information.

[0223] In an exemplary embodiment, the information extraction module 930 is also used to calculate the category probabilities corresponding to different categories of information in the target data; the category probabilities are used to indicate the possibility that the information in the target data belongs to the corresponding category; based on the category probabilities, the category to which the information in the target data belongs is determined to obtain a prediction result.

[0224] In an exemplary embodiment, the information extraction module 930 is further configured to select, from among the various category probabilities, a category corresponding to a category probability that satisfies a set condition as the category to which the information in the target data belongs.

[0225] In an exemplary embodiment, the information extraction module 930 is further configured to extract category information from the target data according to the target slot dictionary included in the target automaton, and obtain second slot information that conforms to the target slot dictionary.

[0226] In an exemplary embodiment, the slot prediction model includes an input layer, an encoding layer, and an output layer; the business query device 900 also includes a model training module 970, which is used to train the slot prediction model. The training process includes: obtaining training information, which is multilingual information carrying slot labels; the slot labels are used to indicate the categories corresponding to each information in the training information; transmitting the training information to the input layer for training, and performing feature learning on the training information in the encoding layer to obtain training features; transmitting the training features to the output layer for multi-task learning prediction to obtain training results; the training results include at least one prediction label of the training information; and using the prediction labels in the training results and the slot labels in the training information to train the slot prediction model until a trained slot prediction model is obtained.

[0227] In an exemplary embodiment, the model training module 970 is also used to obtain original data; the original data is multilingual information that does not carry slot labels; the original data is annotated with respect to slot labels by manual annotation; or, the original data is annotated with respect to slot labels by template annotation; or, the original data is annotated with respect to slot labels by a natural language model to obtain training data.

[0228] In an exemplary embodiment, the model training module 970 is also used to configure corresponding loss functions for multiple prediction tasks of the slot prediction model based on each prediction label and each slot label; based on the weighted average method of each loss function, the slot prediction model is subjected to back-propagation multi-task learning until each loss function indicates that the training is completed, thereby obtaining the slot prediction model.

[0229] In an exemplary embodiment, the business query device 900 also includes an automaton construction module 990, which is used to obtain multilingual dictionary information related to location categories and festival categories; construct a target slot dictionary based on the multilingual dictionary information, and construct an AC automaton based on the target slot dictionary to obtain a target automaton.

[0230] It should be noted that the business query device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing business queries. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the business query device will be divided into different functional modules to complete all or part of the functions described above.

[0231] In addition, the business query device and the business query method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiment and will not be repeated here.

[0232] See also Figure 11 In an embodiment of the present application, an electronic device 4000 is provided. The electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc.

[0233] exist Figure 11 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0234] Data exchange between the processor 4001 and the memory 4003 can be achieved via at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, for example. The communication bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0235] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0236] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0237] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store a computer program in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to these.

[0238] The memory 4003 stores a computer program, and the processor 4001 can read the computer program stored in the memory 4003 through the communication bus 4002 .

[0239] The computer program is executed by one or more processors 4001 to implement the service query method in the above embodiments.

[0240] In addition, an embodiment of the present application provides a storage medium on which a computer program is stored. The computer program is executed by one or more processors to implement the business query method as described above.

[0241] A computer program product is provided in an embodiment of the present application, including a computer program, which is executed by one or more processors to implement the service query method described above.

[0242] Compared with related technologies, according to the characteristics of the first slot information and the second slot information, the slot prediction model and the target automaton are used to predict the target data respectively, so as to obtain the first slot information and the second slot information. This can not only improve the accuracy of slot information prediction, but also extract different categories of information in the target data at the same time, which can improve information processing efficiency.

[0243] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A business query method, characterized in that: include: Acquire target data, where the target data is used to express business query requirements; Extracting information from the target data based on the custom slot to obtain target slot information; The custom slot corresponds to the information category related to the business query; A service query is performed based on the target slot information to obtain a service query result.

2. The method according to claim 1, wherein The extracting information from the target data based on the custom slot to obtain target slot information includes: Performing a first slot prediction on the target data using a slot prediction model to obtain first slot information; the first slot information includes attribute category information and / or time category information; the slot prediction model is a trained machine learning model capable of predicting the first slot information of the target data; Using a target automaton to predict a second slot of the target data, obtaining second slot information; the second slot information includes location category information and / or holiday category information; the target automaton has the ability to identify category information related to a target slot dictionary in the target data; The target slot information is obtained based on the first slot information and / or the second slot information.

3. The method according to claim 2, wherein The performing a first slot prediction on the target data by using a slot prediction model to obtain first slot information includes: Performing multi-task slot prediction on the category to which the information in the target data belongs using the slot prediction model to obtain a prediction result; the prediction result is used to indicate the category to which the information in the target data belongs; the multi-task slot prediction refers to the process of synchronously extracting and identifying multiple semantic category slots from the target data; Based on the category to which the information indicated by the prediction result belongs, information extraction is performed on the target data to obtain the first slot information.

4. The method according to claim 3, wherein The performing multi-task slot prediction on the category to which the information in the target data belongs by using the slot prediction model to obtain a prediction result includes: Calculating the category probabilities corresponding to different categories of information in the target data; the category probabilities are used to indicate the likelihood that the information in the target data belongs to a corresponding category; The category to which the information in the target data belongs is determined based on each of the category probabilities to obtain the prediction result.

5. The method according to claim 4, wherein Determining the category to which the information in the target data belongs based on each of the category probabilities to obtain the prediction result includes: The category corresponding to the category probability that meets the set conditions is selected from the category probabilities as the category to which the information in the target data belongs.

6. The method according to claim 2, wherein The using the target automaton to perform second slot prediction on the target data to obtain second slot information includes: Category information of the target data is extracted according to the target slot dictionary included in the target automaton to obtain the second slot information that conforms to the target slot dictionary.

7. The method according to any one of claims 2 to 6, characterized in that The slot prediction model includes an input layer, a coding layer and an output layer; The training process of the slot prediction model includes: Acquire training information, where the training information is multilingual information carrying slot labels; the slot labels are used to indicate the categories corresponding to each piece of information in the training information; The training information is transmitted to the input layer for training, and feature learning is performed on the training information in the encoding layer to obtain training features; Transmitting the training features to the output layer for multi-task learning prediction to obtain a training result; the training result includes at least one predicted label of the training information; The slot prediction model is trained using the prediction label in the training result and the slot label in the training information until a trained slot prediction model is obtained.

8. The method according to claim 7, wherein Before obtaining the training information, the following steps are included: Obtaining original data; the original data is multilingual information without slot labels; Annotate the original data with slot labels by manual annotation; or Annotate the original data with slot labels by means of template annotation; or The original data is annotated with slot labels using a natural language model to obtain the training data.

9. The method according to claim 7, wherein The slot prediction model is trained using the prediction label in the training result and the slot label in the training information until a trained slot prediction model is obtained, including: Based on each of the prediction labels and each of the slot labels, configuring corresponding loss functions for multiple prediction tasks of the slot prediction model; Based on the weighted average method of each loss function, back-propagation multi-task learning is performed on the slot prediction model until each loss function indicates that the training is completed, thereby obtaining the slot prediction model.

10. The method according to any one of claims 2 to 7, characterized in that The process of constructing the target automaton includes: Obtain multilingual dictionary information related to location categories and festival categories; A target slot dictionary is constructed based on the multilingual dictionary information, and an AC automaton is constructed according to the target slot dictionary to obtain the target automaton.

11. A business query device, characterized in that: include: A corpus acquisition module is used to acquire target data, which is used to express business query requirements; An information extraction module, configured to extract information from the target data based on the custom slot to obtain target slot information; The custom slot corresponds to the information category related to the business query; The service query module is used to perform service query based on the target slot information and obtain service query results.

12. An electronic device comprising at least one processor and at least one memory, wherein: The memory stores a computer program, wherein the computer program, when executed by the processor, implements the service query method according to any one of claims 1 to 10.

13. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by one or more processors, the service query method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by one or more processors, the service query method according to any one of claims 1 to 10 is implemented.