Word weight generation model training method and device, word weight generation method and device

By acquiring target questions and answers, extracting keyword combinations, constructing document sets and calculating word weights, and training a word weight generation model, the problem of inaccurate word weight labeling in vertical domains is solved, achieving more accurate retrieval and database matching.

CN114417863BActive Publication Date: 2025-11-14BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210067908.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-07-13
Filing Date
2022-01-20
Publication Date
2025-11-14
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

In the cold start phase of vertical industries, existing technologies suffer from inaccurate word weight labeling when training machine learning models by manually labeling word segmentation weights. This leads to a mismatch between the TF-IDF of keywords in the database and human prior knowledge, affecting retrieval accuracy.

Method used

By obtaining the target question and answer, extracting keyword combinations, constructing an initial document set, determining the target document set and keyword combinations, calculating the word weight of each keyword, and training the word weight generation model until the training stops, the reliance on manual annotation is avoided.

Benefits of technology

Accurately calculate the word weight of each keyword in the target question to improve retrieval efficiency, ensure the accuracy of retrieval answers, and avoid the mismatch between keyword TF-IDF and prior knowledge in vertical domain databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417863B_ABST
    Figure CN114417863B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for training a word weight generation model, and a method and apparatus for generating word weights. The word weight generation model training method includes: obtaining a target question and a target answer corresponding to the target question; extracting at least one keyword combination from the target question, and determining an initial document set based on the at least one keyword combination; determining a target document set and a target keyword combination based on the target answer and the initial document set; determining the word weight corresponding to each keyword in the target question based on the target keyword combination; and training a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until a training stopping condition is met. The word weight generation model trained using the method provided in this application effectively avoids the problem of mismatch between keyword TF-IDF in databases built in certain vertical domains and human prior knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence in the field of computer technology, and in particular to a method and apparatus for training a word weight generation model, a method and apparatus for generating word weights, a computing device, and a computer-readable storage medium. Background Technology

[0002] Artificial intelligence (AI) refers to the ability of an engineered (i.e., designed and manufactured) system to perceive its environment, and to acquire, process, apply, and represent knowledge. Natural language processing, robotics, and computer vision have become the three most popular industrial directions in artificial intelligence. The development status of key technologies in the field of artificial intelligence includes machine learning, knowledge graphs, natural language processing, computer vision, human-computer interaction, biometrics, and virtual reality / augmented reality. With the development of computer technology, the field of natural language processing has also developed rapidly; information retrieval based on text is an important branch of natural language processing.

[0003] Natural Language Processing (NLP) is an important research area in computer science. It studies various theories and methods that enable effective communication between humans and computers using natural language. Specific manifestations of NLP include machine translation, text summarization, text classification, text proofreading, information extraction, speech synthesis, and speech recognition. With the development of NLP technology, users of various applications have increasingly higher demands for applications to accurately recognize and understand their questions. NLP faces four major challenges: first, uncertainties exist at different levels such as lexical, syntactic, semantic, pragmatic, and phonological; second, new vocabulary, terminology, semantics, and grammar lead to the unpredictability of unknown language phenomena; third, insufficient data resources make it difficult to cover complex language phenomena; and fourth, the fuzziness and intricate relationships of semantic knowledge are difficult to describe with simple mathematical models, and semantic computation requires nonlinear calculations with large parameters.

[0004] For question processing tasks, existing technologies typically employ supervised manual annotation during the cold start phase in vertical domains to label word segmentation weights in different questions, thereby training machine learning models. However, since manual annotation relies on prior human knowledge, annotation without supervised annotation of answers can lead to inaccurate word weight labeling in the questions being processed. This, in turn, can result in a mismatch between the keyword TF-IDF values ​​in databases built in certain vertical domains and human prior knowledge. Summary of the Invention

[0005] In view of this, embodiments of this application provide a word weight generation model training method and apparatus, a word weight generation method and apparatus, a computing device, and a computer-readable storage medium to address the deficiencies existing in the prior art.

[0006] According to a first aspect of the embodiments of this application, a word weight generation model training method is provided, including:

[0007] Obtain the target question and the corresponding target answer;

[0008] Extract at least one keyword combination of the target question, and determine an initial document set based on the at least one keyword combination;

[0009] Based on the target answer and the initial document set, determine the target document set and the target keyword combination;

[0010] Determine the word weight corresponding to each keyword in the target question based on the target keyword combination;

[0011] The word weight generation model is trained based on the target question, each keyword, and the word weight corresponding to each keyword until the training stops.

[0012] According to a second aspect of the embodiments of this application, a word weight generation method is provided, including:

[0013] Get the issues to be processed;

[0014] The problem to be processed is input into a pre-trained word weight generation model, wherein the word weight generation model is trained by the word weight generation model training method described above.

[0015] The word weight generation model generates at least one keyword and its corresponding word weight in response to the question to be processed as input.

[0016] According to a third aspect of the embodiments of this application, a word weight generation model training apparatus is provided, comprising:

[0017] The first acquisition module is configured to acquire the target question and the target answer corresponding to the target question;

[0018] The extraction module is configured to extract at least one keyword combination of the target question and determine an initial document set based on the at least one keyword combination;

[0019] The determination module is configured to determine a target document set and a target keyword combination based on the target answer and the initial document set;

[0020] The weighting module is configured to determine the word weight corresponding to each keyword in the target question based on the target keyword combination;

[0021] The training module is configured to train a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword, until the training stops.

[0022] According to a fourth aspect of the embodiments of this application, a word weight generation apparatus is provided, comprising:

[0023] The second acquisition module is configured to acquire issues to be processed.

[0024] The input module is configured to input the problem to be processed into a pre-trained word weight generation model, wherein the word weight generation model is trained by the word weight generation model training method described above.

[0025] The generation module is configured such that the word weight generation model generates at least one keyword and the corresponding word weight of the at least one keyword in response to the question to be processed as input.

[0026] According to a fifth aspect of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the instructions to implement the steps of the word weight generation model training method or the word weight generation method.

[0027] According to a sixth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer instructions, which, when executed by a processor, implement the steps of the word weight generation model training method or the word weight generation method.

[0028] According to a seventh aspect of the present application, a chip is provided that stores computer instructions, which, when executed by the chip, implement the steps of the word weight generation model training method or the word weight generation method.

[0029] The word weight generation model training method provided in this application includes: obtaining a target question and a target answer corresponding to the target question; extracting at least one keyword combination of the target question; determining an initial document set based on the at least one keyword combination; determining a target document set and a target keyword combination based on the target answer and the initial document set; determining the word weight corresponding to each keyword in the target question based on the target keyword combination; and training a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until a training stopping condition is reached. The word weight generation model training method provided in this application can accurately calculate the word weight of each keyword in the target question, and thus can retrieve and obtain the answer corresponding to the target question based on the word weight, effectively avoiding the problem of mismatch between keyword TF-IDF in databases built in certain vertical domains and human prior knowledge.

[0030] Secondly, by extracting keyword combinations from the target question through word segmentation and stop word filtering, computational resources are saved and the retrieval efficiency of subsequent keyword-based searches is improved.

[0031] Finally, by matching and determining the target document set based on the target answer in the document set, the document set that matches the target answer can be determined more accurately, which solves the problem of inaccurate answer retrieval in certain vertical fields caused by the use of manually labeled keywords in the existing technology. Attached Figure Description

[0032] Figure 1 This is a structural block diagram of the computing device provided in the embodiments of this application;

[0033] Figure 2 This is a flowchart of the word weight generation model training method provided in the embodiments of this application;

[0034] Figure 3 This is a flowchart of the word weight generation method provided in the embodiments of this application;

[0035] Figure 4 This is a flowchart of the word weight generation model training method and the word weight generation method provided in this application embodiment in a specific application scenario;

[0036] Figure 5 This is a schematic diagram of the structure of the word weight generation model training device provided in the embodiments of this application;

[0037] Figure 6 This is a schematic diagram of the word weight generation device provided in the embodiments of this application. Detailed Implementation

[0038] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0039] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.

[0040] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "in response to a determination".

[0041] First, the terminology used in one or more embodiments of the present invention will be explained.

[0042] Cold start: refers to the initial stage of a product when there is no user data.

[0043] Vertical fields: refers to specialized fields, such as military, government affairs, automobiles and other fields.

[0044] Machine learning is an interdisciplinary field involving statistics, system identification, approximation theory, neural networks, optimization theory, computer science, and neuroscience. It studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills, reorganize existing knowledge structures to continuously improve their performance, and is the core of artificial intelligence technology. Data-driven machine learning is one of the important methods in modern intelligent technology. It studies how to find patterns from observed data (samples) and use these patterns to predict future data or unobservable data. Machine learning can be classified in different ways depending on the learning model, learning method, and algorithm. Based on the learning model, machine learning can be classified into supervised learning, unsupervised learning, and reinforcement learning, among others.

[0045] Supervised learning, also known as supervised machine learning, refers to the task of learning an input-output mapping function based on labeled example input-output pairs. It's a method in machine learning that learns or builds a pattern (function) from training data and uses this pattern to infer new instances. Supervised learning utilizes a limited, labeled training dataset to build a model through a specific learning strategy / method, achieving labeling (classification) / mapping of new data / instances. The most typical supervised learning algorithms include regression and classification. Supervised learning requires that the classification labels of the training samples are known. The higher the accuracy of the classification labels, the more representative the samples are, and the higher the accuracy of the learning model. Supervised learning has been widely applied in natural language processing, information retrieval, text mining, handwriting recognition, and spam detection.

[0046] Unsupervised learning utilizes limited, unlabeled data to describe structures / patterns hidden within unlabeled data. Typical unsupervised learning algorithms include one-class density estimation, one-class dimensionality reduction, and clustering. Unsupervised learning does not require training samples or manually labeled data, facilitating compressed data storage, reducing computational load, improving algorithm speed, and avoiding classification errors caused by positive or negative sample bias. It is primarily used in fields such as economic forecasting, anomaly detection, data mining, image processing, and pattern recognition, for example, in organizing large computer clusters, social network analysis, market segmentation, and astronomical data analysis.

[0047] Term weight: Represents the importance of a word in a sentence, usually expressed as TermWeight.

[0048] TF-IDF (term frequency–inverse document frequency) is a commonly used weighting technique for information retrieval and data mining. TF stands for Term Frequency, and IDF stands for Inverse Document Frequency.

[0049] The BM25 algorithm is an algorithm used to evaluate the relevance between search terms and documents. It mainly calculates the relevance between all words in the question and the documents.

[0050] This application provides a word weight generation model training method and apparatus, a word weight generation method and apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0051] Figure 1A structural block diagram of a computing device 100 according to an embodiment of this application is shown. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and a database 150 is used to store data.

[0052] The computing device 100 also includes an access device 140, which enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0053] In one embodiment of this application, the aforementioned components of the computing device 100 and Figure 1 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 1 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0054] The computing device 100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 100 can also be a mobile or stationary server.

[0055] Among them, processor 120 can execute Figure 2 The steps in the training method of the word weight generation model are shown.

[0056] Figure 2 A flowchart of a word weight generation model training method according to an embodiment of this application is shown, including steps S202 to S210.

[0057] Step S202: Obtain the target question and the target answer corresponding to the target question.

[0058] In the field of natural language processing, business scenarios typically involve providing answers to questions. In these scenarios, the importance of words in each question varies. Some words significantly influence the final answer, while others serve to ensure the coherence of the question. Therefore, it is necessary to label the importance (i.e., weight) of each word in the question. Currently, labeling the weight of each word in the question is done manually. However, manual labeling relies too heavily on prior knowledge and, without the supervision of labeled answers, can lead to inaccurate word weights in the question.

[0059] In the product development stage where there is no user data and no storage of user click behavior and user data, in order to avoid the discrepancy between human prior knowledge and TF-IDF (term frequency-inverse document frequency) in the retrieval database, this application provides a word weight generation model training method. The word weight generation model trained by the word weight generation model training method provided in this application is obtained, which effectively avoids the problem of mismatch between keyword TF-IDF in databases built in certain vertical fields and human prior knowledge.

[0060] The word weight generation model training method provided in this application uses the proposed target question and the feedback documents to form training samples, and calculates the word weight of each keyword in the target question based on the proposed target question and the feedback documents. During the training process of the word weight generation model, the method obtains the user's online search question, generates multiple documents corresponding to the search question, and provides them to the user. The user then selects a useful target feedback document from these documents and browses it. Training data is constructed based on the search question and the target document. The target question is obtained by the user inputting the desired search question on their mobile phone or computer, which is transmitted to the server via network transmission. The server uses this question as the target question, and the target answer is the correct answer corresponding to the target question. Typically, the target answer appears in multiple documents or paragraphs. For the same question, multiple documents or paragraphs may provide different or the same answer. The target answer is obtained by the server through calculation.

[0061] Optionally, methods for obtaining the target question and target answer include:

[0062] Read log information;

[0063] Retrieve the search question and the target feedback document for the search question recorded in the log information;

[0064] The target answer corresponding to the search question is determined based on the search question and the target feedback document for the search question.

[0065] The log information is stored on the search engine's server, recording various user actions online, such as logging in, typing, clicking, and searching. When a user searches online, the server's log records the user's search question as the target question. Multiple response documents are retrieved based on this target question, and the target answer is displayed and highlighted to the user. Simultaneously, multiple response documents corresponding to the target answer are shown to the user. The user can then select from these response documents by clicking the corresponding document links to view them. Additionally, the log information also records which document links the user clicked. The document provided by the search engine for the user to view is called a response document, and the response document viewed by the user through a clicked link is called the target response document.

[0066] The server reads log information and can retrieve the target question and links to one or more target feedback documents corresponding to the target question from the log information. Based on the links of the target feedback documents, one can obtain a set of one or more target feedback documents corresponding to the search question.

[0067] After obtaining the search question and the target feedback document for the search question, a target answer corresponding to the search question can be found in the target feedback document using a pre-trained question-answering model, or it can be found in the target feedback document using text analysis or keyword matching.

[0068] In one specific embodiment provided in this application, by obtaining information from log records that a user searches for the question "How many years does a leap year occur in?" on the Internet, the question is determined to be the target question. At the same time, the target feedback documents are obtained: Document 1 (which records what a leap year is and why there are leap years) and Document 2 (which records basic knowledge about leap years). By performing semantic analysis on Document 1 and Document 2, the target answer corresponding to the target question can be determined to be "A leap year occurs every four years".

[0069] During the cold start phase, the target question and the corresponding target answer are obtained, ensuring that articles that meet the target question can be accurately obtained based on the target answer. This, in turn, ensures that the word weight generation model can accurately obtain the word weights in the target question during the training process.

[0070] Step S204: Extract at least one keyword combination of the target question, and determine an initial document set based on the at least one keyword combination.

[0071] The keyword combination is a phrase obtained by combining the keywords in the target question, and the document set is a collection of documents retrieved by searching through the keyword combination.

[0072] In practical applications, the target question is usually a sentence, and a sentence typically includes multiple keywords. These keywords are extracted and then combined to obtain at least one keyword combination for the target question. For example, if a target sentence consists of three keywords, t1, t2, and t3, then according to the principles of permutation and combination, a total of seven keyword combinations can be obtained: {t1, t2, t3}, {t1, t2}, {t1, t3}, {t2, t3}, {t1}, {t2}, and {t3}. These seven keyword combinations are then used to search the internet, and the documents retrieved based on each keyword combination are combined as recall documents to obtain a document set.

[0073] In practical applications, for example, the question "How many people took the postgraduate entrance exam in 2019?" includes keywords such as "2019", "of", "postgraduate entrance exam", "number", and "how many". After obtaining the keywords for the target question, at least one keyword can be combined to obtain at least one keyword combination for the target question. For example, combining the keywords "2019" and "postgraduate entrance exam" yields the keyword combination "2019 postgraduate entrance exam", or combining "postgraduate entrance exam" with "number" yields the keyword combination "number of postgraduate entrance exam takers". After obtaining the keyword combination, keyword matching is performed on the Internet based on the keyword combination to retrieve at least one recall document containing the keywords. The set of at least one recall document constitutes the document set for the target question.

[0074] By searching for and identifying documents based on keywords in the target question, the number of documents matched by keywords can be increased, providing a document basis for subsequent identification of target keywords.

[0075] In an optional embodiment of this application, at least one keyword combination of the target problem is extracted, including:

[0076] Extract at least one keyword from the target question;

[0077] Determine at least one keyword combination based on the at least one keyword.

[0078] In practical applications, each target question contains at least one keyword. Before searching using the at least one keyword, the at least one keyword can be combined to obtain at least one keyword combination. Searching based on the keyword combination will yield more accurate documents, avoid irrelevant or invalid documents, and improve processing efficiency.

[0079] In one embodiment provided in this application, assuming the target question is "How many people took the postgraduate entrance examination in 2019?", the keywords in the target question include: "2019", "participate", "postgraduate", "examination", and "number". These keywords can be combined to obtain keyword combinations. For example, combining the keywords "2019" and "examination" yields the keyword combination "2019 examination". Alternatively, combining "2019" with "postgraduate" yields the keyword combination "2019 postgraduate". Another example is combining "postgraduate" with "number" to obtain the keyword combination "number of postgraduates". Three different keywords can also be combined to obtain the keyword combination "2019 took the exam". In practical applications, the extracted keywords need to be combined in any permutation and combination manner to obtain various different keyword combinations.

[0080] In an optional embodiment of this application, at least one keyword of the target problem is extracted, including:

[0081] The target question is segmented into words to obtain at least one keyword for the target question.

[0082] In practical applications, to extract keywords from the target question, it is necessary to first perform word segmentation on the target question. For example, if the target question "How many people took the postgraduate entrance examination in 2019?" is segmented, several keywords can be obtained, such as "2019", "participate", "postgraduate", "admission", "examination", "of", "number", and "how many".

[0083] In an optional embodiment of this application, the target question is segmented to obtain at least one keyword for the target question, including:

[0084] The target problem is segmented into words to obtain an initial set of keywords;

[0085] Filter the stop words in the initial keyword set to obtain at least one keyword for the target question.

[0086] Stop words, in information retrieval, refer to certain characters or words that are automatically filtered out before or after processing natural language text in order to save storage space and improve search efficiency. These stop words are generally generated manually rather than automatically, and the generated stop words form a stop word list.

[0087] By removing stop words from the initial keyword set, redundant data in the initial keyword combination is eliminated, further improving the accuracy of the keywords extracted from the target question and ensuring the accuracy of calculating the word weights of the keywords.

[0088] In practical applications, after segmenting the target question, an initial keyword set is obtained. Following the previous example, after segmenting the target question "How many people took the postgraduate entrance examination in 2019?", an initial keyword set of {"2019", "participate", "postgraduate", "admission", "exam", "of", "number of people", "how many"} is obtained. Then, stop words in the initial keyword set are filtered. For example, based on a preset stop word list, "of" and "how many" are filtered from the target question "How many people took the postgraduate entrance examination in 2019?", the keywords for the target question are {"2019", "participate", "postgraduate", "admission", "exam", "number of people"}.

[0089] By filtering out stop words from the initial keyword set, computational resources are saved, and the efficiency of subsequent keyword-based searches is improved.

[0090] In an optional implementation of this embodiment, determining the initial document set based on the at least one keyword combination includes:

[0091] Search for the initial document corresponding to each of the keyword combinations;

[0092] The initial documents are combined into an initial document set.

[0093] After determining the keyword combinations, keyword matching is performed to search for corresponding documents for each keyword combination. One or more recalled documents corresponding to each keyword combination are obtained as initial documents. The initial documents corresponding to all keyword combinations are combined together to form the document set. The document set is a combination of one or more recalled documents without any filtering.

[0094] It's important to note that in practical applications, search engines return a large number of initial documents for each keyword combination. When there are too many keyword combinations, the number of documents in the initial document combination becomes very large, leading to a heavy service load. The server needs to spend more time calculating and filtering the target answer. Therefore, to reduce the server load, the initial documents corresponding to each keyword combination can be sorted according to their relevance to the keyword combination. Then, based on a preset document selection strategy, the top-ranked documents can be selected as the best initial documents. For example, the top 5 documents with high relevance to each keyword combination can be selected, or the top 10 documents with high relevance to each keyword combination can be selected, and so on.

[0095] In one specific embodiment provided in this application, the keywords are t1, t2, and t3. Combining these keywords yields multiple keyword combinations: t1, t2, t3, t1 t2, t1 t3, t2 t3, t1 t2 t3. A search is performed based on each keyword combination to obtain several recalled documents: C1, C2, ..., Cn. C1 corresponds to the keyword combinations t1 t2 and t1 t3, C2 corresponds to the keyword combination t2 t3, and ..., Cn corresponds to the keyword combination t1 t3. After obtaining several recalled documents, the set of these documents constitutes the document set C: {C1, C2, ..., Cn}.

[0096] By obtaining keyword combinations from the target question and searching based on the keywords in those combinations, a document set is obtained, which expands the number of reference documents for calculating the target answer and provides a foundation for accurately determining the target keyword combinations in the future.

[0097] Step S206: Determine the target document set and target keyword combination based on the target answer and the initial document set.

[0098] The process involves retrieving initial documents or selected initial documents from an initial document set. Some of these documents contain the target answer to the target question, while others do not. In this case, it's necessary to determine which documents in the initial document set contain the target answer. These documents are then grouped into a target document set. Therefore, the target document set is the collection of documents in the initial document set that match the target answer. The keyword combinations corresponding to these target documents constitute the target keyword set. In other words, target documents are a batch of documents that contain both a significant number of keywords related to the target question and the target answer. This application uses the keyword combinations corresponding to these target documents as the target keyword set.

[0099] Specifically, determining the target document set and target keyword combination based on the target answer and the initial document set includes:

[0100] The target document set is determined from the initial document set based on the target answer;

[0101] The target keyword combination is determined based on the target document set.

[0102] Specifically, the step of determining the target document set from the initial document set based on the target answer includes:

[0103] Match the target answer with the initial documents in the initial document set;

[0104] The initial document that matches the target answer is identified as the target document, and at least one or more target documents are combined to generate a target document set.

[0105] In practical applications, there are many methods for matching the target document set based on the target answer and the initial document set. For example, the target answer can be converted into an answer vector, the initial document can be converted into a document vector, and then the similarity between the answer vector and the document vector can be calculated. The initial document with the similarity exceeding a preset threshold can be selected as the target document. Alternatively, a pre-trained question-answering matching model can be used to determine whether each initial document in the initial document set contains the target answer to the target question. The initial document containing the target answer can be selected as the target document, thereby determining the target document set.

[0106] In one specific implementation provided in this application, assuming that the document set C: {C1, C2, ..., Cn} contains documents C2, C4, C7, C11, C14...Cm that match the target answer "The number of people who took the postgraduate entrance examination in 2019 was 2.9 million", then C2, C4, C7, C11, C14...Cm can be determined to be documents that match the target answer in the document set C. Furthermore, it is determined that C2 corresponds to the keyword combination "t3", C4, C7, C11 corresponds to the keyword combination "t1 t3", C14 corresponds to the keyword combination "t1 t2", ..., Cm corresponds to the keyword combination "t1 t2 t3", and finally, "t1 t2", "t1 t3", "t1 t2t3", and "t3" are the target keyword combinations.

[0107] In practical applications, the target document set is the collection of documents that can satisfy the target answer, and the target keyword combination is the keyword combination in the collection of documents that can satisfy the target answer. For example, if the target answer is "The author of 'Quiet Night Thoughts' is Li Bai," and the target question is "What is the name of the author of 'Quiet Night Thoughts'?", keywords are extracted based on the target question, resulting in the keywords "Quiet Night Thoughts," "author," and "name," and keyword combinations such as "Quiet Night Thoughts author," "Quiet Night Thoughts name," "author's name," and "Quiet Night Thoughts author's name" are obtained. Using the extracted keyword combinations for retrieval, we obtain document A (corresponding to the keyword combination "author of 'Quiet Night Thoughts'"), document B (corresponding to the keyword combination "title of 'Quiet Night Thoughts'"), document C (corresponding to the keyword combination "author's name"), and document D (corresponding to the keyword combination "author's name of 'Quiet Night Thoughts'"). At this point, documents A, B, C, and D form document set K. We then match the target answer with each document. If document A matches the target answer, then document A is the target document, and the keyword combination "author of 'Quiet Night Thoughts'" corresponding to document A is the target keyword combination.

[0108] Step S208: Determine the word weight corresponding to each keyword in the target question based on the target keyword combination.

[0109] After obtaining the target keyword combination, the word weight corresponding to each keyword in the target question can be determined based on the target keyword combination. It should be noted that in this application, the word weight corresponding to each keyword in the target question is determined based on the target keyword combination. For example, following the example in step S206, after obtaining the target keyword combination "author of 'Quiet Night Thoughts'", the word weight of each keyword in the target question ("Quiet Night Thoughts", author, name, what, name) can be determined based on the keywords "Quiet Night Thoughts" and "author" appearing in the target keyword combination.

[0110] By obtaining the target keyword combination and then determining the word weight corresponding to each keyword in the target question through the target keyword combination, it can be ensured that the weight labeling of each word in the target question is accurate, and that the answer obtained by searching based on the target question is accurate. This effectively avoids the problem of mismatch between the keyword TF-IDF of databases built in certain vertical fields and human prior knowledge.

[0111] In an optional implementation of this application, determining the word weight corresponding to each keyword in the target question based on the target keyword combination includes:

[0112] Obtain the number of the target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations;

[0113] The word weight of each keyword in the target question is determined based on the number of target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations.

[0114] In practical applications, it is necessary to calculate the word weight of each keyword in the target question based on the total number of all keywords in the target question and the number of target keywords obtained.

[0115] For example, the target question is "How many people were admitted to universities nationwide in the 2020 National College Entrance Examination?", and the corresponding target answer is "5 million". After obtaining the target question, the target question "How many people were admitted to universities nationwide in the 2020 National College Entrance Examination?" is processed by word segmentation and stop word removal to obtain the keywords "2020 National College Entrance Examination", "nationwide", "admitted", "university", and "number". After combining the above keywords "2020 National College Entrance Examination", "nationwide", "admitted", "university", and "number", the keyword combinations can include multiple keyword combinations such as "2020 National College Entrance Examination", "2020 National College Entrance Examination", "National Universities", "National Number", "Admitted to University", "National University Number", and "2020 National College Entrance Examination Admissions to University". Based on each keyword combination, a search is performed to obtain a document set (W1, W2...Wn). Based on the target answer being "5 million", each document in the document set is matched to determine that W1 and W5 can match the target answer. Therefore, W1 and W5 are the target documents. The keyword combination "2020 college entrance examination pass" for target document W1 and the keyword combination "2020 college entrance examination pass university" for target document W5 are the target keyword combinations.

[0116] At this point, there are two target keyword combinations: the keyword "2020 National College Entrance Examination" appears twice, the keyword "nationwide" appears zero times, the keyword "passed the exam" appears twice, the keyword "university" appears once, and the keyword "number of people" appears zero times.

[0117] After obtaining the number of times each keyword appears in the target keyword combination and the number of keyword combinations in the target keyword combination, the weight of each keyword can be determined. Specifically, the weight of a keyword is obtained by the following formula 1:

[0118]

[0119] In Formula 1, X represents the word weight corresponding to the keyword, n represents the number of times the keyword appears in the target keyword combination in the target question, and N represents the number of target keyword combinations.

[0120] In a specific implementation provided in this application, following the example above, taking the keyword "2020 College Entrance Examination" as an example, "2020 College Entrance Examination" appears 2 times in the target keyword combination, and there are 2 target keyword combinations, so the word weight of the keyword "2020 College Entrance Examination" is x = 2 / 2 = 1.

[0121] It should be noted that in practical applications, there may be situations where certain keywords do not appear in the target keyword combination. For example, if the keyword "nationwide" appears 0 times in the target keyword combination, then the word weight for the keyword "nationwide" is x = 0 / 2 = 0. In this case, the word weight for the keyword "nationwide" in the target question "How many people nationwide were admitted to universities in the 2020 National College Entrance Examination?" is 0.

[0122] It is important to note that the importance of the same keyword varies in different target questions. For example, the keyword "nationwide" may have a weight of 0 in the first target question, but a weight of 0.5 in the second target question. Therefore, the weight of the same keyword may be different in different target questions. The weight of each keyword is related to the target question and is not related to the keyword itself.

[0123] By statistically analyzing the frequency of keyword occurrences in target keyword combinations and the number of such combinations, the word weight of each keyword in the target question is calculated based on the frequency of keyword occurrences and the number of keyword combinations. This ensures that the word weight generation model can accurately obtain the word weight of each keyword in the target question, improving the accuracy of the word weight generation model. It also effectively avoids the problem of inaccurate word weights calculated using the TF-IDF method in databases built in vertical domains. This provides a simple and convenient calculation method for calculating the word weight of each keyword in the target question.

[0124] Step S210: Train a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until the training stops.

[0125] After obtaining the keywords in the target question and calculating the word weight corresponding to each keyword in the target question through the above steps, the target question is used as sample data, and each keyword and the word weight corresponding to each keyword are used as sample labels to train the word weight generation model.

[0126] In a specific implementation provided in this application, following the previous example, the target question is "How many people nationwide were admitted to universities in the 2020 National College Entrance Examination?", with corresponding keywords and keyword weights as (2020 National College Entrance Examination -1, Nationwide -0, Admitted -1, University -0.5, Number -0), where the word weight of "2020 National College Entrance Examination" is 1, the word weight of "Nationwide" is 0, and so on. "How many people nationwide were admitted to universities in the 2020 National College Entrance Examination?" is used as sample data, and (2020 National College Entrance Examination -1, Nationwide -0, Admitted -1, University -0.5, Number -0) is used as sample labels to train the word weight generation model.

[0127] In an optional implementation of this embodiment, a word weight generation model is trained based on the target question, each keyword, and the word weight corresponding to each keyword, including:

[0128] The target question is input into the word weight generation model;

[0129] The word weight generation model generates at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword in response to the target question as input;

[0130] The loss value is calculated based on the at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword, and each target keyword and the word weight corresponding to each target keyword.

[0131] The parameters of the word weight generation model are adjusted based on the loss value.

[0132] In practical applications, the target question and each keyword are input into the word weight generation model to be trained for prediction processing. The word weight generation model generates a predicted weight value for each keyword based on the target question and each keyword. The loss value is calculated based on the predicted weight value and the target weight value of each keyword. The parameters of the word weight generation model are adjusted based on the loss value to train the word weight generation model.

[0133] In this application, the loss value Loss can be calculated using the MSE (mean squared error) loss function, as shown in Formula 2 below:

[0134]

[0135] Where MSE represents the loss value, y i Let i be the target weight value for the i-th keyword. Let be the predicted weight value of the i-th keyword. In practical applications, keywords are marked with positional information when input into the word weight generation model. The positional information of each keyword is the same as its order in the target question. Correspondingly, the generated predicted weight values ​​also have positional information. The loss value can be calculated based on the positional information of the keywords and the positional information of the predicted weight values, and then the loss value can be calculated according to Formula 2 above. For example, in response to the target question "How many people were admitted to universities nationwide in the 2020 National College Entrance Examination?" as input, the word weight generation model generates predicted keywords and their corresponding weights as (2020 National College Entrance Examination -0.7, Nationwide -0.2, Admitted -0.6, University -0.7, Number of People -0.2). The loss value is calculated based on the predicted keywords, their corresponding weights, and the sample labels, and the model parameters in the word weight generation model are adjusted based on the loss value.

[0136] The word weight generation model training method provided in this application includes: obtaining a target question and a target answer corresponding to the target question; extracting at least one keyword combination of the target question; determining an initial document set based on the at least one keyword combination; determining a target document set and a target keyword combination based on the target answer and the initial document set; determining the word weight corresponding to each keyword in the target question based on the target keyword combination; and training a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until a training stopping condition is met. The word weight generation model trained using the method provided in this application effectively avoids the problem of mismatch between keyword TF-IDF in databases built in certain vertical domains and human prior knowledge.

[0137] Secondly, by extracting keyword combinations from the target question through word segmentation and stop word filtering, computational resources are saved and the retrieval efficiency of subsequent keyword-based searches is improved.

[0138] Finally, by matching and determining the target document set based on the target answer in the document set, the document set that matches the target answer can be determined more accurately, which solves the problem of inaccurate answer retrieval in certain vertical fields caused by the use of manually labeled keywords in the existing technology.

[0139] Figure 3 A word weight generation method according to an embodiment of this application is shown, the word weight generation method including steps S302 to S306.

[0140] Step S302: Obtain the problem to be processed.

[0141] In practical applications, once the word weight generation model has been trained, it can receive questions from users and treat these questions as pending issues. For example, if a user asks, "What was the weather like on December 15, 2020?", then that question will be treated as a pending issue.

[0142] By acquiring the questions to be answered, the word weight generation model can be ensured to receive valid input content, avoiding errors caused by invalid input content and improving the user experience.

[0143] Step S304: Input the problem to be processed into the pre-trained word weight generation model.

[0144] Step S306: The word weight generation model generates at least one keyword and the corresponding word weight of the at least one keyword in response to the problem to be processed as input.

[0145] In step S306, after the word weight generation model obtains the input question to be processed, it calculates the word weight generation model according to the pre-trained word weight generation model, extracts keywords from the question to be processed, and obtains the keywords "December 15, 2020" and "weather", and obtains the word weight of each keyword in the question "What is the weather like on December 15, 2020?": the weight of the keyword "December 15, 2020" is X1 = 1, and the weight of the keyword "weather" is X2 = 0.8.

[0146] The word weights of the questions to be processed are calculated by the word weight generation model, which ensures that the word weights of each keyword in the questions to be processed can be obtained quickly and accurately. This avoids the problem of inaccurate word weights caused by manually annotating the word weights of keywords in the questions to be answered, and effectively avoids the problem of mismatch between the TF-IDF of keywords in databases built in certain vertical fields and human prior knowledge.

[0147] like Figure 4 As shown, Figure 4 The diagram illustrates a word weight generation model training method and a word weight generation method in a specific application scenario provided by an embodiment of this application, including steps S402-S416.

[0148] Step S402: Obtain the target question "How many people participated in basic medical insurance nationwide in 2019?" and the target answer "134,541,200 people".

[0149] During the cold start phase, in order to train the word weight generation model, it is necessary to set a target question and a corresponding target answer. In this embodiment, the target question is "How many people participated in basic medical insurance nationwide in 2019?" and the target answer is "13,454,120,000 people". In practical applications, in order to train the word weight generation model, it is necessary to obtain multiple target questions and corresponding target answers. In this embodiment, one target question and its corresponding answer are used as an example.

[0150] Step S404: Extract keywords from the target question and obtain keyword combinations, and determine the document set through the keyword combinations.

[0151] In the specific embodiments provided in this application, following the example above, after obtaining the target question, it is necessary to perform word segmentation and stop word removal on the target question, and extract the keywords "2019", "national", "participate", "basic medical insurance", and "number of people" from the target question. The above keywords are combined to obtain 31 keyword combinations for the target question, namely Y1, Y2, ... Y31, where Y1 is "2019", Y2 is "national", ..., and Y31 is "number of people participating in basic medical insurance nationwide in 2019".

[0152] After obtaining the keyword combinations, keyword searches are performed based on these combinations to obtain the retrieved document set (Z1, Z2, ..., Z31). Among them, retrieved documents Z1 to Z31 correspond to keyword combinations Y1 to Y31, respectively.

[0153] Step S406: Determine the target document set and target keyword combination based on the target answer and the initial document set.

[0154] In the specific embodiments provided in this application, following the example above, the target answer "1345412 million people" is matched in the document set (Z1, Z2...Z31) to determine the target documents that match the target answer as Z4 and Z7. Then, the keyword combination "participating in basic medical insurance" corresponding to the target document Z4 and the keyword combination "number of people participating in basic medical insurance in 2019" corresponding to the target document Z7 are determined as the target keyword combination.

[0155] Step S408: Determine the word weight corresponding to each keyword in the target question within the target keyword combination.

[0156] In the specific embodiments provided in this application, following the example above, after determining the target keyword combination, the word weight of each keyword is calculated based on the number of target keyword combinations and the number of times each keyword in the target question appears in the target keyword combination.

[0157] Among them, the word weight of the keyword "2019" is 1 / 2 = 0.5, the word weight of the keyword "nationwide" is 0 / 2 = 0, the word weight of the keyword "participate" is 2 / 2 = 1, the word weight of the keyword "basic medical insurance" is 2 / 2 = 1, and the word weight of the keyword "number of people" is 1 / 2 = 0.5.

[0158] Step S410: Input the target question, keywords, and the word weights corresponding to the keywords as training samples into the word weight generation model and train the word weight generation model until the training stopping condition is met, and obtain the trained word weight generation model.

[0159] The word weight generation model is trained by combining multiple target questions, their corresponding keywords, and their corresponding word weights until the loss value of the word weight generation model is less than a preset threshold. At this point, the trained word weight generation model is obtained.

[0160] Step S412: Obtain the question to be processed: "How long does it take to conduct a national population census?"

[0161] Step S414: Input the problem to be processed into the trained word weight generation model.

[0162] After obtaining the word weight generation model, the question to be processed, "How long is the cycle for conducting a national population census?", is input into the word weight generation model.

[0163] Step S416: Obtain the keywords generated by the word weight generation model in response to the question to be processed as input and the word weight corresponding to each keyword.

[0164] The word weight generation model responds to the question "How long is the cycle for conducting a national population census?" as input, and generates corresponding keywords and their word weights as follows (conducting -0.01, national -0.03, population -0.8, census -0.9, cycle -0.5, time -0.2).

[0165] The word weight generation model training method provided in this application includes: obtaining a target question and a target answer corresponding to the target question; extracting at least one keyword combination of the target question; determining an initial document set based on the at least one keyword combination; determining a target document set and a target keyword combination based on the target answer and the initial document set; determining the word weight corresponding to each keyword in the target question based on the target keyword combination; and training a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until a training stopping condition is reached. The word weight generation model training method provided in this application can accurately calculate the word weight of each keyword in the target question, and thus can retrieve and obtain the answer corresponding to the target question based on the word weight, effectively avoiding the problem of mismatch between keyword TF-IDF in databases built in certain vertical domains and human prior knowledge.

[0166] Secondly, by extracting keyword combinations from the target question through word segmentation and stop word filtering, computational resources are saved and the retrieval efficiency of subsequent keyword-based searches is improved.

[0167] Finally, by matching and determining the target document set based on the target answer in the document set, the document set that matches the target answer can be determined more accurately, which solves the problem of inaccurate answer retrieval in certain vertical fields caused by the use of manually labeled keywords in the existing technology.

[0168] Corresponding to the above-described embodiment of the word weight generation model training method, this application also provides an embodiment of the word weight generation model training device. Figure 5 A schematic diagram of the structure of a word weight generation model training device according to an embodiment of this application is shown. Figure 5 As shown, the device 500 includes:

[0169] The first acquisition module 502 is configured to acquire the target question and the target answer corresponding to the target question;

[0170] Extraction module 504 is configured to extract at least one keyword combination of the target question and determine an initial document set based on the at least one keyword combination;

[0171] The determination module 506 is configured to determine a target document set and a target keyword combination based on the target answer and the initial document set;

[0172] The weighting module 508 is configured to determine the word weight corresponding to each keyword in the target question based on the target keyword combination.

[0173] Training module 510 is configured to train a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword, until the training stops.

[0174] Optionally, the extraction module 504 is further configured to:

[0175] Extract at least one keyword from the target question;

[0176] Determine at least one keyword combination based on the at least one keyword.

[0177] Optionally, at least one keyword of the target question is extracted, including:

[0178] The target question is segmented into words to obtain at least one keyword for the target question.

[0179] Optionally, the target question is segmented to obtain at least one keyword for the target question, including:

[0180] The target problem is segmented into words to obtain an initial set of keywords;

[0181] Filter the stop words in the initial keyword set to obtain at least one keyword for the target question.

[0182] Optionally, the extraction module 504 is further configured to:

[0183] Search for the initial document corresponding to each of the keyword combinations;

[0184] The initial documents corresponding to each keyword combination are combined into a document set.

[0185] Optionally, the determining module 506 is further configured to:

[0186] Determine the target document set based on the target answer and the document set;

[0187] The target keyword combination is determined based on the target document set.

[0188] Optionally, determining the target document set based on the target answer and the document set includes:

[0189] Match the target answer with documents in the document collection;

[0190] The documents that match the target answer are identified as target documents, and a target document set is generated by combining the target documents.

[0191] Optionally, determining the target keyword combination based on the target document set includes:

[0192] The keyword combination corresponding to each target document in the target document set is determined as the target keyword combination.

[0193] The weighting module 508 is further configured as follows:

[0194] Obtain the number of the target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations;

[0195] The word weight of each keyword in the target question is determined based on the number of target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations.

[0196] The training module 510 is further configured as follows:

[0197] The target question is input into the word weight generation model;

[0198] The word weight generation model generates at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword in response to the target question as input;

[0199] The loss value is calculated based on the at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword, and each target keyword and the word weight corresponding to each target keyword.

[0200] The parameters of the word weight generation model are adjusted based on the loss value.

[0201] A word weight generation model training device provided in this application includes: obtaining a target question and a target answer corresponding to the target question; extracting at least one keyword combination of the target question; determining an initial document set based on the at least one keyword combination; determining a target document set and a target keyword combination based on the target answer and the initial document set; determining the word weight corresponding to each keyword in the target question based on the target keyword combination; and training a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword until a training stopping condition is met. The word weight generation model training method provided in this application can accurately calculate the word weight of each keyword in the target question, and thus can retrieve and obtain the answer corresponding to the target question based on the word weight, effectively avoiding the problem of mismatch between keyword TF-IDF in databases built in certain vertical domains and human prior knowledge.

[0202] Secondly, by extracting keyword combinations from the target question through word segmentation and stop word filtering, computational resources are saved and the retrieval efficiency of subsequent keyword-based searches is improved.

[0203] Finally, by matching and determining the target document set based on the target answer in the document set, the document set that matches the target answer can be determined more accurately, which solves the problem of inaccurate answer retrieval in certain vertical fields caused by the use of manually labeled keywords in the existing technology.

[0204] The above is a schematic scheme of a word weight generation model training device according to this embodiment. It should be noted that the technical solution of this word weight generation model training device and the technical solution of the word weight generation model training method described above belong to the same concept. For details not described in detail in the technical solution of the word weight generation model training device, please refer to the description of the technical solution of the word weight generation model training method described above.

[0205] Corresponding to the above-described word weight generation method embodiments, this application also provides a word weight generation apparatus embodiment. Figure 6 A schematic diagram of the word weight generation apparatus provided in an embodiment of this application is shown. Figure 6 As shown, the device 600 includes:

[0206] The second acquisition module 602 is configured to acquire the problem to be processed;

[0207] The input module 604 is configured to input the problem to be processed into a pre-trained word weight generation model, wherein the word weight generation model is trained by the word weight generation model training method described above.

[0208] The generation module 606 is configured to generate at least one keyword and the corresponding word weight of the at least one keyword in response to the question to be processed as input.

[0209] The word weight generation model device provided in this embodiment calculates the word weight of the question to be answered, ensuring that the word weight of each keyword in the question to be answered can be obtained quickly and accurately. This ensures that the word weight is not accurate due to manual annotation of the word weight of the keywords in the question to be answered, and also effectively avoids the problem of mismatch between the TF-IDF of keywords in databases built in certain vertical fields and human prior knowledge.

[0210] The above is a schematic scheme of a word weight generation device according to this embodiment. It should be noted that the technical solution of this word weight generation device and the technical solution of the word weight generation method described above belong to the same concept. For details not described in detail in the technical solution of the word weight generation device, please refer to the description of the technical solution of the word weight generation method described above.

[0211] It should be noted that each component in the device claim should be understood as a functional module necessary to implement each step of the program flow or method, and the functional modules are not actual functional divisions or separations. A device claim defined by such a set of functional modules should be understood as a functional module architecture that implements the solution primarily through the computer program described in the specification, and not as a physical device that implements the solution primarily through hardware.

[0212] In one embodiment of this application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor. When the processor executes the instructions, it implements the steps of the word weight generation model training method or the word weight generation method.

[0213] The above is a schematic representation of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the word weight generation model training method or the word weight generation method described above. Details not described in detail in the technical solution of the computing device can be found in the description of the word weight generation model training method or the word weight generation method described above.

[0214] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the word weight generation model training method or the word weight generation method as described above.

[0215] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the word weight generation model training method or the word weight generation method described above. Details not described in detail in the technical solution of the storage medium can be found in the description of the word weight generation model training method or the word weight generation method described above.

[0216] This application discloses a chip that stores computer instructions, which, when executed by a processor, implement the steps of the word weight generation model training method or the word weight generation method as described above.

[0217] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0218] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0219] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0220] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0221] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A method for training a word weight generation model, characterized in that, include: Obtain the target question and the corresponding target answer; Extract at least one keyword combination of the target question, and determine an initial document set based on the at least one keyword combination, wherein the keyword combination is a phrase obtained by combining the keywords in the target question in any permutation and combination manner, and the initial document set is a document set composed of recalled documents obtained by searching through the keyword combination; Based on the target answer and the initial document set, a target document set and a target keyword combination are determined, wherein the target document set is the set of documents in the initial document set that match the target answer, and the keyword combination corresponding to the target document is the target keyword set; Determine the word weight corresponding to each keyword in the target question based on the target keyword combination; The word weight generation model is trained based on the target question, each keyword, and the word weight corresponding to each keyword until the training stops.

2. The method as described in claim 1, characterized in that, Extract at least one keyword combination of the target question, including: Extract at least one keyword from the target question; Determine at least one keyword combination based on the at least one keyword.

3. The method as described in claim 2, characterized in that, Extract at least one keyword from the target question, including: The target question is segmented into words to obtain at least one keyword for the target question.

4. The method as described in claim 3, characterized in that, The target question is segmented to obtain at least one keyword for the target question, including: The target problem is segmented to obtain an initial keyword set; Filter the stop words in the initial keyword set to obtain at least one keyword for the target question.

5. The method as described in claim 1, characterized in that, Determining an initial document set based on the at least one keyword combination includes: Search for the initial document corresponding to each of the keyword combinations; The initial documents corresponding to each keyword combination are combined into an initial document set.

6. The method as described in claim 1, characterized in that, Based on the target answer and the initial document set, the target document set and target keyword combination are determined, including: Determine the target document set based on the target answer and the document set; The target keyword combination is determined based on the target document set.

7. The method as described in claim 6, characterized in that, The target document set is determined based on the target answer and the document set, including: Match the target answer with documents in the document collection; The documents that match the target answer are identified as target documents, and a target document set is generated by combining the target documents.

8. The method as described in claim 6, characterized in that, Determine the target keyword combination based on the target document set, including: The keyword combination corresponding to each target document in the target document set is determined as the target keyword combination.

9. The method as described in claim 1, characterized in that, Determine the word weight corresponding to each keyword in the target question based on the target keyword combination, including: Obtain the number of the target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations; The word weight of each keyword in the target question is determined based on the number of target keyword combinations and the number of times each keyword in the target question appears in the target keyword combinations.

10. The method as described in claim 1, characterized in that, Based on the target question, each keyword, and the word weights corresponding to each keyword, a word weight generation model is trained, including: The target question is input into the word weight generation model; The word weight generation model generates at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword in response to the target question as input; The loss value is calculated based on the at least one predicted keyword and the predicted word weight corresponding to the at least one predicted keyword, and each target keyword and the word weight corresponding to each target keyword. The parameters of the word weight generation model are adjusted based on the loss value.

11. A word weight generation method, characterized in that, include: Get the issues to be processed; The problem to be processed is input into a pre-trained word weight generation model, wherein the word weight generation model is trained by any one of the word weight generation model training methods of claims 1-10 above; The word weight generation model generates at least one keyword and its corresponding word weight in response to the question to be processed as input.

12. A word weight generation model training device, characterized in that, include: The first acquisition module is configured to acquire the target question and the target answer corresponding to the target question; The extraction module is configured to extract at least one keyword combination of the target question, and determine an initial document set based on the at least one keyword combination, wherein the keyword combination is a phrase obtained by combining the keywords in the target question in any permutation and combination, and the initial document set is a document set composed of recalled documents obtained by searching through the keyword combination; The determination module is configured to determine a target document set and a target keyword combination based on the target answer and the initial document set, wherein the target document set is the set of documents in the initial document set that match the target answer, and the keyword combination corresponding to the target document is the target keyword set; The weighting module is configured to determine the word weight corresponding to each keyword in the target question based on the target keyword combination; The training module is configured to train a word weight generation model based on the target question, each keyword, and the word weight corresponding to each keyword, until the training stops.

13. A word weight generation device, characterized in that, include: The second acquisition module is configured to acquire issues to be processed. The input module is configured to input the problem to be processed into a pre-trained word weight generation model, wherein the word weight generation model is trained by any one of the word weight generation model training methods of claims 1-10 above; The generation module is configured such that the word weight generation model generates at least one keyword and the corresponding word weight of the at least one keyword in response to the question to be processed as input.

14. A computing device, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the instructions, it implements the steps of the method according to any one of claims 1-10 or 11.

15. A computer-readable storage medium storing computer instructions, characterized in that, When executed by a processor, this instruction implements the steps of the method according to any one of claims 1-10 or 11.

Citation Information

Patent Citations

  • Weight model training method and related device

    CN110276010A