Query processing method and device for enhancing timeliness, electronic equipment and storage medium
By extracting the timeliness qualifiers in user questions, determining the target search conditions, performing searches, and considering timeliness during the processing process, the problem of inaccurate handling of timeliness problems in the prior art is solved, and accurate query and processing of timeliness problems are achieved.
Patent Information
- Application Number
- CN202411862112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the direct generation mode and the search enhancement generation mode cannot accurately search and answer when dealing with timeliness problems, resulting in poor ability to process timeliness problems.
By obtaining the user's original question, we judge whether it is a timeliness question, extract the timeliness qualifier, determine the target search conditions, search, obtain the target data, and add the current date to the original question to obtain the target prompt word, and process the target data to get the target answer.
Improve the accuracy of handling timeliness problems, ensuring that timeliness factors are considered during query and processing, thereby providing more accurate and timely answers.
Smart Images

Figure CN119782471A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to artificial intelligence technology, and more particularly to a query processing method, device, electronic device, and storage medium that enhance timeliness. Background Art
[0002] The big language model is a large neural network trained using deep learning technology, which is designed to understand and generate natural language text. It is widely used in the field of natural language processing due to its powerful language understanding and language generation capabilities.
[0003] The existing technology includes two solutions: model direct generation mode and search enhanced generation mode. However, the direct generation mode and search enhanced generation mode cannot accurately search and answer time-sensitive questions, and the query processing time-sensitive questions are poor and cannot accurately process time-sensitive questions. Summary of the invention
[0004] The present application provides a query processing method, device, electronic device and storage medium for enhancing timeliness, so as to accurately query and process timeliness issues and improve the accuracy of processing timeliness issues.
[0005] In a first aspect, an embodiment of the present application provides a query processing method for enhancing timeliness, and the query processing method for enhancing timeliness includes:
[0006] Obtain the original question asked by the user and determine whether the original question is a time-sensitive question;
[0007] If so, extract the time qualifier in the original question;
[0008] Determine the target search criteria based on the time qualifiers and original question;
[0009] Retrieve according to the target search conditions to obtain the target data;
[0010] The current date is added to the original question to obtain the target prompt word, and the target data is processed according to the target prompt word to obtain the target answer to the original question.
[0011] In a second aspect, an embodiment of the present application further provides a query processing device with enhanced timeliness, the query processing device with enhanced timeliness comprising:
[0012] A timeliness question judgment module is used to obtain the original question asked by the user and judge whether the original question is a timeliness question;
[0013] A time qualifier extraction module is used to extract the time qualifier in the original question if yes;
[0014] A target search condition determination module, used to determine the target search condition according to the time qualifier and the original question;
[0015] A target data determination module is used to retrieve according to the target search conditions to obtain the target data;
[0016] The target answer determination module is used to add the current date to the original question, obtain the target prompt word, and process the target data according to the target prompt word to obtain the target answer to the original question.
[0017] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0018] one or more processors;
[0019] A storage device for storing one or more programs;
[0020] When one or more programs are executed by one or more processors, the one or more processors implement any one of the query processing methods for enhancing timeliness provided in the embodiments of the present application.
[0021] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute any one of the query processing methods for enhancing timeliness provided in the embodiments of the present application.
[0022] This application obtains the original question queried by the user and determines whether the original question is a time-sensitive question; if so, extracts the time-sensitive qualifiers in the original question to improve the recognition accuracy of the time-sensitive qualifiers; determines the target search conditions based on the time-sensitive qualifiers and the original question to improve the timeliness of the search; retrieves based on the target search conditions to obtain the target data to improve the timeliness of the target data; adds the current date to the original question to obtain the target prompt word, and processes the target data based on the target prompt word to obtain the target answer to the original question. By adding the current date to the original question to obtain the target prompt word, the timeliness factor is considered in the processing process, and the accuracy of processing timeliness issues is improved. Therefore, the technical solution of this application solves the problem that timeliness issues cannot be accurately searched and answered, and timeliness issues cannot be accurately processed, and the effect of accurately querying and processing timeliness issues and improving the accuracy of processing timeliness issues is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of a query processing method for enhancing timeliness in Embodiment 1 of the present application;
[0024] Figure 2It is a flowchart of a query processing method for enhancing timeliness in Embodiment 2 of the present application;
[0025] Figure 3 It is a flowchart of a query processing method for enhancing timeliness in Embodiment 3 of the present application;
[0026] Figure 4 It is a structural diagram of a query processing device for enhancing timeliness in the fourth embodiment of the present application;
[0027] Figure 5 It is a structural diagram of an electronic device in Embodiment 5 of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0029] It should be noted that the terms "first" and "second" etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flowchart of a query processing method for enhancing timeliness is provided in the first embodiment of the present application. This embodiment is applicable to the situation of processing timeliness query problems. The method can be executed by a query processing device for enhancing timeliness. The device can be implemented in software and / or hardware and is specifically configured in a query processing platform, for example, a query processing server.
[0032] See also Figure 1 The query processing method for enhancing timeliness shown specifically includes the following steps:
[0033] S110: Obtain the original question asked by the user, and determine whether the original question is a time-sensitive question.
[0034] The original question may be a query question input by the user. The user may send the original question through a mobile phone, computer or other electronic device capable of network communication, and the query processing server for enhancing timeliness obtains the original question queried by the user.
[0035] Timeliness questions may be time-sensitive questions or questions with high timeliness requirements. Exemplarily, time-sensitive questions may be questions that include time limits. For example, time-sensitive questions may be questions that include time limits such as today, yesterday, within a month, and this month. Exemplarily, questions with high timeliness requirements may be questions that have high timeliness requirements. For example, questions with high timeliness requirements may be query requirements for news, price, and financial questions. Determining whether the original question is a timeliness question is used to determine the question type of the original question, so as to determine the corresponding query and processing method.
[0036] In an optional embodiment, determining whether the original question is a timeliness question includes: determining whether the original question is a timeliness question using a trained timeliness recognition model; the timeliness recognition model is a deep learning model.
[0037] The timeliness identification model can be a deep learning model that classifies timeliness issues and non-timeliness issues, and is used to identify whether the original issue is a timeliness issue. The original issue is input into the trained timeliness identification model to obtain the timeliness category of the original issue, which includes timeliness and non-timeliness. Exemplarily, the timeliness identification model can be a convolutional neural network, a decision tree, or a random forest, etc., which is not specifically limited in this application.
[0038] The trained aging recognition model is obtained by supervising the initial aging recognition model. For example, the initial aging recognition model can be trained by labeled sample data, and the trained initial aging recognition model can be verified by a validation set. After the accuracy reaches a preset requirement, the trained aging recognition model is obtained.
[0039] Through the trained timeliness recognition model, it is determined whether the original question is a timeliness issue; the timeliness recognition model is a deep learning model. Through the trained timeliness recognition model, it is automatically identified whether the question is a timeliness issue, thereby improving the accuracy of identifying timeliness issues, so as to facilitate subsequent specific processing of timeliness issues and improve the accuracy of query processing of timeliness issues.
[0040] S120: If yes, extract the time qualifier in the original question.
[0041] If so, the original question is a time-sensitive question. Time-sensitive qualifiers can be time entities. Time-sensitive qualifiers generally contain words related to dates, such as year, month, day, week, and ten days. For example, time-sensitive qualifiers can be this week, the middle of this month, and last month. Time-sensitive qualifiers can also be adjectives for dates. For example, time-sensitive qualifiers can also be recent and latest.
[0042] Extracting the timeliness qualifiers in the original question can be used for temporal entity recognition. Temporal entity recognition is a technique in natural language processing that is used to automatically identify and extract time-related information from text, such as date, time, and duration. The temporal entity recognition process involves analyzing the language features and context of the text to determine the specific meaning of the time expression. Temporal entity recognition is crucial for processing and understanding time-based queries, and can help the model more accurately understand and respond to questions that require timeliness considerations.
[0043] Exemplarily, a timeliness recognition model that determines whether the original question is a timeliness question can be used to output timeliness qualifiers to extract the timeliness qualifiers in the original question. Exemplarily, the timeliness qualifiers in the original question can also be extracted by a trained time entity recognition model. The trained time entity recognition model can be a deep learning model.
[0044] If not, that is, the original question is not a time-sensitive issue, there is no need to proceed with subsequent steps and it can be directly retrieved and processed through the existing search enhancement generation mode, which will not be elaborated in detail in this application.
[0045] S130, determining target search conditions according to the time qualifier and the original question.
[0046] The target search condition may be a search condition determined based on the time qualifier and the original question. Exemplarily, the time qualifier may be converted into a specific date, and combined with other keywords in the original question to determine the target search condition. For example, a preset keyword extraction method may be used to extract keywords from the original question, and the extracted keywords and the time qualifier may be combined to generate the target search condition. By determining the target search condition based on the time qualifier and the original question, the problem of searching for timeliness information being insensitive in the prior art may be optimized.
[0047] S140, searching according to the target search condition to obtain target data.
[0048] According to the target search conditions, the corresponding corpus is searched to obtain the target data. Exemplarily, the corpus may include a news library, a social media library, and an official announcement library, etc., which is not specifically limited in this application. The target data is also the data obtained by searching according to the target search conditions. The target data may be data after standard processing, which is convenient for subsequent processing and improves the efficiency and accuracy of subsequent processing. For example, according to the target search conditions, the original data obtained is searched, and keywords are extracted, and the target data is obtained after being normalized according to a certain field arrangement order. For example, for the retrieved news, in the target data, the retrieved original corpus is normalized in the order of title, release date, and release content to obtain the target data.
[0049] S150, adding the current date to the original question to obtain a target prompt word, and processing the target data according to the target prompt word to obtain a target answer to the original question.
[0050] The target prompt word can be a prompt word in the processing of the target data, which is used to instruct the processing model to process the target data and obtain the target answer to the original question. The current date is added to the preset position in the original question to obtain the target prompt word. By adding the current date to the original question, a clear current time reference point can be provided to the processing model, thereby improving the processing model's ability to process time-sensitive information. Exemplarily, today can be added to the front of the original question as xxxx-year-xx-month-xx-day-week x, where x represents a number. For example, today can be added to the front of the original question as Thursday, December 12, 2024.
[0051] Exemplarily, the processing model may be a large language model. The target prompt word and the target data are input into the trained large language model, and the large language model processes the target data according to the target prompt word to obtain the target answer to the original question. The target data is the latest real-time data obtained by searching the time qualifier. The target data and the target prompt word are input into the trained large language model together, realizing real-time data mixing, which can significantly improve the accuracy and relevance of the large language model when processing time-sensitive information, making its output more in line with current events and development trends.
[0052] Real-time data blending refers to the process of combining the latest information from real-time data sources with the output of a pre-trained large language model when processing a query or performing a task. Real-time data blending methods dynamically integrate real-time data from sources such as news, social media, and official announcements to provide the latest information and insights.
[0053] A large language model is a large neural network trained using deep learning techniques to understand and generate natural language text. The large language model learns the structure, grammar, semantics, and contextual information of a language by analyzing large text datasets, enabling it to perform various language tasks such as text generation, translation, summarization, and question answering. The large language model is widely used in the field of natural language processing due to its powerful language understanding and generation capabilities.
[0054] Timeliness refers to the relevance and accuracy of information, data, or content within a specific time frame. This is particularly important in areas such as news reporting, financial analysis, and market research, where the value of information is highly dependent on its recency. Timely information refers to time-sensitive data or information whose value and accuracy change rapidly over time. For large language models, timeliness means that the information provided by the model reflects recent events, developments, or changes, ensuring that the answers users receive are not only accurate, but also highly relevant to the current context.
[0055] In the prior art, the methods for responding to user queries include model direct generation mode and search enhanced generation mode. The model direct generation method relies on a large pre-trained language model to directly answer user queries. The large pre-trained language model learns language structure, knowledge information and answer strategies by analyzing a large amount of text data during the training phase. The search enhanced generation mode is a language model method that combines retrieval and generation capabilities, aiming to overcome the limitations of traditional direct generation models in terms of timeliness and accuracy. In the search enhanced generation mode, the search enhanced generation mode first performs a search operation on a given query to retrieve relevant information from a predefined document set; then, these retrieved documents are used as context for generating answers, helping the model generate more accurate, richer and more timely answers.
[0056] However, since the model-based direct generation mode no longer updates the knowledge base after training, it faces challenges in dealing with time-sensitive information. The model-based direct generation mode can generate fluent and grammatically correct answers, but the content of its answers may appear outdated due to lack of access to the latest information.
[0057] The effectiveness of search enhancement generation mode is highly dependent on the accuracy of the retrieval stage and the quality of the retrieved documents, and may still face challenges in real-time information retrieval and processing. First, the data used for model training is often outdated, and the fine-tuning alignment step added after the training limits its answers, such as "Because my training data ends in 2023, I cannot predict or answer information related to 2024..."; second, during the search process, the vectorized semantic search model is not sensitive to information such as digital dates, and often cannot search for the news that users want; finally, the prompt words required for time-sensitive questions raised by users and other questions that require rigorous analysis and calculation are often different.
[0058] The technical solution of this embodiment obtains the original question queried by the user and determines whether the original question is a time-sensitive question; if so, extracts the time-sensitive qualifiers in the original question to improve the recognition accuracy of the time-sensitive qualifiers; determines the target search conditions based on the time-sensitive qualifiers and the original question to improve the timeliness of the search; retrieves based on the target search conditions to obtain the target data to improve the timeliness of the target data; adds the current date to the original question to obtain the target prompt word, and processes the target data based on the target prompt word to obtain the target answer to the original question. By adding the current date to the original question to obtain the target prompt word, the timeliness factor is considered in the processing process, and the accuracy of processing timeliness issues is improved. Therefore, the technical solution of this application solves the problem that timeliness issues cannot be accurately searched and answered, and timeliness issues cannot be accurately processed, and the effect of accurately querying and processing timeliness issues and improving the accuracy of processing timeliness issues is achieved.
[0059] Embodiment 2
[0060] Figure 2 This is a flow chart of a query processing method with enhanced timeliness provided in Embodiment 2 of the present application. The technical solution of this embodiment is further refined on the basis of the above technical solution.
[0061] Furthermore, time qualifiers include precise qualifiers and fuzzy qualifiers. Accordingly, "determine the target search conditions based on the time qualifiers and the original question" is refined into: "determine whether the time qualifier is a fuzzy qualifier; if so, determine the target qualification date based on the fuzzy qualification and the current date; determine the target search conditions based on the target qualification date and the original question" to accurately determine the target search conditions.
[0062] See also Figure 2 A query processing method for enhancing timeliness is shown, comprising:
[0063] S210: Obtain the original question asked by the user, and determine whether the original question is a time-sensitive question.
[0064] S220: If yes, extract the time qualifier in the original question.
[0065] S230. Determine whether the time limit qualifier is a vague qualifier.
[0066] Time qualifiers include accurate qualifications and fuzzy qualifications. Accurate qualifications can be absolute qualifications including absolute dates. For example, accurate qualifications can be from June 1, 2024 to June 30, 2024. Fuzzy qualifications can be relative qualifications that do not include absolute dates. In an optional embodiment, fuzzy qualifications can include duration qualifications and non-duration qualifications. Duration qualifications can be fuzzy qualifications that include limitations on duration, for example, duration qualifications can be today, yesterday, this week, the middle of this month, and last month, etc. Non-duration qualifications can be fuzzy qualifications that do not include limitations on duration, for example, non-duration qualifications can be recent and latest, etc.
[0067] When the statute of limitations qualifier does not include an exact date, it is determined that the statute of limitations qualifier is a vague qualifier. When the statute of limitations qualifier includes an exact date, it is determined that the statute of limitations qualifier is an exact qualifier.
[0068] S240: If yes, determine the target limit date according to the fuzzy limit and the current date.
[0069] If so, that is, the time limit qualifier is a fuzzy qualifier, in which case the fuzzy qualifier needs to be converted into an exact qualifier to determine the target limit date and ensure the accuracy of subsequent retrieval. When the time limit qualifier is a fuzzy qualifier, it may affect the accuracy of the target data. For example, if the time limit qualifier is today, if you search directly through today, you may find many articles published on historical dates that include "today", but they are not the day of the search. Therefore, when the time limit qualifier is a fuzzy qualifier, the fuzzy qualifier needs to be converted into an exact qualifier.
[0070] The target limited date can be a date limit defined by an accurate date, which is used to determine the target search condition. The fuzzy limit can be a limit on a relative date relative to the current date. According to the current date, the relative date can be converted into an absolute date, and then the fuzzy limit can be converted into an accurate limit to obtain the target limited date.
[0071] In an optional embodiment, determining the target limit date based on the fuzzy limit and the current date includes: determining a target date determination rule from candidate date determination rules based on the fuzzy limit; and determining the target limit date based on the current date and the target date determination rule.
[0072] The candidate date determination rules may be various pre-set rules for converting fuzzy definitions into accurate definitions. Exemplarily, for fuzzy definitions of duration limitations, including limitations of relative duration, the candidate date determination rules are rules for determining accurate definitions based on relative duration. For example, the candidate date determination rules may include: converting this week's fuzzy definition into an accurate definition of this week's calculation rule according to the weekly calculation rule, converting this month's fuzzy definition into an accurate definition of this month's calculation rule according to the monthly calculation rule, converting this ten-day period's fuzzy definition into an accurate definition of this ten-day calculation rule according to the ten-day calculation rule, converting today's fuzzy definition into an accurate definition of today's calculation rule according to the current date's calculation rule, and converting yesterday's fuzzy definition into an accurate definition of yesterday's calculation rule according to yesterday's calculation rule, etc.
[0073] Exemplarily, for non-time limit, the fuzzy limit can be converted into an accurate limit according to the preset time corresponding to the original question type and the current date. The preset time can be a preset relative time for converting the non-time limit. Exemplarily, the preset time can include at least one. Multiple preset time can be set according to the question type, for example, a shorter first preset time is set for financial questions, and a longer second preset time is set for policy news. The number and specific time of the preset time can be set by professional technicians based on experience, and this application does not make specific restrictions on this.
[0074] Specifically, according to the type of fuzzy restriction, the target date determination rule is determined from the candidate date determination rule, and the fuzzy restriction can be converted into an accurate restriction according to the current date combined with the target date determination rule. For example, if the fuzzy restriction includes this week, the this week calculation rule is determined as the target date determination rule, and the fuzzy restriction can be converted into an accurate restriction according to the current date combined with the this week calculation rule.
[0075] By determining the target date determination rules from the candidate date determination rules based on fuzzy limitations; determining the target limit date based on the current date and the target date determination rules, the fuzzy limitations are accurately converted into accurate limitations, thereby improving the accuracy of date limitations in subsequent target search conditions, and thereby improving the accuracy of target data in terms of timeliness.
[0076] It should be noted that if not, that is, the instant qualifier is an exact qualifier, the exact qualifier will be directly determined as the target qualifier date.
[0077] S250: Determine target search conditions according to the target limited date and the original question.
[0078] The keywords in the original question are extracted by a preset keyword extraction method, and the keywords are combined with the target limited date to obtain the target search conditions.
[0079] S260: Search according to the target search condition to obtain target data.
[0080] S270, adding the current date to the original question to obtain a target prompt word, and processing the target data according to the target prompt word to obtain a target answer to the original question.
[0081] The technical solution of this embodiment includes accurate limitation and fuzzy limitation through the time limit qualifier, and accordingly, it is judged whether the time limit qualifier is a fuzzy limitation; if so, the target limitation date is determined according to the fuzzy limitation and the current date; the target search condition is determined according to the target limitation date and the original question, and the target limitation date can be accurately determined to ensure the accuracy of the time limit in the target search condition.
[0082] Embodiment 3
[0083] Figure 3 This is a flow chart of a query processing method with enhanced timeliness provided in Example 3 of the present application. The technical solution of this embodiment is further refined on the basis of the above technical solution.
[0084] Furthermore, "search according to the target search conditions to obtain the target data" is refined as: "search according to the target search conditions through a preset search algorithm to obtain at least one original data; for each original data, add a number to the original data, and add the release date of the original data to the original data; determine the relative release time of each original data according to the current date and the release date, and add the relative release time to the release log in the corresponding original data to obtain the target data" to obtain accurate target data.
[0085] See also Figure 3 A query processing method for enhancing timeliness is shown, comprising:
[0086] S310: Obtain the original question asked by the user, and determine whether the original question is a time-sensitive question.
[0087] S320: If yes, extract the time qualifier in the original question.
[0088] S330: Determine target search conditions based on the time qualifier and the original question.
[0089] S340. Using a preset search algorithm, search according to the target search condition to obtain at least one piece of original data.
[0090] The preset search algorithm may be a pre-set search algorithm for obtaining original data. Exemplarily, the preset search algorithm may be a keyword search algorithm for searching according to keywords in the target search condition.
[0091] The target search condition is input into the preset search algorithm, and the preset search algorithm determines the corresponding corpus according to the target search condition, and retrieves files or documents that meet the target search condition in the corpus as raw data. The corpus may include news libraries, social media libraries, official announcement libraries, etc. There may be multiple raw data.
[0092] S350: For each piece of original data, add a number to the original data, and add the release date of the original data to the original data.
[0093] The release date is the release date of each piece of raw data. A number is added to each piece of raw data to distinguish different raw data and prevent confusion of raw data. The release date of the raw data is added to the raw data to clarify the release date of each piece of raw data and provide time information for subsequent large language model processing.
[0094] For example, the order of the serial number, release date and other fields may be as follows:
[0095]
Number
[0096] The title can be replaced by other fields, for example, the title can be replaced by the issuing agency. The release date is placed in the middle field to avoid confusion between the release dates of two adjacent pieces of original data and improve the accuracy of the release date.
[0097] S360: Determine the relative release time of each piece of original data according to the current date and the release date, and add the relative release time to the release log in the corresponding original data to obtain the target data.
[0098] The relative release time of the original data can be the time between the release date of the original data and the current date. The release date is an absolute time, and the relative release time is often used to determine the order of time, and the mathematical calculation ability of the relative release time is a weak point of the large language model. Therefore, the relative release time of each piece of original data can be determined according to the current date and the release date through a preset time algorithm. For example, the relative release time can be one week ago, three months ago, or two years ago. After adding the relative release time to the release date in the corresponding original data, the large language model can combine the current date, the release date, and the date appearing in the original data at both the absolute time and relative time levels to form a complete timeline, thereby improving the accuracy of data processing.
[0099] S370, adding the current date to the original question, obtaining a target prompt word, and processing the target data according to the target prompt word to obtain a target answer to the original question.
[0100] In an optional embodiment, for the original question of non-trend analysis type, the target data is processed according to the target prompt word to obtain the target answer to the original question, including: if the processing results obtained by processing the target data according to the target prompt word are contradictory, then the processing result of the target data with a relatively shorter release time is used as the target answer.
[0101] For the original questions that are not trend analysis, the data processing results are generally single. If the processing results obtained by processing the target data according to the target prompt words are contradictory, it means that the processing results of the target data in different time periods are different. In order to ensure the timeliness of the target answer, the processing results of the target data with a shorter relative release time can be used as the target answer. The relative release time is the relative release time after the release time in the target data. For example, if the processing results of the target data with a relative release time of within two weeks and within one week obtained by processing the target data according to the target prompt words are contradictory, the processing results of the target data within one week will be used as the target answer.
[0102] For example, for the original question of non-trend analysis, a restriction can be added to the target prompt word, so that if the processing results of the target data processed according to the target prompt word are contradictory, the processing results of the target data with a relatively short release time will be used as the target answer. For example, for the original question of non-trend analysis, the target prompt word is added with "If multiple search results are contradictory, please refer to the article with a more recent release time."
[0103] For the original questions of non-trend analysis type, if the processing results of the target data according to the target prompt word are contradictory, the processing results of the target data with a relatively shorter release time will be used as the target answer to ensure the timeliness of the target answer.
[0104] The technical solution of this embodiment uses a preset retrieval algorithm to perform retrieval according to the target search conditions to obtain at least one original data; for each original data, a number is added to the original data, and the release date of the original data is added to the original data; the relative release time of each original data is determined according to the current date and the release date, and the relative release time is added to the release log in the corresponding original data to obtain the target data, so that the target data includes a description of the time information of the original data at both the absolute time and relative time levels, which makes up for the lack of time calculation capabilities of the large language model and improves the accuracy of subsequent timeliness information processing of the target data.
[0105] Embodiment 4
[0106] Figure 4The structure diagram of a query processing device for enhancing timeliness provided in the fourth embodiment of the present application is shown. This embodiment is applicable to the case of processing timeliness query problems and is configured in a query processing platform. The specific structure of the query processing device for enhancing timeliness is as follows:
[0107] The timeliness question determination module 410 is used to obtain the original question queried by the user and determine whether the original question is a timeliness question;
[0108] A time qualifier extraction module 420 is used to extract the time qualifier in the original question if yes;
[0109] A target search condition determination module 430 is used to determine the target search condition according to the time qualifier and the original question;
[0110] The target data determination module 440 is used to retrieve according to the target search condition to obtain the target data;
[0111] The target answer determination module 450 is used to add the current date to the original question, obtain the target prompt word, and process the target data according to the target prompt word to obtain the target answer to the original question.
[0112] The technical solution of this embodiment obtains the original question queried by the user and determines whether the original question is a time-sensitive question; if so, extracts the time-sensitive qualifiers in the original question to improve the recognition accuracy of the time-sensitive qualifiers; determines the target search conditions based on the time-sensitive qualifiers and the original question to improve the timeliness of the search; retrieves based on the target search conditions to obtain the target data to improve the timeliness of the target data; adds the current date to the original question to obtain the target prompt word, and processes the target data based on the target prompt word to obtain the target answer to the original question. By adding the current date to the original question to obtain the target prompt word, the timeliness factor is considered in the processing process, and the accuracy of processing timeliness issues is improved. Therefore, the technical solution of this application solves the problem that timeliness issues cannot be accurately searched and answered, and timeliness issues cannot be accurately processed, and the effect of accurately querying and processing timeliness issues and improving the accuracy of processing timeliness issues is achieved.
[0113] Optionally, time qualifiers include exact qualifiers and vague qualifiers;
[0114] Accordingly, the target search condition determination module 430 includes:
[0115] A fuzzy restriction judgment unit, used to judge whether the time limit qualifier is a fuzzy restriction;
[0116] a target limit date determination unit, for determining the target limit date according to the fuzzy limit and the current date if yes;
[0117] The target search condition determination unit is used to determine the target search condition according to the target limit date and the original question.
[0118] Optionally, the target limit date determination unit includes:
[0119] A target date determination rule determination subunit is used to determine the target date determination rule from the candidate date determination rules according to the fuzzy limitation;
[0120] The target limit date determination subunit is used to determine the target limit date according to the current date and the target date determination rule.
[0121] Optionally, the target data determination module 440 includes:
[0122] The original data acquisition unit is used to retrieve at least one original data according to the target search condition through a preset retrieval algorithm;
[0123] A release date adding unit, used for adding a number to each piece of original data, and adding the release date of the original data to the original data;
[0124] The relative release time adding unit is used to determine the relative release time of each piece of original data according to the current date and the release date, and add the relative release time to the release log in the corresponding original data to obtain the target data.
[0125] Optionally, the timeliness problem determination module 410 includes:
[0126] The timeliness question recognition unit is used to determine whether the original question is a timeliness question through a trained timeliness recognition model; the timeliness recognition model is a deep learning model.
[0127] Optionally, for the original question of non-trend analysis type, the target answer determination module 450 further includes:
[0128] The relative release time comparison unit is used to use the processing result of the target data with a shorter relative release time as the target answer if the processing results obtained by processing the target data according to the target prompt word are contradictory.
[0129] The query processing device with enhanced timeliness provided in the embodiments of the present application can execute the query processing method with enhanced timeliness provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the query processing method with enhanced timeliness.
[0130] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.
[0131] Embodiment 5
[0132] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present application is shown in FIG. Figure 5 As shown, the electronic device includes a processor 510, a memory 520, an input device 530 and an output device 540; the number of the processor 510 in the electronic device can be one or more. Figure 5 A processor 510 is taken as an example; the processor 510, the memory 520, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0133] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the query processing method for enhancing timeliness in the embodiment of the present application (for example, the timeliness problem judgment module 410, the timeliness qualifier extraction module 420, the target search condition determination module 430, the target data determination module 440 and the target answer determination module 450). The processor 510 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 520, that is, realizes the query processing method for enhancing timeliness.
[0134] The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 520 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 non-volatile solid-state storage device. In some instances, the memory 520 may further include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The input device 530 may be used to receive input character information and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.
[0136] Embodiment 6
[0137] Embodiment 6 of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a query processing method for enhancing timeliness, the method comprising: obtaining an original question queried by a user, and determining whether the original question is a timeliness question; if so, extracting timeliness qualifiers in the original question; determining target search conditions based on the timeliness qualifiers and the original question; searching based on the target search conditions to obtain target data; adding the current date to the original question to obtain a target prompt word, and processing the target data based on the target prompt word to obtain a target answer to the original question.
[0138] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application is not limited to the method operations described above, and the computer executable instructions can also execute related operations in the query processing method for enhancing timeliness provided in any embodiment of the present application.
[0139] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0140] It is worth noting that in the embodiment of the query processing device for enhancing timeliness, the various units and modules included are divided only according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0141] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A query processing method for enhancing timeliness, characterized in that: include: Obtaining the original question asked by the user and determining whether the original question is a time-sensitive question; If yes, extract the time qualifier in the original question; Determining target search conditions according to the time qualifier and the original question; Retrieve according to the target search condition to obtain target data; The current date is added to the original question to obtain a target prompt word, and the target data is processed according to the target prompt word to obtain a target answer to the original question.
2. The method according to claim 1, characterized in that: The time limit qualifiers include precise qualifiers and vague qualifiers; Accordingly, determining the target search condition according to the time limit qualifier and the original question includes: Determining whether the time limit qualifier is a vague qualifier; If yes, determining the target limit date according to the fuzzy limit and the current date; The target search condition is determined according to the target limit date and the original question.
3. The method according to claim 2, characterized in that The step of determining the target limit date according to the fuzzy limit and the current date includes: According to the fuzzy limitation, determining a target date determination rule from candidate date determination rules; The target limit date is determined according to the current date and the target date determination rule.
4. The method according to claim 1, characterized in that: The step of retrieving according to the target search condition to obtain target data includes: By using a preset search algorithm, searching according to the target search condition to obtain at least one piece of original data; For each piece of the original data, add a number to the original data, and add the release date of the original data to the original data; The relative release time of each piece of original data is determined according to the current date and the release date, and the relative release time is added to the release log in the corresponding original data to obtain the target data.
5. The method according to claim 1, characterized in that The determining whether the original question is a time-sensitive question includes: Through the trained timeliness recognition model, it is determined whether the original question is a timeliness question; the timeliness recognition model is a deep learning model.
6. The method according to claim 4, characterized in that For the original question of non-trend analysis type, the target data is processed according to the target prompt word to obtain the target answer to the original question, including: If the processing results obtained by processing the target data according to the target prompt word are contradictory, the processing result of the target data with a relatively shorter release time is used as the target answer.
7. A query processing device for enhancing timeliness, characterized in that: include: A timeliness question judgment module is used to obtain the original question queried by the user and judge whether the original question is a timeliness question; a time definite word extraction module, for extracting the time definite word in the original question if yes; A target search condition determination module, used to determine the target search condition according to the time limit qualifier and the original question; A target data determination module, used to retrieve according to the target search condition to obtain the target data; The target answer determination module is used to add the current date to the original question to obtain a target prompt word, and process the target data according to the target prompt word to obtain a target answer to the original question.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the query processing method for enhancing timeliness as described in any one of claims 1-6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the query processing method for enhancing timeliness as described in any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the query processing method for enhancing timeliness according to any one of claims 1 to 6.