Question and answer resource processing method, question and answer resource processing device, medium and electronic equipment
By extracting the keywords and object identifiers in the user input questions, and performing multi-dimensional search and sorting in the preset resource library, the problem of insufficient accuracy and comprehensiveness of Q&A in the existing technology is solved, and more accurate and relevant Q&A resource determination is achieved.
Patent Information
- Application Number
- CN202510251602.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-03
AI Technical Summary
In the prior art, computer equipment relies on simple keyword matching when conducting knowledge questions and answers, resulting in insufficient accuracy and comprehensiveness of questions and answers, and it is impossible to deeply understand user problems.
A question-and-answer resource processing method is proposed. By obtaining the questions entered by the user, extracting keywords and object identifiers, and searching intermediate resources from multiple dimensions in the preset resource library, including searching based on the questions, keywords and object identifiers, and sorting the retrieved intermediate resources to finally determine the target resource.
The accuracy and comprehensiveness of question and answer are improved. Through multi-dimensional retrieval and sorting, the determined target resources are more accurate and relevant, and the diversity and comprehensiveness of user needs are met.
Smart Images

Figure CN120086343A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of artificial intelligence technology. More specifically, embodiments of the present disclosure relate to a method for processing question-and-answer resources, an apparatus for processing question-and-answer resources, a computer-readable storage medium, and an electronic device. Background Art
[0002] This section aims to provide background or context for the embodiments of the present disclosure stated in the claims. The description herein is not admitted to be prior art merely because it is included in this section.
[0003] With the rapid development of artificial intelligence technology, computer devices in many application scenarios can provide users with knowledge question-and-answer functions. However, in the prior art, computer devices often can only determine the resources corresponding to the questions input by users through simple keyword matching, and the accuracy and comprehensiveness of the question-and-answer are insufficient, and the question-and-answer effect is poor. Summary of the Invention
[0004] However, currently, the accuracy and comprehensiveness of question-and-answer in the question-and-answer scenario need to be improved.
[0005] In the related art, computer devices can only recall resources according to the similarity between the questions input by users and the resources. However, this method still lacks a deep understanding of the questions of users, and the accuracy and comprehensiveness of the question-and-answer are insufficient.
[0006] Therefore, there is a great need for a method for processing question-and-answer resources, which can comprehensively mine the questions of users and improve the accuracy and effectiveness of determining target resources according to the questions of users.
[0007] In this context, embodiments of the present disclosure are expected to provide a method for processing question-and-answer resources, an apparatus for processing question-and-answer resources, a computer-readable storage medium, and an electronic device.
[0008] According to a first aspect of the present disclosure, there is provided a method for processing question-and-answer resources, including: obtaining a to-be-processed question input by a user; the to-be-processed question includes a question-and-answer object; extracting keywords and an object identifier of the question-and-answer object from the to-be-processed question; retrieving intermediate resources in a preset resource library according to the to-be-processed question, the keywords, and the object identifier; sorting the intermediate resources, and determining target resources from the intermediate resources according to the sorting result.
[0009] In one embodiment, retrieving intermediate resources in the preset resource library according to the problem to be processed, keywords, and the object identifier includes: retrieving first intermediate resources in the preset resource library according to the problem to be processed; retrieving second intermediate resources in the preset resource library according to the keywords; retrieving third intermediate resources in the preset resource library according to the object identifier; and integrating the first intermediate resources, second intermediate resources, and third intermediate resources to obtain the intermediate resources.
[0010] In one embodiment, retrieving first intermediate resources in the preset resource library according to the problem to be processed includes: performing vectorization processing on the problem to be processed to obtain a feature vector of the problem to be processed; calculating a first similarity between the feature vector and each resource in the preset resource library, and determining first intermediate resources in the preset resource library according to the calculation result of the first similarity.
[0011] In one embodiment, retrieving second intermediate resources in the preset resource library according to the keywords includes: retrieving second intermediate resources containing the keywords in the preset resource library according to the keywords by using an inverted index retrieval algorithm.
[0012] In one embodiment, where there are multiple intermediate resources, sorting the intermediate resources includes: calculating a second similarity between the problem to be processed and each of the intermediate resources, and performing a first sorting process on the intermediate resources according to the calculation result of the second similarity; processing the intermediate resources after the first sorting process by using a preset sorting model, and performing a second sorting process on the intermediate resources after the first sorting process according to the processing result.
[0013] In one embodiment, after performing the first sorting process on the intermediate resources, the method further includes: deleting intermediate resources that do not meet the preset sorting conditions from the intermediate resources after the first sorting process.
[0014] In one embodiment, processing the intermediate resources after the first sorting process by using a preset sorting model, and performing a second sorting process on the intermediate resources after the first sorting process according to the processing result includes: processing the intermediate resources after the first sorting process by using a preset sorting model to determine a relevance evaluation value of each of the intermediate resources to the problem to be processed; determining a popularity evaluation value and a timeliness evaluation value of each of the intermediate resources after the first sorting process; and performing a second sorting process on each of the intermediate resources according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each of the intermediate resources.
[0015] In one implementation, the second sorting process for each of the intermediate resources according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each of the intermediate resources includes: respectively obtaining a first weight of the relevance evaluation value, a second weight of the popularity evaluation value, and a third weight of the timeliness evaluation value; performing weighted calculation on the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each of the intermediate resources according to the first weight of the relevance evaluation value, the second weight of the popularity evaluation value, and the third weight of the timeliness evaluation value to obtain a comprehensive evaluation value of each of the intermediate resources; and performing a second sorting process on each of the intermediate resources according to the comprehensive evaluation value of each of the intermediate resources.
[0016] In one implementation, after obtaining the problem to be processed input by the user, the method further includes: using a language processing model to perform standardization processing on the problem to be processed.
[0017] According to a second aspect of the present disclosure, there is provided a question-and-answer resource processing device, including: a question acquisition module configured to acquire a problem to be processed input by a user; the problem to be processed includes a question-and-answer object; an information extraction module configured to extract keywords and an object identifier of the question-and-answer object from the problem to be processed; a resource retrieval module configured to retrieve intermediate resources in a preset resource library according to the problem to be processed, the keywords, and the object identifier; and a resource sorting module configured to sort the intermediate resources and determine a target resource from the intermediate resources according to the sorting result.
[0018] According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the question-and-answer resource processing method of the first aspect and its possible implementation manners.
[0019] According to a fourth aspect of the present disclosure, there is provided an electronic device, including: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the question-and-answer resource processing method of the first aspect and its possible implementation manners by executing the executable instructions.
[0020] In the solution of the present disclosure, on the one hand, a new method for processing question-and-answer resources is proposed in this exemplary embodiment. It can retrieve resources from multiple dimensions of the question to be processed, keywords, and object identifiers, and determine the target resources corresponding to the question to be processed based on the retrieved intermediate resources. Compared with the prior art, the recalled target resources are more complete, and the method of retrieving resources based on object identifiers is more accurate and more targeted, further improving the accuracy of determining the target resources. On the other hand, after retrieving intermediate resources in various ways in this exemplary embodiment, the intermediate resources are sorted, and the target resources are determined from the intermediate resources according to the sorting result, so that when determining the target resources, the help provided by the sorting result is combined, ensuring the effectiveness, relevance, and accuracy of determining the target resources. Brief Description of the Drawings
[0021] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment.
[0022] Figure 2 A flowchart showing a method for processing question-and-answer resources in this exemplary embodiment.
[0023] Figure 3 A schematic diagram showing a song ID and associated resources in this exemplary embodiment.
[0024] Figure 4 A flowchart showing the architecture of a method for processing question-and-answer resources in this exemplary embodiment.
[0025] Figure 5 A schematic diagram showing the structure of a device for processing question-and-answer resources in this exemplary embodiment.
[0026] Figure 6 A schematic diagram showing the structure of an electronic device in this exemplary embodiment.
[0027] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Embodiments
[0028] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and then implement the present disclosure, and do not limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to be able to fully convey the scope of the present disclosure to those skilled in the art.
[0029] Embodiments of the present disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a form combining hardware and software.
[0030] The principles and spirit of the present disclosure will be elaborated in detail below with reference to several representative embodiments of the present disclosure. Summary of the Invention
[0032] The inventors of the present disclosure have found that the accuracy of the question-and-answer results in the current question-and-answer scenario needs to be improved. Specifically, in the related art, computer devices can only recall resources based on the similarity between the questions input by users and the resources. However, this method still lacks a deep understanding of the user's questions, and the accuracy and comprehensiveness of the question and answer are insufficient.
[0033] In view of the above, the present disclosure provides a question-and-answer resource processing method, a question-and-answer resource processing apparatus, a computer-readable storage medium, and an electronic device. On the one hand, this exemplary embodiment proposes a new question-and-answer resource processing method that can consider retrieving resources from multiple dimensions of the question to be processed, keywords, and object identifiers, and determine the target resource corresponding to the question to be processed based on the retrieved intermediate resources. Compared with the prior art, the recalled target resources are more complete, and the method of retrieving resources based on object identifiers is more accurate and more targeted, further improving the accuracy of determining the target resource. On the other hand, after retrieving intermediate resources in multiple ways in this exemplary embodiment, the intermediate resources are sorted, and the target resource is determined from the intermediate resources according to the sorting result, so that when the target resource is determined, the help provided by the sorting result is combined, ensuring the effectiveness, relevance, and accuracy of determining the target resource.
[0034] The various non-limiting embodiments of the present disclosure will be specifically introduced below.
[0035] Overview of Application Scenarios
[0036] It should be noted that the following application scenarios are only shown for the convenience of understanding the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this regard. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0037] The embodiments of the present disclosure can be applied to related scenarios of resource recall in the question-and-answer scenario. The specific application scenario will be described below in combination with the system architecture.
[0038] Figure 1A schematic diagram showing the system architecture for processing Q&A resources is presented. The system architecture includes a user terminal 110 and a server 120. Among them, the user terminal 110 can be an electronic device such as a computer, a mobile phone, an interactive robot, etc. that can conduct Q&A interactions with users. Users can interact with the user terminal 110 to input the question to be processed. After receiving the question to be processed input by the user, the user terminal 110 can send it to the server 120, so that the server 120 processes the question to be processed, retrieves resources in a preset resource library to determine the target resource, and finally, the target resource can be returned to the user terminal 110 for display or to reply to the user.
[0039] Exemplary Method
[0040] Exemplary embodiments of the present disclosure provide a method for processing Q&A resources. Refer to Figure 2 As shown, the method may include steps S210 to S240. Each of the following Figure 2 steps will be described in detail.
[0041] Refer to Figure 2 , in step S210, obtain the question to be processed input by the user; the question to be processed includes the Q&A object.
[0042] Among them, the question to be processed refers to the question information input by the user in the Q&A scenario. The questions to be processed may vary in different scenarios. For example, in a music program, the question to be processed may be "Find the song Little Frog"; in a video program, the question to be processed may be "Recommend comedy movies released in the last month", etc. The question to be processed can be the original question information, such as "I want to listen to a song called Little Frog", and the question to be processed can also be the question after processing the original question information. For example, after processing the foregoing original question information, "Want to listen to Little Frog" can be obtained. The Q&A object refers to the main object around which the Q&A process revolves. For example, if the question to be processed is "Find the song called Little Frog", among them, Little Frog is the Q&A object; for example, if the question to be processed is "Find the songs of singer Xiaoming", among them, Xiaoming is the Q&A object, etc.
[0043] Step S220, extract keywords and the object identifier of the Q&A object from the question to be processed.
[0044] Among them, the keyword refers to the entity representing the key meaning in the question to be processed. For example, if the question to be processed is "Find the song Little Frog", the keywords may include "song" and "Little Frog". In this exemplary embodiment, a set of object identifiers can be pre-configured for different Q&A objects. For example, in a music program, for all the songs included, a corresponding song ID (Identify, unique identifier) is set. This song ID can uniquely indicate a song, and the song IDs of each song are different.
[0045] In this exemplary embodiment, natural language processing technology, or large language models, etc. can be set in the question-and-answer device or program to analyze the problem to be processed through natural language processing technology or large language models, etc., extract keywords therefrom, and identify the object identifier of the question-and-answer object.
[0046] Step S230: Retrieve intermediate resources in a preset resource library according to the problem to be processed, keywords, and object identifier.
[0047] The preset resource library refers to a database including a large number of resources. Different scenarios can correspond to different resource libraries. For example, a music program can correspond to a preset resource library for music resources, which may include song information, singer information, creator information, album information, lyric information, and so on. Intermediate resources refer to the retrieved candidate resources that can be used to answer the problem to be processed.
[0048] In this exemplary embodiment, a preset resource library can be pre-constructed. For example, in a music question-and-answer scenario, the preset resource library can include music and other information related to music, such as albums, reviews, videos, lyrics, etc. This exemplary embodiment can associate the attributes of resources with various information and construct keyword indexes, vector indexes, and the association relationship between object IDs and resources. Specifically, the construction of the preset resource library can include obtaining various attribute information of the question-and-answer object, associating the attribute information and adding it to the preset resource library. For example, the attribute information can include "program name", "release date", "program description", and so on. Based on this preset resource library for resource retrieval, resources in different dimensions related to the problem to be processed can be determined. For example, when the problem to be processed is a song, songs, as well as lyrics, playlists, reviews, albums, etc. related to the song can be returned.
[0049] In this exemplary embodiment, intermediate resources can be retrieved in the preset resource library according to the problem to be processed, keywords, and object identifier. For example, in the order of the problem to be processed, keywords, and object identifier, or other orders, intermediate resources can be gradually screened out in the preset resource library one by one. Specifically, first use the problem to be processed to screen resources, and then further screen the screened resources through keywords, and so on to determine the intermediate resources; it is also possible to separately use the problem to be processed, keywords, and object identifier to search for resources in the preset resource library, and then take the union or intersection of the found resources to determine the intermediate resources, etc.
[0050] Step S240: Sort the intermediate resources and determine the target resource according to the sorting result among the intermediate resources.
[0051] Finally, sort the retrieved intermediate resources. The sorting result can be used to reflect the importance of the intermediate resources or the relevance to the problem to be processed. The higher the ranking of the intermediate resources, the more important they are or the more relevant they are to the problem to be processed. Then, the target resources can be determined from the intermediate resources according to the sorting result. For example, the top 10% of the intermediate resources can be selected as the target resources, or the top 20% of the intermediate resources can be selected as the target resources, etc. The specific criteria for determining the target resources can be determined according to actual needs, and the present disclosure does not make specific limitations thereon.
[0052] In this exemplary embodiment, the target resources may include various resources related to the Q&A object. For example, when a user asks about a song, the retrieved target resources may include the song, or may also include the song and lyrics, etc. After obtaining the target resources, the target resources can be returned to the user; or the target resources can be summarized or processed to obtain the answer to the problem to be processed, and the answer can be returned to the user. For example, the song "Little Frog" or the song "Little Frog" and its lyrics can be returned to the user together. Since the target resources include different resources in multiple dimensions, the method of determining the target resources from the preset resource library in this exemplary embodiment can improve the diversity and comprehensiveness of the resources determined in the Q&A scenario.
[0053] In an exemplary embodiment, the above-mentioned retrieval of intermediate resources from the preset resource library according to the problem to be processed, keywords, and object identifier may include:
[0054] Retrieve the first intermediate resources from the preset resource library according to the problem to be processed;
[0055] Retrieve the second intermediate resources from the preset resource library according to the keywords;
[0056] Retrieve the third intermediate resources from the preset resource library according to the object identifier;
[0057] Integrate the first intermediate resources, the second intermediate resources, and the third intermediate resources to obtain the intermediate resources.
[0058] Among them, the first intermediate resources refer to the corresponding resources retrieved according to the problem to be processed, the second intermediate resources refer to the corresponding resources retrieved according to the keywords, and the third intermediate resources refer to the corresponding resources retrieved according to the object identifier. In this exemplary embodiment, the retrieval can be performed in the preset resource library according to the problem to be processed, keywords, and object identifier respectively. Then, the first intermediate resources, the second intermediate resources, and the third intermediate resources are integrated to obtain the intermediate resources. For example, 50 first intermediate resources are retrieved according to the problem to be processed, 100 second intermediate resources are retrieved according to the keywords, and 20 third intermediate resources are retrieved according to the object identifier. Then these resources can be integrated, and the 170 retrieved resources can be used as the intermediate resources.
[0059] In an exemplary embodiment, retrieving the first intermediate resource from a preset resource library according to the problem to be processed may include:
[0060] Performing vectorization processing on the problem to be processed to obtain a feature vector of the problem to be processed;
[0061] Calculating a first similarity between the feature vector and each resource in the preset resource library, and determining the first intermediate resource in the preset resource library according to the calculation result of the first similarity.
[0062] In this exemplary embodiment, after obtaining the problem to be processed, the problem to be processed can be first converted into the form of a feature vector. Specifically, various methods can be adopted. For example, the problem to be processed can be first segmented to obtain multiple segments, and then each segment is converted into a corresponding word vector by using a word embedding model or Word2Vec technology. Then, according to the word vectors of each segment, the feature vector of the entire problem to be processed is obtained.
[0063] The first similarity refers to the similarity between the calculated feature vector of the problem to be processed and the resources in the preset resource library. In this exemplary embodiment, the resources stored in the preset resource library may have corresponding feature vectors. After obtaining the feature vector of the problem to be processed, the first similarity between this feature vector and each resource in the preset resource library can be calculated, that is, the similarity between the feature vector of the problem to be processed and the feature vectors of each resource in the preset resource library is calculated. Then, according to the calculation result of the first similarity, the first intermediate resource is determined in the preset resource library. For example, if the problem to be processed is "want to listen to the song Little Jumping Frog", the first intermediate resources found in the preset resource library may be Little Jumping Frog songs by different singers and different versions, while the similarity of another song "Little Frog" is lower than that of "Little Jumping Frog" and may not be used as the first intermediate resource. Determining the first intermediate resource in the preset resource library according to the calculation result of the first similarity may be to sort the involved resources according to the calculation result of the first similarity, and determine the first intermediate resource according to the sorting result. For example, resources with a similarity greater than a preset threshold are determined as the first intermediate resources, or the first preset number of resources with the highest similarity are determined as the first intermediate resources, and so on.
[0064] In an exemplary embodiment, retrieving the second intermediate resource from a preset resource library according to the keyword may include:
[0065] According to the keyword, using an inverted index retrieval algorithm to retrieve the second intermediate resource containing the keyword in the preset resource library.
[0066] Among them, the inverted index is a data structure that maps keywords in a document to information containing these keywords. In this exemplary embodiment, when the preset resource library is established, the system has already constructed an inverted index for all resources in the resource library. For example, in this exemplary embodiment, a large number of music resources are stored in the preset resource library, including various songs, albums, singer information, etc. When the preset resource library is built, an inverted index has been established for all music resources. The inverted index is a data structure that maps keywords (such as song names, singer names, etc.) to a list of music resources containing these keywords. After obtaining the keywords, the music resources corresponding to the threshold can be found in the inverted index table. Suppose there are multiple music resource records containing the keyword "Little Frog" in the music resource library. These resources may come from different singers or different versions, and they will all be listed in the position corresponding to "Little Frog" in the inverted index table.
[0067] Considering that multiple resources may be found according to the keywords. For example, there may be multiple versions of "Little Frog" in the music resource library. In order to further screen out the resources that best meet the user's needs, the resources retrieved according to the resources can be sorted or filtered according to other factors, such as according to factors such as the play popularity of the song, user ratings, and the clarity of the song, and the second intermediate resources retrieved are processed to obtain the processed second intermediate resources.
[0068] In an exemplary embodiment, the above-mentioned retrieving the third intermediate resource in the preset resource library according to the object identifier may include:
[0069] According to the object identifier, directly find the resource that matches the object identifier in the preset resource library as the third intermediate resource. For example, if the ID of "Little Frog" is "000012", then the resource related to this ID can be found in the preset resource library.
[0070] In this exemplary embodiment, the object identifier can be associated with different types of resources. Taking music resources as an example, as Figure 3 shown, taking the song ID 310 of a certain song as the center, lyrics 320, creator 330, album 340, related play videos and explanations 350, comments 360, etc. can be associated in the preset resource library.
[0071] In an exemplary embodiment, when there are multiple above-mentioned intermediate resources, the above-mentioned sorting of the intermediate resources may include:
[0072] Calculate the second similarity between the problem to be processed and each intermediate resource, and perform a first sorting process on the intermediate resources according to the calculation result of the second similarity;
[0073] Process the intermediate resources after the first sorting process using a preset sorting model, and perform a second sorting process on the intermediate resources after the first sorting process according to the processing results.
[0074] To improve the effectiveness and accuracy of target resource determination, in this exemplary embodiment, the intermediate resources can be rearranged to determine the target resources according to the rearranged intermediate resources.
[0075] In this exemplary embodiment, resource rearrangement can include two stages, the first sorting process and the second sorting process. Among them, the first sorting process refers to the sorting process performed according to the calculation results of the second similarity between the problem to be processed and each intermediate resource, and the second sorting process refers to the sorting process of using a preset sorting model to sort the intermediate resources after the first sorting process. Among them, the preset sorting model can be a reranker sorting model.
[0076] The calculation method of the second similarity is similar to that of the first similarity, and both can be realized by vectorizing the object to be calculated and then calculating the similarity of the vectors. For example, calculating the cosine similarity between the vector of the problem to be processed and the vector of the intermediate resource. The difference is that the first similarity refers to the calculation result of the similarity between the problem to be processed and the resources in the preset resource library, and the second similarity refers to the calculation result of the similarity between the problem to be processed and the intermediate resources retrieved from the preset resource library.
[0077] In an exemplary embodiment, after performing the first sorting process on the intermediate resources, the above question-and-answer resource processing method may further include:
[0078] Delete the intermediate resources that do not meet the preset sorting conditions among the intermediate resources after the first sorting process.
[0079] To ensure the accuracy and reasonableness of resource rearrangement, after performing the first sorting process, the intermediate resources can be screened to delete the intermediate resources that do not meet the preset sorting conditions. Among them, the preset sorting conditions can be set according to requirements. For example, delete some resources with a lower ranking after the first sorting process, or delete resources whose second similarity calculation results are lower than the preset threshold, etc.
[0080] In an exemplary embodiment, the above process of using a preset sorting model to process the intermediate resources after the first sorting process and performing a second sorting process on the intermediate resources after the first sorting process according to the processing results may include:
[0081] Use a preset sorting model to process the intermediate resources after the first sorting process to determine the relevance evaluation values of each intermediate resource to the problem to be processed;
[0082] Determine the popularity evaluation values and timeliness evaluation values of each intermediate resource after the first sorting process;
[0083] Perform a second sorting process on each intermediate resource according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource.
[0084] Among them, the relevance evaluation value is an index value used to reflect the degree of relevance between the resource and the problem to be processed. The higher the relevance evaluation value, the more relevant the resource is to the problem to be processed. The relevance evaluation value can be obtained by processing the intermediate resources after the first sorting process through a preset sorting model. For example, the reranker sorting model can be used to process the intermediate resources to output the relevance evaluation value.
[0085] The popularity evaluation value of the intermediate resource is an index value used to reflect the popularity of the resource, which can be determined according to the interaction behavior data. For example, the popularity evaluation value can be determined according to data such as the play volume, comment volume, like volume, favorite volume, share volume, and click-through rate of the resource. For example, the like volume is used as the popularity evaluation value, or different data is normalized, and multiple interaction behavior data is calculated to obtain the popularity evaluation value, etc. The higher the popularity evaluation value, the more popular the resource is. The timeliness evaluation value is an index value used to reflect the timeliness of the resource. The timeliness evaluation value can be determined according to the time distance between the time corresponding to the resource and the current time. For example, the closer the resource is to the current time, the higher the timeliness evaluation value. The timeliness evaluation value can also be determined according to other factors. For example, for a song with multiple cover versions, the cover version of the song closer to the release time of the original version has a higher timeliness evaluation value, etc. The specific setting is not specifically limited in this disclosure.
[0086] Finally, perform a second sorting process on each intermediate resource according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource. Specifically, the relevance evaluation value, popularity evaluation value, and timeliness evaluation value can be used to perform sorting processes in sequence. For example, first use the relevance evaluation value to perform a sorting process, and for the sorting result, use the popularity evaluation value to further sort, and so on; or a weighted summation method can be used to first determine the comprehensive evaluation value, and then sort according to the comprehensive evaluation value.
[0087] This exemplary embodiment sorts resources in two stages, and combines the relevance evaluation value, popularity evaluation value, and timeliness evaluation value for sorting in the second stage, improving the accuracy and timeliness of determining the target resource or returning the answer to the question, and can more provide targeted and reasonable resources and answers for users in the application scenario.
[0088] In an exemplary embodiment, the above-mentioned performing a second sorting process on each intermediate resource according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource may include:
[0089] Obtain the first weight of the relevance evaluation value, the second weight of the popularity evaluation value, and the third weight of the timeliness evaluation value respectively;
[0090] According to the first weight of the relevance evaluation value, the second weight of the popularity evaluation value, and the third weight of the timeliness evaluation value, perform weighted calculations on the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource to obtain the comprehensive evaluation value of each intermediate resource;
[0091] Perform a second sorting process on each intermediate resource according to the comprehensive evaluation value of each intermediate resource.
[0092] In this exemplary embodiment, different weights can be set for the relevance evaluation value, popularity evaluation value, and timeliness evaluation value. Through a weighted algorithm, first calculate the comprehensive evaluation value, and then perform a second sorting process on each intermediate resource according to the total evaluation value of each intermediate resource.
[0093] The setting of specific weight values can be customized according to actual needs, or can be set according to the degree of importance, or can also be set according to specific application scenarios. The present disclosure does not make specific limitations in this regard. For example, the weight of the relevance evaluation value can be set to 0.4, the weight of the popularity evaluation value can be set to 0.3, and the weight of the timeliness evaluation value can be set to 0.3. Then the comprehensive evaluation value is the relevance evaluation value × 0.4 + the popularity evaluation value × 0.3 + the timeliness evaluation value × 0.3.
[0094] In an exemplary embodiment, after obtaining the problem to be processed input by the user, the above-mentioned Q&A resource processing method may further include:
[0095] Adopt a language processing model to perform standardization processing on the problem to be processed.
[0096] To ensure the efficiency of resource processing, in this exemplary embodiment, after obtaining the problem to be processed, a language processing model can be adopted to perform standardization processing on the problem to be processed. The standardization processing may include normalizing or abbreviating the problem to be processed. For example, "I want to listen to a song named Little Frog" is processed as "want to listen to song Little Frog"; eliminating ambiguity in the problem to be processed; extracting special type information such as time from the problem to be processed to facilitate the determination of other information in the subsequent process, such as determining the timeliness evaluation value of the resource.
[0097] Figure 4The framework flowchart of a method for processing Q&A resources in this exemplary embodiment is shown, which may specifically include the following steps: obtaining the problem to be processed 402 input by the user; performing normalization processing 404 on the problem to be processed; extracting keywords 406 and object identifiers 408 from the problem to be processed; performing vector recall 412 in a preset resource library 410 using the vector of the problem to be processed to determine the first intermediate resource 414; performing keyword recall 416 in the preset resource library 410 using the keywords to determine the second intermediate resource 418; performing identifier recall 420 in the preset resource library 410 using the object identifier to determine the third intermediate resource 422; integrating and processing the first intermediate resource, the second intermediate resource, and the third intermediate resource to obtain an intermediate resource 424, such as filtering duplicate resources or deleting resources, such as deleting a certain proportion of resources and retaining a preset number of resources, etc.; using a sorting algorithm to sort the intermediate resources 426; determining and returning a target resource 428 from the intermediate resources after resource rearrangement as the answer to the problem to be processed 402.
[0098] Exemplary Device
[0099] An exemplary embodiment of the present disclosure also provides a Q&A resource processing device. Refer to Figure 5 As shown, the Q&A resource processing device 500 may include the following program modules: a problem acquisition module 510 for obtaining the problem to be processed input by the user; the problem to be processed includes a Q&A object; an information extraction module 520 for extracting keywords and the object identifier of the Q&A object from the problem to be processed; a resource retrieval module 530 for retrieving intermediate resources in a preset resource library according to the problem to be processed, the keywords, and the object identifier; a resource sorting module 540 for sorting the intermediate resources and determining a target resource from the intermediate resources according to the sorting result.
[0100] In one embodiment, the resource retrieval module 530 includes: a first resource retrieval unit for retrieving a first intermediate resource in a preset resource library according to the problem to be processed; a second resource retrieval unit for retrieving a second intermediate resource in the preset resource library according to the keywords; a third resource retrieval unit for retrieving a third intermediate resource in the preset resource library according to the object identifier; an intermediate resource integration unit for integrating the first intermediate resource, the second intermediate resource, and the third intermediate resource to obtain an intermediate resource.
[0101] In one embodiment, the first resource retrieval unit includes: a vectorization processing subunit for performing vectorization processing on the problem to be processed to obtain a feature vector of the problem to be processed; a first similarity calculation subunit for calculating the first similarity between the feature vector and each resource in the preset resource library and determining the first intermediate resource in the preset resource library according to the calculation result of the first similarity.
[0102] In one embodiment, the second resource retrieval unit includes: a keyword retrieval subunit, configured to retrieve second intermediate resources containing the keyword in a preset resource library according to the keyword by using an inverted index retrieval algorithm.
[0103] In one embodiment, there are multiple intermediate resources, and the resource sorting module 540 includes: a first sorting processing unit, configured to calculate a second similarity between the problem to be processed and each intermediate resource, and perform a first sorting process on the intermediate resources according to the calculation result of the second similarity; a second sorting processing unit, configured to process the intermediate resources after the first sorting process by using a preset sorting model, and perform a second sorting process on the intermediate resources after the first sorting process according to the processing result.
[0104] In one embodiment, after performing the first sorting process on the intermediate resources, the question and answer resource processing device further includes: an intermediate resource deletion unit, configured to delete intermediate resources that do not meet the preset sorting conditions from the intermediate resources after the first sorting process.
[0105] In one embodiment, the second sorting processing unit includes: a relevance evaluation subunit, configured to process the intermediate resources after the first sorting process by using a preset sorting model to determine a relevance evaluation value of each intermediate resource with respect to the problem to be processed; a popularity and timeliness evaluation subunit, configured to determine a popularity evaluation value and a timeliness evaluation value of each intermediate resource after the first sorting process; a second sorting processing subunit, configured to perform a second sorting process on each intermediate resource according to the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource.
[0106] In one embodiment, the second sorting processing subunit includes: a weight acquisition subunit, configured to respectively acquire a first weight of the relevance evaluation value, a second weight of the popularity evaluation value, and a third weight of the timeliness evaluation value; a comprehensive evaluation determination subunit, configured to perform a weighted calculation on the relevance evaluation value, popularity evaluation value, and timeliness evaluation value of each intermediate resource according to the first weight of the relevance evaluation value, the second weight of the popularity evaluation value, and the third weight of the timeliness evaluation value to obtain a comprehensive evaluation value of each intermediate resource; a sorting processing subunit, configured to perform a second sorting process on each intermediate resource according to the comprehensive evaluation value of each intermediate resource.
[0107] In one embodiment, after obtaining the problem to be processed input by the user, the question and answer resource processing device further includes: a normalization processing module, configured to perform normalization processing on the problem to be processed by using a language processing model.
[0108] In addition, other specific details of the embodiments of the present disclosure have been described in detail in the embodiments of the above method, and will not be repeated here.
[0109] Exemplary Storage Medium
[0110] Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above methods of the present disclosure are implemented. The above methods can be implemented by a program product. For example, a portable compact disc read-only memory (CD-ROM) can be used and includes program code, and can be run on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0111] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, but not be limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0112] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, and the readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0113] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0114] Program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0115] Exemplary Electronic Device
[0116] Exemplary embodiments of the present disclosure also provide an electronic device, which can be any device among Figure 1 This electronic device includes a processor and a memory, and the memory is used to store executable instructions for the processor. The processor is configured to execute the above method of the present disclosure by executing the executable instructions.
[0117] Refer to Figure 6 for the description of the electronic device of the exemplary embodiments of the present disclosure. Figure 6 The displayed electronic device 600 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0118] As Figure 6 shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0119] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. For example, the processing unit 610 can execute the method steps as Figure 2 shown, etc.
[0120] The storage unit 620 may include a volatile storage unit, such as a random access storage unit (RAM) 621 and / or a cache storage unit 622, and may further include a read-only storage unit (ROM) 623.
[0121] The storage unit 620 may also include a program / utilities 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, and implementation of a network environment may be included in each or some combination of these examples.
[0122] The bus 630 may include a data bus, an address bus, and a control bus.
[0123] The electronic device 600 may also communicate with one or more external devices 700 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and such communication may be through the input / output (I / O) interface 640. The electronic device 600 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 650. As shown in the figure, the network adapter 650 communicates with other modules of the electronic device 600 through the bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0124] It should be noted that although several modules or sub-modules of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described units / modules may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided and embodied by multiple units / modules.
[0125] In addition, although the operations of the method of the present disclosure are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the shown operations must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.
[0126] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division of each aspect does not mean that the features in these aspects cannot be combined for benefit. Such division is only for the convenience of description. The present disclosure aims to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A question and answer resource processing method, characterized in that: include: Obtaining a pending question input by a user; the pending question includes a question-and-answer object; Extracting keywords and object identifiers of the question-and-answer objects from the question to be processed; Retrieving intermediate resources in a preset resource library according to the problem to be processed, the keywords and the object identifier; The intermediate resources are sorted, and a target resource is determined from the intermediate resources according to the sorting result.
2. The method according to claim 1, characterized in that The retrieving intermediate resources in a preset resource library according to the problem to be processed, the keyword and the object identifier includes: Retrieving a first intermediate resource in the preset resource library according to the problem to be processed; Retrieving a second intermediate resource in the preset resource library according to the keyword; Retrieving a third intermediate resource in the preset resource library according to the object identifier; The first intermediate resource, the second intermediate resource and the third intermediate resource are integrated to obtain the intermediate resource.
3. The method according to claim 2, characterized in that The step of retrieving a first intermediate resource from the preset resource library according to the problem to be processed includes: Performing vectorization processing on the problem to be processed to obtain a feature vector of the problem to be processed; A first similarity between the feature vector and each resource in the preset resource library is calculated, and a first intermediate resource is determined in the preset resource library according to a calculation result of the first similarity.
4. The method according to claim 2, characterized in that: The step of searching the preset resource library for the second intermediate resource according to the keyword includes: According to the keyword, an inverted index search algorithm is used to search the preset resource library for a second intermediate resource containing the keyword.
5. The method according to claim 1, characterized in that The intermediate resources include a plurality of resources, and the sorting of the intermediate resources includes: Calculating a second similarity between the problem to be processed and each of the intermediate resources, and performing a first sorting process on the intermediate resources according to a calculation result of the second similarity; A preset sorting model is used to process the intermediate resources after the first sorting process, and a second sorting process is performed on the intermediate resources after the first sorting process according to the processing result.
6. The method according to claim 5, characterized in that After performing the first sorting process on the intermediate resources, the method further includes: Among the intermediate resources after the first sorting process, the intermediate resources that do not meet the preset sorting condition are deleted.
7. The method according to claim 5, characterized in that The adopting a preset sorting model to process the intermediate resources after the first sorting process, and performing a second sorting process on the intermediate resources after the first sorting process according to the processing result, includes: Using a preset sorting model to process the intermediate resources after the first sorting process, and determining a correlation evaluation value between each of the intermediate resources and the problem to be processed; Determine a heat evaluation value and a timeliness evaluation value of each of the intermediate resources after the first sorting process; A second sorting process is performed on each of the intermediate resources according to the relevance evaluation value, heat evaluation value and timeliness evaluation value of each of the intermediate resources.
8. A question-answer resource processing device, characterized in that: include: A question acquisition module is used to acquire pending questions input by a user; the pending questions include question and answer objects; An information extraction module, used to extract keywords and object identifiers of the question and answer objects from the question to be processed; A resource retrieval module, used to retrieve intermediate resources in a preset resource library according to the problem to be processed, keywords and the object identifier; The resource sorting module is used to sort the intermediate resources and determine the target resource among the intermediate resources according to the sorting result.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.