Processing method and electronic device
By establishing the association between users' historical questions and files in the information retrieval system, and using similarity matching and browsing time to determine the target file, the instability of retrieval under semantically similar questions is solved, and the consistency of retrieval results and the reflection of user preferences are improved.
Patent Information
- Application Number
- CN202611340726.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-24
AI Technical Summary
Existing information retrieval systems struggle to fully utilize users' historical interaction information when dealing with semantically similar questions, resulting in poor stability of search results and difficulty in reflecting users' historical usage preferences.
By establishing the association between users' historical questions and files, the target question is determined using similarity matching, and response information is generated based on the target file. Prompt word information is constructed and input into the target model to generate inference results. The association is determined by combining historical source identifiers and file browsing time.
It improves the consistency of search results for semantically similar problems, reduces fluctuations in file recall caused by changes in query expression, and enhances the stability of search results and the reflection of user preferences.
Smart Images

Figure CN123157789A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, and more specifically, to a processing method and an electronic device. Background Technology
[0002] With the development of artificial intelligence, semantic retrieval systems typically determine relevant documents from a knowledge base based on the user's current input question and generate response results by combining these documents. For semantically similar questions submitted by the same user at different times, separate retrieval processes are usually performed. Because the retrieval process struggles to fully utilize the actual interaction information generated by the user regarding the source documents, different queries, even those with similar semantics, may retrieve different documents, resulting in poor stability of retrieval results and difficulty in consistently reflecting the user's historical usage preferences. Summary of the Invention
[0003] In view of this, the present disclosure provides a processing method and an electronic device.
[0004] One aspect of this disclosure provides a processing method, comprising: obtaining first question information, the first question information representing a question to be responded to; performing similarity matching between the first question information and each of at least one historical question to determine a target question matching the first question information, wherein each historical question is associated with at least one file in a knowledge base; recalling at least one target file associated with the target question from the knowledge base; constructing prompt word information for input to a target model based on the first question information and at least one target file, so that the target model generates a reasoning result based on the first question information and at least one target file; obtaining the reasoning result; generating and outputting response information for the first question information based on the reasoning result; wherein the historical question is a question that has been responded to before the first question information is obtained; the historical response information corresponding to the historical question includes at least one historical source identifier, each historical source identifier indicating a source file that provides source content for generating the historical response information; the at least one file associated with each historical question includes: a source file that establishes an association with the historical question in response to a user performing a trigger operation on a target historical source identifier among the at least one historical source identifier.
[0005] According to embodiments of this disclosure, at least one file associated with each historical issue includes: a target source file indicated by the target historical source identifier, presented in response to a user performing a trigger operation on a target historical source identifier among at least one historical source identifier.
[0006] According to embodiments of this disclosure, the process of establishing an association between a source file and a historical issue includes: in response to a user's browsing time for a target source file being greater than or equal to a target duration, establishing an association between the target source file and the historical issue.
[0007] According to embodiments of this disclosure, the knowledge base includes a first knowledge base and a second knowledge base; the first knowledge base is used to store pre-configured reference files, and the second knowledge base is used to store interactive files obtained based on user interaction; the target source files include interactive files stored in the second knowledge base, and the association information between the target source files and historical questions is stored in the second knowledge base.
[0008] According to embodiments of this disclosure, the target file includes multiple file fragments; the method further includes: determining at least one target file fragment that matches the first question information from the multiple file fragments based on the first question information; constructing prompt word information for input to the target model based on the first question information and at least one target file, including: constructing prompt word information based on the first question information and at least one target file fragment.
[0009] According to embodiments of this disclosure, each target file in at least one target file includes multiple file fragments; the method further includes: determining at least one target file fragment that matches the first question information from the multiple file fragments based on first question information; constructing prompt word information for input to a target model based on the first question information and at least one target file, including: constructing prompt word information based on the first question information and at least one target file fragment.
[0010] According to embodiments of this disclosure, rewriting the first problem information to obtain at least one rewritten problem information includes: determining the intent of the first problem information and the keywords in the first problem information; determining at least one rewritten problem information based on each keyword, wherein the rewritten problem information is associated with the intent, and the rewritten problem information includes at least one keyword, and the rewritten problem information also includes a weight tag for improving the semantic weight of the keywords when performing similarity matching.
[0011] According to embodiments of this disclosure, the response information includes at least one source identifier, which is used to indicate a target file; the method further includes: in response to a user performing a trigger operation on a target source identifier among the at least one source identifier, associating first problem information and / or rewriting problem information with the target file.
[0012] According to embodiments of this disclosure, determining a target question that matches the first question information by performing similarity matching between the first question information and each of at least one historical question includes: determining the number of keywords contained in the first question information; determining a dynamic similarity threshold corresponding to the first question information based on the number; and performing similarity matching between the first question information and each historical question to determine a target question with a similarity greater than or equal to the dynamic similarity threshold.
[0013] Another aspect of this disclosure provides an electronic device, including: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the following operations: obtaining first question information, the first question information representing a question to be responded to; performing similarity matching based on the first question information with each of at least one historical question to determine a target question matching the first question information, wherein each historical question is associated with at least one file in a knowledge base; recalling at least one target file associated with the target question from the knowledge base; constructing prompt word information for input to a target model based on the first question information and at least one target file, so that the target model generates a reasoning result based on the first question information and at least one target file; obtaining the reasoning result; generating and outputting response information for the first question information based on the reasoning result; wherein the historical question is a question that has been responded to before the first question information was obtained; the historical response information corresponding to the historical question includes at least one historical source identifier, each historical source identifier indicating a source file that provides source content for generating the historical response information; the at least one file associated with each historical question includes: a source file that establishes an association with the historical question in response to a user performing a trigger operation on a target historical source identifier among the at least one historical source identifiers.
[0014] Another aspect of this disclosure provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform a processing method according to any of the foregoing embodiments.
[0015] Another aspect of this disclosure provides a computer program product, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the operation of the processing method of any of the foregoing embodiments. Attached Figure Description
[0016] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 A flowchart illustrating a processing method according to an embodiment of the present disclosure is shown schematically.
[0018] Figure 2 A flowchart illustrating the process of determining a target problem according to an embodiment of the present disclosure is shown schematically.
[0019] Figure 3 A flowchart illustrating the process of determining rewrite problem information in a processing method according to an embodiment of the present disclosure is shown schematically.
[0020] Figure 4 This schematically illustrates another flowchart of the process for determining a target problem according to an embodiment of the present disclosure;
[0021] Figure 5 Adaptation illustrates another flowchart of the processing method according to embodiments of the present disclosure; and
[0022] Figure 6 A block diagram of an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure, is illustrated schematically. Detailed Implementation
[0023] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0024] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0026] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0027] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0028] Figure 1 A flowchart illustrating a processing method according to an embodiment of the present disclosure is shown schematically.
[0029] like Figure 1 As shown, the processing method may include at least operations S110 to S160.
[0030] In operation S110, the first question information is obtained, which represents the question to be addressed. The first question information can be obtained based on the original search question entered by the user, and is used to represent the query content that the user currently hopes to obtain a response to.
[0031] In operation S120, a similarity match is performed between the first question information and each of the at least one historical question to determine the target question that matches the first question information. Each historical question is associated with at least one file in the knowledge base. Similarity matching can be understood as determining the semantic similarity between the first question information and each historical question. The target question can be a historical question from the at least one historical question that meets preset matching conditions with the first question information. The semantic similarity between questions can be represented by corresponding question vectors; higher similarity indicates that the query requirements expressed by the two questions are closer.
[0032] Specifically, we can obtain the question vector corresponding to the first question and the question vectors corresponding to each historical question, calculate the vector similarity between the first question and each historical question, and determine the target question based on the similarity calculation results. The similarity calculation can employ a method that reflects the semantic similarity between different questions.
[0033] The matching objects here are not all files in the knowledge base, but rather historical questions that have already been responded to. Since each historical question is associated with at least one file in the knowledge base, when the information of the first question semantically matches a historical question, the existing association between that historical question and the file can be used to determine the file related to the current question. The knowledge base here serves as a data resource capable of managing the files involved in the processing and supporting file retrieval or recall.
[0034] Furthermore, by performing similarity matching between the first question information and historical questions, we can leverage the more focused semantic representation characteristics of question text compared to document content. First question information and historical questions are typically used to represent relatively clear query needs; their text length can be relatively short, and keywords, key entities, and other substantial semantic content constitute a relatively high proportion of the entire question text. When two questions express the same or similar query needs, their corresponding vector representations can exhibit a high degree of clustering in the corresponding semantic directions.
[0035] In contrast, files or file fragments in a knowledge base may contain content related to the current question, as well as background information, additional descriptions, or other topical content. When using dense vectors to represent files or file fragments, the semantic information corresponding to different text content within the file collectively participates in the formation of the overall vector representation. When content directly related to the current question constitutes only a portion of the file or file fragment, other content may affect the overall vector representation, reducing the representational degree of semantic features related to the current query requirement in the overall vector.
[0036] For example, two semantically similar questions may contain many identical or semantically related substantive words, resulting in a high degree of word overlap. Conversely, for document fragments with long question and content lengths, even if the fragment contains content relevant to the question, it may also contain other content not included in the question, causing the overall vector formed by the fragment to represent a comprehensive representation of multiple semantic contents. Therefore, by first performing question-level similarity matching between the initial question information and historical questions, and then using the established association between historical questions and documents to determine the corresponding document after a historical question is matched, semantically focused question text can be used as an intermediate matching medium for document retrieval, reducing the dilution effect of other content in the document on relevant semantic features.
[0037] In operation S130, at least one target file associated with the target problem is retrieved from the knowledge base. Retrieval can be understood as identifying and obtaining the corresponding file from the knowledge base based on the existing association between the target problem and the file. The target file can be a file in the knowledge base that has already established an association with the target problem and has been identified as related to the first problem information during this problem processing.
[0038] Specifically, based on the identifier information corresponding to the target question or the association between the target question and the file, one or more files corresponding to the target question can be searched in the knowledge base, and the searched files can be used as target files. Files can contain one or more forms of content, such as text, images, audio, and video. Specifically, for files of different modalities, one or more representations can be formed to characterize their semantic content. For text files, text vectors can be obtained directly from the text content; for image files, image vectors can be obtained from the image itself, or text content in the image can be obtained through optical character recognition, or text describing the image content can be obtained through an image description generation model, and then the corresponding text vectors can be obtained; for audio or video files, corresponding audio and video vectors can be obtained from the audio or video content, or speech-to-text can be obtained through automatic speech recognition, and then the corresponding text vectors can be obtained.
[0039] For image files, a label extraction model can be used to identify the image content, obtaining one or more labels representing objects, scenes, attributes, or other visual content in the image, along with a confidence score for each label. The confidence scores of each label can be filtered based on a preset label threshold. Labels with confidence scores greater than or equal to the preset threshold are identified as keywords and / or metadata corresponding to the image, and these keywords and / or metadata are associated with and saved with the image vector corresponding to the image for subsequent retrieval.
[0040] Multiple high-confidence labels obtained by the label extraction model can form a discrete label set used to represent the semantics of image content. This discrete label set, along with the image vector corresponding to the image and the descriptive text obtained through the image description generation model, can be used together to represent the image content. Specifically, the image vector can be used to represent the continuous semantic features of the image content, the descriptive text can be used to represent the overall or partial content of the image in natural language, and the discrete label set can be used to represent objects, attributes, scenes, or other visual features in the image that have relatively clear semantic meanings.
[0041] For video files, one or more video frames can be identified from the video. For example, video frames can be acquired at preset time intervals, or at least one keyframe can be identified from the video. A label extraction model can then be used to identify labels for at least one video frame, obtaining the labels and label confidence scores corresponding to each or multiple video frames as a whole. Labels whose confidence scores meet a preset label threshold can be identified as keywords and / or metadata corresponding to the video, so that the video, in addition to having video vectors and text vectors corresponding to speech-to-text, also possesses keyword information obtained based on visual content.
[0042] For video files, high-confidence tags can be obtained for one or more video frames, and a discrete tag set for the video can be formed based on the tags corresponding to multiple video frames. The discrete tag set can be used together with at least one of the following to characterize the semantics of the video content: the audio / video vectors corresponding to the video, the transcribed text obtained through automatic speech recognition, and the visual description information obtained based on the video frames.
[0043] For example, for audio content, Wav2Vec (a speech vector representation model) can be used to obtain the vector representation of the audio; for video content, models such as VideoBERT (a bidirectional video transformer representation model) that can characterize video semantics can be used to obtain the vector representation of the video. For image content, CLIP (a contrastive language-image pre-trained model) can be used to obtain image vectors that can be associated with text semantics.
[0044] For example, for image content, ComfyUI-WD14-Tagger (a tag extraction model based on WD14) or other tag extraction models that can output image content tags and corresponding confidence scores can be used to obtain multiple tags corresponding to the image. For instance, when the tag extraction model outputs different tags and their confidence scores, tags with confidence scores greater than or equal to a preset tag threshold can be retained, and these retained tags can be used as keywords for the corresponding images. For video content, the above tag extraction method can be applied to video frames obtained from the video, and the keywords corresponding to the video can be determined based on the tags corresponding to different video frames.
[0045] Furthermore, the same file can also have multiple dimensions of auxiliary information. For example, images, audio, or video can have at least one type of metadata, including shooting time, shooting location, file name, and source information. This metadata, together with at least one of the following: the vector representation corresponding to the original modality of the file, the text vector obtained through character recognition or speech recognition, or the text vector generated through image description, can form a multi-dimensional representation of the file.
[0046] To enable users to retrieve files in other modalities based on a question posed in one modality, the vector representations corresponding to different modalities can be configured to reside in the same or comparable semantic spaces. For example, if the vectors output by the corresponding pre-trained model are originally in comparable semantic spaces, similarity can be directly calculated using vectors from different modalities. If the vectors output by different models reside in different semantic spaces, semantic alignment methods such as contrastive learning and transfer learning can be used to map the vector representations of text, images, audio, and video to semantic spaces capable of similarity comparison.
[0047] This leverages the existing association between the target question and the file. In other words, once the first question information semantically matches a historical question, it is not necessary to rely solely on the file retrieval results re-executed for the first question information. Instead, the association between "question and file" formed during previous interactions can be used to recall the corresponding file to the current question's processing.
[0048] In operation S140, cue word information is constructed based on the first question information and at least one target file for input to the target model, so that the target model generates inference results based on the first question information and at least one target file. The target model may be a language generation model capable of performing semantic understanding and content generation by combining the input question and relevant source content. The cue word information may be information formed by organizing the content provided by the first question information and at least one target file according to the input format that the target model can process.
[0049] Furthermore, when at least one target file comprises multiple target files or multiple target file fragments, the target files or target file fragments used to construct the prompt word information can be sorted according to the relevance between each target file or target file fragment and the first question information, and the corresponding source content can be added to the prompt word information according to the sorting result. For example, the target files or target file fragments can be sorted from high to low according to their relevance scores, so that target files or target file fragments with higher relevance scores are placed in a relatively prominent position in the prompt word information.
[0050] In one implementation, the prompt information can be organized in the following order: system prompt information, first question information, and sorted target files or target file fragments. The system prompt information can be used to instruct the target model to perform processes such as question understanding, source content filtering, and response generation; the first question information is used to characterize the current query requirement; and the sorted target files or target file fragments are used to provide the target model with the source content upon which the response is based.
[0051] After determining the order of target files or target file fragments according to their relevance, the positional encoding characteristics of the target model can be utilized to further influence the target model's attention to different source content. This is because, when the target model employs Rotated Positional Encoding (RoPE), RoPE is used to represent the relative positional information between different terms when calculating attention; the relative distance between terms can affect the attention score. In long text processing, as the relative distance between two terms increases, their mutual attention contribution may decrease. When forming prompt information according to the structure of "system prompt information—first question information—target file content," placing target files or target file fragments with higher relevance at the beginning can ensure a relatively small terminological distance between the corresponding source content and the first question information. This makes it easier for the target model to focus on source content with higher relevance to the current question when processing multiple source contents based on the first question information.
[0052] Therefore, by further converting the file relevance ranking results into the content arrangement order within the prompt word information, the file relevance determined in the retrieval stage can continue to influence the inference stage of the target model, rather than just being used to determine which files are selected into the prompt word information, thereby improving the utilization of source content with higher relevance in the response generation process.
[0053] In operation S150, the inference result is obtained. The inference result may include information generated by the target model based on the first problem information and at least one target file, which can be used to form a response to the first problem information.
[0054] In operation S160, based on the reasoning results, response information for the first question is generated and output.
[0055] According to embodiments of this disclosure, a historical issue is an issue for which a response was completed before the first issue information was obtained; the historical response information corresponding to a historical issue includes at least one historical source identifier, each historical source identifier indicating a source file that provides source content for generating the historical response information; at least one file associated with each historical issue includes a source file that establishes an association with the historical issue in response to a user performing a trigger operation on a target historical source identifier among the at least one historical source identifier. The historical response information may be information generated and output when a response to the corresponding historical issue was previously completed. The source file may be a file that provides source content during the generation of the historical response information. The historical source identifier may be identifier information set in the historical response information and capable of indicating the corresponding source file, thereby distinguishing different source files referenced by the historical response information based on different historical source identifiers.
[0056] The target historical source identifier can be any historical source identifier that has been triggered by a user action. The triggering action can include a click, selection, or other interactive action performed by the user on the corresponding historical source identifier that can trigger that identifier. This embodiment does not limit the specific interactive form used for the triggering action.
[0057] Specifically, when responding to a historical issue, the generated historical response information may include one or more historical source identifiers, each indicating the source file that provided the source content for that historical response information. When a user performs a trigger operation targeting a specific historical source identifier, the source file indicated by the target historical source identifier can be determined, and the association between that source file and the corresponding historical issue can be established.
[0058] The association between a file and a historical issue for subsequent recall is not established simply because the file previously provided source content for historical response information. Instead, the actual triggering action taken by the user in response to the corresponding historical source identifier serves as the basis for establishing this association. In this way, a historical interaction relationship can be formed between "historical issue - source file actually triggered by the user" in a completed question-and-answer process.
[0059] When new information about the first question is subsequently obtained, it is first matched with the existing historical questions that have established a historical interaction relationship. When a historical question matches the information about the first question, that historical question can be identified as the target question. Then, the corresponding file is retrieved based on the established relationship between the target question and the source file. At this point, the source file can serve as the target file in this processing, participating in subsequent reasoning and response generation based on the information about the first question.
[0060] Therefore, the correspondence between "what questions the user asked" and "which source files the user actually triggered for those questions" from the previous Q&A process is actually preserved, and this correspondence is reused when a new question with similar semantics appears. Even if the two questions are expressed differently, as long as they meet the semantic similarity matching condition, the files that have already been associated can still be found through the matching historical questions.
[0061] For example, a user previously entered the question "How do I view the user manual for a certain function?" The historical response information generated for this question includes multiple historical source identifiers, one of which points to file A. When the user clicks on this historical source identifier, a link is established between the historical question and file A.
[0062] In a subsequent query, the user entered the first question: "How should I use a certain function?" Although the wording of the first question differed from the previously mentioned historical questions, the semantics of their query requirements were similar. Therefore, the historical questions could be identified as the target question through similarity matching. Subsequently, based on the established association between the target question and file A, file A was retrieved from the knowledge base as the target file, and prompt words were constructed based on the first question and file A. The target model combined the first question and the source content provided by file A to generate a reasoning result, and then generated and output response information for the first question based on this reasoning result.
[0063] According to embodiments of this disclosure, by establishing an association between historical questions and corresponding source files based on actual triggering operations performed by users on historical source identifiers, user interaction information generated during historical question-and-answer processes can be transformed into a question-file association that can be reused in subsequent retrieval processes. When semantically similar questions are subsequently obtained, the corresponding historical question can be located first through question similarity matching, and then the corresponding file can be retrieved based on the existing association between the historical question and the file.
[0064] For multiple queries with similar semantics but different textual expressions, it is not necessary to rely entirely on the search expression that is re-formed for the current question each time to determine the search results. Instead, the association between questions and files formed in previous interactions can be used to allow files that have been actually triggered by users in the past to participate in the response process of similar questions again. This reduces the fluctuations in file recall results caused by changes in query expression in different question processing processes and improves the consistency of file recall results under similar questions.
[0065] Furthermore, from the perspective of semantic vector matching, file retrieval through historical questions can reduce the semantic dilution effect caused by directly matching the current question with the content of longer files. For files or file fragments with long content, the semantic content related to the current query may only account for a portion, while other textual content will also participate in the formation of the overall semantic representation of the file, thus making the file vector a comprehensive representation of multiple semantic contents. In contrast, the first question information and historical questions are usually formed around relatively clear query requirements. When the two are semantically similar, the semantic content such as keywords and key entities related to the query requirements account for a relatively high proportion in the text, and the corresponding vector can more concentratedly represent the corresponding query requirements. By matching the similarity between the first question information and historical questions, the historical interaction relationship can be located using a more focused question-level semantic representation, and then the corresponding files can be retrieved based on the historical interaction relationship, thus providing a supplement to retrieval based on the overall file vector.
[0066] In some embodiments, the current processing mode can be determined based on the network connection status, the availability of the target model in the cloud, and whether the electronic device has the capability to process large language models locally.
[0067] When the target model in the cloud can be invoked, the normal processing mode can be adopted, and the target model in the cloud can perform corresponding processing such as question rewriting, search result filtering, response generation, and knowledge base file summary generation.
[0068] When an electronic device is offline, has an abnormal network connection, or is otherwise unable to access the cloud-based target model, it can be further determined whether a usable edge-side large language model is deployed locally on the electronic device. If the edge-side large language model is available, at least some of the processing originally performed by the cloud-based target model can be switched to be performed by the edge-side large language model. For example, at least one of the following processes can be performed using the edge-side large language model: question rewriting, search result filtering, response generation, document summary generation, hypothetical question generation, key entity extraction, and keyword extraction.
[0069] When the target model in the cloud is unavailable and no usable edge-side large language model is deployed locally on the electronic device, the processing steps that depend on the large language model can be canceled and the basic retrieval mode can be entered.
[0070] In the basic retrieval mode, for the question currently initiated by the user, the question rewriting based on the large language model can be canceled. Instead, the original question input by the user can be directly used as the first question information, and the question vector corresponding to the first question information can be obtained by using the locally available text embedding model.
[0071] The similarity matching can be performed between the question vector corresponding to the first question and the question vector corresponding to the locally saved historical questions, and the corresponding files or file fragments can be recalled based on the established association between the matched historical questions and the files. Alternatively, the similarity matching can be performed between the question vector corresponding to the first question and the vector representation corresponding to the file, file fragment, or existing file metadata. Keyword matching methods such as BM25 (Best Match 25, a keyword matching method that determines text relevance based on word occurrence and word differentiation) can be used to match the original words or keywords in the first question with the original content of the file, existing file metadata, and / or historical questions. One or more of the following methods—historical question vector matching, file or metadata vector matching, and keyword matching—can be used individually or in combination.
[0072] For the retrieved candidate files or file fragments, those that meet the preset search criteria can be retained and sorted according to vector similarity, keyword relevance score, or a comprehensive relevance determined by multiple matching results. Without invoking the large language model, the candidate content filtering, content summarization, and natural language response generation performed based on the large language model can be canceled, and the sorted original file list or original file fragment list can be directly presented to the user.
[0073] Furthermore, in the basic retrieval mode, for files that need to be added to the knowledge base, basic data entry processing that does not rely on a large language model can continue to be performed. For example, the original content of the file can be saved, and / or a vector representation of the file or file fragment can be obtained using a locally available embedding model; metadata such as file name, time information, location information, and source information that can be obtained directly can also be saved at the same time.
[0074] When both the cloud-based target model and the edge-based large language model are unavailable, enhancement processes such as document summary generation, hypothetical question generation, key entity extraction, and keyword extraction that rely on the large language model can be temporarily suspended. Instead, the original content of the document, basic metadata, and corresponding vector representations can be added to the database first, so that newly added documents can still participate in subsequent searches based on vector matching and / or keyword matching.
[0075] Based on the foregoing embodiments, at least one file associated with each historical issue includes: the target source file indicated by the target historical source identifier, which is presented in response to a user performing a trigger operation on the target historical source identifier among at least one historical source identifier.
[0076] Presentation can be understood as responding to a trigger action against a target historical source identifier, making the source file indicated by the target historical source identifier available for viewing by the user. The target source file can be the actual source file pointed to by the target historical source identifier and presented to the user after the target historical source identifier is triggered. Therefore, the file associated with historical issues is not only determined by whether the corresponding source file is referenced in the historical response information, but can also be determined by whether the user has triggered an action against the corresponding historical source identifier, and which source file is actually presented after the trigger.
[0077] Specifically, historical response information may include one or more historical source identifiers, each indicating a different source file that provides the content for the historical response information. When a user performs a trigger operation targeting one of the historical source identifiers, the target source file can be determined based on the correspondence between the historical source identifier and the source file, and the content of the target source file will be presented in response to the trigger operation. Referring to the aforementioned method for establishing the association between historical issues and source files, the actually presented target source file can be considered as the file associated with the corresponding historical issue.
[0078] When historical response information includes multiple historical source identifiers, different source files can be distinguished based on the target historical source identifier actually triggered by the user. In other words, even if multiple source files have provided content for historical response information, the target source file triggered and presented by the user can be determined based on the user's actual interaction with the historical source identifier. The association formed between historical questions and files can correspond to the source file that the user actually accessed and viewed during the historical Q&A process, without having to treat all source files involved in the historical response information as files that the user actually interacted with.
[0079] For example, for a historical question that has already been responded to, the historical response information includes a first historical source identifier, a second historical source identifier, and a third historical source identifier. These three historical source identifiers indicate source file A, source file B, and source file C, respectively. After a user clicks on the second historical source identifier, the system can determine the indicated source file B based on the second historical source identifier and present the corresponding content of source file B to the user. In this case, source file B can be used as the target source file associated with the historical question.
[0080] If a user performs a trigger operation targeting the first historical source identifier, source file A will be displayed accordingly, and source file A will be used as the target source file associated with that historical issue. Therefore, the actual source file associated with a given historical issue can be determined based on the user's actual triggering behavior targeting different historical source identifiers.
[0081] According to embodiments of this disclosure, by presenting the corresponding target source file in response to a user's triggering action on a historical source identifier, and using the actually presented target source file as the file associated with the historical question, the association between historical questions and files can further reflect the source content actually viewed by the user during the historical Q&A process. When historical response information references multiple source files, this can distinguish between source files that only participated in the generation of historical responses and source files that the user actually triggered and viewed.
[0082] When retrieving files for semantically similar issues by leveraging the association between historical issues and files, the source files from which user-triggered actions actually occurred can be included in subsequent processing. This reduces interference caused by using source files from historical response information that were referenced but did not trigger user actions as historical interaction objects, thereby ensuring greater consistency between the retrieved files and the user's historical interaction history.
[0083] Based on the foregoing embodiments, the process of establishing an association between source files and historical issues may include: in response to a user's browsing time for a target source file being greater than or equal to a target duration, establishing an association between the target source file and historical files. The browsing time may be the duration during which the user browses the target source file after triggering the target historical source identifier and presenting the target source file. The target duration may be a pre-set duration threshold used to determine whether the user's browsing behavior for the target source file meets the conditions for establishing an association between the target source file and the corresponding historical issue. The specific value of the target duration can be set according to actual application needs, and this embodiment does not limit this.
[0084] Specifically, referring to the aforementioned presentation process of the target source file, after the user triggers the target historical source identifier and the corresponding target source file is presented, the user's browsing time for the target source file can be recorded and compared with the target duration. When the browsing time is greater than or equal to the target duration, it can be considered that the user has performed a continuous browsing behavior that meets preset conditions for the target source file, thereby establishing a correlation between the target source file and the corresponding historical issue. When the browsing time is less than the target duration, the correlation between the target source file and the corresponding historical issue can be temporarily not established based on the current browsing behavior.
[0085] Therefore, in the process of establishing a link between historical issues and source files, the triggered behaviors can be further filtered by utilizing the user's actual browsing behavior of the source files. Compared to determining the associated files solely based on whether the user triggered the historical source identifier, browsing duration can further reflect whether the user continuously viewed the file after entering the target source file, making the established association between historical issues and files reflect the user's further interaction with the source content.
[0086] When a historical question corresponds to multiple source files triggered by users, the browsing time of each user for different target source files can be obtained, and each browsing time can be compared with the target time. For target source files whose browsing time meets the condition, a relationship can be established between them and the historical question; for target source files whose browsing time does not meet the condition, a relationship can be established without considering the current browsing behavior.
[0087] For example, for a historical issue that has already been responded to, when a user triggers a historical source identifier in the historical response information, the source file A indicated by that historical source identifier is displayed. Assuming the preset target duration is 30 seconds, if the user browses source file A for 45 seconds, the browsing time exceeds the target duration, and a relationship can be established between source file A and the historical issue.
[0088] If a user triggers another historical source identifier within the same historical response information and displays source file B, but the browsing time for source file B is only 10 seconds, then this browsing time is less than the target duration. Therefore, it is not necessary to establish an association between source file B and the historical issue based on this browsing behavior. Thus, even if multiple source files are triggered by the user, it is possible to determine whether to establish a corresponding association based on the actual browsing time of the user for each different source file.
[0089] According to embodiments of this disclosure, by further using the browsing duration of the target source file as a criterion for establishing the association between historical issues and target source files, based on the user's triggering of historical source identifiers, the source files formed during historical interactions can be further filtered. This ensures that the source files with established associations not only correspond to the source content actually triggered by the user but also to the source content that the user has continuously browsed for a preset duration. When subsequently using the association between historical issues and source files to recall files for semantically similar issues, it can reduce file associations formed by weak interactive behaviors such as accidental touches or brief viewings. This makes the files participating in subsequent recalls more reflective of the source content that the user previously focused on, thereby improving the effectiveness of historical interaction information for subsequent file recall and reducing the interference of historical files with low relevance to the user's actual needs on the recall results.
[0090] Based on the aforementioned embodiments, the knowledge base includes a first knowledge base and a second knowledge base; the first knowledge base is used to store pre-configured reference files, and the second knowledge base is used to store interactive files obtained based on user interaction; the target source files include interactive files stored in the second knowledge base, and the association information between the target source files and historical questions is stored in the second knowledge base.
[0091] Files acquired through user interaction can be understood as files being acquired in direct correspondence with user interactions; that is, without corresponding user interaction, the file will not be acquired during that usage session. The specific form of user interaction is not limited to a single operation; it can include users actively providing content to the current interaction process, or users performing operations on the currently presented content to acquire or save that content.
[0092] Accordingly, the main difference between reference files and interactive files lies in how they enter the knowledge base. Reference files originate from pre-configuration and their entry into the first knowledge base is not contingent upon the current user having already performed a corresponding interaction; interactive files, on the other hand, are acquired during actual user use, and their entry into the second knowledge base is related to the corresponding user interaction. A file that has already been pre-configured as a reference file in the first knowledge base will not automatically become an interactive file simply because the user subsequently views, clicks, or performs other operations on that file.
[0093] Specifically, the first knowledge base can store pre-organized, configured, or imported reference files, which can serve as information sources for responding to questions before a user raises one. Different reference files can carry different types of information and can be retrieved or called as needed when handling user questions.
[0094] The interactive files stored in the second knowledge base can be generated or added as the user interacts with the device. For example, when interacting with an electronic device, a user can proactively provide a file, and the resulting file can serve as an interactive file. Users can also perform actions such as collecting, saving, or otherwise retrieving the currently presented content, allowing the corresponding content to be obtained based on these interactions and forming interactive files that can be stored in the second knowledge base. Therefore, interactive files are not limited to files directly uploaded by the user; any file obtained through corresponding interactions during user interaction can be stored as an interactive file in the second knowledge base.
[0095] From the perspective of data formation, the first knowledge base can carry pre-formed reference information, while the second knowledge base can carry interactive information formed as the user uses the system. The former focuses on providing pre-configured information sources, while the latter focuses on retaining information obtained through actual user interaction. Together, they constitute a knowledge base capable of participating in problem-solving.
[0096] Furthermore, when an interactive file in the second knowledge base serves as a source file in the response process of a historical question, and an association is established with the historical question according to the aforementioned embodiments, association information representing the correspondence between the interactive file and the historical question can be stored in the second knowledge base.
[0097] The association information allows the second knowledge base to not only store the interaction files themselves, but also the connections between questions generated during the user's historical usage and the interaction files. Therefore, the information stored in the second knowledge base can gradually form and accumulate as the user continues to use it. When processing new questions later, the saved historical associations can be used to identify the interaction files obtained by the user in previous interactions and associated with the corresponding historical questions. The second knowledge base can have a memory attribute for recording the user's historical interaction information. This memory attribute means that the second knowledge base can store files obtained based on user interactions and the association information formed during usage, so that this historical interaction information can be reused in subsequent processing. It does not imply the establishment of a separate knowledge base independent of the first and second knowledge bases.
[0098] It should be noted that storing the association information between the target source document and the historical issue in the second knowledge base can be considered as a way of storing association information. This disclosure does not limit the association information to be stored in the form of association records independent of the document entries.
[0099] In another implementation, at least one of the following can be stored as additional metadata fields for the file entry corresponding to the target file or target file fragment: historical questions associated with the target file or target file fragment, rewrite questions obtained based on historical questions, vector representations of the aforementioned questions, and information characterizing the correspondence between questions and target files. This metadata is stored in association with the original content and / or vector representation of the file entry. When a new question is subsequently obtained, the vector representation of the new question can be matched with the vector representations of historical questions stored in the file entry for similarity, and the corresponding target file can be determined based on the matching historical questions. The above-mentioned metadata storage method based on file entries and the aforementioned method of storing associated information in a second knowledge base can be implemented separately or in combination.
[0100] For example, in one scenario, the electronic device has pre-configured file A and stores file A in a first knowledge base. File A exists as an accessible information resource before the user begins the current usage process and can therefore serve as a reference file. During subsequent communication between the user and the electronic device, the user actively uploads file B. File B is obtained due to the user's upload operation during this communication and can be stored as an interactive file in a second knowledge base.
[0101] In another scenario, a user browses content and saves it. In response to this saving action, the saved content is retrieved, and an interactive file C is created based on this content and stored in the second knowledge base. Thus, although files B and C are obtained through different forms of user interaction, they are both interactive files obtained through user interaction during the user's usage. Later, during the generation of historical response information for a historical question Q, assuming that interactive file B participates as the source file in the generation of this historical response information, and establishing the association between interactive file B and historical question Q according to the aforementioned embodiments, the association information representing the correspondence between historical question Q and interactive file B can be stored in the second knowledge base. When subsequently searching for files associated with historical question Q, interactive file B can be determined based on this association information.
[0102] In some implementations, if the content actively saved by the user includes the original document, the name of the currently used application, the time, screenshots, or a large model summary (abstract, keywords, hypothetical questions, etc.), it can be stored as metadata in the first knowledge base. Interaction information generated by the user's interaction can be stored in the second database.
[0103] It should be noted that, in some implementations, the "difference" between the first knowledge base and the second knowledge base may refer to the different sources of content they target and / or the different conditions that trigger the storage action. In actual deployment, the first knowledge base and the second knowledge base may refer to the same actual knowledge base. Those skilled in the art can determine whether the first knowledge base and the second knowledge base refer to the same actual knowledge base based on the actual deployment environment.
[0104] According to embodiments of this disclosure, by storing pre-configured reference files and interaction files obtained based on actual user interactions in a first knowledge base and a second knowledge base respectively, relatively fixed reference information and information formed during user use can be distinguished, enabling the knowledge base to not only utilize pre-configured information resources, but also to continuously retain information obtained during actual user use.
[0105] By storing the association information between target source files and historical questions in a second knowledge base, files obtained based on user interactions and the relationships formed during historical question-and-answer sessions can be continuously preserved. When subsequent queries related to historical questions occur, the established historical associations can be used to identify the corresponding interaction files. This allows content obtained and used by users during previous interactions to be reused in subsequent question processing, ensuring that information generated by user behavior continuously participates in the retrieval process and mitigating the problem of insufficient historical user behavior when relying solely on pre-configured reference information.
[0106] Based on the foregoing embodiments, each target file in at least one target file includes multiple file fragments; the processing method may also include operation S510.
[0107] In operation S510, based on the first problem information, at least one target file segment that matches the first problem information is determined from multiple file segments. A file segment can be a content unit obtained by dividing a target file according to a preset granularity. Different file segments each carry a portion of the content of the target file, enabling the determination of content in the target file related to the first problem information at the file segment level. The target file segment can be a file segment among multiple file segments that meets the matching conditions with the first problem information in terms of content or semantics.
[0108] The method of dividing file segments can be adapted to the content format of the target file. For text content, it can be divided into sentences, paragraphs, or other granularities that maintain the semantic integrity of the content. When a single segmentation result is not suitable for independent processing, adjacent content can be merged to form file segments that meet the corresponding processing requirements. The specific length and granularity of the file segments can be set according to the actual processing capabilities.
[0109] Specifically, after recalling one or more target files according to the aforementioned operations, the correlation between the first problem information and each file fragment can be further compared within each target file, and at least one target file fragment can be determined from multiple file fragments based on the comparison results.
[0110] In one implementation, the first question information and the vector representations corresponding to each file segment can be obtained separately. The similarity between the vector representation of the first question information and the vector representations of each file segment can be calculated, and at least one target file segment matching the first question information can be determined based on the similarity calculation results. In another implementation, a relevance ranking model can be used to evaluate the relevance between the first question information and each file segment, obtain the relevance results corresponding to each file segment, and rank the multiple file segments according to the relevance results to determine at least one target file segment.
[0111] Therefore, the aforementioned method of recalling target files based on the association between historical questions and documents can be used to first narrow down the search scope at the file level. After obtaining the target file, fragment-level matching can then be performed within the target file based on the current first question information. In this way, even if a target file contains a lot of content, the parts relevant to the current query can be further located, without having to use all file fragments included in the target file as input for subsequent model processing.
[0112] Operation S140 may include operation S520.
[0113] In operation S520, prompt word information is constructed based on the first question information and at least one target file fragment. Referring to the aforementioned description of prompt word information, in this embodiment, the source content used to construct the prompt word information can be further refined from the target file into target file fragments. That is, after determining the target file fragment that matches the first question information from the multiple file fragments included in the target file, the content carried by the first question information and at least one target file fragment can be organized to form prompt word information for inputting into the target model.
[0114] Specifically, the first question information can be used as the question content to be responded to, and one or more target file fragments can be used as source content related to the question. These two can be combined according to the input format that the target model can process. When multiple target file fragments are identified, they can be used together as source content, or some fragments can be selected to participate in the construction of the prompt word information based on their relevance to the first question information. The source content input to the target model can focus on the local content in the target file related to the current question; other file fragments in the target file may not participate in the construction of this prompt word information.
[0115] For target file fragments identified separately from multiple target files, these fragments can be combined and used together with the first question information to form prompt word information. The source content of the prompt word information is not limited to the same target file, but can include file fragments from different target files that match the first question information.
[0116] For example, suppose we recall target file A and target file B based on the aforementioned association between historical issues and documents. Target file A includes file fragments A1, A2, A3, and A4, and target file B includes file fragments B1, B2, and B3.
[0117] Based on the first problem information obtained so far, the degree of correlation between the first problem information and file fragments A1 to A4 and file fragments B1 to B3 can be determined. If file fragments A2 and B3 meet the matching conditions with the first problem information, then file fragments A2 and B3 can be identified as target file fragments, without having to use all file fragments in target files A and B as source content for this processing.
[0118] Subsequently, the information of the first question, the content carried by file fragment A2, and the content carried by file fragment B3 can be organized to form prompt word information. This prompt word information is then input into the target model, enabling the target model to generate inference results based on the current question and the file fragments that match the current question.
[0119] According to embodiments of this disclosure, after recalling target files using existing associations between historical questions and files, further determining matching target file fragments within the target files based on the first question information combines the file-level associations formed by historical interactions with the fragment-level relevance corresponding to the current question. Since the same file may contain multiple parts of content related to and unrelated to the current question, directly using all file fragments included in the recalled file to construct prompt word information may introduce content with low relevance to the current question and increase the amount of information the target model needs to process. By further determining target file fragments matching the first question information from the target file, irrelevant file fragments entering the prompt word information can be reduced, making the source content input to the target model more focused on the information corresponding to the current question. Simultaneously, it reduces the interference of irrelevant content in the target file on the reasoning process, thereby improving the relevance between the source content used for the current question response and the first question information.
[0120] In another embodiment of this disclosure, in addition to recalling the corresponding files based on the similarity matching between the first question information and the historical questions, it is also possible to combine the similarity retrieval of files or file fragments in the knowledge base directly based on the first question information to form two retrieval results, and then fuse the two retrieval results.
[0121] Specifically, a first question vector corresponding to the first question information can be obtained, and a first retrieval path and a second retrieval path can be executed based on the first question vector. The first retrieval path is used to determine candidate files obtained based on historical interactions based on the similarity between the first question information and historical questions; the second retrieval path is used to determine candidate files obtained by direct retrieval based on the current question based on the similarity between the first question information and files or file fragments in the knowledge base.
[0122] In the first search path, the similarity between the first question vector and the corresponding historical question vectors of multiple historical questions can be calculated. Based on the similarity calculation results, one or more target historical questions that meet the similarity criteria can be determined from the multiple historical questions. For example, cosine similarity can be used for similarity calculation. Since each historical question has already established an association with the corresponding file in the knowledge base, the file or file fragment associated with the target historical question can be further determined based on the association between the target historical question and the file, and this file can be used as the first candidate file.
[0123] Compared to directly matching the current problem with a long document fragment, matching the current problem with semantically similar historical problems usually results in a more focused semantic representation. When using dense vector representations of text, the semantic information corresponding to different words in the text collectively contributes to the formation of the overall vector representation. When a document fragment includes content related to the current problem as well as other background, explanatory, or thematic content, this other content also participates in the formation of the overall vector representation of the document fragment. This weakens the representation of semantic features directly related to the current problem in the overall semantic representation of the document fragment. Longer document fragments may form comprehensive vector representations containing multiple semantic themes, thereby reducing the matching degree between the vector of that document fragment and the more semantically focused vector of the first problem.
[0124] Both historical questions and the first question can be relatively short question texts. When historical questions and the first question express the same or similar query needs, they usually have a high degree of overlap in keywords, key entities, or other substantial semantic content, and are less affected by text content unrelated to the query needs. Therefore, the corresponding vector representation can more centrally represent the corresponding query needs. For example, two semantically similar questions can have a high degree of overlap in their word sets, while the first question and a longer document fragment may have a relatively low degree of overlap in their word sets because the document fragment includes a large amount of other text content not included in the first question. By first performing question-level semantic matching between the first question and historical questions, and then determining the corresponding document based on the established association between the matched historical questions and the document, the relatively concentrated semantic features between the question texts can be utilized to reduce the dilution effect of other content in the document fragment on the relevant semantic features.
[0125] In the second retrieval path, the first question vector can be directly compared with the vectors corresponding to multiple files or file fragments in the knowledge base to calculate similarity. Based on the similarity calculation results, one or more second candidate files that meet the similarity criteria are determined. The second retrieval path can employ a knowledge base retrieval method based on vector similarity. For example, the correlation between the first question vector and the vectors of each file fragment can be determined based on cosine similarity. Therefore, even if a file has not previously been associated with a historical question, as long as the content of the file itself has a high semantic relevance to the current first question information, it can still be recalled through the second retrieval path.
[0126] Furthermore, the first candidate file obtained through the first search path and the second candidate file obtained through the second search path can be merged, and duplicate files or file fragments can be removed. For example, results corresponding to the same file or the same file fragment in the two search results can be identified based on file identifiers or file fragment identifiers, and duplicate results can be merged into one candidate result.
[0127] For candidate files obtained through the first retrieval path based on the target historical question mapping, the file similarity between the first question information and the candidate file, and the question similarity between the first question information and the corresponding target historical question, can be obtained respectively. The fusion score corresponding to the candidate file is then determined based on the file similarity and the question similarity. In one implementation, the larger value between the file similarity and the question similarity can be determined as the fusion score corresponding to the candidate file.
[0128] For candidate files obtained directly through the second search path without being based on the target historical question mapping, the file similarity between the first question information and the candidate file can be used as the score for that candidate file. For the same file, the ranking criteria can be determined by both the direct semantic relevance between the file's own content and the current question, and the semantic relevance between the current question and historical questions formed during the user's historical interactions.
[0129] After obtaining the scores for each candidate file, the fused candidate files or candidate file fragments can be sorted from high to low scores, and the sorting results can be truncated according to a preset number to obtain target files or target file fragments for subsequent prompt word construction.
[0130] Furthermore, a limit can be set for the number of candidate files or file fragments obtained from different retrieval paths, and a total limit can be set for the number of candidate results after fusion. For example, a first preset number can be set for the first candidate files obtained based on historical question mapping, and a second preset number can be set for the candidate file set formed after fusion of the two retrieval results. The second preset number can be greater than the first preset number. In one example, the first preset number can be 10, and the second preset number can be 50. The specific numbers mentioned above can be adjusted according to the context length that the target model can handle, the retrieval resource consumption, or the actual application requirements.
[0131] By employing the two retrieval methods described above, on the one hand, question-level similarity matching between the first question information and historical questions can be used to identify relevant files that the user has previously interacted with, utilizing shorter and more semantically focused question texts. This reduces the dilution effect of other text content in long file fragments on relevant semantic features. On the other hand, direct similarity retrieval between the first question information and knowledge base files can recall files that are directly related to the current question but have not yet formed a historical association. By fusing, deduplicating, and uniformly ranking the two recall results, the personalized association information formed by historical interactions and the direct semantic relevance between the current question and knowledge base content can be utilized simultaneously, improving the coverage of candidate file recall and its relevance to the current query requirements.
[0132] Furthermore, the aforementioned fusion score can also be used to determine the position of each target file or target file fragment in the prompt word information. Specifically, candidate files or candidate file fragments can be arranged in descending order of fusion score, and prompt word information can be constructed according to the order of system prompt information, first question information, and the sorted candidate files or candidate file fragments. Files obtained from historical question mapping and having a higher fusion score can thus be arranged in a position relatively close to the first question information.
[0133] When the target model employs rotational positional encoding, this encoding allows attention calculation to reflect the relative positional relationships between terms. When the term distance between the source content and the first question information varies, the attention relationship formed between them during the target model's inference process may differ. Therefore, arranging files or file fragments with higher fusion scores in positions relatively close to the first question information can leverage their relative positional relationships to strengthen the target model's focus on highly relevant source content.
[0134] For files obtained based on historical question mapping, their fusion score can simultaneously reflect the relevance between the first question information and the file itself, as well as the question-level relevance between the first question information and the corresponding historical questions. When historical questions and current questions have high similarity, the corresponding historical interaction files can obtain a relatively high ranking position based on the fusion score. This allows personalized association information formed by the user's previous actual interactions to not only participate in file retrieval and ranking, but also further participate in the inference process of the target model through the relative position in the prompt word information.
[0135] Figure 2 A flowchart illustrating the process of determining a target problem according to an embodiment of the present disclosure is shown schematically.
[0136] like Figure 2 As shown, based on the aforementioned embodiments, operation S120 may include operations S610 to S620.
[0137] In operation S610, the first question information is rewritten to obtain at least one rewritten question information. The rewritten question information is semantically related to at least part of the first question information, and the semantic scope of the rewritten question information is no greater than that of the first question information. Question rewriting can be understood as adjusting the expression or semantic scope of the first question information without departing from its original query semantics, to obtain question information that can represent at least part of the query requirements of the first question information from another expression perspective. The rewritten question information may have the same semantic scope as the first question information, or it may correspond to only a part of the semantic scope of the first question information.
[0138] The semantic scope of rewritten question information is no greater than that of the semantic scope of the first question information. This can be understood as rewriting the question information not introducing new query directions beyond the original query requirements relative to the first question information. Rewriting the question information can maintain the original query scope of the first question information, only using different language expressions; or it can refine some of the query content within the original semantic scope of the first question information, making the query scope corresponding to the rewritten question information smaller than the query scope corresponding to the first question information.
[0139] Specifically, language generation models can be used to rewrite the first question information, generating one or more rewritten question information entries. Different rewritten question information entries can describe the query requirements corresponding to the first question information from different perspectives, so that questions with the same or similar semantics are not limited to a single linguistic expression.
[0140] In one scenario, the wording of the question can be modified while maintaining the basic semantic scope of the query, so that the rewritten question information expresses the same or essentially the same query requirement as the original question information. This can reduce the impact of different users' expression habits or different language organization methods on subsequent semantic matching.
[0141] In another scenario, some of the query content can be further clarified within the semantic scope of the first question information, so that the obtained rewritten question information corresponds to a more specific query direction within the first question information. In this case, the rewritten question information still originates from the query requirements already expressed in the first question information, without adding new query content outside of the first question information.
[0142] When the first problem information can form multiple rewriting directions, multiple rewritten problem information can be obtained. Each rewritten problem information retains at least part of the semantics of the first problem information, so that subsequent historical problem matching can be processed from the original expression of the first problem information and one or more rewritten expressions.
[0143] In operation S620, the target question is determined by performing similarity matching between the first question information and the rewritten question information and each historical question. Referring to the aforementioned description of similarity matching, in this embodiment, the question information participating in similarity matching includes not only the first question information but also at least one rewritten question information obtained through question rewriting. That is, when determining the target question, the rewritten question information is not used to replace the first question information; instead, both the first question information and the rewritten question information participate in semantic matching with historical questions.
[0144] Specifically, the similarity between the first question information and each historical question, as well as the similarity between each rewritten question information and each historical question, can be determined separately. The target question that matches the current query requirement can then be determined by combining the obtained matching results.
[0145] In one implementation, the first problem information, each rewritten problem information, and the problem vector corresponding to each historical problem can be obtained respectively. The similarity between the problem vector corresponding to the first problem information and the problem vector corresponding to each historical problem, as well as the similarity between the problem vector corresponding to each rewritten problem information and the problem vector corresponding to each historical problem, can be calculated respectively. Then, the target problem is determined based on the similarity matching results.
[0146] Since the first question information retains the question expression currently entered by the user, while the rewritten question information represents all or part of the semantics of the first question information from other expression perspectives, when the two participate together in historical question matching, the degree of correlation between the current question and the historical question can be determined from multiple semantic expression perspectives.
[0147] For example, the first question entered by the user is "What should I do when the terminal device fails to connect to the wireless network?" After rewriting this first question, multiple rewritten question messages can be obtained, including: "How to handle the problem of the terminal device being unable to connect to the wireless network normally", "How to handle when the terminal device fails to connect to the wireless network", and "How to handle when the terminal device cannot communicate normally after connecting to the wireless network". Among them, the first two rewritten question messages use different word expressions to describe the same or basically the same query requirements as the first question message; the third rewritten question message further clarifies one of the abnormal situations covered by "failed to connect to the wireless network" in the first question message, and its semantic scope is smaller than that of the first question message, but it is still within the original query semantic scope of the first question message.
[0148] If historical questions include phrases like "What to do if a device cannot connect to the wireless network" and "How to handle a device that connects to the wireless network but cannot communicate normally," then the first question information and the aforementioned rewritten question information can be matched with each historical question based on their similarity. Since the first question information and the different rewritten question information represent the current query requirement from different perspectives, the matching results can be combined to determine the target question that matches the current query requirement from multiple historical questions.
[0149] According to embodiments of this disclosure, by rewriting the first question information, one or more other question expressions can be formed to represent the current query requirement without expanding the original semantic scope of the current question. Multiple rewritten question information can describe the same query requirement from different perspectives, or they can correspond to different refined query directions within the semantic scope of the first question information, thereby increasing the number of question expressions available for semantic matching between the current query requirement and historical questions.
[0150] Furthermore, by having the initial question information and multiple rewritten question information entries participate in similarity matching with historical questions, the difficulty in identifying semantic connections between current and historical questions due to their different wording can be reduced. Simultaneously, the initial question information itself remains the matching basis and is not replaced by the rewritten question information. Therefore, when the rewriting results change during different question processing stages, the query semantics corresponding to the user's original question can still be retained for matching. This reduces the fluctuations in historical question matching caused by relying solely on real-time question rewriting results, making it easier for semantically similar questions to match related historical questions that have already been responded to.
[0151] Figure 3 The flowchart illustrating the process of determining rewrite problem information according to an embodiment of the present disclosure is shown.
[0152] like Figure 3As shown, based on the aforementioned embodiments, operation S610 may include operations S710 to S720.
[0153] In operation S710, the intent and keywords of the first question information are determined. The intent can be understood as the query purpose or processing requirement expressed by the first question information, representing the direction of information the user hopes to obtain through the current question. Keywords can be words in the first question information that can represent the query topic, query object, or query content. Compared to other words in the first question information, keywords can carry semantic information that is highly relevant to the current query requirement. Specifically, semantic analysis can be performed on the first question information to determine the intent that can represent the current query purpose, and one or more keywords that can represent the current query content can be extracted.
[0154] Intent and keywords can represent the information of the first question from different perspectives. Intent focuses on representing the overall direction of the query, while keywords focus on representing the main semantic elements within that query. By combining intent and keywords, the main semantic meaning of the first question can be preserved during the question rewriting process, rather than generating rewritten results solely based on the surface textual form of the question.
[0155] In operation S720, based on each keyword, at least one rewritten question message is determined. This rewritten question message is associated with the intent and includes at least one keyword. It also includes a weight marker used to increase the semantic weight of the keyword during similarity matching. The weight marker can be associated with the keyword and indicates how much influence the keyword will have in subsequent semantic representation or similarity matching. The weight marker can be directly set on the keyword or a corresponding relationship can be established with the keyword, as long as the subsequent processing can identify the keyword whose semantic weight needs to be increased based on the weight marker.
[0156] Improving the semantic weight of keywords can be understood as making keywords have a higher influence on forming the semantic representation of the question or performing similarity matching, relative to other content in the rewritten question information. This makes it easier for historical questions containing the same or related keywords to reflect the query semantics carried by the corresponding keywords during the semantic matching process.
[0157] When generating multiple rewritten query messages, each message can include different keywords, or they can collectively include one or more keywords that are highly representative of the current query. Each rewritten query message can use different language expressions, but all should be related to the intent corresponding to the first query message, thus preventing the query rewriting from deviating from the user's original query direction.
[0158] Furthermore, weight tags can be set for one or more keywords included in the rewrite question information. For example, keywords can be marked with asterisks, parentheses, or other tags that can be recognized by subsequent processing. The keyword weight increase indicated by the weight tags can be implemented at different processing stages.
[0159] In one implementation, keyword weighting can be implemented during the generation of the semantic representation corresponding to the rewritten question information. Specifically, when inputting the rewritten question information into a text embedding model to obtain the corresponding question vector, corresponding weight labels can be identified, and the semantic information corresponding to the labeled keywords can be weighted so that the contribution of the labeled keywords to the overall semantic representation of the rewritten question information is higher than that of other unlabeled content, thereby obtaining a question vector that can strengthen the semantic features of the corresponding keywords.
[0160] In another implementation, keyword weighting can be implemented during the similarity matching process. Specifically, a corresponding question vector can be obtained first based on the rewritten question information. When performing similarity matching between this question vector and the question vectors corresponding to historical questions, keywords that need to have their weight increased are identified based on weight labels, and the contribution of matching information related to these keywords to the final matching result is increased. For example, the vector similarity obtained based on the question vector can be fused with the keyword relevance score obtained based on keyword matching, and the weight of the keyword relevance score corresponding to the labeled keyword can be increased; the keyword relevance score can be obtained, for example, using term relevance calculation methods such as BM25.
[0161] The aforementioned methods of weighting keywords during semantic representation generation and similarity matching can be used separately or in combination to enhance the influence of the main query semantics carried by the keywords on the historical question matching results.
[0162] Weighting does not alter the semantic meaning of the keywords themselves, but rather indicates the degree to which the corresponding keywords will increase their influence in subsequent semantic processing. When weighting is applied during the semantic representation generation stage, it can increase the contribution of keywords to the overall semantic representation of the rewritten question information. When weighting is applied during the similarity matching stage, it can increase the contribution of matching information related to the keyword to the final similarity matching result. Therefore, keywords relevant to the main semantic meaning of the current query can have a higher impact on the matching results under different implementation methods, reducing the weakening of the main query semantics by other auxiliary expressions in the rewritten question information.
[0163] For example, if the first question a user enters is "What should I do when my terminal device is experiencing a connection problem with the wireless network?", it can be determined that the user's intention is to find out how to handle a wireless network connection problem, and keywords such as "terminal device," "wireless network," and "connection problem" can be identified from the first question.
[0164] Based on this intent and the aforementioned keywords, multiple rewritten question messages can be generated. For example, rewritten question messages such as "How to handle the terminal device's [wireless network] connection error", "How to handle when the terminal device cannot connect to the [wireless network] normally", and "How to handle when the [terminal device] experiences a [wireless network connection error]" can be generated. Each rewritten question message revolves around the handling requirements of wireless network connection errors and includes at least one keyword determined from the first question message.
[0165] For example, in one implementation, when forming the semantic representation corresponding to each rewritten question, keywords such as "wireless network" marked in parentheses can be identified, and the semantic weight of the corresponding keywords can be increased, making the influence of this word in the overall semantic representation of the rewritten question information higher than its unweighted influence. In another implementation, the question vector corresponding to the rewritten question information can be obtained in a conventional way, and when matching the question vector with historical questions for similarity, the contribution of the keyword matching information corresponding to "wireless network" to the final matching result can be increased based on the parentheses marking. For example, the similarity between question vectors can be fused with the keyword relevance scores corresponding to keywords such as "wireless network". Thus, regardless of which weighting method is used, the semantic content related to the marked keywords in historical questions can have a higher influence on the matching results.
[0166] Parentheses can serve as weight markers. When forming the semantic representation of each rewritten question, keywords marked with parentheses can be identified, and their corresponding semantic weights can be increased. For example, after weighting "wireless network," the influence of this word in the overall semantic representation of the rewritten question can be higher than its unweighted influence. Subsequently, when performing similarity matching between the rewritten question and previous questions, the semantic content related to the marked keywords such as "wireless network" in the previous questions can have a higher impact on the matching results.
[0167] According to embodiments of this disclosure, by determining the intent and keywords of the first question information before question rewriting, and ensuring that the rewritten question information is associated with the intent and includes at least one keyword, question rewriting can be performed around the main query semantics in the first question information, reducing the possibility that the rewritten question deviates from the user's original query direction.
[0168] Furthermore, by assigning weights to keywords in the rewritten question information and increasing the semantic weight of these keywords in subsequent semantic representation or similarity matching, the influence of semantic information representing the main content of the current query on the matching results can be enhanced. In this way, even if the rewritten question information includes other content to improve the language expression, the core query semantics carried by the keywords can still be largely reflected when matching with historical questions. This increases the likelihood of semantically similar current questions being identified as matches with related historical questions and reduces the impact of expression differences during question rewriting on the matching results of historical questions.
[0169] Based on the foregoing embodiments, the response information includes at least one source identifier, which is used to indicate the target file. Referring to the aforementioned description of historical source identifiers, the source identifier in this embodiment corresponds to the response process of the current first question information and is used to indicate the target file that provides the source content for generating the current response information. When the response information includes source content provided by multiple target files, multiple source identifiers corresponding to different target files can be set respectively, so that different source identifiers point to their respective target files.
[0170] The source identifier can be associated with the location in the response information that references the corresponding target file, allowing users to identify the source of the response content based on the source identifier. The specific form of the source identifier is not limited; it can be a number, character, graphic, or other identifier that can distinguish and indicate the corresponding target file.
[0171] Specifically, when the target model generates inference results based on the first problem information and at least one target file, and further generates response information, corresponding source identifiers can be set in the response information according to the target file on which the response information is based. One source identifier can indicate one target file; when the response information references source content provided by multiple target files, multiple source identifiers can be set, and an indication relationship between each source identifier and its corresponding target file can be established.
[0172] The processing method may also include operating S810.
[0173] In operation S810, in response to the user performing a trigger operation on a target source identifier among at least one source identifier, the first problem information and / or rewritten problem information are associated with the target file. The target source identifier can be the source identifier whose trigger operation was performed by the user among at least one source identifier included in the current response information, and the target file indicated by it can be the file corresponding to this user interaction.
[0174] Associating the first issue information and / or rewrite issue information with the target file can include establishing an association between the first issue information and the target file, establishing an association between the rewrite issue information and the target file, or simultaneously establishing associations between the first issue information and the rewrite issue information and the target file. If multiple rewrite issue information entries exist, one or more of the rewrite issue information entries can be associated with the target file.
[0175] After outputting the response information for the first question, the system can receive the user's triggered operation based on the source identifier and determine the target file indicated by the triggered target source identifier. After confirming that the user has actually interacted with the target source identifier, the system can associate the current first question with the target file, thus establishing a correspondence between the question entered by the user and the target file involved in the user's interaction.
[0176] In the aforementioned embodiments where the first problem information has already been rewritten, the corresponding rewritten problem information can also be associated with the target file. Thus, the same target file can be associated with the first problem information actually input by the user, or with one or more rewritten problem information obtained based on the first problem information.
[0177] The initial problem information and the rewrite problem information do not necessarily need to be associated with the target file simultaneously. In one scenario, an association can be established between the initial problem information and the target file; in another scenario, an association can be established between the rewrite problem information and the target file; or, simultaneously, associations can be established between both the initial problem information and the rewrite problem information and the target file.
[0178] When determining whether to establish the aforementioned association, the user's interactions with the target file can be further considered. Referring to the aforementioned explanation of browsing duration, when a user triggers the target source identifier and presents the corresponding target file, the user's browsing duration for the target file can be recorded. When the browsing duration meets the corresponding duration condition, an association between the first issue information and / or the rewritten issue information and the target file can be established accordingly; if the browsing duration does not meet the corresponding condition, an association can be temporarily not established based on this browsing behavior.
[0179] In addition to browsing behavior, other interactive behaviors that demonstrate a user's active selection of relevant content can also be used to determine whether to establish an association. For example, after a target file is presented, a user can save the target file or related content to their favorites. In response to detecting this save action, an association can be established between the first issue information and / or the rewritten issue information and the target file corresponding to the saved content.
[0180] The user behavior upon which the association is based can be implemented in different ways. The association can be established directly in response to a user's triggered action on a target source identifier; it can also be established based on triggering the target source identifier, combined with the user's continuous browsing of the target file; or it can be established based on the user's proactive selection behavior such as adding the target file to their favorites. For multiple interactive behaviors that indicate a user's actual interest in the corresponding target file, at least one of these can be combined as the basis for establishing the association.
[0181] The established relationships can serve as new historical interaction relationships formed during the current problem-solving process. For the same target file, a set of historical problems associated with that target file can be maintained, and the number of historical problems in the set can be limited.
[0182] Specifically, a preset upper limit for the number of historical issues can be set for each target file. When the number of historical issues currently associated with a target file does not reach the preset upper limit, the current first issue information and / or rewritten issue information can be added as new historical issues to the historical issue set corresponding to the target file, provided that the aforementioned association conditions are met. When adding new historical issues would cause the number of historical issues in the historical issue set to exceed the preset upper limit, historical issues to be removed can be identified from the historical issues already associated with the target file, and the association between the historical issues to be removed and the target file can be terminated or updated, so that the number of historical issues associated with the target file remains within the preset upper limit.
[0183] For example, the preset maximum quantity can be set to 10. The specific value of the preset maximum quantity can be set according to the storage resources of historical association information and the number of historical issues that need to be processed in the subsequent issue matching process.
[0184] Therefore, a target file can be associated with multiple related issues generated at different times as the user continues to use it, and an issue can also be associated with one or more target files based on the user's interaction with different target files. After the first issue is responded to, it can be used as a historical issue in subsequent processing, and the association between the currently generated issue and the target file can also be used as the file association relationship corresponding to the historical issue.
[0185] The association between the problem and the target file established in this study can be saved using different data storage formats.
[0186] In one implementation, when using the aforementioned first and second knowledge base structures, the association information between the question and the target file generated during the current response process is information formed during user interaction and can be stored as an independent association record in the second knowledge base. The association record may include at least one of the following: first question information and / or rewritten question information, a vector representation of the corresponding question, and a file identifier or index information corresponding to the target file, thereby enabling the pointing to the corresponding target file through the file identifier or index information corresponding to the target file.
[0187] In another implementation, the first issue information and / or rewritten issue information can be used as historical issues associated with the target file, and the historical issues and their corresponding vector representations can be saved as additional metadata fields for the target file or the file entry corresponding to a segment of the target file. For example, at least one of the historical issues, historical issue vectors, and information representing the corresponding user clicks, browsing, or favorites can be associated with and saved as a target file entry.
[0188] In subsequent problem handling, the target file associated with the target problem can be determined based on independently saved association records, or it can be determined based on the historical problem metadata saved in the target file entry. These two methods can be used independently or in combination.
[0189] When a user interacts with a reference document in the first knowledge base, the reference document does not automatically become an interactive document; the interaction creates new questions and document association information. The second knowledge base can store this association information formed as the user interacts with the document, thus possessing the aforementioned memory attribute of recording the user's historical interaction information.
[0190] As users continue to ask questions and interact with the source content in the responses, new associations between questions and target files can be continuously formed. To prevent the number of historical questions associated with the same target file from continuously increasing, a rolling elimination system can be implemented for the set of historical questions associated with the target file when the number of historical questions reaches a preset limit.
[0191] One implementation method employs a first-in, first-out (FIFO) strategy. FIFO means determining historical questions to be phased out based on the chronological order in which they are associated with the target file. When the number of historical questions associated with the target file exceeds a preset limit due to new historical questions, the historical questions that were associated with the target file earlier are prioritized for phase-out. These new historical questions then replace the previously phased ones. This ensures that the historical questions associated with the target file are continuously updated with subsequent user interactions, allowing the retained historical questions to better correspond to more recent query needs.
[0192] In another implementation, a strategy of prioritizing the elimination of historical questions with a larger number of neighboring questions can be adopted. Specifically, the number of neighboring questions corresponding to each historical question associated with the target file can be obtained. When the number of historical questions exceeds a preset limit due to the addition of new historical questions, historical questions with a larger number of neighboring questions are prioritized for elimination. A large number of neighboring questions indicates that there are already many semantically similar questions near the corresponding historical question, and the query semantics corresponding to the historical question have a relatively high degree of repetition. After removing the historical question, the corresponding or similar query requirements can still be represented by other semantically similar historical questions. Prioritizing the elimination of historical questions with a larger number of neighboring questions reduces semantic redundancy in the historical question set and reserves association capacity for historical questions representing other query requirements.
[0193] The aforementioned first-in-first-out (FIFO) strategy and the strategy of prioritizing the elimination of issues with a larger number of neighboring issues can be adopted according to actual application needs. When the number of historical issues associated with the target file has not reached the preset limit, new historical issues can continue to be added; when the preset limit is reached, the set of historical issues can be updated through a corresponding rolling elimination strategy to keep the number of historical issues associated with the target file within a preset range.
[0194] Once the first issue information has been responded to, it can become a historical issue in subsequent processing. The information saved in this first issue information and / or the association information between the rewritten issue information and the target file can also be used as a corresponding historical interaction record to continue participating in subsequent issue matching and file determination processes.
[0195] For example, the user inputs the first problem message, "How to handle the problem of the terminal device being unable to connect to the wireless network normally," and receives multiple rewritten problem messages, such as "How to handle when the terminal device fails to connect to the wireless network" and "How to handle when the device cannot access the wireless network normally." The response information generated for the first problem message references the source content in target file A and target file B. Therefore, the response information is set with source identifiers to indicate target file A and target file B, respectively.
[0196] In one scenario, the user clicks on the source identifier indicating target file A and then enters target file A to view it. If the method of directly establishing an association after triggering the source identifier is adopted, an association can be established between the first issue information and target file A, and one or more associations can also be established between rewrite issue information and target file A.
[0197] In another scenario, after a user accesses target file A, the duration of their browsing of target file A can be further recorded. If the browsing duration meets the corresponding time requirement, an association between the first issue information and / or the rewritten issue information and target file A is established. Even if a user clicks on the source identifier corresponding to target file B, but only briefly views target file B, and the browsing duration does not meet the corresponding time requirement, an association between the issue and target file B may not be established based on this brief browsing.
[0198] In another scenario, after accessing target file A, the user further performs a bookmarking operation on target file A. In response to this bookmarking operation, an association can be established between the first issue information and / or the rewritten issue information and target file A.
[0199] After establishing the association, you can save the first issue information, the corresponding rewritten issue information, the file identifier corresponding to target file A, and the association information used to represent the correspondence between the two. You can also save click, browsing, or favorite information corresponding to this association, depending on the actual association determination method used.
[0200] If the aforementioned structure of the first and second knowledge bases is adopted, the newly formed association information can be stored in the second knowledge base. When the target file A was originally a reference file in the first knowledge base, the target file A remains in the first knowledge base, and the file identifier pointing to the target file A and the corresponding question association information can be saved in the second knowledge base; when the target file A itself is an interactive file in the second knowledge base, the target file A and the association information between it and the first question information and / or the rewritten question information can be saved in the second knowledge base.
[0201] In another scenario, a file-entry-based storage method can be used to preserve the aforementioned associations. For example, after a user performs a corresponding interaction on target file A and meets the conditions for establishing an association, the first question information, one or more rewritten question information obtained based on the first question information, and their corresponding vector representations can be saved as additional metadata fields of the file entry corresponding to target file A. With the completion of the response to the first question information, the first question information and / or the corresponding rewritten question information can be used as historical questions in subsequent question processing. When the user subsequently raises a new first question information, the vector representation corresponding to the new first question information can be matched with the vector representations of historical questions saved in the file entry of target file A for similarity. If the corresponding matching conditions are met, target file A can be determined based on the matching historical questions.
[0202] Once the first question has been addressed, it can be treated as a historical question in subsequent processing. When a user raises a semantically similar question later, semantic matching can be performed based on the saved question information, and the target file A can be determined using the association information stored in the second knowledge base.
[0203] According to embodiments of this disclosure, by establishing an association between the first issue information and / or rewritten issue information and the corresponding target file based on the user's actual interaction with the source identifier in the current response information, and saving the resulting association information, the user behavior generated during the current issue processing can be transformed into historical interaction information that can be used for subsequent issue processing. As the user continues to query issues and interact with source content, the current issue can form a new historical issue after the response is completed, and the corresponding association can continue to be retained and used by subsequent semantically similar issues. This allows files that the user has actually clicked, continuously browsed, or collected to participate in subsequent file retrieval again through historical interaction relationships, thereby enabling historical user behavior feedback to continuously affect the subsequent information retrieval process.
[0204] Furthermore, by setting a preset upper limit on the number of historical issues associated with a single target file, and adopting a rolling elimination mechanism when the preset upper limit is reached, the number of historical issues corresponding to a single target file can be prevented from accumulating continuously as users continue to use the system. This limits the storage resources occupied by historical association information and reduces the number of historical issues that need to be matched when matching new first issue information with historical issues, thereby improving the processing efficiency of historical association information maintenance and historical issue matching.
[0205] Figure 4 Another flowchart illustrating the process of determining a target problem according to an embodiment of the present disclosure is shown.
[0206] like Figure 4 As shown, based on the aforementioned embodiments, operation S120 may include operations S910 to S930.
[0207] In operation S910, the number of keywords contained in the first question information is determined. Referring to the aforementioned explanation of keywords, keywords can be words in the first question information used to represent the main query content. The number of keywords can be the total number of different keywords identified from the first question information, used to represent the number of main semantic elements in the first question information that can participate in semantic matching. Specifically, keywords can be extracted from the first question information, and the number of extracted keywords can be counted. Different first question information contains different query content, and the corresponding number of keywords determined can also be different.
[0208] In operation S920, a dynamic similarity threshold is determined based on the quantity of keywords in the first question information. The quantity and the dynamic similarity threshold are negatively correlated. The dynamic similarity threshold is a similarity judgment condition dynamically determined based on the number of keywords in the first question information, used to determine whether historical questions match the first question information. The negative correlation between quantity and the dynamic similarity threshold can be understood as follows: as the number of keywords in the first question information increases, the corresponding dynamic similarity threshold decreases; as the number of keywords decreases, the corresponding dynamic similarity threshold increases.
[0209] Specifically, similarity thresholds can be pre-configured for different numbers of keywords. For example, threshold T1 can be used when the number of keywords is zero, threshold T2 when the number of keywords is one, threshold T3 when the number of keywords is two, and threshold T4 when the number of keywords further increases. The order of T1 > T2 > T3 > T4 can be set. Each threshold can be determined after testing and adjustment using pre-built test data.
[0210] As another implementation method parallel to the above, in scenarios that prioritize improving matching relevance, the similarity threshold can be increased as the number of keywords increases, allowing questions containing more keywords to be filtered using stricter similarity conditions. In scenarios that prioritize improving matching accuracy, the dynamic similarity threshold can also be increased as the number of keywords increases, meaning the number of keywords is positively correlated with the dynamic similarity threshold. For example, T1 < T2 < T3 < T4 can be set, allowing the first question information containing more keywords to be filtered using stricter similarity conditions, thereby reducing the number of historical questions with low relevance being identified as target questions. This parallel method, along with the method in this embodiment where the number of keywords is negatively correlated with the dynamic similarity threshold, can be adopted according to different matching requirements.
[0211] In operation S930, the first question information is matched with each historical question for similarity, and the target question with a similarity greater than or equal to the dynamic similarity threshold is determined. The dynamic similarity threshold can be used as a boundary to determine whether the first question information and the historical questions meet the matching conditions. Specifically, referring to the aforementioned similarity matching method, the similarity between the first question information and each historical question is determined, and the dynamic similarity threshold used for this matching is determined based on the number of keywords in the first question information. Then, each similarity is compared with the dynamic similarity threshold.
[0212] For example, suppose thresholds T1, T2, T3, and T4 are configured for the number of keywords, satisfying T1 > T2 > T3 > T4. When the first question is "How to handle connection anomalies," it can be determined that it contains fewer keywords, therefore a relatively high dynamic similarity threshold is used. After matching the first question with the similarity of each historical question, only historical questions with a similarity greater than or equal to the dynamic similarity threshold are identified as the target question.
[0213] When another initial question is "How to handle the situation where a terminal device cannot access the network normally after connecting to the wireless network?", multiple keywords such as "terminal device", "wireless network", "connection", and "access network" can be identified. Since this initial question contains a large number of keywords, a relatively low dynamic similarity threshold can be used. Subsequently, the initial question is matched with each historical question for similarity, and historical questions with a similarity greater than or equal to the dynamic similarity threshold are identified as the target question.
[0214] According to embodiments of this disclosure, by dynamically adjusting the similarity threshold used for matching historical questions based on the number of keywords in the first question information, the matching conditions can change with the semantic information contained in the first question information. Using a relatively high similarity threshold when the number of keywords is small can reduce the number of historical questions with low relevance that are matched as target questions when semantic information is insufficient; using a relatively low similarity threshold when the number of keywords is large can expand the matching range of historical questions and increase the likelihood of recalling relevant historical questions.
[0215] Figure 5 Adaptation illustrates another flowchart of a processing method according to an embodiment of this disclosure.
[0216] Figure 5 The multimodal knowledge base in the text can correspond to the aforementioned knowledge base. Referring to the relevant embodiments of the first and second knowledge bases, the knowledge base may include a first knowledge base for storing pre-configured reference files, and a second knowledge base for storing interactive files and corresponding associated information obtained based on user interaction. The files in the knowledge base may include one or more modalities of information such as text, images, audio, and video.
[0217] In the process of building the knowledge base, files of different modalities can be obtained, and the file content can be converted into vector representations using an embedding model that matches the corresponding modality. Text content can include notes, documents, messages, to-do lists, etc.; image content can include photos, screenshots, etc.; audio and video content can include recordings, videos, screen recordings, etc. For the second knowledge base, interactive files can also be obtained in response to user-triggered operations such as uploading, favorites, and saving. For example, when a user favorites currently displayed content, the user can obtain the corresponding content, as well as the address information and the interface image at the time of favorites, which are then saved as information related to the interactive file.
[0218] For text files, they can be divided into multiple file segments according to the input length supported by the text embedding model, and then the vector representation of each file segment can be obtained. File segments can be divided at the granularity of sentences, paragraphs, etc., or they can be initially divided at the sentence level, and then adjacent content can be merged according to the number of lexical units and semantic integrity, so that the length of the file segment does not exceed the maximum input length that the text embedding model can process.
[0219] Text embedding models can employ semantic representation models based on transformer structures, such as BERT (Bidirectional Encoder Representations from Transformers), Sentence-BERT (Sentence-Bidirectional Encoder Representations from Transformers), or SimCSE (Simple Contrastive Learning of Sentence Embeddings). The specific text embedding model used is not limited.
[0220] For image files, image-text semantic embedding models can be used to convert images into vector representations. For example, CLIP (Contrastive Language-Image Pre-Training) can be used to vectorize image content. When an image contains text, OCR (Optical Character Recognition) can be used to extract the text, and then a text embedding model can be used to obtain the vector representation of the corresponding text. Image description generation models can also be used to generate text describing the image content, and then the vector representation of that descriptive text can be obtained. When an image contains metadata such as shooting time and location, this metadata can be processed as additional information about the image.
[0221] For audio or video files, an audio-video embedding model can be used to obtain the corresponding vector representation. When the audio or video contains text content such as subtitles or transcribed text, ASR (Automatic Speech Recognition) can be used to obtain the text content in the audio or video first, and then a text embedding model can be used to obtain the vector representation of the corresponding text. When the audio or video contains metadata such as shooting time and location, the corresponding metadata can be combined with the vector representation of the audio or video to form a content representation that includes multiple information dimensions.
[0222] For files of different modalities, the corresponding vector representations can be placed in the same semantic space where similarity comparisons can be performed. When the vector representations generated by different embedding models are not in the same semantic space, semantic alignment methods such as contrastive learning and transfer learning can be used to align the vector representations corresponding to different modalities to the same semantic space.
[0223] In addition to the original content of the file and its vector representation, language generation models can be used to generate meta-information such as summaries, hypothetical questions, key entities, and keywords for files or file entries in the knowledge base. The original content, summary, hypothetical questions, key entities, keywords, and their corresponding vector representations are then saved as multi-dimensional information for each file entry. This information can be stored in a vector database to support subsequent semantic similarity-based retrieval.
[0224] Furthermore, when a user triggers an action based on the source identifier in the response information, and establishes an association between the question and the corresponding file, at least one of the user's current input question, the rewritten question obtained for that question, and the vector representation of the corresponding question can be saved as additional metadata for that file entry. Thus, the multidimensional information of a file entry can also include historically associated questions and their vector representations formed based on the user's historical interactions. When a new question is subsequently obtained, a similarity match can be performed between the vector representation of the new question and the vector representations of the aforementioned historically associated questions, and the corresponding file can be determined based on the matching result.
[0225] In other implementations, the correspondence between the aforementioned historical issues, corresponding vector representations, and file identifiers can also form independent association records and be stored in a second knowledge base, so as to determine the file corresponding to the historical issue through the association records.
[0226] like Figure 5 As shown, when a user initiates a new question, the aforementioned first question information can be obtained and preprocessed. Preprocessing may include at least one of question rewriting, key entity extraction, keyword extraction, and question classification. Furthermore, historical questions generated by the user during previous question processing can also be obtained. These historical questions may correspond to the aforementioned historical questions, and at least one of the following can be saved: question vector, keywords, key entities, and association information with corresponding files, for use in the current processing of the first question information.
[0227] One or more key entities and one or more keywords can be extracted from the first question information to determine the corresponding question category. Question categories can be divided according to actual application scenarios, such as learning, work, life, entertainment, schedules, personal information, contacts and call records, messages, and memos. Question category information can be used as supplementary information to participate in subsequent processing.
[0228] Key entities can be obtained through NER (Named Entity Recognition). Keywords can be extracted using language generation models, or based on word frequency, word discrimination, or the relationships between words. Question classification can also be achieved by providing relevant prompts to the language generation model.
[0229] After completing the above preprocessing, the first question information and the question vectors corresponding to each rewritten question information can be obtained. Referring to the aforementioned example of keyword weighting, when the first question information or rewritten question information includes key entities, keywords, or other content that needs to be emphasized in semantic matching, weighting can be set for the corresponding content.
[0230] In one implementation, the weight markers can be identified during the process of obtaining the question vector, and the semantic weights corresponding to the marked content can be increased, so that the marked content has a higher semantic contribution in the question vector corresponding to the first question information or the rewritten question information.
[0231] In another implementation, corresponding question vectors can be obtained based on the first question information or rewritten question information. When subsequently using these question vectors for similarity retrieval or similarity matching, the weight of the matching information corresponding to the tagged content can be increased based on the weighted label. For example, the vector similarity between question vectors can be fused with keyword relevance scores, giving the keyword relevance scores corresponding to the tagged keywords a relatively high weight. These two keyword weighting methods can also be used in combination.
[0232] Then enter Figure 5 The process of "retrieving relevant information" can be performed in the knowledge base by using the question vector corresponding to the first question and the question vectors corresponding to each rewritten question.
[0233] For example, a pre-filtering threshold T0 can be used to calculate the similarity between the first question information and the question vectors corresponding to each rewritten question information, and the files or file fragments in the knowledge base, thus obtaining preliminary search results. Similarity calculations can employ methods that characterize the closeness between vectors, such as cosine similarity, Euclidean distance, and Manhattan distance. By having the first question information and multiple rewritten question information participate in the search separately, candidate files or file fragments can be obtained from different question expression perspectives.
[0234] For candidate content in different modalities such as text, images, and audio / video, appropriate filtering methods can be used.
[0235] For candidate document fragments in text format, different filtering thresholds can be set by combining relevance scores with the number of keywords and key entities contained in the fragment. For example, as the number of keywords or key entities contained in the fragment increases sequentially, thresholds T1, T2, T3, and T4 can be used respectively. To increase the number of recalled content, the threshold can be set to T1 > T2 > T3 > T4, meaning the more relevant keywords or key entities the fragment contains, the lower the filtering threshold should be. Each threshold can be determined through debugging using pre-built test data.
[0236] In implementations that focus more on relevance, an opposite threshold change relationship can be used, where the filtering threshold increases as the number of keywords or key entities contained in the file fragment increases. In this embodiment, where the target model is subsequently used to further determine the relevance of the source content, the former threshold setting method can be used to prioritize retaining more potentially relevant candidate file fragments.
[0237] In addition to the above filtering, a relevance ranking model can be used to reorder candidate file fragments based on the first question information, so as to further adjust the relevance order between the candidate file fragments and the current query requirements.
[0238] For images, filtering can be performed based on key entities and keywords contained in the first question information. When images contain metadata such as shooting time and location, further matching can be performed by combining the time and location information from the first question information. The corresponding filtering threshold for images can be determined through debugging using pre-built test data.
[0239] For audio and video content, filtering can also be based on key entities and keywords in the first question information; when audio and video contain metadata such as shooting time and location, further filtering can be performed based on the corresponding time or location information in the first question information. The filtering thresholds for audio and video can also be determined through test data debugging.
[0240] After the above retrieval and filtering, the candidate content can be sorted according to relevance, and the top M files or file fragments can be selected as target files or target file fragments. The value of M can be determined based on the context length that the target model can process, so that the amount of information input to the target model is compatible with the model's processing capabilities. For cases where target files have already been recalled based on the correlation between historical questions and target files, the aforementioned target file fragment example can be used to further determine target file fragments that match the information of the first question within the target file.
[0241] After selecting target files or target file fragments according to their relevance, the relevance ranking relationship between the target files or target file fragments can be retained, and the corresponding source content can be added to the prompt word information in descending order of relevance. Therefore, the relevance ranking of target files or target file fragments can not only be used to filter the top M source content from candidate content, but also to determine the order of the selected source content within the prompt word information.
[0242] After identifying the target file or target file fragment, you can proceed to... Figure 5The process of "generating prompt words based on search results" involves: Specifically, selected target files or file fragments can be numbered, and the corresponding source content can be organized with the first question information to form prompt word information for input into the target model. This prompt word information guides the target model to focus on key information within the target file or file fragment and generates inference results based on the query requirements corresponding to the first question information.
[0243] Then you can enter Figure 5 The process involves "filtering relevant content and generating answers based on prompt words." When the target model infers based on prompt word information, it can further determine the relevance between each target file fragment and the information of the first question, filter file fragments with a low degree of relevance to the current question, and use the retained relevant source content to generate inference results and corresponding response information.
[0244] The prompt message can also require the target model to retain the corresponding source relationships when generating the response information. For example, target file fragments involved in response generation can be assigned numbers such as "Content 1" and "Content 2," and source identifiers can be set at the locations in the response information that reference the corresponding source content. Source identifiers can use a distinctive numbering format, such as a blue underline, allowing users to identify the source file corresponding to the response content. After a user performs a trigger action based on the source identifier, they can jump to or be presented with the corresponding target file or target file fragment to view the source content used in generating the current response information.
[0245] like Figure 5 As shown, after the response information is output, the system can also record the user's triggering operations on the source identifier and target file, and update the knowledge base accordingly.
[0246] Referring to the aforementioned association implementation, user clicks on source identifiers and browsing durations of corresponding target files can be recorded. When a user triggers a source identifier and browses the indicated target file or target file fragment, and the browsing duration meets the target duration condition, the initial issue information and corresponding rewritten issue information can be used as historical issues for subsequent queries after the response is completed, and an association can be established with the target file actually browsed by the user.
[0247] Specifically, the system can save the first issue information, the information for each rewritten issue, and the corresponding issue vectors, and associate this issue information with the target file actually triggered by the user. Furthermore, the issue vector corresponding to the first issue information can be used as additional information, forming a historical query record together with the target file actually interacted with by the user.
[0248] When users perform active actions such as adding a file to their favorites, these actions can also serve as the basis for establishing or strengthening the association between the question and the target file. Referring to the aforementioned embodiments of the first and second knowledge bases, the question-file association information formed by user interaction can be stored in the second knowledge base; the target file itself can still be stored in either the first or second knowledge base according to its original acquisition method.
[0249] As users continue to use the service, when new first-question information is obtained again, the new question vector can be matched with the question vectors corresponding to the saved historical questions based on similarity. When the new first-question information has a high semantic similarity to a certain historical question, the system can prioritize recalling target files that the user has previously clicked, continuously browsed, or bookmarked for similar questions, based on the established association between the historical question and the target file. This can also improve the ranking position of the corresponding target file in the current search results.
[0250] Since historical questions and their corresponding rewrite questions are usually short texts formed around specific query requirements, their question vectors can relatively centrally represent the corresponding query requirements. When the target file or a fragment of the target file itself contains multiple topics or a lot of text content that is not directly related to the current query, the overall vector corresponding to the target file may be affected by the aforementioned other content, which will relatively reduce the direct vector similarity between the current question and the target file.
[0251] thus, Figure 5 A feedback relationship is established between "recording user-triggered actions and updating the knowledge base" and the "multimodal knowledge base." As users continue to ask questions and interact with the responses, new historical questions and their associations with target files can be continuously added. When semantically similar questions reappear, the existing historical interaction records can be directly used for file retrieval, rather than relying entirely on the rewritten question information generated in real time during the current question processing. This reduces the fluctuations in file retrieval results caused by differences in rewriting results between different questions, allowing relevant files that users have previously interacted with to participate more stably in the response generation for subsequent similar questions.
[0252] Figure 6 A block diagram of an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure, is illustrated schematically. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0253] like Figure 6As shown, an electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0254] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1002 and / or RAM 1003. It should be noted that the programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0255] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the input / output (I / O) interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output (I / O) interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0256] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0257] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0258] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0259] For example, according to embodiments of this disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.
[0260] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the processing methods provided in the embodiments of this disclosure.
[0261] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0262] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices or magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via communication section 1009, and / or installed from removable medium 1011. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof. According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to user computing devices via any type of network, including local area networks (LANs) or wide area networks (WANs), or they can be connected to external computing devices (e.g., via the Internet using an Internet service provider).
[0263] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0264] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A processing method, comprising: Obtain the first problem information, which represents the problem to be addressed; Based on the first question information, a similarity match is performed between the first question information and each of the at least one historical question to determine a target question that matches the first question information, wherein each of the historical questions is associated with at least one file in a knowledge base; Retrieve at least one target file associated with the target problem from the knowledge base; Based on the first question information and the at least one target file, prompt word information is constructed for input to the target model, so that the target model generates inference results based on the first question information and the at least one target file; The reasoning result is obtained; Based on the reasoning results, generate and output response information for the first question information; Wherein, the historical question is a question that has been responded to before the first question information is obtained; the historical response information corresponding to the historical question includes at least one historical source identifier, each of the historical source identifiers is used to indicate the source file that provides the source content for generating the historical response information; at least one file associated with each historical question includes: a source file that establishes an association with the historical question in response to a user performing a trigger operation on a target historical source identifier in at least one of the historical source identifiers.
2. The method according to claim 1, wherein at least one file associated with each of the historical issues comprises: The target source file indicated by the target historical source identifier is presented in response to a user performing a trigger operation on a target historical source identifier among at least one of the historical source identifiers.
3. The method according to claim 2, wherein the process of establishing an association between the source document and the historical issue includes: In response to a user's browsing time for the target source file being greater than or equal to the target duration, an association is established between the target source file and the historical issue.
4. The method according to claim 1, wherein the knowledge base includes a first knowledge base and a second knowledge base; the first knowledge base is used to store pre-configured reference files, and the second knowledge base is used to store interactive files obtained based on user interaction; the target source file includes interactive files stored in the second knowledge base, and the association information between the target source file and the historical question is stored in the second knowledge base.
5. The method according to claim 1, wherein the target file comprises multiple file fragments; the method further comprises: Based on the first problem information, at least one target file segment that matches the first problem information is determined from the plurality of file segments; The step of constructing prompt word information for input to the target model based on the first question information and the at least one target file includes: The prompt word information is constructed based on the first question information and the at least one target file fragment.
6. The method according to claim 1, wherein the step of performing similarity matching between the first question information and each of at least one historical question to determine the target question matching the first question information comprises: The first problem information is rewritten to obtain at least one rewritten problem information; The rewritten problem information is semantically related to at least a portion of the first problem information, and the semantic range of the rewritten problem information is no greater than the semantic range of the first problem information; Based on the first problem information and the rewritten problem information, a similarity match is performed with each of the historical problems to determine the target problem.
7. The method according to claim 6, wherein rewriting the first problem information to obtain at least one rewritten problem information comprises: Determine the intent of the first question information and the keywords in the first question information; Based on each of the keywords, at least one rewritten question information is determined. The rewritten question information is associated with the intent, and the rewritten question information includes at least one of the keywords. The rewritten question information also includes a weight tag for improving the semantic weight of the keyword when performing similarity matching.
8. The method according to claim 1 or 6, wherein the response information includes at least one source identifier, the source identifier being used to indicate the target file; The method further includes: In response to a user performing a trigger operation on a target source identifier among at least one of the source identifiers, the first issue information and / or the rewrite issue information are associated with the target file.
9. The method according to claim 1, wherein the step of determining a target question matching the first question information by performing similarity matching between the first question information and each of at least one historical question includes: Determine the number of keywords contained in the first question information; Based on the quantity, a dynamic similarity threshold corresponding to the first problem information is determined; The first question information is matched with each of the historical questions to determine the target question whose similarity is greater than or equal to the dynamic similarity threshold.
10. An electronic device, comprising: At least one processor; as well as The memory connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed, enable the at least one processor to perform the following operations: obtaining first question information, the first question information representing a question to be responded to; performing similarity matching between the first question information and each of at least one historical question to determine a target question matching the first question information, wherein each historical question is associated with at least one file in a knowledge base; retrieving at least one target file associated with the target question from the knowledge base; constructing prompt word information for input to a target model based on the first question information and the at least one target file, so that the target model generates a reasoning result based on the first question information and the at least one target file; obtaining the reasoning result; generating and outputting response information for the first question information based on the reasoning result; wherein the historical question is a question that has been responded to before the first question information was obtained; the historical response information corresponding to the historical question includes at least one historical source identifier, each historical source identifier indicating a source file that provides source content for generating the historical response information; the at least one file associated with each historical question includes a source file that establishes an association with the historical question in response to a user performing a trigger operation on a target historical source identifier among at least one of the historical source identifiers.
