Question and answer processing method and device based on time sensitivity and medium

By determining the time sensitivity of user questions and obtaining the target time range in the question-and-answer system, the problem of the failure to effectively consider the time factor in existing technologies is solved, thereby improving the accuracy of answers and user experience.

CN122047232APending Publication Date: 2026-05-15ZHEJIANG MEIRI HUDONG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG MEIRI HUDONG NETWORK TECH CO LTD
Filing Date
2026-02-13
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing question-and-answer systems fail to effectively consider the time factor when processing user questions, resulting in decreased accuracy of answers and a decline in user experience.

Method used

By determining whether the user's input question contains words representing time, and performing intent analysis when it does not, we can identify the user's potential time needs, obtain the target time range, and construct target questions to improve the time sensitivity of the answers.

Benefits of technology

It improved the accuracy of answers in the question-and-answer system, avoided returning outdated or irrelevant information, and enhanced user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122047232A_ABST
    Figure CN122047232A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric digital data processing, in particular to a question and answer processing method and device based on time sensitivity and a medium. The method comprises the steps of receiving a question input by a user; judging whether the question input by the user comprises a word representing time or not, and if yes, determining the question input by the user as a target question; otherwise, performing intention analysis on the question input by the user, judging whether the question input by the user needs to consider a time factor or not, and if not, determining the question input by the user as a target question; otherwise, acquiring a target time range matched with the question input by the user, and constructing a target question according to the target time range and the question input by the user. The question answering accuracy of the question answering system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic digital data processing technology, and in particular to a time-sensitive question-and-answer processing method, device, and medium. Background Technology

[0002] In today's information age, intelligent question-answering systems have become essential tools for people to obtain information. The ability of intelligent systems to process users' natural language queries directly impacts user experience and the efficiency of information retrieval. Currently, most existing question-answering systems simply rely on whether the user's input contains explicit time-related terms (such as "today," "2023," etc.). If so, they use it as a search condition; otherwise, they ignore the time factor. The drawback of this approach is that many user questions do not explicitly mention time, yet their answers are time-sensitive. For example, when a user asks about the weather, they typically need a current or future weather forecast, not historical weather; when a user asks about popular movies, they usually intend to find movies currently showing or about to be released, not historical films. If a question-answering system returns an answer that ignores the time dimension simply because the question lacks time-related terms, it will affect the accuracy of the answer and the user experience. Summary of the Invention

[0003] The purpose of this invention is to provide a time-sensitive question-answering processing method to improve the accuracy of question-answering system responses.

[0004] According to a first aspect of the present invention, a time-sensitive question-answering processing method is provided, comprising the following steps: S100, the issue of receiving user input.

[0005] S200: Determine whether the user-input question contains words representing time. If it does, then the user-input question is identified as the target question; otherwise, proceed to S300.

[0006] S300: Perform intent analysis on the user-inputted question to determine whether the user-inputted question needs to consider the time factor. If not, the user-inputted question is identified as the target question; otherwise, proceed to S400.

[0007] S400, obtain the target time range that matches the question input by the user, and construct the target question based on the target time range and the question input by the user.

[0008] According to a second aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the time-sensitive question-and-answer processing method described above.

[0009] According to a third aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described time-sensitive question-and-answer processing method.

[0010] Compared with the prior art, the present invention has at least the following beneficial effects: This invention, when faced with a user-inputted question, first determines whether it contains words representing time. Even if it doesn't, it still identifies unspoken but present time needs through intent analysis of the user's input. This prevents the question-answering system from ignoring the time dimension when replying, avoiding the return of outdated or irrelevant information, thus improving the accuracy of the answer and increasing user satisfaction. Furthermore, considering the different time sensitivities of various questions, this invention also determines corresponding target time ranges for user-inputted questions, enabling the question-answering system to more accurately search and query information and generate more precise answers. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a time-sensitive question-answering processing method provided in Embodiment 1 of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] Example 1: According to this embodiment, as Figure 1 As shown, a time-sensitive question-answering processing method is provided, including the following steps: S100, the issue of receiving user input.

[0015] In this embodiment, the question input by the user refers to the text entered by the user in natural language form, which is obtained through the user interaction interface.

[0016] In this embodiment, the question entered by the user may include words that represent time, for example, the user enters the question: What will the weather be like tomorrow?; or it may not include words that represent time, for example, the user enters the question: What is the date of the Spring Festival in the Gregorian calendar?

[0017] S200: Determine whether the user-input question contains words representing time. If it does, then the user-input question is identified as the target question; otherwise, proceed to S300.

[0018] As a specific implementation, keyword matching or named entity recognition (NER) technology is used to identify whether the user's input question contains words representing time. When using keyword matching, a dictionary containing numerous time expressions can be pre-built. The user's input question is matched against entries in the dictionary. If the user's input question contains any entry from the dictionary, it is determined that the user's input question contains words representing time; otherwise, it is determined that the user's input question does not contain words representing time. When using named entity recognition technology to identify the user's input question, a named entity recognition model capable of recognizing words representing time needs to be pre-trained. Those skilled in the art will understand that the training process of a named entity recognition model is existing technology and will not be elaborated upon here.

[0019] For example, the user inputs the question: "What's the weather like next Monday?" Since the question includes a word representing time (i.e., next Monday), this embodiment directly identifies the user's input as the target question.

[0020] For example, the user inputs the question: "How's the weather?" Since the question does not contain any words representing time, step S300 is executed.

[0021] S300: Perform intent analysis on the user-inputted question to determine whether the user-inputted question needs to consider the time factor. If not, the user-inputted question is identified as the target question; otherwise, proceed to S400.

[0022] As a specific implementation, the intent analysis of the user-inputted question to determine whether the time factor needs to be considered includes: S310, using a pre-trained text classification model to perform intent recognition on the user-input question, classifying the user-input question into a specific question type in a preset mapping knowledge base; the preset mapping knowledge base includes several specific question types and corresponding time-sensitive labels; wherein, when the time-sensitive label is a first preset value, the corresponding specific question type is a question type that does not need to consider time factors; when the time-sensitive label is a second preset value, the corresponding specific question type is a question type that needs to consider time factors.

[0023] In this embodiment, the pre-trained text classification model refers to a machine learning model that has been trained on a large text dataset and fine-tuned for the question type classification task, such as BERT or TextCNN. The pre-defined mapping knowledge base refers to a structured database or configuration file that stores the correspondence between question types and time-sensitive labels.

[0024] As a specific implementation method, the user input question is fed into a pre-trained text classification model. The model outputs multiple question type labels and their confidence scores. The question type label with the highest confidence score is determined as the type label of the user input question (i.e., the specific question type to which the user input question is classified).

[0025] S320 determines whether the user-input question needs to consider the time factor based on the preset mapping knowledge base and the specific question type into which the user-input question is categorized.

[0026] In this embodiment, if the time sensitivity label corresponding to the specific question type categorized by the user input question in the preset mapping knowledge base is a first preset value (e.g., 0), then the time factor does not need to be considered when determining the user input question; if the time sensitivity label corresponding to the specific question type categorized by the user input question in the preset mapping knowledge base is a second preset value (e.g., 1), then the time factor needs to be considered when determining the user input question.

[0027] For example, if a user inputs the question "What is the speed of light?", the pre-trained text classification model outputs the question type label with the highest confidence as "scientific principle". The time sensitivity label corresponding to scientific principle in the preset mapping knowledge base is 0, indicating that the user's input question does not need to consider the time factor and can be searched directly.

[0028] For example, if the user inputs a question about the weather in Beijing, and the pre-trained text classification model outputs a question type label with the highest confidence as "weather," and the time sensitivity label corresponding to the scientific principle in the preset mapping knowledge base is 1, indicating that the user input question needs to consider the time factor, then proceed to S400.

[0029] S400, obtain the target time range that matches the question input by the user, and construct the target question based on the target time range and the question input by the user.

[0030] As one specific implementation, obtaining the target time range that matches the user-input question includes: S410, Obtain a preset time mapping table; the preset time mapping table includes the correspondence between different specific problem types and default time ranges.

[0031] In this embodiment, the preset time mapping table is a configuration file that stores the mapping relationship between problem types and default time ranges.

[0032] S420: Based on the specific question type categorized by the user-input question, query the preset time mapping table to obtain the default time range corresponding to the specific question type categorized by the user-input question.

[0033] In this embodiment, a preset time mapping table is queried based on the identified problem type to obtain a preset, reasonable default time range. For example, when the problem type is weather, the corresponding default time range is the next 24 hours; when the problem type is a movie release, the corresponding default time range is the next 7 days.

[0034] S430, determine the default time range corresponding to the specific question type into which the user-input question is categorized as the target time range.

[0035] Based on S410-S430, it can return meaningful answers to time-sensitive questions.

[0036] As a specific implementation, prior to S410, obtaining the target time range matching the user-input question further includes: S401, Obtain the context information of the dialogue in which the user inputs the question; the context information includes historical question and answer records in the same dialogue.

[0037] S402, determine whether a target time range matching the user-input question can be obtained based on the context information; if not, execute S410; if yes, obtain the target time range matching the user-input question based on the context information.

[0038] As a specific implementation, the determination of whether a target time range matching the user-input question can be obtained based on the context information includes: S4021, determine whether time information exists in the context information; if not, determine that the target time range matching the user's input question cannot be obtained based on the context information; otherwise, proceed to S4022.

[0039] S4022, determine the semantic similarity between the context information and the user-input question. If the semantic similarity is greater than a preset similarity threshold, determine that a target time range matching the user-input question can be obtained based on the context information; otherwise, determine that a target time range matching the user-input question cannot be obtained based on the context information.

[0040] In this embodiment, if time information exists in the context information, and the semantic similarity between the context information and the user-input question is greater than a preset similarity threshold, then it is determined that a target time range matching the user-input question can be obtained based on the context information, and the time information existing in the context information is identified as the target time range matching the user-input question. Optionally, the preset similarity threshold is an empirical value, such as 0.7 or 0.8. As a specific implementation, if multiple time information exists in the context information, then the semantic similarity between the question-and-answer record corresponding to each time information and the user-input question is obtained, and the time information corresponding to the highest similarity is identified as the target time range matching the user-input question.

[0041] As a specific implementation, constructing the target question based on the target time range and the user-input question includes: appending the target time range to the user-input question text, and using the new question obtained after appending as the target question.

[0042] As one specific implementation, the method further includes: using a large language model to answer the target question.

[0043] In this embodiment, when a user inputs a question, it first determines whether the question contains words representing time. Even if it doesn't, it still identifies unspoken but real time needs through intent analysis of the user's input. This prevents the question-answering system from ignoring the time dimension when replying, avoiding the return of outdated or irrelevant information, thus improving the accuracy of the answer and increasing user satisfaction. Furthermore, this embodiment considers the different time sensitivities of different questions and determines corresponding target time ranges for the user's input questions, enabling the question-answering system to search and query information more accurately and generate more precise answers.

[0044] Example 2: Compared to Embodiment 1, this embodiment also includes a specific process for answering the target question using a large language model, which includes: P100 performs an online search to obtain several web pages and corresponding web page summaries.

[0045] As a specific implementation method, the target problem is submitted to a search engine (such as Google or Baidu). If the search engine can directly output a summary, the summary output by the search engine is determined as the summary of the corresponding webpage. If the search engine cannot output a summary, a lightweight text summarization model (such as TextRank) is called to crawl the webpage title and body text to generate a summary.

[0046] P200, obtain the similarity between the semantic vector of each webpage summary and the semantic vector of the target question.

[0047] In this embodiment, the semantic vector of the target question and the semantic vector of any webpage summary have the same dimension. Those skilled in the art will understand that the process of obtaining semantic vectors and the process of obtaining the similarity between two vectors are existing technologies and will not be described further here. As an optional specific implementation, the similarity is cosine similarity.

[0048] P300, based on the similarity, select the top N web pages with the highest similarity from the plurality of web pages; N is a preset number of pages to be selected.

[0049] In one specific implementation, N is an empirical value, such as N being 5 or 10, etc.

[0050] P400, input the content of the top N web pages with the highest similarity and the target question into the large language model.

[0051] In this embodiment, the large language model can be a large language model in the prior art, such as GPT-4.

[0052] As a specific implementation, the complete text (not just the summary) of the top N most similar web pages, along with the target question, is constructed into a carefully crafted prompt and input into the large language model. The prompt template might be similar to: Please answer the question based on the following information: Information: [The complete text of the top N most similar web pages]. Question: [The target question].

[0053] P500 is generated and output by the large language model based on the content of the top N web pages with the highest similarity.

[0054] In this embodiment, the large language model, based on its powerful language understanding and generation capabilities, reads and understands the provided web page content, extracts, integrates, and summarizes information from it, and directly generates a natural, fluent, and accurate text answer, which is then returned to the user.

[0055] In addition to the advantages of Embodiment 1, this embodiment performs online searches for the target question, overcoming the limitations of static training data in large language models. It can acquire the latest real-time information and generate answers, effectively overcoming the illusions or incorrect answers caused by outdated knowledge in large language models, ensuring the timeliness and authenticity of the final answer. Furthermore, based on semantic similarity, this embodiment can accurately and automatically filter the content of the top N web pages most relevant to the target question from massive search results, filtering out irrelevant and low-relevance noise information. This provides high-quality and high-purity information input for the subsequent large model to answer the target question, ensuring the accuracy and credibility of the final answer generated by the large model from the source. It also reduces the amount of content that the large model needs to process (compared to inputting all search results into the large model), accelerating the reasoning speed and the speed of generating the final answer, and improving the efficiency of the large model in generating the final answer.

[0056] In a preferred embodiment, prior to P100, the method further includes the following steps: P110, Analyze the target problem and determine whether the target problem meets the first preset condition and the second preset condition; the first preset condition is used to determine whether the target problem needs to be rewritten based on the context information; the second preset condition is the same as determining whether the target problem needs to be rewritten based on related words.

[0057] In this embodiment, the first preset condition is the condition for initiating context completion, and the second preset condition is the condition for initiating semantic expansion. As a specific implementation, the first preset condition includes the presence of pronouns in the question, and the second preset condition includes the presence of keywords of a preset type in the question. For example, the preset type of keywords includes technical terms.

[0058] As a specific implementation, the named entity recognition module in natural language processing analyzes the sentence structure of the target question to detect the presence of pronouns (such as he, it, this, there, etc.). If pronouns are found, the subsequent context completion step is triggered. The named entity recognition module is used to identify pronouns in the sentence.

[0059] As a specific implementation method, keywords in the target question are extracted, and the extracted keywords are matched with a predefined list of keywords of preset types (such as a professional terminology dictionary) or a model specifically trained on the domain corpus is used to determine whether there are professional terms in the target question. If the match is successful, the subsequent semantic expansion steps are triggered.

[0060] P120. According to the judgment result, execute the corresponding rewriting path: If the target problem meets the first preset condition, access the memory bank, retrieve the context information related to the target problem, and generate a query problem with context completion; if the target problem meets the second preset condition, access the knowledge base, obtain the related words of the keywords of the preset type in the target problem, and generate a query problem with semantic expansion; if both are met, access the memory bank and the knowledge base, and generate a query problem with context completion and semantic expansion; if neither is met, directly use the target problem as the query problem; the memory bank is constructed according to the historical conversation.

[0061] P130: Use the query problem to replace the target problem for subsequent steps.

[0062] As a specific implementation manner, the accessing the memory bank, retrieving the context information related to the target problem, and generating a query problem with context completion includes: P121. Obtain the semantic vector of the target problem.

[0063] P122. Calculate the similarity between the semantic vector of the target problem and the semantic vectors of each memory unit in the memory bank; the memory bank is constructed by converting the key entities in the historical conversation into semantic vectors.

[0064] P123. Based on the similarity ranking, retrieve the most relevant memory unit.

[0065] As a preferred specific implementation manner, determine the priority value of each memory unit according to the similarity and the dialogue turn. Among them, the dialogue turn reflects the timeliness, and the memory unit corresponding to the later dialogue turn has better timeliness (that is, the memory unit corresponding to the latest dialogue turn has better timeliness and higher timeliness score). Therefore, the dialogue turn is positively correlated with the priority value. Optionally, use the weighted summation formula to obtain the priority value of any memory unit. For example, the priority value of any memory unit is: w×a+(1 - w)×b, where w is the preset weight of the similarity (which can be an empirical value), a is the similarity corresponding to this memory unit, b is the timeliness score corresponding to this memory unit, 0 < w < 1, 0 < b ≤ 1, and b is obtained by normalizing the dialogue turn corresponding to this memory unit. It should be understood that the higher the priority value, the more relevant the corresponding memory unit. Those skilled in the art know that the normalization process is prior art and will not be elaborated here.

[0066] In this embodiment, the memory unit with the highest priority value is determined as the most relevant memory unit retrieved.

[0067] P124. Complete the pronouns in the target problem according to the content in the most relevant memory unit, and obtain a query problem with context completion.

[0068] As a specific implementation, replacing the pronouns in the target question with the entity names stored in the most relevant memory unit will yield a context-completed query question.

[0069] As a specific implementation method, the process of constructing the memory includes: P1201, For any round of historical dialogue, extract the core entities from the questions and answers of that round of historical dialogue.

[0070] As a specific implementation method, for each round of historical dialogue, information extraction technology is used to extract core entities (such as person names, organization names, and product names).

[0071] P1202 uses a semantic vector model to convert the extracted content into corresponding semantic vectors, and encapsulates the converted semantic vectors and related information into structured memory units; the related information includes the content before conversion and the dialogue rounds.

[0072] As a specific implementation, a semantic vector model (such as Pentence-BERT) is used to convert the extracted text content into a fixed-dimensional semantic vector. This vector mathematically represents the deep semantics of the text. Subsequently, the semantic vector, the original text content (i.e., the entity names before conversion), and information such as the dialogue turn are packaged into a structured memory unit.

[0073] P1203, store the packaged memory unit into the memory bank.

[0074] Based on P1201-P1203, scattered historical dialogues can be constructed into a structured database (i.e., a memory bank) that can be semantically retrieved.

[0075] As a specific implementation, the step of accessing the knowledge base, obtaining related words of preset types of keywords in the target question, and generating a semantically expanded query question includes: P11, identify and extract keywords of a preset type from the target question; the preset type of keywords includes professional terms.

[0076] In this embodiment, technical terms refer to words that have a clear meaning within a specific field and may have multiple expressions. As a specific implementation, a terminology recognition tool or a predefined domain dictionary is used to scan the target question and identify words belonging to technical terms. For example, the target question might be: What is the attention mechanism of a Transformer? Here, "Transformer" and "attention mechanism" are technical terms.

[0077] P12, query the knowledge base to obtain related words of the extracted preset type of keywords; the related words include: synonyms or words with a relevance greater than or equal to the preset relevance threshold.

[0078] As a specific implementation method, the extracted keywords are submitted to a knowledge base (such as WordNet, a domain-specific thesaurus, or a relational graph constructed by experts) for querying. The obtained related words include synonyms or words with a relevance greater than or equal to a preset relevance threshold. Synonyms refer to words with the same meaning, and words with a relevance greater than or equal to the preset relevance threshold refer to words that are semantically closely related (such as Apple iPhone and Steve Jobs, machine learning and deep learning). Their relevance can be measured by predefined weights or co-occurrence frequencies in the knowledge base.

[0079] P13. Combine the target question with the associated terms to construct a semantically expanded query question.

[0080] As a specific implementation method, the target question and the obtained related words are combined using syntax supported by the search engine (such as OR, parentheses, etc.). For example, if a technical term (denoted as D) appears in the target question, and its corresponding related words include D1 and D2, then the semantically expanded query question obtained after combination is to replace D in the target question with D (or D1 or D2).

[0081] Based on P11-P13, the search scope can be expanded, avoiding missed detections caused by inconsistencies between user-defined terms and webpage terms, and improving information recall.

[0082] This embodiment also introduces a multi-path rewriting mechanism. For example, when facing context-related questions involving pronoun references, this embodiment can automatically complete the context through the knowledge base, transforming the target question into a clear query question, effectively solving the reference problem in multi-turn dialogues, and ensuring that the output of the large model corresponds to the target question. As another example, when the target question includes technical terms, this embodiment can perform semantic expansion through the knowledge base, generating richer query questions based on words with the same and high relevance to the technical terms, thereby improving the search coverage and recall rate, making the final answer output by the large model more comprehensive.

[0083] Example 3: Compared to Embodiment 1, this embodiment also includes a specific process for answering the target question using a large language model, which includes: E100 retrieves several sliced ​​texts obtained after slicing documents in the document knowledge base.

[0084] In this embodiment, the document knowledge base includes several documents, which are unstructured or semi-structured text data, and the documents are natural language text.

[0085] E200, obtain the similarity between the semantic vector of each of the several slice texts and the semantic vector of the target question.

[0086] In this embodiment, the semantic vector of the target question and the semantic vector of any slice of text have the same dimension. Those skilled in the art will understand that the process of obtaining semantic vectors and the process of obtaining the similarity between two vectors are existing technologies and will not be described further here. As an optional specific implementation, the similarity is cosine similarity.

[0087] E300, based on the similarity, select the top M slice texts with the highest similarity from the plurality of slice texts; M is a preset selection number.

[0088] As a specific implementation, M is an empirical value, such as M being 3, 5, or 10, etc.

[0089] E400 inputs the top M most similar text slices and the target question into the large language model.

[0090] In this embodiment, the large language model can be a large language model in the prior art, such as GPT-4.

[0091] As a specific implementation, the top M most similar text segments, along with the target question, are combined to construct a carefully crafted prompt, which is then input into the large language model. The prompt template might be similar to: Please answer the question based on the following information: Information: [The top M most similar text segments]. Question: [The target question].

[0092] E500 is generated and output by the large language model based on the top M similarity text slices.

[0093] In this embodiment, the large language model, based on its powerful language understanding and generation capabilities, reads and understands the provided document content, extracts, integrates, and summarizes information from it, and directly generates a natural, fluent, and accurate text answer, which is then returned to the user.

[0094] In addition to the advantages of Embodiment 1, this embodiment further enhances semantic understanding by calculating the similarity between the target question and the semantic vectors of document slices. This allows for a deeper understanding of semantic relationships and the precise selection of the top M most relevant slices. Subsequently, the large language model generates answers based on these highly relevant source documents, effectively avoiding the illusion phenomenon and ensuring that the answer content is based on verifiable evidence, thus greatly improving the accuracy and credibility of the answer. Moreover, by providing concise and highly relevant top M slices as context, the noise information that the large language model needs to process is greatly reduced. This allows the large language model to focus more on key information, resulting in higher quality and more concise answers, while also reducing the model's computational overhead and processing time, thereby achieving a dual optimization of efficiency and effectiveness.

[0095] As a preferred embodiment, the process of obtaining the plurality of sliced ​​texts includes: E101 sets the first text unit of the specified document as the current segment text; the specified document is any document in the document knowledge base.

[0096] E102, for each subsequent text unit in the specified document, perform the following operations: a) Obtain the semantic center of the current text segment.

[0097] As a specific implementation, a) includes: inputting the entire text of the current segmented text into a trained language model, and determining the vector output by the trained language model as the semantic center of the current segmented text; the trained language model is used to obtain the semantic vector of the input text.

[0098] b) Simulate adding subsequent text units to the new semantic center after the current text segment.

[0099] In one specific implementation, the text unit is a sentence, a paragraph, or a text block containing a preset number of characters.

[0100] As a specific implementation, b) includes: merging the current text segment and subsequent text units to obtain the merged whole text, and inputting the merged whole text into a trained language model, and determining the vector output by the trained language model as the new semantic center; the trained language model is used to obtain the semantic vector of the input text.

[0101] c) Obtain the offset between the new semantic center and the semantic center of the current segmented text.

[0102] In one specific implementation, the offset between the new semantic center and the semantic center of the current text segment is the cosine distance between the new semantic center and the semantic center of the current text segment. The cosine distance is the difference between 1 and the cosine similarity, meaning the offset between the new semantic center and the semantic center of the current text segment is the difference between 1 and the cosine similarity between the two semantic centers.

[0103] It should be understood that the smaller the offset between the new semantic center and the semantic center of the current segmented text, the higher the semantic similarity between the subsequent text and the current segmented text.

[0104] d) If the offset is less than a preset offset threshold, then the subsequent text unit is merged into the current text segment.

[0105] In this embodiment, the preset offset threshold is a pre-set value, which can be an empirical value, for example, the preset offset threshold is 0.1 or 0.2.

[0106] e) If the offset is greater than or equal to a preset offset threshold, the current segment text is output as a complete segment text, and the subsequent text unit is set as the starting text unit of the new current segment text.

[0107] E103, repeat E102, until all text units in the specified document have been processed, then the slicing of the specified document is considered complete.

[0108] In this embodiment, any document in the document knowledge base is sliced ​​according to the process E101-E103, thereby completing the slicing process of the document knowledge base.

[0109] Based on this preferred implementation, this embodiment uses a recursive judgment method based on semantic center offset to dynamically and intelligently merge semantically related text units (such as sentences and paragraphs) into the same segment. This effectively avoids the semantic fragmentation problem that may be caused by fixed-length segments, ensuring the coherence and integrity of the semantics within each segment. Since each segment is a self-contained semantic unit, its semantic vector can more accurately represent the core content of the segment. When performing similarity matching with the target question, it can more accurately retrieve truly relevant and complete segments, reducing the omission of important information (improving recall) and the mixing of irrelevant information (improving precision). This is beneficial to improving the accuracy of the document finally input to the large language model, thereby improving the accuracy of the large language model's output answer, enabling users to accurately obtain the information they need.

[0110] Example 4: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: S100, the issue of receiving user input.

[0111] S200: Determine whether the user-input question contains words representing time. If it does, then the user-input question is identified as the target question; otherwise, proceed to S300.

[0112] S300: Perform intent analysis on the user-inputted question to determine whether the user-inputted question needs to consider the time factor. If not, the user-inputted question is identified as the target question; otherwise, proceed to S400.

[0113] S400, obtain the target time range that matches the question input by the user, and construct the target question based on the target time range and the question input by the user.

[0114] Example 5: This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: S100, the issue of receiving user input.

[0115] S200: Determine whether the user-input question contains words representing time. If it does, then the user-input question is identified as the target question; otherwise, proceed to S300.

[0116] S300: Perform intent analysis on the user-inputted question to determine whether the user-inputted question needs to consider the time factor. If not, the user-inputted question is identified as the target question; otherwise, proceed to S400.

[0117] S400, obtain the target time range that matches the question input by the user, and construct the target question based on the target time range and the question input by the user.

[0118] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A time-sensitive question-answering processing method, characterized in that, Includes the following steps: S100, the issue of receiving user input; S200, determine whether the user input question contains words representing time; if so, determine the user input question as the target question. Otherwise, enter S300; S300 performs intent analysis on the user's input question to determine whether the user's input question needs to consider the time factor. If not, the user's input question is identified as the target question. Otherwise, enter S400; S400, obtain the target time range that matches the question input by the user, and construct the target question based on the target time range and the question input by the user.

2. The time-sensitive question-answering processing method according to claim 1, characterized in that, The process of performing intent analysis on user-input questions to determine whether time factors need to be considered includes: S310, using a pre-trained text classification model to perform intent recognition on the user-input question, classifying the user-input question into a specific question type in a preset mapping knowledge base; the preset mapping knowledge base includes several specific question types and corresponding time-sensitive labels; wherein, when the time-sensitive label is a first preset value, the corresponding specific question type is a question type that does not need to consider time factors; when the time-sensitive label is a second preset value, the corresponding specific question type is a question type that needs to consider time factors; S320 determines whether the user-input question needs to consider the time factor based on the preset mapping knowledge base and the specific question type into which the user-input question is categorized.

3. The time-sensitive question-answering processing method according to claim 2, characterized in that, The target time range for obtaining the matching of the user input question includes: S410, Obtain a preset time mapping table; the preset time mapping table includes the correspondence between different specific problem types and default time ranges; S420: Based on the specific question type categorized by the user-input question, query the preset time mapping table to obtain the default time range corresponding to the specific question type categorized by the user-input question. S430, determine the default time range corresponding to the specific question type into which the user-input question is categorized as the target time range.

4. The time-sensitive question-answering processing method according to claim 3, characterized in that, Prior to S410, obtaining the target time range that matches the user-input question also includes: S401, Obtain the context information of the dialogue in which the user-input question is located; the context information includes historical question-and-answer records in the same dialogue; S402, determine whether a target time range matching the user-input question can be obtained based on the context information; if not, execute S410; if yes, obtain the target time range matching the user-input question based on the context information.

5. The time-sensitive question-answering processing method according to claim 4, characterized in that, The determination of whether a target time range matching the user-input question can be obtained based on the context information includes: S4021, determine whether time information exists in the context information; if not, determine that the target time range matching the user's input question cannot be obtained based on the context information; otherwise, proceed to S4022. S4022, determine the semantic similarity between the context information and the user-input question. If the semantic similarity is greater than a preset similarity threshold, determine that a target time range matching the user-input question can be obtained based on the context information; otherwise, determine that a target time range matching the user-input question cannot be obtained based on the context information.

6. The time-sensitive question-answering processing method according to claim 1, characterized in that, The step of constructing a target question based on the target time range and the user-input question includes: appending the target time range to the user-input question text, and using the new question obtained after appending as the target question.

7. The time-sensitive question-answering processing method according to claim 1, characterized in that, The method also includes using a large language model to answer the target 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 computer program, it implements the time-sensitive question-answering method as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the time-sensitive question-answering method as described in any one of claims 1 to 7.