Big model-based keyword expansion and multi-information fusion data element search method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DATA SPACE RES INST
- Filing Date
- 2023-10-31
- Publication Date
- 2026-08-07
AI Technical Summary
[0011]本发明的目的在于提供基于大模型的关键词扩充与多信息融合数据要素搜索方法,为了解决搜索场景下,因用户描述不清楚、用户意图理解不到位导致的搜索结果匹配度低、搜索体验不好的问题,提出基于大语言模型的关键词扩充与多信息融合搜索方法来优化搜索结果,解决了背景技术中所提出的问题
[0025]本发明的基于大模型的关键词扩充与多信息融合数据要素搜索方法,通过自研大语言模型SearchLLM来扩充关键词,利用SearchLLM的语义理解能力,充分理解用户搜索意图,并结合生成能力进一步细化用户搜搜需求,且可将用户背景信息与搜索词相融合,通过Prompt封装后,由大语言模型进行理解后充分理解和优化并返回搜索词,因此本申请可基于大语言模型技术与向量搜索技术,通过关键词扩充机制、多信息融合机制两大关键技术,实现根据不同领域、背景、需求反馈给用户不同内容的搜索结果,从而形成个性化的搜索引擎,大大提高搜索体验。
Smart Images

Figure CN117453725B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent search technology, specifically to a method for searching data elements based on keyword expansion and multi-information fusion using a large model. Background Technology
[0002] Currently, since the emergence of the Web, the amount of information on the network has increased almost exponentially, especially in recent years. There are two main reasons for this: First, Web 2.0 users are transforming from simple information consumers to dual roles as producers and consumers; second, the development of the Deep Web has led to an ever-accelerating pace of information updates. Studies have shown that 25% of new links are generated every week.
[0003] A search engine is a system that automatically collects information from the Internet, organizes it, and then provides it to users for querying. The information on the Internet is vast and disordered; all the information is like small islands in a vast ocean, and web page links are the crisscrossing bridges between these islands. A search engine, on the other hand, creates a clear and concise information map for users to access at any time.
[0004] The working principle of existing search engines can be described in the simplest terms as follows:
[0005] Information gathering: First, a robot program called a web crawler is used to track the hyperlinks of every webpage on the Internet. Since no webpage on the Internet exists independently (there must be links to other webpages), the robot program then links from the original webpage to other webpages, one link leads to ten, ten leads to a hundred, and so on. In this way, the web crawler has crawled the vast majority of webpages.
[0006] Information organization: The process by which search engines organize information is called "indexing". Search engines not only need to store the collected information, but also need to arrange it according to certain rules. In this way, search engines can quickly find the information they need without having to search through all the information they have stored.
[0007] Accepting queries: Users send queries to the search engine, the search engine accepts the queries and returns information to the users. The search engine receives a large number of queries from users almost simultaneously every moment. It checks its index according to each user's request, finds the information the user needs in a very short time, and returns it to the user.
[0008] The existing technical solutions still have at least the following shortcomings:
[0009] 1. Users often struggle to effectively express their search needs: When users cannot find information or are searching for information in unfamiliar fields, they often use search engines to obtain search results by describing keywords. The search results are usually closely related to the keywords, but in professional fields, users often find it difficult to properly express their search keywords.
[0010] 2. Search engines struggle to effectively understand user search needs: Search engine programs cannot accurately determine the true needs of users. Different people may search for different content using the same keywords. In the process of returning search results, organizing all results in descending order of importance is crucial. Currently, many search engines use traditional information retrieval algorithms and technologies based on keyword queries, returning tens of thousands of pages, which is insufficient to accurately and effectively meet user needs. Summary of the Invention
[0011] The purpose of this invention is to provide a keyword expansion and multi-information fusion data element search method based on a large model. In order to solve the problems of low search result matching and poor search experience caused by unclear user descriptions and inadequate understanding of user intent in search scenarios, this invention proposes a keyword expansion and multi-information fusion search method based on a large language model to optimize search results and solve the problems mentioned in the background art.
[0012] To achieve the above objectives, the present invention provides the following technical solution: a method for searching data elements based on keyword expansion and multi-information fusion using a large model, comprising the following steps:
[0013] S1. When a user describes keywords in a search engine, the semantic understanding capability of the large language model is used to fully understand the user's search intent based on the keywords entered by the user. Combined with the generation capability, the user's search needs are further refined, and the large language model is called to generate expanded keywords, thereby completing the keyword expansion work and further enriching the user's search information.
[0014] S2. The search engine calls the user's identity information on the platform, integrates the user's background information with the search terms, encapsulates it through a prompt, and then the large language model fully understands and optimizes it before returning the search terms, thus completing the multi-information fusion work.
[0015] S3. The optimized keywords are used to generate feature vectors through a vectorization model, and the similarity between the keywords and the data to be matched in the vector database is calculated through vector similarity. The data with high similarity is then returned as the search results.
[0016] The large language model is trained on a search query optimization dataset. The automatic discrete prompt search method is used to fine-tune the large language model based on P-Tuning technology. The parameters of the large model are fixed, and the prompt is encoded using multilayer perceptron and LSTM. After encoding, it is concatenated with other vectors and then input into the LLM normally.
[0017] In a preferred embodiment of the present invention, the keyword expansion in S1 is accomplished by combining the keywords input by the user with the Prompt and inputting them into the large language model for keyword expansion.
[0018] In a preferred embodiment of the present invention, in step S2, the multi-information fusion extracts the user's profession, field, direction, and the top five frequently searched directions based on the user ID, combines them with the expanded keywords and Prompt, and inputs them into the large language model for multi-information fusion.
[0019] In a preferred embodiment of the present invention, the P-Tuning technique inputs some pseudo-prompts into the LSTM, and then uses the output vector of the LSTM to replace the original prompt tokens and input them into the pre-trained language model for fine-tuning the language model.
[0020] In a preferred embodiment of the present invention, the vectorization model in S3 uses a dedicated embedding layer that embeds pre-trained words into the vector space to complete the vectorization of the text.
[0021] In a preferred embodiment of the present invention, the vector database in S3 is used to store and process vector data and provide efficient vector retrieval functions.
[0022] In a preferred embodiment of the present invention, the vector similarity calculation method in S3 adopts cosine similarity.
[0023] In a preferred embodiment of the present invention, after fine-tuning the training of the large language model, only the vector after prompt encoding is retained, and the encoder is not retained.
[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0025] The keyword expansion and multi-information fusion data element search method based on a large model of the present invention expands keywords by using a self-developed large language model SearchLLM. Utilizing SearchLLM's semantic understanding capabilities, it fully understands the user's search intent and further refines the user's search needs by combining its generation capabilities. Furthermore, it can integrate user background information with search terms, encapsulate them through a Prompt, and then have the large language model fully understand, optimize, and return the search terms. Therefore, this application, based on large language model technology and vector search technology, through two key technologies—keyword expansion mechanism and multi-information fusion mechanism—can achieve search results that provide users with different content based on different fields, backgrounds, and needs, thereby forming a personalized search engine and greatly improving the search experience. Attached Figure Description
[0026] By reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of the overall framework of the keyword expansion and multi-information fusion data element search method based on a large model according to the present invention.
[0028] Figure 2 This is a flowchart illustrating the keyword expansion and multi-information fusion data element search method based on a large model according to the present invention.
[0029] Figure 3 This is a schematic diagram of the P-Tuning training architecture of the keyword expansion and multi-information fusion data element search method based on a large model according to the present invention.
[0030] Figure 4 This is a data comparison diagram illustrating the keyword expansion and multi-information fusion data element search method based on a large model according to the present invention. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] Example 1
[0033] Please see Figure 1-2 This invention provides a technical solution: a data element search method based on keyword expansion and multi-information fusion using a large model.
[0034] When a user describes keywords in a search engine, the semantic understanding capabilities of the SearchLLM large language model are used to fully understand the user's search intent based on the keywords entered by the user. Combined with the generation capabilities, the user's search needs are further refined, and the large language model is called to generate expanded keywords, thereby completing the keyword expansion work and further enriching the user's search information.
[0035] Specifically, based on users' search keywords, the content is expanded using the self-developed large language model SearchLLM. By leveraging SearchLLM's semantic understanding capabilities, the system fully comprehends users' search intent and further refines their search needs using generative capabilities. An example is shown below:
[0036] Search keywords: pathology slide training set
[0037] Expanded keywords: "pathological slides" + "training set" + "medical images" + "datasets" + "deep learning" + "machine learning" + "medical research" + "medical training data" + "pathological image analysis" + "medical image processing".
[0038] In this embodiment, the mechanism is accomplished by combining the keywords input by the user with the Prompt and then feeding them into a large language model for keyword expansion.
[0039] Example 2
[0040] Please see Figure 1-2 The search engine calls the user's identity information on the platform, integrates the user's background information with the search terms, encapsulates it through a Prompt, and then the large language model fully understands and optimizes it before returning the search terms, thus completing the multi-information fusion work.
[0041] Specifically, when users search for information, it is usually closely related to their knowledge background and business field. Especially on a data circulation platform like Data Element Field, users' data needs are often in a specific field. For example, if a user in the medical industry searches for "dataset", the search results presented to the user by the platform should be as closely related to the hidden information of the medical industry as possible. This can greatly improve the user search experience and realize "personalized search that is relevant to you".
[0042] In this embodiment, after being encapsulated by Prompt, the large language model fully understands and optimizes the search terms and returns them.
[0043] Example as follows:
[0044] The search terms are:
[0045] User Information: Industry: Healthcare; Specialty: Internal Medicine, Medical Imaging; Frequently Viewed Topics: Lung Diseases, Lung Lobe, Tuberculosis; Search Terms: Datasets;
[0046] Imagine you are a search expert. Based on user information and search terms, help users optimize their search terms to achieve search results that better meet their potential needs. Return the optimized results in JSON format.
[0047] The search results are:
[0048] {"search_terms":["Lung Disease Dataset","Lung Lobe Dataset","Tuberculosis Dataset"],"search_description":"For users in the medical industry specializing in internal medicine and medical imaging, we recommend datasets related to lung diseases, lung lobes, and tuberculosis to meet their needs in research and practice."}
[0049] Example 3
[0050] Please see Figure 1-2 The optimized keywords generate feature vectors through a vectorization model, and the similarity between them and the data to be matched in the vector database is calculated through vector similarity, thereby returning the data with high similarity as search results;
[0051] Specifically, vectors are an important metric in large language models, knowledge base interactions, and computation processes. They can represent text and knowledge as mathematical vectors, and text vectorization is accomplished by using pre-trained word embeddings or embedding them into a dedicated embedding layer in the vector space.
[0052] In this embodiment, the main function of the vector database is to store and process vector data and provide efficient vector retrieval functions. The core function is similarity search, which finds the most similar vector (the most similar knowledge or content) by calculating the distance between a vector and all other vectors. The similarity measurement method adopts cosine similarity, which is a method used to measure the similarity between two vectors. It is usually used in multidimensional space. It measures the cosine value of the angle between two vectors, thus providing a way to evaluate the relationship between them. Cosine similarity is commonly used in text processing, information retrieval, recommendation systems and cluster analysis.
[0053] The formula for calculating cosine similarity is as follows:
[0054] cosine_similarity(A,B)=(A dot B) / (||A||*||B||)
[0055] Where A and B are two vectors to be compared.
[0056] dot represents the dot product of vectors, also known as the inner product, which is the sum of the products of corresponding elements of two vectors.
[0057] ||A|| and ||B|| represent the modulus (or length) of a vector, which can be obtained by calculating the sum of the squares of each vector element and then taking the square root.
[0058] The value of cosine similarity ranges from -1 to 1:
[0059] When the cosine similarity is equal to 1, it means that the two vectors have the same direction in multidimensional space, that is, they are completely similar.
[0060] When the cosine similarity is equal to 0, it means that there is no linear relationship between the two vectors, and they are unrelated.
[0061] When the cosine similarity is -1, it means that the two vectors have opposite directions in multidimensional space, that is, they are completely different.
[0062] Characteristics of cosine similarity:
[0063] Unaffected by vector length: Cosine similarity is not affected by the absolute size of the vectors, but only by their direction, so it is applicable to vector comparisons of any dimension.
[0064] Ignoring zero elements: Cosine similarity can effectively handle sparse vectors because it ignores the zero elements in both vectors.
[0065] Bounded range: The range of cosine similarity is always between -1 and 1, making it easy to interpret and compare.
[0066] Example 4
[0067] Please see Figure 3-4 The large language model is trained on the search query optimization dataset. The automatic discrete prompt search method is used to fine-tune the large language model based on P-Tuning technology. The LLM parameters are fixed, and the prompt is encoded using multilayer perceptron and LSTM. After encoding, it is concatenated with other vectors and then input into the LLM normally.
[0068] In this model, after training, the large language model only retains the vector encoded by the prompt and does not retain the encoder.
[0069] The specific training architecture of P-Tuning is as follows: Tuning inputs some pseudo-prompts into an LSTM, then uses the output vector of the LSTM to replace the original prompt tokens, and then inputs them together into a pre-trained language model. Moreover, the LSTM is trained together with the pre-trained language model. It is not randomly initialized with several new tokens and then trained directly, but rather a small LSTM model is used to calculate these embeddings, and this LSTM model is set as a learnable operator, as follows:
[0070]
[0071] In this embodiment, the P-Tuning method has the following advantages:
[0072] (1) Based on the bert-base model, P-tuning performs better than fine-tuning on 5 / 7 datasets.
[0073] (2) Based on the GPT model, P-tuning outperforms fine-tuning and other methods on all datasets.
[0074] (3) Comparing gpt-base and bert-base, gpt-base performs better on 6 / 7 of the datasets based on P-tuning.
[0075] (4) In the natural language understanding task of searching keywords, the bidirectional LSTM model is better than the unidirectional LSTM model.
[0076] The operation process of this method is as follows:
[0077] 1. Users describe keywords in search engines, such as: medical dataset;
[0078] 2. The search engine calls a large language model to generate expanded keywords, such as: medical public dataset, medical training set, medical research, deep learning, machine learning, medical data analysis set;
[0079] 3. The search engine calls the user's identity information on the platform to obtain the top 5 most frequently viewed directions in the industry (medicine), profession (imaging) (lung disease, cancer, alveoli, etc.), and provides fused search keywords through a large language model, such as: lung medical imaging dataset, lung cancer dataset, lung image dataset, deep learning medical imaging training set.
[0080] 4. The optimized keywords are used to generate feature vectors through a vectorization model. The results of similar documents are then obtained from a vector database and returned to the search engine to present the search results to the user.
Claims
1. A method for keyword expansion and multi-information fusion data element search based on a large model, characterized in that: Includes the following steps: S1. The user enters keywords in the search engine, combines the keywords with the Prompt, and inputs them into the large language model SearchLLM. The large language model SearchLLM is used to perform semantic understanding and refine the search requirements of the keywords to generate expanded keywords. S2. The search engine extracts the top five items of the user's profession, field, direction and frequently searched direction on the platform based on the user ID, encapsulates the top five items of the profession, field, direction and frequently searched direction, the expanded keywords and the Prompt, inputs them into the SearchLLM large language model for multi-information fusion, and returns the fused search terms. S3. Input the fused search terms into a vectorization model, wherein the vectorization model uses a dedicated embedding layer that embeds pre-trained words into a vector space to generate feature vectors; S4. Input the feature vector into the vector database, calculate the similarity between the feature vector and the data vector to be matched in the vector database using cosine similarity, and return the data with high similarity as the search result. The large language model SearchLLM is trained on a search query optimized dataset and fine-tuned using P-Tuning technology with an automatic discrete prompt search method. The large model parameters are fixed, and the prompt is encoded using a multilayer perceptron and LSTM. After encoding, the prompt is concatenated with other vectors and then input into the LLM. The P-Tuning technology inputs the pseudo-prompt into the LSTM, and then uses the output vector of the LSTM to replace the original prompt token and input it into the pre-trained language model. After fine-tuning and training, the SearchLLM large language model retains only the vector encoded by the prompt and does not retain the encoder.
2. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The expanded keywords in S1 include search terms that have synonymous, hierarchical, application scenario, and retrieval task relationships with the user-input keywords.
3. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The fused search terms in S2 are returned in the form of structured fields, which include a search term field and a search description field.
4. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The top five most frequently searched terms are extracted by the search engine based on the user's historical search and browsing history on the platform, sorted by frequency of occurrence.
5. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The vector database stores the vector data of the data to be matched, and sorts the data to be matched according to the calculation results of the cosine similarity.
6. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: When a user enters keywords related to the medical field, the SearchLLM large language model generates fusion search terms related to medical images, training data, pathological image analysis, or medical image processing based on the user's expertise, field, and common search directions.
7. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The data with high similarity are those data in the vector database that are sorted by cosine similarity and fall within a preset return range.
8. The keyword expansion and multi-information fusion data element search method based on a large model according to claim 1, characterized in that: The search results return different data elements based on the user's profession, field, direction, and the top five most frequently searched directions. For the same user, the search results return different data elements.
Citation Information
Patent Citations
Enterprise knowledge base question answering system based on large model and knowledge graph
CN116821310A