Retrieval enhancement method combining keyword extraction and semantic analysis

By combining keyword extraction and semantic analysis, the problem of inaccurate keyword extraction by traditional search engines in government Q&A is solved, and more efficient and accurate information retrieval is achieved, which is suitable for government affairs and other fields.

CN118535682AInactive Publication Date: 2024-08-23XIAODUO INTELLIGENT TECH (BEIJING) CO LTD

Patent Information

Application Number
CN202410745468.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional search engines are difficult to accurately extract keywords when processing complex government questions and answers, and ignore the correlation between words, resulting in incomplete or inaccurate search results and unable to meet the diverse and personalized needs of users.

Method used

Combining the method of keyword extraction and semantic analysis, the key words are screened through the preset keyword extraction model and semantic analysis model, and the pre-trained natural language processing model is used to determine the candidate key statement set, and the cosine similarity is calculated based on the vector retrieval module to return the correlation Knowledge information and answers to user questions.

Benefits of technology

It improves the accuracy and efficiency of information retrieval, can better understand user queries, and meets users' personalized needs. It is suitable for information retrieval in government Q&A and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535682A
    Figure CN118535682A
Patent Text Reader

Abstract

The invention provides a retrieval enhancement method combining keyword extraction and semantic analysis. The retrieval enhancement method comprises the following steps: receiving query information of a user and converting the query information into text data; using a preset keyword extraction model and a semantic analysis model to screen out keywords of the text data; inputting the keyword as a training sample into a pre-training natural language processing model to determine a candidate key statement set; based on a vector retrieval module, knowledge information most relevant to the text data is returned from a vector database by calculating cosine similarity; and answering the questions in the text data according to the knowledge information to obtain answers. According to the method, the information inquired by the user can be more accurately understood, so that the information retrieval efficiency and accuracy are greatly improved, and the requirements of the user are better met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information retrieval, and in particular to a retrieval enhancement method combining keyword extraction and semantic analysis. Background Art

[0002] With the rapid development of the Internet, the amount of information has exploded. However, traditional search engines cannot meet the diverse needs of users and the requirements for personalized experience. Therefore, a technology that can improve the diversity, accuracy and personalization of retrieval results is needed to meet this challenge.

[0003] Keyword extraction is one of the important tasks in natural language processing. It aims to extract representative words or phrases from text datasets as keywords for query matching to obtain relevant knowledge. Currently commonly used methods include methods based on word frequency statistics such as the BM25 algorithm and deep learning models such as BERT-basedKeywordExtractionModels. However, these methods often only consider the importance of individual words or phrases and ignore the relationship between them. This results in the extracted keywords being incomplete or inaccurate. In addition, due to the large amount of professional knowledge and terminology involved in the field of government question answering, existing keyword extraction methods are difficult to adapt to this complex situation. Therefore, it is necessary to propose new technical solutions to solve these problems. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, an object of the present invention is to provide a retrieval enhancement method combining keyword extraction and semantic analysis.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A retrieval enhancement method combining keyword extraction and semantic analysis, comprising:

[0007] Receiving query information from a user and converting the query information into text data;

[0008] Filter out key words of the text data using a preset keyword extraction model and a semantic analysis model;

[0009] Input the key words as training samples into a pre-trained natural language processing model to determine a set of candidate key sentences;

[0010] Based on the vector retrieval module, the knowledge information most relevant to the text data is returned from the vector database by calculating the cosine similarity;

[0011] The questions in the text data are answered according to the knowledge information to obtain answers.

[0012] Preferably, the method for constructing the keyword extraction model includes:

[0013] Constructing a first fine-tuning dataset; the first fine-tuning dataset includes questions raised by users and keywords corresponding to the questions;

[0014] The pre-trained natural language processing model is fine-tuned according to the first fine-tuning data set to obtain the keyword extraction model.

[0015] Preferably, the method for constructing the semantic analysis model includes:

[0016] Constructing a second fine-tuning dataset; the second fine-tuning dataset includes questions raised by users and the true meanings of the questions;

[0017] The pre-trained natural language processing model is fine-tuned according to the second fine-tuning dataset to obtain the semantic analysis model.

[0018] Preferably, the key words are input as training samples into a pre-trained natural language processing model to determine a set of candidate key sentences, including:

[0019] The key words are divided into three types of questions by manual annotation; the three types of questions include: correct answers, wrong answers and repeated answers;

[0020] Using a pre-trained natural language processing model to fine-tune the key words corresponding to the three types of questions, so that each key word has a higher accuracy rate in the corresponding category;

[0021] A statistical method is used to calculate the relevance score of each keyword, and the top 3% of the keywords with the highest relevance are selected as the candidate key statement set after sorting according to the relevance scores.

[0022] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0023] The present invention provides a retrieval enhancement method combining keyword extraction and semantic analysis, including: receiving user query information and converting the query information into text data; using a preset keyword extraction model and a semantic analysis model to screen out key words of the text data; inputting the key words into a pre-trained natural language processing model as training samples to determine a set of candidate key sentences; based on a vector retrieval module, returning the knowledge information most relevant to the text data from a vector database by calculating cosine similarity; answering questions in the text data according to the knowledge information to obtain answers. The present invention can more accurately understand the information queried by the user, which greatly improves the retrieval efficiency and accuracy of the information, thereby better meeting the needs of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 A flow chart of a method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] The purpose of the present invention is to provide a retrieval enhancement method combining keyword extraction and semantic analysis, which can more accurately understand the information queried by users, which greatly improves the retrieval efficiency and accuracy of information, thereby better meeting the needs of users.

[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Figure 1 A flow chart of a method provided by an embodiment of the present invention, such as Figure 1 As shown, the present invention provides a retrieval enhancement method combining keyword extraction and semantic analysis, comprising:

[0030] Step 100: receiving query information from a user and converting the query information into text data;

[0031] Step 200: Filter out key words of the text data using a preset keyword extraction model and semantic analysis model;

[0032] Step 300: Input the key words as training samples into a pre-trained natural language processing model to determine a set of candidate key sentences;

[0033] Step 400: Based on the vector retrieval module, the knowledge information most relevant to the text data is returned from the vector database by calculating the cosine similarity;

[0034] Step 500: answer the questions in the text data according to the knowledge information to obtain answers.

[0035] Specifically, the construction process of the keyword extraction model in this embodiment is as follows:

[0036] First, this embodiment creates a fine-tuning dataset, which contains questions raised by users and their keywords. The selection of these keywords is based on factors such as word frequency, part of speech, and semantics to ensure that the most representative keywords are selected. The keyword extraction model is fine-tuned based on the qwen model to extract keywords by evaluating the importance of words.

[0037] Furthermore, the construction process of the semantic analysis large model of this embodiment is as follows:

[0038] This example creates a fine-tuned dataset containing user questions and their true meanings. This helps the model understand and process typos, repetitions, verbose or difficult language. The semantic analysis model is also fine-tuned based on the qwen model (pre-trained natural language processing model) to improve its language understanding ability and the accuracy of the answer.

[0039] Furthermore, the vector retrieval module of this embodiment uses an embedding model to encode unstructured data into vectors and retrieve knowledge from the vector library, and returns the top k pieces of knowledge most relevant to the user input by calculating cosine similarity.

[0040] In addition, this embodiment also includes a dialogue model, which is the output module of the system. The dialogue model receives user input and retrieved knowledge and generates answers. The model is fine-tuned based on the qwen model, i.e., the qwen1.5-14b model and 100,000 professional question-and-answer knowledge.

[0041] Optionally, the method further comprises the following steps:

[0042] Receive the user's query information and convert it into text form; use factors such as word frequency, part of speech and semantics to filter out the key words of the query; submit these key words as training samples to the qwen1.5-14b large pre-trained natural language processing model to obtain the corresponding weight values, thereby obtaining a set of candidate key sentences with higher weights; return the topk most relevant knowledge to the query from the vector database by calculating cosine similarity; answer the questions in the query based on the returned knowledge and send the answers to the user.

[0043] Furthermore, this embodiment first obtains a fine-tuning dataset containing questions raised by users and their true meanings, and then divides the questions into three categories by manual annotation, namely, correct answers, incorrect answers, and long-winded and repetitive answers; then uses the qwen1.5-14b large-scale pre-trained natural language processing model to fine-tune the sentences of these three types of questions respectively, so that each sentence shows a higher accuracy rate in the corresponding category; finally, a statistical method is used to calculate the relevance score of each sentence, and after sorting according to the relevance score, the top 3% of the most relevant sentences are selected as the candidate key sentence set.

[0044] Furthermore, this embodiment traverses each sentence in the set of all candidate key sentences to determine whether it meets the conditions; if the conditions are met, a higher score value is given to the sentence and the relevant information it provides is given priority in the subsequent process; otherwise, if the conditions are not met, a lower score is given to it and its contribution is not considered in the subsequent process.

[0045] Furthermore, the present embodiment achieves this goal by scoring each sentence in each set of candidate key sentences in turn; wherein the scoring criteria are based on the degree to which they can provide effective help; secondly, when more than a certain number of candidate key sentence sets fail to achieve the expected results within a specific time interval, the current task is stopped and all previously completed tasks are reviewed to determine whether there is any need for improvement; finally, once any need for improvement is found, it is adjusted immediately to ensure that the overall performance is improved.

[0046] Furthermore, this embodiment records the original scores of each sentence in each set of candidate key sentences in turn for the convenience of subsequent comparative analysis; secondly, when a certain number of candidate key sentence sets with an average score below a certain threshold have accumulated within a specific time interval and still have not achieved the desired results, the current task is stopped and a review is conducted to determine whether it is necessary to optimize the existing strategy; finally, once a situation is found that it is necessary to optimize the existing strategy, corresponding measures can be taken in a timely manner to resolve it.

[0047] Corresponding to the above method, this embodiment also provides a government dialogue system based on the qwen big model, including: a fine-tuning data set; a big model for building a keyword extraction model and a big model for semantic analysis of user input; a vector library and a vector retrieval module and a big dialogue model for generating answers; the method also includes the following steps: receiving the user's query information and converting it into text form; using factors such as word frequency, part of speech and semantics to filter out the key words of the query; submitting these keywords as training samples to the qwen1.5-14b large pre-trained natural language processing model to obtain corresponding weight values ​​to obtain a set of candidate key sentences with higher weights; returning the topk knowledge most relevant to the query from the vector database by calculating the cosine similarity; answering the questions in the query based on the returned knowledge and sending the answer to the user.

[0048] The beneficial effects of the present invention are as follows:

[0049] (1) By using the Qwen large model for fine-tuning, our technology can more accurately understand the government information that users query. This greatly improves the efficiency and accuracy of government information retrieval, thereby better meeting the needs of users;

[0050] (2) The technical method of combining keyword extraction and semantic analysis in the present invention can be applied to information retrieval in other fields, such as healthcare or education, to improve the information search capabilities in these fields and provide a better service experience;

[0051] (3) The present invention integrates multiple modules and technical means to process different types of data input, including unstructured text, images, etc., making the entire system more comprehensive and more flexible. This will help solve the contradiction between the massive information brought about by the rapid development of the Internet and personalized needs, and provide an efficient and convenient data acquisition channel and service platform for the majority of netizens.

[0052] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0053] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A search enhancement method combining keyword extraction and semantic analysis, characterized in that: include: Receiving query information from a user and converting the query information into text data; Filter out key words of the text data using a preset keyword extraction model and a semantic analysis model; Input the key words as training samples into a pre-trained natural language processing model to determine a set of candidate key sentences; Based on the vector retrieval module, the knowledge information most relevant to the text data is returned from the vector database by calculating the cosine similarity; The questions in the text data are answered according to the knowledge information to obtain answers.

2. The retrieval enhancement method combining keyword extraction and semantic analysis according to claim 1, characterized in that: The method for constructing the keyword extraction model includes: Constructing a first fine-tuning dataset; the first fine-tuning dataset includes questions raised by users and keywords corresponding to the questions; The pre-trained natural language processing model is fine-tuned according to the first fine-tuning data set to obtain the keyword extraction model.

3. The retrieval enhancement method combining keyword extraction and semantic analysis according to claim 1, characterized in that: The method for constructing the semantic analysis model includes: Constructing a second fine-tuning dataset; the second fine-tuning dataset includes questions raised by users and the true meanings of the questions; The pre-trained natural language processing model is fine-tuned according to the second fine-tuning dataset to obtain the semantic analysis model.

4. The retrieval enhancement method combining keyword extraction and semantic analysis according to claim 1, characterized in that: The key words are input as training samples into a pre-trained natural language processing model to determine a set of candidate key sentences, including: The key words are divided into three types of questions by manual annotation; the three types of questions include: correct answers, wrong answers and repeated answers; Using a pre-trained natural language processing model to fine-tune the key words corresponding to the three types of questions, so that each key word has a higher accuracy rate in the corresponding category; A statistical method is used to calculate the relevance score of each keyword, and the top 3% of the keywords with the highest relevance are selected as the candidate key statement set after sorting according to the relevance scores.

Citation Information

Patent Citations

  • Smart answering method capable of identifying natural language

    CN105930452A

  • Intelligent questioning and answering method and system

    CN108153876A

  • A method for implementing a question answering system based on a question-answer pair

    CN109271505A

  • Data retrieval / intelligent question and answer method and device and storage medium

    CN112463926A

Cited By

  • RAG-oriented multi-branch hybrid balance retrieval optimization method and system

    CN119025662A

  • Case analysis method and device, equipment, storage medium and program product

    CN119314695A

  • Database knowledge dialogue method and system based on retrieval enhancement

    CN119415638A

  • Data matching method and device for enhancing large language model in combination with external knowledge retrieval, and medium

    CN119474262A

  • Intelligent question answering method and system based on semantic vector optimization and dynamic prompt

    CN119557407A