Method and device for realizing meteorological information question and answer interaction, terminal and medium
Through the preset intention recognition model to identify user intentions and evaluate confidence, the shortcomings of existing meteorological information interaction services in intention recognition and multi-round dialogue management are solved, and accurate meteorological information reply and intelligent interaction are achieved.
Patent Information
- Application Number
- CN202411762788.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing meteorological information interaction services may have misjudgments in understanding and identifying user intentions, and lack multi-round dialogue management capabilities, memory capabilities, and contextual reasoning capabilities, resulting in providing inaccurate or incorrect meteorological information.
Through the preset intent recognition model, the intent is identified and the intent recognition results are generated based on the user's input text, including entity information and intent information. Then, confidence evaluation is performed on the intent recognition results, intent recognition sets with high confidence are screened out, data assembly is performed to obtain target meteorological information.
It realizes accurate responses to users' inquiries about meteorological information, enhances the intelligent interaction ability of meteorological information with users, and reduces the occurrence of misjudgment and error information.
Smart Images

Figure CN119691120A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent interaction technology, and in particular to a method, device, terminal and medium for implementing meteorological information question-and-answer interaction. Background Art
[0002] Meteorological information service refers to the use of modern information technology to collect, process, analyze and publish meteorological data to provide users with accurate and timely meteorological information. With the continuous advancement of science and technology and the growing social needs, meteorological information services have evolved from traditional manual operations and experience judgments to highly automated, intelligent and personalized service models.
[0003] However, the current interactive weather information services have the following shortcomings: existing interactive service technologies may misjudge when understanding and identifying user intentions, resulting in the provision of inaccurate or even erroneous weather information; they lack the ability to manage multiple rounds of dialogues, and existing interactive service technologies lack sufficient memory and contextual reasoning capabilities. Summary of the invention
[0004] The main purpose of this application is to provide a method, device, terminal and medium for realizing meteorological information question-and-answer interaction, aiming to accurately respond to users' inquiries about meteorological information, thereby realizing intelligent interaction of meteorological information with users.
[0005] To achieve the above purpose, the present application provides a method for realizing meteorological information question-and-answer interaction, the method comprising:
[0006] Obtaining an intent recognition result according to the user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, the intent recognition set includes entity information and intent information, the entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model;
[0007] Performing a confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set;
[0008] Based on the comparison result between the confidence evaluation value and the preset confidence threshold, the intention recognition set is processed to obtain target meteorological information.
[0009] Specifically, the preset intention recognition model includes a word segmenter, a first model and a second model;
[0010] The method of obtaining the intent recognition result according to the user input text by using the preset intent recognition model includes:
[0011] Obtaining at least one word component according to the user input text by the word segmenter;
[0012] Performing feature extraction processing on the word component through the first model to obtain a feature vector corresponding to the word component;
[0013] The second model is used to perform entity extraction processing and intent recognition processing on the feature vector to obtain the entity information and the intent information.
[0014] Specifically, the first model includes a first input layer, an embedding layer, an encoder layer, and a first output layer;
[0015] The step of performing feature extraction processing on the word component through the first model to obtain a feature vector corresponding to the word component includes:
[0016] Obtaining, through the first input layer, an identity sequence corresponding to the word component, a position code corresponding to the word component, and a paragraph code corresponding to the word component according to the word component;
[0017] Obtaining, through the embedding layer, an embedding vector corresponding to the word component according to the identity sequence corresponding to the word component, the position code corresponding to the word component, and the paragraph code corresponding to the word component;
[0018] Obtaining, through the encoder layer, an encoding feature vector corresponding to the embedding vector according to the embedding vector;
[0019] Through the first output layer, a feature vector corresponding to the word component is obtained according to the encoded feature vector.
[0020] Specifically, the second model includes a second input layer, a BERT layer, a feature extraction layer, and a CRF layer;
[0021] The step of performing entity extraction processing and intent recognition processing on the feature vector through the second model to obtain the entity information and the intent information includes:
[0022] Obtaining, through the second input layer, a feature vector sequence corresponding to the feature vector according to the feature vector;
[0023] Obtaining, through the BERT layer, a context embedding tensor corresponding to the feature vector sequence according to the feature vector sequence;
[0024] Obtaining, through the feature extraction layer, a high-level feature vector corresponding to the context embedding tensor according to the context embedding tensor;
[0025] Through the CRF layer, the entity information and the intent information are obtained according to the high-level feature vector.
[0026] Specifically, the processing of the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain the target meteorological information includes:
[0027] Based on the comparison result, filtering out a target intent recognition set from the intent recognition set;
[0028] Data assembly processing is performed on the entity information and intent information in the target intent recognition set to obtain target meteorological information corresponding to the target intent recognition set.
[0029] Specifically, the filtering out a target intention recognition set from the intention recognition set based on the comparison result includes:
[0030] If there is an intention recognition set in the intention recognition set whose confidence evaluation value is greater than or equal to the preset confidence threshold, then the intention recognition set with the largest confidence evaluation value among the intention recognition sets whose confidence evaluation value is greater than or equal to the preset confidence threshold is determined as the target intention recognition set.
[0031] Specifically, the intention recognition result includes at least three intention recognition sets;
[0032] The step of filtering out a target intent recognition set from the intent recognition set based on the comparison result includes:
[0033] If the confidence evaluation values of the intention recognition set are all less than the preset confidence threshold, the three intention recognition sets with the highest confidence evaluation values in the intention recognition set are determined as the intention recognition sets to be selected, so that the user can select the target intention recognition set from the intention recognition sets to be selected.
[0034] To achieve the above purpose, the present application also provides a device for realizing meteorological information question-and-answer interaction, the device comprising:
[0035] A first unit is used to obtain an intent recognition result according to a user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information, wherein the entity information is used to represent time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to represent the intent corresponding to the user input text recognized by the preset intent recognition model;
[0036] The second unit is used to perform confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set;
[0037] The third unit is used to process the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain target meteorological information.
[0038] To achieve the above-mentioned purpose, the present application also provides a terminal, including a memory storing multiple instructions; the processor loads instructions from the memory to execute the steps in any one of the methods provided in the present application.
[0039] To achieve the above objectives, the present application also provides a medium, wherein the medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in any one of the methods provided in the present application.
[0040] The present application provides a method, device, terminal and medium for realizing meteorological information question-and-answer interaction. The method can first obtain accurate intent recognition results according to user input text through a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information. The entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model; then, the intent recognition set is confidence evaluated to obtain a confidence evaluation value corresponding to the intent recognition set; finally, based on the comparison result between the confidence evaluation value and a preset confidence threshold, the intent recognition set is processed to obtain accurate target meteorological information.
[0041] This application can accurately respond to users' inquiries about weather information, thereby achieving intelligent interaction with users' weather information. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of a method for implementing weather information question-and-answer interaction provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a specific application scenario provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the structure of a device for implementing weather information question-and-answer interaction provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0047] The current interactive weather information services have the following deficiencies: existing interactive service technologies may misjudge when understanding and identifying user intentions, resulting in the provision of inaccurate or even erroneous weather information; they lack the ability to manage multiple rounds of dialogues, and existing interactive service technologies lack sufficient memory and contextual reasoning capabilities.
[0048] Therefore, the embodiments of the present application provide a method, device, terminal and medium for implementing meteorological information question and answer interaction to solve practical technical problems.
[0049] In some embodiments, the device may be specifically integrated into an electronic device, which may be a terminal, a server or other device.
[0050] In some embodiments, the server may also be implemented in the form of a terminal.
[0051] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0052] The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0053] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0054] The embodiment of the present application provides a method for realizing weather information question-and-answer interaction, which can accurately respond to users' inquiries about weather information, thereby realizing intelligent interaction of weather information with users.
[0055] like Figure 1 , the specific process of the method can be as follows:
[0056] S110. Obtain an intent recognition result based on the user input text through a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information. The entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model.
[0057] In some embodiments, the preset intent recognition model includes a word segmenter, a first model and a second model.
[0058] Specifically, the method of obtaining the intention recognition result according to the user input text by using the preset intention recognition model includes the following steps S111 to S113:
[0059] S111. Obtain at least one word component according to the user input text through the word segmenter.
[0060] The word segmenter is a preprocessing tool used to convert user input text into a form that the model can understand and process. Therefore, there is no so-called "network structure" or "network layer". However, the word segmentation process can involve a variety of techniques and algorithms, such as rule-based methods, statistical methods, etc. In modern natural language processing (NLP) tasks, especially in the deep learning framework, the word segmenter is usually closely integrated with the neural network model.
[0061] In some embodiments, the word segmenter may be jieba, which is a very popular Chinese word segmentation tool widely used in Chinese natural language processing tasks.
[0062] Specifically, before word segmentation, Jieba will perform some preprocessing on the text to ensure better word segmentation results. Preprocessing may include: removing irrelevant characters (such as punctuation marks, special symbols, etc.); converting to a unified format (such as full-width to half-width, uppercase to lowercase, etc.).
[0063] During the word segmentation process, jieba provides several different word segmentation modes, including precise mode, full mode and search engine mode; select the appropriate word segmentation mode for word segmentation, and output the word segmentation result, that is, the at least one word component, through jieba.
[0064] S112. Perform feature extraction processing on the word component through the first model to obtain a feature vector corresponding to the word component.
[0065] In some embodiments, the first model may be a Bert-bast-Chinese model for processing natural language, wherein BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model based on the Transformer architecture, and BERT-base-Chinese is a version of BERT pre-trained on Chinese data.
[0066] In some embodiments, the first model includes a first input layer, an embedding layer, an encoder layer, and a first output layer, wherein the encoder layer may be a network layer based on a 12-layer Transformer encoder.
[0067] In some embodiments, the feature extraction process is performed on the word component by the first model to obtain the feature vector corresponding to the word component, including the steps S1121 to S1124 as shown below:
[0068] S1121. Through the first input layer, according to the word component, obtain the identity sequence corresponding to the word component, the position code corresponding to the word component, and the paragraph code corresponding to the word component.
[0069] Continuing with the above embodiment, the word components (Tokens) obtained after the user input text is processed by the word segmenter are input into the first input layer, and the ID sequence corresponding to each Token (i.e., the identity sequence), as well as the position encoding (Position Embeddings) and the paragraph encoding (Segment Embeddings) are output.
[0070] S1122. Obtain an embedding vector corresponding to the word component through the embedding layer according to the identity sequence corresponding to the word component, the position code corresponding to the word component, and the paragraph code corresponding to the word component.
[0071] Continuing with the above embodiment, the ID sequence, position code and paragraph code of the Token are input into the embedding layer, and the following output result is obtained:
[0072] Token Embeddings: Pre-trained embedding vector corresponding to each Token;
[0073] Position Embeddings: The position information of each token in the sentence in the user input text;
[0074] Segment Embeddings: Identifiers used to distinguish different sentences in the user input text (usually the same value in single-sentence tasks).
[0075] The above output results are added through the embedding layer to obtain the embedding vector corresponding to the word component.
[0076] S1123. Obtain, through the encoder layer, an encoding feature vector corresponding to the embedding vector according to the embedding vector.
[0077] Continuing with the above embodiment, the embedding vector is input to the encoder layer, and the encoded feature vector processed by the multi-layer Transformer encoder is obtained through the following specific operations:
[0078] Multi-Head Self-Attention: Captures the dependencies between different positions in the user input text;
[0079] Feed-Forward Neural Network: Performs nonlinear transformation on the encoded feature vector at each position;
[0080] Residual Connections: Add the input directly to the output, which helps with gradient transfer;
[0081] Layer Normalization: Normalize each encoded feature vector.
[0082] S1124. Obtain, through the first output layer, a feature vector corresponding to the word component according to the encoded feature vector.
[0083] S113. Perform entity extraction processing and intent recognition processing on the feature vector through the second model to obtain the entity information and the intent information.
[0084] In some embodiments, the second model may be a Bert+CRF model. The BERT+CRF model combines two powerful technologies, BERT (Bidirectional Encoder Representations from Transformers) and CRF (Conditional Random Fields), and is commonly used in natural language processing tasks, especially in applications such as named entity recognition (NER) and sequence labeling.
[0085] In some embodiments, the second model includes a second input layer, a BERT layer, a feature extraction layer, and a CRF layer.
[0086] Specifically, the second model is used to perform entity extraction processing and intent recognition processing on the feature vector to obtain the entity information and the intent information, including the steps S1131 to S1134 as shown below:
[0087] S1131. Obtain a feature vector sequence corresponding to the feature vector according to the feature vector through the second input layer.
[0088] In some embodiments, the feature vector is input into the second input layer, and the feature vector sequence is output, where the feature vector sequence may be a two-dimensional array with a shape of (sequence length, feature dimension).
[0089] S1132. Obtain, through the BERT layer, a context embedding tensor corresponding to the feature vector sequence according to the feature vector sequence.
[0090] In some embodiments, the feature vector sequence is input into the BERT layer, and a tensor with a shape of (sequence length, 768) is output, namely, the context embedding tensor, which is used to capture the context information in the user input text.
[0091] S1133. Obtain a high-level feature vector corresponding to the context embedding tensor through the feature extraction layer according to the context embedding tensor.
[0092] Continuing with the above embodiment, the feature extraction layer may be a fully connected layer, and the context embedding tensor is input into the feature extraction layer to further extract features, and output a high-level feature vector with a higher feature level.
[0093] S1134. Obtain the entity information and the intent information through the CRF layer according to the high-level feature vector.
[0094] Continuing with the above embodiment, the high-level feature vector is input into the CRF layer, and the CRF layer performs CRF decoding on the high-level feature vector to obtain a sequence label after CRF decoding. A sequence label is an intent recognition set. A sequence label includes an entity label and an intent label, which are respectively used to represent entity information and intent information.
[0095] The process of the above embodiment is described below through a specific application scenario:
[0096] like Figure 2 As shown, first, the user inputs text "What is the weather like in Chengdu today" or "Is it suitable to go boating in Xinglong Lake the day after tomorrow" on the host terminal or directly on the mobile terminal through an input device;
[0097] The input text is segmented into "today / Chengdu / weather / how" through the jieba word segmenter;
[0098] Use the fine-tuned BERT Chinese pre-trained model, i.e., the BERT-Base-Chinese model, to extract features from the segmented questions and obtain the feature vector of the input text.
[0099] Use the BERT conditional random field, that is, the Bert+CRF model, to perform named entity recognition and intent classification on the feature vector of the input text to obtain entity information and consciousness information. That is, the output entity information is "{time: today, place: Chengdu}", and the output intent information is "weather conditions".
[0100] like Figure 2 , if the input text is "Is it suitable to go boating in Xinglong Lake the day after tomorrow?", the subsequent processing process is the same as the above-mentioned scenario where the input text is "What is the weather like in Chengdu today?", and will not be repeated here.
[0101] S120. Perform confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set.
[0102] In some embodiments, confidence evaluation can be performed in a multi-class classification problem by using a Softmax function, which is a commonly used confidence evaluation method. The output raw scores (logits) of the second model are converted into a probability distribution, and the probability distribution is determined as the confidence evaluation value.
[0103] In some embodiments, the confidence of the intent recognition result can be evaluated by the entropy of the output probability distribution of the second model.
[0104] S130. Based on the comparison result between the confidence evaluation value and a preset confidence threshold, the intention recognition set is processed to obtain target meteorological information.
[0105] In some embodiments, the processing of the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain the target meteorological information includes the steps S131 to S132 as shown below:
[0106] S131. Based on the comparison result, filter out a target intent recognition set from the intent recognition set.
[0107] In some embodiments, the step of filtering out a target intent recognition set from the intent recognition set based on the comparison result includes the following specific implementation process:
[0108] If there is an intention recognition set in the intention recognition set whose confidence evaluation value is greater than or equal to the preset confidence threshold, then the intention recognition set with the largest confidence evaluation value among the intention recognition sets whose confidence evaluation value is greater than or equal to the preset confidence threshold is determined as the target intention recognition set.
[0109] In some embodiments, the intent recognition result includes at least three intent recognition sets. Specifically, based on the comparison result, filtering out a target intent recognition set from the intent recognition sets includes the following specific implementation process:
[0110] If the confidence evaluation values of the intention recognition set are all less than the preset confidence threshold, the three intention recognition sets with the highest confidence evaluation values in the intention recognition set are determined as the intention recognition sets to be selected, so that the user can select the target intention recognition set from the intention recognition sets to be selected.
[0111] S132. Perform data assembly processing on the entity information and intent information in the target intent recognition set to obtain target meteorological information corresponding to the target intent recognition set.
[0112] In some embodiments, a query can be performed in real time in a meteorological database based on the determined time, location, and intention; before the query, the time, location, and intention need to be converted into a format that can execute data query.
[0113] Specifically, the "time" obtained from intent recognition is a common time description, which needs to be converted into a computer-recognizable time. For example, today's daytime is 8:00-20:00 of the current date. Time conversion mainly involves the conversion of short-term time, statutory holidays, and four-season time, as shown in Table 1 below.
[0114] Specifically, there are two forms of "location" obtained in intent recognition: one is that if it is not mentioned, the city where the current location is located is used; the other is that if there is a clear location, it can be obtained directly.
[0115] Specifically, "intent" is a type identified from the problem description, which corresponds to the interface that can provide data services. According to the meteorological data query interface, time and location must be given to facilitate more accurate services. The time and location are the data obtained after the conversion of the previous two links and handed over to the data interface for processing, as shown in Table 2 below.
[0116]
[0117]
[0118] Table 1 Time conversion table
[0119]
[0120]
[0121]
[0122] Table 2 Intent conversion table
[0123] In some embodiments, data can also be assembled through independent third-party applications, which only need to provide time, location, intention, etc. Figure 3 Class information can be assembled and responded to after data is assembled. For example, if it is integrated with a map, after a user searches for a location information and navigates, the time from the current location to the main area of the destination location can be obtained through simple calculation, and the weather information of each area can be pushed.
[0124] In some embodiments, the target meteorological information can be fed back to the user in a variety of presentation forms. For example, the meteorological service product corresponding to the target meteorological information can mainly provide three forms: plain text, charts, and hyperlinks. Among them, plain text is to feedback specific information, such as whether it will rain tomorrow, whether tomorrow is suitable for car washing, etc.; charts are to feedback multiple information, such as the forecast for the next 24 hours, the forecast for 7 days, etc.; hyperlinks are to feedback comprehensive information or existing meteorological data products, such as how the rainfall will be this week.
[0125] In some embodiments, after the target weather information is fed back to the user, statistics can be collected based on the user's behavior data to determine which weather information the user is interested in after interacting with different weather intentions. This statistical process uses a relatively simple statistical method and recommends in descending order according to the statistical number of times.
[0126] In summary, the present application provides a method for realizing meteorological information question-and-answer interaction, which can first obtain accurate intent recognition results based on user input text through a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information, the entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model; then, the intent recognition set is confidence evaluated to obtain a confidence evaluation value corresponding to the intent recognition set; finally, based on the comparison result between the confidence evaluation value and the preset confidence threshold, the intent recognition set is processed to obtain accurate target meteorological information.
[0127] In order to better implement the above method, the embodiment of the present application also provides a device for realizing weather information question-and-answer interaction, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.
[0128] For example, in this embodiment, the method of the embodiment of the present application will be described in detail by taking the device for realizing meteorological information question and answer interaction specifically integrated in the terminal as an example.
[0129] For example, Figure 3 As shown, the device 300 for implementing meteorological information question-and-answer interaction may include a first unit 301, a second unit 302, and a third unit 303. The device 300 for implementing meteorological information question-and-answer interaction includes:
[0130] The first unit 301 is used to obtain an intent recognition result according to a user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information, the entity information is used to represent the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to represent the intent corresponding to the user input text recognized by the preset intent recognition model;
[0131] The second unit 302 is used to perform confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set;
[0132] The third unit 303 is used to process the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain target meteorological information.
[0133] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0134] As can be seen from the above, the embodiments of the present application can accurately respond to users' inquiries about weather information, thereby achieving intelligent interaction with users' weather information.
[0135] The embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc. The server can be a single server or a server cluster composed of multiple servers, etc.
[0136] In some embodiments, the product processing device may also be integrated into multiple electronic devices. For example, the product processing device may be integrated into multiple servers, and the method for realizing meteorological information question-and-answer interaction of the present application may be implemented by multiple servers.
[0137] In this embodiment, the electronic device of this embodiment is a terminal as an example for detailed description, for example, Figure 4 As shown, it shows a schematic diagram of the structure of the terminal 400 involved in the embodiment of the present application, specifically:
[0138] The terminal 400 may include one or more processing core processors 401, one or more medium storages 402, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 4 The structure of the terminal 400 shown in the figure does not constitute a limitation on the terminal 400, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0139] The processor 401 is the control center of the terminal 400. It uses various interfaces and lines to connect various parts of the entire terminal 400. It executes various functions of the terminal 400 and processes data by running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, so as to monitor the terminal 400 as a whole. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0140] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal 400, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0141] The terminal 400 also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0142] The terminal 400 may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0143] The terminal 400 may also include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The terminal 400 may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.
[0144] Although not shown, the terminal 400 may also include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the terminal 400 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402, thereby realizing various functions, as follows:
[0145] Obtaining an intent recognition result according to the user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, the intent recognition set includes entity information and intent information, the entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model;
[0146] Performing a confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set;
[0147] Based on the comparison result between the confidence evaluation value and the preset confidence threshold, the intention recognition set is processed to obtain target meteorological information.
[0148] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0149] As can be seen from the above, the embodiments of the present application can accurately respond to users' inquiries about weather information, thereby achieving intelligent interaction with users' weather information.
[0150] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a medium and loaded and executed by a processor.
[0151] To this end, an embodiment of the present application provides a medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the methods for implementing weather information question-and-answer interaction provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0152] Obtaining an intent recognition result according to the user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, the intent recognition set includes entity information and intent information, the entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model;
[0153] Performing a confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set;
[0154] Based on the comparison result between the confidence evaluation value and the preset confidence threshold, the intention recognition set is processed to obtain target meteorological information.
[0155] The medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0156] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, the computer instruction is stored in a medium. A processor of a computer device reads the computer instruction from the medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations provided in the above embodiments.
[0157] Since the instructions stored in the medium can execute the steps in any method for realizing meteorological information question and answer interaction provided in the embodiments of the present application, the beneficial effects that can be achieved by any method for realizing meteorological information question and answer interaction provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.
[0158] The above is a detailed introduction to a method, device, terminal and medium for realizing meteorological information question and answer interaction provided by an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for realizing meteorological information question-answering interaction, characterized in that: The method comprises: Obtaining an intent recognition result according to the user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, the intent recognition set includes entity information and intent information, the entity information is used to characterize the time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to characterize the intent corresponding to the user input text recognized by the preset intent recognition model; Performing a confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set; Based on the comparison result between the confidence evaluation value and the preset confidence threshold, the intention recognition set is processed to obtain target meteorological information.
2. The method according to claim 1, characterized in that The preset intention recognition model includes a word segmenter, a first model and a second model; The method of obtaining the intent recognition result according to the user input text by using the preset intent recognition model includes: Obtaining at least one word component according to the user input text by the word segmenter; Performing feature extraction processing on the word component through the first model to obtain a feature vector corresponding to the word component; The second model is used to perform entity extraction processing and intent recognition processing on the feature vector to obtain the entity information and the intent information.
3. The method according to claim 2, characterized in that The first model includes a first input layer, an embedding layer, an encoder layer, and a first output layer; The step of performing feature extraction processing on the word component through the first model to obtain a feature vector corresponding to the word component includes: Obtaining, through the first input layer, an identity sequence corresponding to the word component, a position code corresponding to the word component, and a paragraph code corresponding to the word component according to the word component; Obtaining, through the embedding layer, an embedding vector corresponding to the word component according to the identity sequence corresponding to the word component, the position code corresponding to the word component, and the paragraph code corresponding to the word component; Obtaining, through the encoder layer, an encoding feature vector corresponding to the embedding vector according to the embedding vector; Through the first output layer, a feature vector corresponding to the word component is obtained according to the encoded feature vector.
4. The method according to claim 2, characterized in that The second model includes a second input layer, a BERT layer, a feature extraction layer, and a CRF layer; The step of performing entity extraction processing and intent recognition processing on the feature vector through the second model to obtain the entity information and the intent information includes: Obtaining, through the second input layer, a feature vector sequence corresponding to the feature vector according to the feature vector; Obtaining, through the BERT layer, a context embedding tensor corresponding to the feature vector sequence according to the feature vector sequence; Obtaining, through the feature extraction layer, a high-level feature vector corresponding to the context embedding tensor according to the context embedding tensor; Through the CRF layer, the entity information and the intent information are obtained according to the high-level feature vector.
5. The method according to claim 1, characterized in that The step of processing the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain target meteorological information includes: Based on the comparison result, filtering out a target intent recognition set from the intent recognition set; Data assembly processing is performed on the entity information and intent information in the target intent recognition set to obtain target meteorological information corresponding to the target intent recognition set.
6. The method according to claim 5, characterized in that The step of filtering out a target intent recognition set from the intent recognition set based on the comparison result includes: If there is an intention recognition set in the intention recognition set whose confidence evaluation value is greater than or equal to the preset confidence threshold, then the intention recognition set with the largest confidence evaluation value among the intention recognition sets whose confidence evaluation value is greater than or equal to the preset confidence threshold is determined as the target intention recognition set.
7. The method according to claim 5, characterized in that The intention recognition result includes at least three intention recognition sets; The step of filtering out a target intent recognition set from the intent recognition set based on the comparison result includes: If the confidence evaluation values of the intention recognition set are all less than the preset confidence threshold, the three intention recognition sets with the highest confidence evaluation values in the intention recognition set are determined as the intention recognition sets to be selected, so that the user can select the target intention recognition set from the intention recognition sets to be selected.
8. A device for realizing weather information question-answering interaction, characterized in that: The device comprises: A first unit is used to obtain an intent recognition result according to a user input text by using a preset intent recognition model, wherein the intent recognition result includes at least one intent recognition set, and the intent recognition set includes entity information and intent information, wherein the entity information is used to represent time information and location information corresponding to the user input text recognized by the preset intent recognition model, and the intent information is used to represent the intent corresponding to the user input text recognized by the preset intent recognition model; The second unit is used to perform confidence evaluation on the intention recognition set to obtain a confidence evaluation value corresponding to the intention recognition set; The third unit is used to process the intention recognition set based on the comparison result between the confidence evaluation value and the preset confidence threshold to obtain target meteorological information.
9. A terminal, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the method according to any one of claims 1 to 7.
10. A medium, characterized in that The medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Dialogue interaction method, device and computer readable storage medium
CN110377716A
Slot position identification method and electronic equipment
CN113505591A
Natural language processing method and device and storage medium
CN113590831A
Chatpot natural language processing method and device
CN115098666A
Natural language intention translation method oriented to intention-driven data link network
CN117350286A
Cited By
Weather question and answer method, device and equipment based on large language model and medium
CN121459804A