A question and answer result retrieval method, device and equipment based on keyword matching

CN120561220BActive Publication Date: 2026-09-11广州三七极耀网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510411626.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2026-09-11
Estimated Expiration
2045-04-02

AI Technical Summary

Technical Problem

[0004]本申请实施例提供一种基于关键字匹配的问答结果检索方法、装置及设备,解决了由于问答系统接收到的提问方式不同而接收到的问答结果不一致、不准确的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120561220B_ABST
    Figure CN120561220B_ABST
Patent Text Reader

Abstract

This application discloses a question-and-answer result retrieval method, apparatus, and device based on keyword matching, comprising: performing word segmentation processing on the acquired question information to obtain the word segmentation processing result; filtering the word segmentation processing result for keywords according to preset stop type words to obtain multiple first keywords; querying multiple second keywords associated with the first keywords in the target database; determining the semantic distance based on the association type between the first keywords and each second keyword; identifying the multiple second keywords corresponding to the shortest semantic distance as similar keywords; and freely combining each similar keyword and each first keyword according to the part-of-speech of the keywords to obtain the target keyword; retrieving the question information in the target database based on the target keyword to obtain target matching information; and performing natural language conversion on the target matching information through a generative large model to generate a natural language answer. This improves the consistency of question-and-answer results and the accuracy of question-and-answer result retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, and device for retrieving question-and-answer results based on keyword matching. Background Technology

[0002] With the development of generative artificial intelligence technology, the application scenarios that combine retrieval technology with generative artificial intelligence are becoming increasingly widespread, especially in enterprise internal knowledge base management and customer service automated question answering systems. The core requirement of these application scenarios is to quickly and accurately find the answers that users need from a large amount of information through supervised learning algorithms. For example, supervised learning algorithms can learn the mapping relationship between input data and output data, thereby laying the foundation for generating new data.

[0003] In related technologies, question-answering systems extract keywords from received question information according to preset keyword extraction rules, and then search the corresponding database based on the extracted keywords to output search results. However, question-answering systems usually output different answers for situations where the question is expressed in different ways. Therefore, there are problems with inconsistent and inaccurate question-answering results due to different questioning methods. Summary of the Invention

[0004] This application provides a method, apparatus, and device for retrieving question-and-answer results based on keyword matching, solving the problem of inconsistent and inaccurate question-and-answer results due to different question formats received by the question-and-answer system. By determining the semantic distance between a first keyword and each second keyword, multiple second keywords corresponding to the shortest semantic distance are identified as similar keywords. Each similar keyword is then freely combined with each first keyword to obtain a target keyword. Retrieving question information based on the target keyword ensures consistent question-and-answer results for different question formats and improves the accuracy of question-and-answer result retrieval.

[0005] In a first aspect, embodiments of this application provide a question-and-answer result retrieval method based on keyword matching, including:

[0006] Obtain question information, perform word segmentation on the question information to obtain word segmentation results, and filter the word segmentation results for keywords based on preset stop type words to obtain multiple first keywords;

[0007] Query multiple second keywords associated with the first keyword in the target database, determine the semantic distance between the first keyword and each second keyword based on the association type between the first keyword and each second keyword, identify the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keyword to obtain the target keyword;

[0008] Based on the target keywords, query information is retrieved from the target database to obtain target matching information. Then, natural language conversion is performed on the target matching information using a generative big data model to generate a natural language answer.

[0009] Optionally, determining the semantic distance between the first keyword and each of the second keywords based on the association type between the first keyword and each of the second keywords includes:

[0010] The multiple second keywords are classified according to the association type between the first keyword and each of the second keywords to obtain synonymous second keywords and logically related second keywords;

[0011] Based on the target data in the target database, determine the first semantic distance between the first keyword and the synonymous second keyword, and the second semantic distance between the first keyword and the logically associated second keyword.

[0012] Optionally, determining the first semantic distance between the first keyword and the synonymous second keyword and the second semantic distance between the first keyword and the logically associated second keyword based on the target data in the target database includes:

[0013] The co-occurrence frequency of the first keyword and the synonymous second keyword is determined based on the target data in the target database, and the semantic distance corresponding to the co-occurrence frequency is determined as the first semantic distance between the first keyword and the synonymous second keyword. The co-occurrence frequency is the frequency of the two synonyms appearing together in the same semantic environment.

[0014] A knowledge graph is generated based on the target data in the target database, which is used to connect the first keyword with the logically associated second keyword. The second semantic distance between the first keyword and the logically associated second keyword is then determined based on the knowledge graph.

[0015] Optionally, the step of retrieving query information from the target database based on the target keywords to obtain target matching information includes:

[0016] If a target search keyword with the same name as the target keyword exists in the target database, retrieve the historical search results corresponding to the target search keyword, and determine the historical search results as target matching information;

[0017] If no target search keyword identical to the target keyword exists in the target database, retrieve matching data corresponding to the target search keyword, and determine the matching data as target matching information.

[0018] Optionally, the step of freely combining similar keywords and first keywords based on keyword parts of speech to obtain target keywords includes:

[0019] Based on the part-of-speech of the keywords, the similar keywords and the first keywords are classified to obtain a variety of similar keywords and first keywords with different parts of speech;

[0020] By freely combining similar keywords of different parts of speech and primary keywords of different parts of speech, the target keywords can be obtained.

[0021] Optionally, before performing keyword filtering on the word segmentation results based on preset stop type words, the method further includes:

[0022] The word segmentation results are then subjected to keyword calibration to obtain calibration data;

[0023] Accordingly, the word segmentation results are filtered based on preset stop type words to obtain multiple first keywords, including:

[0024] The calibration data is filtered for keywords based on the preset stop type words to obtain multiple first keywords. The stop type words include at least one of the following: no-target words, repetitive words, modal words, and filler words.

[0025] Optionally, after obtaining the query information, the process may further include:

[0026] Obtain the context data associated with the question information, parse the context data, determine the question-and-answer scenario, and determine the target database corresponding to the question-and-answer scenario.

[0027] In a second aspect, embodiments of this application provide a question-and-answer result retrieval device based on keyword matching, comprising:

[0028] The word segmentation processing module is used to obtain the question information, perform word segmentation processing on the question information, and obtain the word segmentation processing result.

[0029] The keyword filtering module is used to filter the word segmentation results based on preset stop words to obtain multiple first keywords.

[0030] The target keyword generation module is used to query multiple second keywords associated with the first keyword in the target database, determine the semantic distance between the first keyword and each second keyword according to the association type between the first keyword and each second keyword, identify the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keywords to obtain the target keyword;

[0031] The information retrieval module is used to retrieve query information from the target database based on the target keywords to obtain target matching information;

[0032] The natural language answer generation module is used to perform natural language conversion on the target matching information through a generative large model to generate a natural language answer.

[0033] In a third aspect, embodiments of this application provide an electronic device, the device comprising: one or more processors; and a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the keyword matching-based question-and-answer result retrieval method described in the first aspect.

[0034] In a fourth aspect, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the keyword-matching-based question-and-answer result retrieval method as described in the first aspect.

[0035] This application embodiment obtains question information, performs word segmentation on the question information to obtain word segmentation results, filters the word segmentation results for keywords based on preset stop words, and obtains multiple first keywords; queries the target database for multiple second keywords associated with the first keywords, determines the semantic distance between the first keywords and each second keyword based on the association type between the first keywords and each second keyword, identifies the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combines each similar keyword and each first keyword according to the keyword part of speech to obtain the target keyword; retrieves question information in the target database based on the target keyword to obtain target matching information, and performs natural language conversion on the target matching information through a generative large model to generate a natural language answer. In the above scheme, by determining the semantic distance between the first keywords and each second keyword, identifying the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combining each similar keyword and each first keyword to obtain the target keyword, and retrieving question information based on the target keyword, the same question-and-answer results can be obtained for different question types, ensuring the consistency of question-and-answer results and improving the accuracy of question-and-answer result retrieval. Attached Figure Description

[0036] Figure 1 This is a flowchart of a question-and-answer result retrieval method based on keyword matching provided in an embodiment of this application;

[0037] Figure 2 This is a flowchart of a semantic distance determination method provided in an embodiment of this application;

[0038] Figure 3 This is a flowchart of another semantic distance determination method provided in the embodiments of this application;

[0039] Figure 4 This is a schematic diagram of a knowledge graph provided in an embodiment of this application;

[0040] Figure 5 This is a schematic diagram of the structure of a question-and-answer result retrieval device based on keyword matching provided in an embodiment of this application;

[0041] Figure 6 This is a schematic diagram of the structure of a question-and-answer result retrieval device based on keyword matching provided in an embodiment of this application. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0043] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0044] In the description and claims of the present application, the terms "first", "second", etc. are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of one type, and the number of objects is not limited. For example, the first object may be one or multiple. In addition, "and / or" in the description and claims indicates at least one of the connected objects, and the character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0045] The following describes in detail the question answering result retrieval method, apparatus and device based on keyword matching provided by the embodiments of the present application through specific embodiments and application scenarios thereof with reference to the accompanying drawings.

[0046] The question answering result retrieval method based on keyword matching provided by the embodiments of the present application can be applied to scenarios such as enterprise internal knowledge base management and automatic customer service question answering. Based on the above application scenarios, it can be understood that the execution subject of this solution may be a server.

[0047] Figure 1 is a flowchart of a question answering result retrieval method based on keyword matching provided by the embodiment of the present application, as Figure 1 shown in the figure, the method includes:

[0048] Step S101: Acquire question information, perform word segmentation processing on the question information to obtain a word segmentation processing result, and perform keyword screening on the word segmentation processing result according to preset stop words to obtain a plurality of first keywords.

[0049] Wherein, the question information may be a relevant question input by a user in an intelligent terminal, such as a question raised by a user to an intelligent customer service on an e-commerce platform. The question information may be text information, voice information, picture information or the like. If the question information is voice information, the voice information will be converted into text information; if the question information is picture information, picture processing will be performed on the picture information first to identify the text content contained in the picture information. Word segmentation processing may refer to cutting a continuous text string into individual words or phrases one by one according to certain rules and algorithms. The preset stop words may be words that do not provide substantial help for the understanding and analysis of text content, such as "the", "a", "an", "is", "are", "was", "were" in English, and "的", "地", "得", "是", "在", "有", "和", "与" in Chinese. The first keywords refer to words that can provide substantial help for the understanding and analysis of text content.

[0050] In one embodiment, the system acquires a user's question input on a smart terminal, converts it into text information according to the type of the question, segments the text information into individual words or phrases from left to right, and filters out words that do not substantially help in understanding and analyzing the text content to obtain the first keyword. For example, if the question is "What is the pixel count of this phone's camera?", word segmentation of the question yields "this", "phone", "of", "camera", "pixels", "is", and "how many". The word segmentation results are then filtered for keywords based on preset stop words, resulting in the first keywords being "this", "phone", "camera", "pixels", and "how many".

[0051] Optionally, before performing keyword filtering on the word segmentation results based on preset stop type words, the method further includes:

[0052] The word segmentation results are then subjected to keyword calibration to obtain calibration data;

[0053] Accordingly, the word segmentation results are filtered based on preset stop type words to obtain multiple first keywords, including:

[0054] The calibration data is filtered for keywords based on the preset stop type words to obtain multiple first keywords. The stop type words include at least one of the following: no-target words, repetitive words, modal words, and filler words.

[0055] In this context, calibration data refers to accurate data free from spelling or logical errors. Undirected words refer to words in language that do not explicitly point to a specific object or direction. Repeated words refer to words that appear multiple times within a language segment (such as a sentence, paragraph, or text); optionally, these repeated words represent the same keywords appearing multiple times in the calibration data. Modal particles are a type of function word, attached to the end of sentences or words to express various tones. Filler words are words that fill time, soften tone, or connect sentences in language, and have little or no actual semantic content. In one embodiment, the word segmentation result is checked for misspelled keywords. If present, the misspelled keywords are corrected to obtain calibration data. The calibration data is then queried for undirected words, repeated words, modal particles, and filler words. The undirected words, repeated words, modal particles, and filler words found in the calibration data are then removed to obtain multiple first keywords.

[0056] This application embodiment calibrates the word segmentation results to obtain calibration data. Then, it filters the calibration data for keywords based on preset stop words to obtain multiple first keywords. In this scheme, the accuracy of the first keywords is improved through keyword calibration, which in turn improves the accuracy of user intent analysis. By filtering the calibration data for preset stop words, the number of combinations of the first keywords and similar keywords is reduced while maintaining retrieval accuracy, thus improving retrieval efficiency.

[0057] Optionally, after obtaining the query information, the process may further include:

[0058] Obtain the context data associated with the question information, parse the context data, determine the question-and-answer scenario, and determine the target database corresponding to the question-and-answer scenario.

[0059] In one embodiment, after obtaining the question information, one or more pieces of context data adjacent to the question information in the interactive interface are determined based on the position of the question information in the interactive interface, and the question scenario is analyzed based on the question information and the context data to determine the environment or scenario of the question, and the database associated with the environment or scenario is determined as the target database.

[0060] This application embodiment obtains contextual data associated with the question information, parses the contextual data, determines the question-and-answer scenario, and identifies the target database corresponding to the question-and-answer scenario. In the above solution, the question scenario can be determined by analyzing the context of the question information, thereby confirming the target database associated with the question scenario, which can correspondingly narrow the scope of information retrieval and improve the accuracy of question information retrieval.

[0061] Step S102: Query multiple second keywords associated with the first keyword in the target database, determine the semantic distance between the first keyword and each second keyword according to the association type between the first keyword and each second keyword, identify the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keyword to obtain the target keyword.

[0062] The target database is used to store data corresponding to the target domain or platform, such as the target database for a navigation platform, which stores map data. The second keyword can be a keyword related to the meaning of the first keyword. Semantic distance is a measure of the semantic similarity between two words, concepts, or text fragments; it can be used to measure the semantic proximity of linguistic units. Similar keywords are those that are semantically most similar to the first keyword. Target keywords can be phrases or short sentences composed of multiple smallest unit keywords. Keyword part-of-speech refers to the word class attribute of a keyword in its grammatical structure, such as noun, verb, adjective, adverb, pronoun, preposition, and conjunction.

[0063] In one embodiment, all historical keywords used in the historical question-and-answer result search process can be collected in advance, and all historical keywords and the relationships between them can be stored in a sub-database of the target database. The sub-database is queried to determine the second keywords associated with each first keyword, and the semantic similarity between the first keyword and each associated second keyword is determined. The second keyword with the highest semantic similarity is identified as a similar keyword. This association can be synonymous or antonymous, etc. Each first keyword has multiple associated second keywords, and there can be multiple second keywords with the highest semantic similarity to the first keyword. For example, if the second keywords associated with the first keyword are A, B, C, D, and E, and the semantic distance between the first keyword and A and B is 80%, the semantic distance with C is 75%, the semantic distance with D is 60%, and the semantic distance with E is 61%, then the second keywords A and B are identified as similar keywords. After determining each first keyword and each similar keyword, the first keywords and each similar keyword are freely combined according to their parts of speech to obtain the target keyword. For example, if the first keywords are "this model", "mobile phone", "camera", "pixels", and "how many", and the similar keywords corresponding to "this model" are "this style", "this type", "this model", and "this style", the similar keywords corresponding to "mobile phone" are "mobile terminal", "mobile phone", "portable phone", and "smart terminal", the similar keywords corresponding to "camera" are "surveillance camera", "camera", "probe", and "monitor", the similar keywords corresponding to "pixels" are "pixel", "image element", and the similar keywords corresponding to "how many" are "several", "several", and "how", then by freely combining the first keywords with the target keywords, all possible combinations are obtained, such as "this model / mobile phone / pixels / how many" or "mobile terminal / camera / pixels / how many", etc. All possible combinations are matched with the search terms used in the historical search process, and the target combination that is the same as the search terms used in the historical search is determined among all possible combinations, and this target combination is determined as the target keyword.

[0064] The process of freely combining similar keywords and primary keywords based on their parts of speech to obtain target keywords includes:

[0065] Based on the part-of-speech of the keywords, the similar keywords and the first keywords are classified to obtain a variety of similar keywords and first keywords with different parts of speech;

[0066] By freely combining similar keywords of different parts of speech and primary keywords of different parts of speech, the target keywords can be obtained.

[0067] In one embodiment, to avoid logical errors that may occur when freely combining the first keyword with similar keywords, similar keywords and the first keyword can be classified in advance according to the part of speech of the keywords. Keywords with the same part of speech are identified as one category. The first keyword and similar keywords are then combined based on the logical relationship between different parts of speech to obtain target keywords that conform to the logical relationship.

[0068] This application embodiment classifies similar keywords and primary keywords according to their parts of speech, obtaining multiple similar keywords and primary keywords with different parts of speech. These similar keywords and primary keywords with different parts of speech are then freely combined to obtain the target keyword. In this scheme, similar keywords and primary keywords are pre-classified according to their parts of speech, and keywords are combined based on the logical relationships between parts of speech. This avoids the need for subsequent logical verification of the target keyword, improving the accuracy of the target keyword and, consequently, the accuracy of user needs analysis.

[0069] Step S103: Retrieve question information in the target database based on the target keywords to obtain target matching information, and perform natural language conversion on the target matching information through a generative big data model to generate a natural language answer.

[0070] Target matching information refers to information that matches the obtained question information. This target matching information can be computer programming languages, mathematical formulas, or logical expressions, etc. Generative large-scale models are artificial intelligence models based on deep learning technology, possessing powerful language understanding and generation capabilities. Natural language conversion transforms the computer programming languages, mathematical formulas, or logical expressions retrieved by the system into natural language that is easy for users to understand. In one embodiment, information is retrieved from a target database based on target keywords to obtain all information matching the target keywords. All matched information is then input into the generative large-scale model. The generative large-scale model cleans and preprocesses all information, and based on its learned language patterns and semantic understanding, converts the target matching information into a natural and fluent natural language description, which is then sent to the corresponding smart terminal for display of the natural language answer.

[0071] This application embodiment obtains question information, performs word segmentation on the question information to obtain word segmentation results, filters the word segmentation results for keywords based on preset stop words, and obtains multiple first keywords; queries the target database for multiple second keywords associated with the first keywords, determines the semantic distance between the first keywords and each second keyword based on the association type between the first keywords and each second keyword, identifies the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combines each similar keyword and each first keyword according to the keyword part of speech to obtain the target keyword; retrieves question information in the target database based on the target keyword to obtain target matching information, and performs natural language conversion on the target matching information through a generative large model to generate a natural language answer. In the above scheme, by determining the semantic distance between the first keywords and each second keyword, identifying the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combining each similar keyword and each first keyword to obtain the target keyword, and retrieving question information based on the target keyword, the same question-and-answer results can be obtained for different question types, ensuring the consistency of question-and-answer results and improving the accuracy of question-and-answer result retrieval.

[0072] Optionally, the step of retrieving query information from the target database based on the target keywords to obtain target matching information includes:

[0073] If a target search keyword with the same name as the target keyword exists in the target database, retrieve the historical search results corresponding to the target search keyword, and determine the historical search results as target matching information;

[0074] If no target search keyword identical to the target keyword exists in the target database, retrieve matching data corresponding to the target search keyword, and determine the matching data as target matching information.

[0075] The historical search results may include target keywords used during the historical search process, with different historical search results corresponding to specific matching information. The target database may include two different types of sub-databases: a first sub-database and a second sub-database. The first sub-database stores the keywords used in the historical search process and the relationships between them, while the second sub-database is a knowledge base used to store relevant data in the target domain. In one embodiment, after determining the target keyword, keyword matching is first performed in the first sub-database of the target database to determine if there are any historical search results identical to the target keyword. If so, the historical matching information corresponding to that search result is directly determined as the target matching information. If not, all information associated with the target keyword is retrieved from the second sub-database of the target database, and this retrieval result is determined as the target matching information.

[0076] This application embodiment retrieves historical search results corresponding to the target search keyword when a target search keyword with the same name exists in the target database, and determines these historical search results as target matching information. Conversely, if no target search keyword with the same name exists in the target database, it retrieves matching data corresponding to the target search keyword and determines this matching data as target matching information. This approach, by first performing keyword matching in a first sub-database and then retrieving relevant content in a second sub-database if a match fails, quickly determines target matching information, improving efficiency and ensuring that the target matching information is the same for different query messages.

[0077] Figure 2 This is a flowchart of a semantic distance determination method provided in an embodiment of this application, such as... Figure 2 As shown, it includes:

[0078] Step S1021: Classify the plurality of second keywords according to the association type between the first keyword and each of the second keywords to obtain synonymous second keywords and logically related second keywords.

[0079] The association type refers to the way keywords are related and connected, including synonym association, antonymous association, logical association, etc. Synonymous association can refer to the association of keywords with the same meaning or keywords with similar meanings, such as "computer" and "PC," or "happy" and "pleasant." Logical association can also be expressed as hypernym / hypernym association or association of words of the same type, such as "sports" and "basketball," or "basketball" and "football." In one embodiment, after determining the second keywords associated with each first keyword, the association type between each first keyword and the second keyword determines whether the second keyword is a synonymous second keyword or a logically related second keyword.

[0080] Step S1022: Determine the first semantic distance between the first keyword and the synonymous second keyword, and the second semantic distance between the first keyword and the logically associated second keyword, based on the target data in the target database.

[0081] The first semantic distance represents the degree of association between the synonymous second keyword and the corresponding first keyword. The first semantic distance corresponding to a second keyword with the same meaning as the first keyword is less than the first semantic distance corresponding to a second keyword with a similar meaning to the first keyword. The second semantic distance represents the degree of association between the logically related second keyword and the corresponding first keyword. In one embodiment, the position of the first keyword or the synonymous second keyword is determined based on the target data in the target database. At this position, the first keyword and the synonymous second keyword are mutually substituted. It is determined whether the semantics after substitution conforms to the context semantic environment. The first semantic distance is determined based on the determination result. If it conforms, the first semantic distance is 0; if it does not conform, the first semantic distance is 1. The position of the first keyword and the position of the logically related second keyword are determined based on the target data in the target database. A preset amount of context data is obtained based on the corresponding position. Semantic role labeling or action labeling is performed on the first keyword and the corresponding logically related second keyword based on the context data. If the roles or actions are the same, the second semantic distance corresponding to the second keyword is determined to be 0; if the roles or actions are different, the second semantic distance corresponding to the second keyword is determined to be 1. For example, in "doctor treats patient" and "doctor heals patient", both "doctor" and "doctor" play the role of agent, and both "treat" and "heal" represent actions. Therefore, the second semantic distance between "doctor" and "doctor" is 0, and the second semantic distance between "treat" and "heal" is also 0.

[0082] This application embodiment classifies multiple second keywords based on the association type between the first keyword and each second keyword, obtaining synonymous second keywords and logically related second keywords; it then determines the first semantic distance between the first keyword and the synonymous second keywords, and the second semantic distance between the first keyword and the logically related second keywords, based on the target data in the target database. In the above scheme, the position of the first keyword and the synonymous second keywords can be used to determine the surrounding data. By combining the surrounding data, the first keyword and the synonymous second keywords can be mutually substituted. The first semantic distance is determined based on the semantics of the substitution. Furthermore, by performing role or action annotation on the first keyword and the second keywords logically related to the first keyword, the second semantic distance is determined based on the annotation results, thus improving the accuracy of the first statement distance and the second semantic distance.

[0083] Figure 3 This is a flowchart of another semantic distance determination method provided in the embodiments of this application, such as... Figure 3 As shown, it includes:

[0084] Step S10221: Determine the co-occurrence frequency of the first keyword and the synonymous second keyword based on the target data in the target database, and determine the semantic distance corresponding to the co-occurrence frequency as the first semantic distance between the first keyword and the synonymous second keyword. The co-occurrence frequency is the frequency of common occurrence of two synonyms in the same semantic environment.

[0085] The co-occurrence frequency of keywords is used to represent the number of times two keywords appear together in a specific text set or corpus. If the two keywords are synonymous, the co-occurrence frequency can be used to represent the number of times the two synonymous keywords appear together in the same context. For example, "computer" and "PC" are synonymous keywords. In contexts related to information technology and technological products, they often appear together, reflecting their close connection in these specific contexts. In one embodiment, a mapping relationship between co-occurrence frequency range and semantic distance can be pre-set. Based on the number of times the first keyword and the synonymous second keyword co-occur in the target data in the target database, the range of co-occurrence frequency is determined according to this number, and the semantic distance corresponding to the co-occurrence frequency range is determined as the first semantic distance.

[0086] Step S10222: Generate a knowledge graph of the first keyword and the logically associated second keyword based on the target data in the target database, and determine the second semantic distance between the first keyword and the logically associated second keyword based on the knowledge graph.

[0087] Among them, the existence relationship between various nodes in a certain scenario of a knowledge graph. Figure 4This is a schematic diagram of a knowledge graph provided in an embodiment of this application, such as... Figure 4 As shown, taking "sports" as the first keyword as an example, based on the target data in the target database, the second keywords logically associated with "sports" can be determined as "aerobic exercise," "anaerobic exercise," "ball sports," "sports protective gear," "sports clothing," "physical health," "mental health," "jogging," "freestyle swimming," and "mountain biking," etc. Based on this first keyword and its logically associated second keywords, a model is generated as follows: Figure 4 The knowledge graph shown indicates that the second semantic distance between "exercise" and "aerobic exercise" is 1, and the second semantic distance between "exercise" and "freestyle swimming" is 2.

[0088] This application's embodiments determine the co-occurrence frequency of a first keyword and a synonymously associated second keyword based on target data in a target database, and determine the semantic distance corresponding to the co-occurrence frequency as the first semantic distance between the first keyword and the synonymously associated second keyword; a knowledge graph of the first keyword and logically associated second keywords is generated based on the target data in the target database, and the second semantic distance between the first keyword and the logically associated second keyword is determined based on the knowledge graph. This approach enables rapid and accurate determination of the corresponding first semantic distance through co-occurrence frequency, and intuitive and rapid determination of the second semantic distance through the knowledge graph, improving the accuracy and efficiency of semantic distance determination.

[0089] Figure 5 This is a schematic diagram of the structure of a question-and-answer result retrieval device based on keyword matching provided in an embodiment of this application, as shown below. Figure 5 As shown, it includes:

[0090] The word segmentation processing module 21 is used to obtain the question information, perform word segmentation processing on the question information, and obtain the word segmentation processing result.

[0091] Keyword filtering module 22 is used to filter the word segmentation results based on preset stop type words to obtain multiple first keywords;

[0092] The target keyword generation module 23 is used to query multiple second keywords associated with the first keyword in the target database, determine the semantic distance between the first keyword and each second keyword according to the association type between the first keyword and each second keyword, determine the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keyword to obtain the target keyword;

[0093] Information retrieval module 24 is used to retrieve query information from the target database based on the target keywords to obtain target matching information;

[0094] The natural language answer generation module 25 is used to perform natural language conversion on the target matching information through a generative large model to generate a natural language answer.

[0095] This application embodiment obtains question information, performs word segmentation on the question information to obtain word segmentation results, filters the word segmentation results for keywords based on preset stop words, and obtains multiple first keywords; queries the target database for multiple second keywords associated with the first keywords, determines the semantic distance between the first keywords and each second keyword based on the association type between the first keywords and each second keyword, identifies the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combines each similar keyword and each first keyword according to the keyword part of speech to obtain the target keyword; retrieves question information in the target database based on the target keyword to obtain target matching information, and performs natural language conversion on the target matching information through a generative large model to generate a natural language answer. In the above scheme, by determining the semantic distance between the first keywords and each second keyword, identifying the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combining each similar keyword and each first keyword to obtain the target keyword, and retrieving question information based on the target keyword, the same question-and-answer results can be obtained for different question types, ensuring the consistency of question-and-answer results and improving the accuracy of question-and-answer result retrieval.

[0096] In one possible embodiment, the target keyword generation module 23 is specifically used for:

[0097] The multiple second keywords are classified according to the association type between the first keyword and each of the second keywords to obtain synonymous second keywords and logically related second keywords;

[0098] Based on the target data in the target database, determine the first semantic distance between the first keyword and the synonymous second keyword, and the second semantic distance between the first keyword and the logically associated second keyword.

[0099] In one possible embodiment, the target keyword generation module 23 is further configured to:

[0100] The co-occurrence frequency of the first keyword and the synonymous second keyword is determined based on the target data in the target database, and the semantic distance corresponding to the co-occurrence frequency is determined as the first semantic distance between the first keyword and the synonymous second keyword. The co-occurrence frequency is the frequency of the two synonyms appearing together in the same semantic environment.

[0101] A knowledge graph is generated based on the target data in the target database, which is used to connect the first keyword with the logically associated second keyword. The second semantic distance between the first keyword and the logically associated second keyword is then determined based on the knowledge graph.

[0102] In one possible embodiment, the information retrieval module 24 is specifically used for:

[0103] If a target search keyword with the same name as the target keyword exists in the target database, retrieve the historical search results corresponding to the target search keyword, and determine the historical search results as target matching information;

[0104] If no target search keyword identical to the target keyword exists in the target database, retrieve matching data corresponding to the target search keyword, and determine the matching data as target matching information.

[0105] In one possible embodiment, the target keyword generation module 23 is specifically used for:

[0106] Based on the part-of-speech of the keywords, the similar keywords and the first keywords are classified to obtain a variety of similar keywords and first keywords with different parts of speech;

[0107] By freely combining similar keywords of different parts of speech and primary keywords of different parts of speech, the target keywords can be obtained.

[0108] In one possible embodiment, the calibration module is used for:

[0109] Keyword calibration is performed on the word segmentation results to obtain calibration data.

[0110] The target keyword generation module 23 is specifically used for:

[0111] The calibration data is filtered for keywords based on the preset stop type words to obtain multiple first keywords. The stop type words include at least one of the following: no-target words, repetitive words, modal words, and filler words.

[0112] In one possible embodiment, the target database determination module is used to:

[0113] Obtain the context data associated with the question information, parse the context data, determine the question-and-answer scenario, and determine the target database corresponding to the question-and-answer scenario.

[0114] This application also provides an electronic device that can integrate a keyword matching-based question and answer result retrieval device provided in this application. Figure 6This is a schematic diagram of the structure of a question-and-answer result retrieval device based on keyword matching provided in an embodiment of this application. (Refer to...) Figure 6 The keyword-matching-based question-and-answer result retrieval device includes: an input device 33, an output device 34, a memory 32, and one or more processors 31; the memory 32 is used to store one or more programs; when one or more programs are executed by one or more processors 31, the one or more processors 31 implement the keyword-matching-based question-and-answer result retrieval method provided in the above embodiments. The input device 33, output device 34, memory 32, and processors 31 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.

[0115] The memory 32, as a computing device-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the keyword-matching question-and-answer result retrieval method provided in any embodiment of this application. The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 32 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 32 may further include memory remotely located relative to the processor 31, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0116] Input device 33 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 34 may include display devices such as a display screen.

[0117] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, thereby realizing the above-mentioned question-and-answer result retrieval method based on keyword matching.

[0118] The keyword-matching question-and-answer result retrieval device, equipment, and computer provided above can be used to execute the keyword-matching question-and-answer result retrieval method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0119] This application embodiment also provides a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the keyword-matching-based question-and-answer result retrieval method provided in the above embodiment. The keyword-matching-based question-and-answer result retrieval method includes:

[0120] Obtain question information, perform word segmentation on the question information to obtain word segmentation results, and filter the word segmentation results for keywords based on preset stop type words to obtain multiple first keywords;

[0121] Query multiple second keywords associated with the first keyword in the target database, determine the semantic distance between the first keyword and each second keyword based on the association type between the first keyword and each second keyword, identify the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keyword to obtain the target keyword;

[0122] Based on the target keywords, query information is retrieved from the target database to obtain target matching information. Then, natural language conversion is performed on the target matching information using a generative big data model to generate a natural language answer.

[0123] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0124] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the question-and-answer result retrieval method based on keyword matching as described above, but can also execute related operations in the question-and-answer result retrieval method based on keyword matching provided in any embodiment of this application.

[0125] The question-and-answer result retrieval device, equipment, and storage medium based on keyword matching provided in the above embodiments can execute the question-and-answer result retrieval method based on keyword matching provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the question-and-answer result retrieval method based on keyword matching provided in any embodiment of this application.

[0126] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A question-and-answer result retrieval method based on keyword matching, characterized in that, include: Obtain question information, perform word segmentation on the question information to obtain word segmentation results, and filter the word segmentation results for keywords based on preset stop type words to obtain multiple first keywords; The process involves querying multiple second keywords associated with the first keyword in the target database, classifying the multiple second keywords according to the association type between the first keyword and each second keyword, obtaining synonymous second keywords and logically associated second keywords, determining the co-occurrence frequency of the first keyword and the synonymous second keywords based on the target data in the target database, and determining the semantic distance corresponding to the co-occurrence frequency as the first semantic distance between the first keyword and the synonymous second keywords, where the co-occurrence frequency is the frequency of common occurrence of two synonyms in the same semantic environment, generating a knowledge graph of the first keyword and the logically associated second keywords based on the target data in the target database, determining the second semantic distance between the first keyword and the logically associated second keywords based on the knowledge graph, identifying the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combining each similar keyword and each first keyword according to the part of speech of the keywords to obtain the target keyword; Based on the target keywords, query information is retrieved from the target database to obtain target matching information. Then, natural language conversion is performed on the target matching information using a generative big data model to generate a natural language answer.

2. The question-answering result retrieval method based on keyword matching according to claim 1, characterized in that, The step of retrieving query information from the target database based on the target keywords to obtain target matching information includes: If a target search keyword with the same name as the target keyword exists in the target database, retrieve the historical search results corresponding to the target search keyword, and determine the historical search results as target matching information; If no target search keyword identical to the target keyword exists in the target database, retrieve matching data corresponding to the target keyword and determine the matching data as target matching information.

3. The question-answering result retrieval method based on keyword matching according to claim 1, characterized in that, The process of freely combining similar keywords and primary keywords based on their parts of speech to obtain target keywords includes: Based on the part-of-speech of the keywords, the similar keywords and the first keywords are classified to obtain a variety of similar keywords and first keywords with different parts of speech; By freely combining similar keywords of different parts of speech and primary keywords of different parts of speech, the target keywords can be obtained.

4. The question-answering result retrieval method based on keyword matching according to claim 1, characterized in that, Before performing keyword filtering on the word segmentation results based on preset stop type words, the method further includes: The word segmentation results are then subjected to keyword calibration to obtain calibration data; Accordingly, the word segmentation results are filtered based on preset stop type words to obtain multiple first keywords, including: The calibration data is filtered for keywords based on the preset stop type words to obtain multiple first keywords. The stop type words include at least one of the following: no-target words, repetitive words, modal words, and filler words.

5. The question-answering result retrieval method based on keyword matching according to claim 1, characterized in that, After obtaining the query information, the following is also included: Obtain the context data associated with the question information, parse the context data, determine the question-and-answer scenario, and determine the target database corresponding to the question-and-answer scenario.

6. A question-and-answer result retrieval device based on keyword matching, characterized in that, include: The word segmentation processing module is used to obtain the question information, perform word segmentation processing on the question information, and obtain the word segmentation processing result. The keyword filtering module is used to filter the word segmentation results based on preset stop words to obtain multiple first keywords. The target keyword generation module is used to query multiple second keywords associated with the first keyword in the target database, classify the multiple second keywords according to the association type between the first keyword and each second keyword to obtain synonymous second keywords and logically associated second keywords, determine the co-occurrence frequency of the first keyword and the synonymous second keywords according to the target data in the target database, and determine the semantic distance corresponding to the co-occurrence frequency as the first semantic distance between the first keyword and the synonymous second keywords, where the co-occurrence frequency is the frequency of common occurrence of two synonyms in the same semantic environment, generate a knowledge graph of the first keyword and the logically associated second keywords according to the target data in the target database, determine the second semantic distance between the first keyword and the logically associated second keywords according to the knowledge graph, identify the multiple second keywords corresponding to the shortest semantic distance as similar keywords, and freely combine each similar keyword and each first keyword according to the part of speech of the keywords to obtain the target keyword; The information retrieval module is used to retrieve query information from the target database based on the target keywords to obtain target matching information; The natural language answer generation module is used to perform natural language conversion on the target matching information through a generative large model to generate a natural language answer.

7. An electronic device, the device comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the question-answering result retrieval method based on keyword matching as described in any one of claims 1-5.

8. A storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the question-and-answer result retrieval method based on keyword matching as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Synonym mining method and device for question and answer retrieval system

    CN110442760A

  • Computer implemented system and methods for implementing a search engine access point enhanced for suggested listing navigation

    US20200380047A1