Word weight generation model training method and device, word weight generation method and device
By obtaining the target questions and answers, extracting keyword combinations, training the word weight generation model, and automatically constructing training samples using online click data, it solves the problems of high cost of word weight calculation and insufficient utilization of semantic information in the existing technology, and improves efficiency. Accuracy and automation of word weight generation.
Patent Information
- Application Number
- CN202110962135.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-08-20
AI Technical Summary
In the existing technology, the word weight calculation method is expensive and difficult to manually label, and the unsupervised method cannot effectively utilize text semantic information, resulting in poor word weight generation results.
By obtaining the target questions and target answers, extracting keyword combinations, determining the initial document set and target document set, training the word weight generation model based on the target keywords and weight values, automatically constructing training samples using online click data, and comprehensively utilizing semantics and text information characteristics.
It improves the accuracy of word weight generation, reduces the cost of manual annotation, realizes the construction of automatic training samples without manual labor, and enhances the semantic utilization of word weights.
Smart Images

Figure CN113609248B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence in computer technology, and in particular to a word weight generation model training method and device, a word weight generation method and device, a computing device, and a computer-readable storage medium. Background Art
[0002] Artificial intelligence is an interdisciplinary subject, usually regarded as a branch of computer science, which studies models and systems that exhibit various functions related to human intelligence (such as reasoning and learning). With the development of artificial intelligence technology, the field of natural language processing has also developed rapidly. Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between humans and computers using natural language. Information retrieval based on text is an important branch of the field of natural language processing.
[0003] In the process of information retrieval based on text, the word weight value in the text information is a basic issue in information retrieval research. The purpose is to assign different weight values to the words in the text, so as to focus more on them in the subsequent processing process. The existing commonly used word weight calculation methods are mainly divided into supervised training models and unsupervised calculation methods. Among them, the supervised training method requires a large amount of manually annotated data to train a regression model for word weight prediction, but the cost of manual annotation is high and the difficulty of manual annotation is large. The unsupervised calculation method is usually calculated through algorithms such as TF-IDF and TextRank. Although the unsupervised calculation method does not require manual annotation, it cannot effectively utilize the semantic information in the text, resulting in the same word having the same weight in different texts, and the generated word weight value effect is poor. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a word weight generation model training method and device, a word weight generation method and device, a computing device and a computer-readable storage medium to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a word weight generation model training method is provided, comprising:
[0006] Respectively obtain a target question and a target answer corresponding to the target question;
[0007] Extracting keywords of the target question to form keyword combinations, and determining an initial document set according to at least one of the keyword combinations;
[0008] Determine a target document set and a target keyword combination according to the target answer and the initial document set;
[0009] Obtaining a target weight value for each target keyword according to the target keyword combination;
[0010] A word weight generation model is trained according to the target question, each target keyword and the target weight value until a training stop condition is reached.
[0011] According to a second aspect of an embodiment of the present application, a word weight generation method is provided, comprising:
[0012] Obtaining a problem to be processed, and extracting target keywords of the problem to be processed;
[0013] Inputting the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training the word weight generation model training method according to any one of claims 1 to 10 or other training methods;
[0014] In response to the question to be processed and the target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword.
[0015] According to a third aspect of an embodiment of the present application, a word weight generation model training device is provided, comprising:
[0016] An acquisition module is configured to respectively acquire a target question and a target answer corresponding to the target question;
[0017] An extraction module is configured to extract keywords of the target question to form keyword combinations, and determine an initial document set according to at least one of the keyword combinations;
[0018] A determination module, configured to determine a target document set and a target keyword combination according to the target answer and the initial document set;
[0019] A weight value obtaining module, configured to obtain a target weight value of each target keyword according to the target keyword combination;
[0020] The training module is configured to train a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached.
[0021] According to a fourth aspect of an embodiment of the present application, a word weight generation device is provided, including:
[0022] An acquisition module is configured to acquire a problem to be processed and extract target keywords of the problem to be processed;
[0023] An input module, configured to input the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training the word weight generation model training method according to any one of claims 1 to 10 or other training methods;
[0024] The generating module is configured to generate a prediction weight value corresponding to each target keyword in response to the problem to be processed and the target keyword as inputs, and the word weight model generates a prediction weight value corresponding to each target keyword.
[0025] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the word weight generation model training method or the word weight generation method are implemented.
[0026] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which 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.
[0027] According to a seventh aspect of an embodiment of the present application, a chip is provided, which stores computer instructions, and when the instructions are executed by the chip, the steps of the word weight generation model training method or the word weight generation method are implemented.
[0028] The word weight generation model training method provided in the embodiment of the present application includes respectively obtaining a target question and a target answer corresponding to the target question; extracting keywords of the target question to form a keyword combination, and determining an initial document set according to at least one of the keyword combinations; determining a target document set and a target keyword combination according to the target answer and the initial document set; obtaining a target weight value for each target keyword according to the target keyword combination; training a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached. The word weight generation model training method provided in the embodiment of the present application can calculate different weight values of target keywords in different documents, thereby improving the accuracy of the weight values of generated keywords.
[0029] Secondly, by recording information in logs to obtain target questions and target answers, the problem of time-consuming and labor-intensive manual data labeling is solved. By clicking on data online, the goal of automated training sample construction without manual effort is achieved.
[0030] Finally, in the word weight generation model, based on the semantics and feature information of the keywords, more text semantics and text information features can be comprehensively utilized to better generate target keywords and keyword weights. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;
[0032] Figure 2 is a flow chart of a word weight generation model training method provided in an embodiment of the present application;
[0033] Figure 3 It is a schematic diagram of obtaining recalled documents after searching for each keyword combination provided in an embodiment of the present application;
[0034] Figure 4 is a flow chart of a word weight generation method provided in an embodiment of the present application;
[0035] Figure 5 It is a structural schematic diagram of a word weight generation model training device provided in an embodiment of the present application;
[0036] Figure 6 It is a structural diagram of a word weight generation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0038] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0039] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "in response to determination".
[0040] First, the terms involved in one or more embodiments of the present invention are explained.
[0041] TF-IDF (Term Frequency-Inverse Document Frequency): is a commonly used weighting technique for information retrieval and data mining.
[0042] TF (Term Frequency): The frequency with which a word appears in a document.
[0043] IDF (Inverse Document Frequency): A measure of the general importance of a term.
[0044] Term Weight: represents the importance of a word in a sentence.
[0045] Feedback document: The document that the search engine feeds back to the user for the user to view is called feedback document. The feedback document that the search engine feeds back to the user can be one or more.
[0046] Target feedback document: The document that the user selects to view in the feedback document. Usually, the user selects one document from multiple feedback documents as the target feedback document. One or more target feedback documents constitute a target feedback document set.
[0047] Keyword combination: A keyword combination includes one or more keywords, wherein the keyword combination is obtained after different combinations.
[0048] Initial document: For a keyword combination, each document that the search engine recalls is the initial document.
[0049] Initial document set: a set of one or more recalled documents that have not undergone any screening.
[0050] Target document: If an initial document includes the target answer corresponding to the target question, then the initial document is the target document.
[0051] Target keyword set: a keyword set that can be used to recall the target document. For example, keyword set A can be used to recall document F. When document F is the target document, keyword set A is the target keyword set.
[0052] Text to be input: The text after the search question and the target keyword are concatenated. The text to be input is the text that needs to be input into the word weight model.
[0053] In the present application, 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 are provided, which are described in detail one by one in the following embodiments.
[0054] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present 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 the database 150 is used to store data.
[0055] The computing device 100 also includes an access device 140 that 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 network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (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 the like.
[0056] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0057] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.
[0058] The processor 120 may execute Figure 2 The steps in the word weight generation model training method are shown. Figure 2 A flowchart of a word weight generation model training method according to an embodiment of the present application is shown, including steps 202 to 210.
[0059] Step 202: Obtain a target question and a target answer corresponding to the target question respectively.
[0060] The word weight generation model training method provided in the present application adopts an automated method for constructing training samples, by obtaining the user's online search questions, obtaining multiple feedback documents corresponding to the search questions and feeding them back to the user, and the user selects a target feedback document useful to him / her from the multiple feedback documents for browsing, and constructs training data based on the search questions and the target feedback documents. Among them, the target question is obtained by the following method: the user enters the question he / she wants to search on a mobile phone or computer, and the server obtains the question as the target question through network transmission; the target answer is the correct answer corresponding to the target question, and the target answer usually appears in multiple documents or paragraphs, or in other words, for the same question, there may be multiple documents or paragraphs that can give different or the same answers, and the target answer is obtained by the server through calculation.
[0061] Optionally, the method for obtaining the target question and the target answer includes:
[0062] Read log record information;
[0063] Obtaining the search question recorded in the log record information and the target feedback document of the search question;
[0064] A target answer corresponding to the search question is determined according to the search question and the target feedback document of the search question.
[0065] Among them, the log record information is stored on the server side corresponding to the search engine, recording various online processes performed by users, such as logging in, inputting, clicking, searching, and a series of other operations. When users search online, the search question entered by the user will be recorded in the server's log record information as the target question. Multiple feedback documents are obtained by searching according to the target question, and the target answer is displayed to the user and highlighted. At the same time, multiple feedback documents corresponding to the target answer are displayed to the user separately. The user will select from the multiple feedback documents displayed and view them by clicking on the corresponding document link. In addition, the log record information will also record which document links the user clicked. The document that the search engine feeds back to the user for the user to view is called a feedback document, and the feedback document that the user clicks on the document link to view is called a target feedback document.
[0066] The server reads the log record information, and can read the target question and the link of one or more target feedback documents corresponding to the target question in the log record information, and obtain one or more target feedback document sets corresponding to the search question according to the link of the target feedback document.
[0067] After obtaining the search question and the target feedback document of the search question, a target answer corresponding to the search question can be found in the target feedback document through a pre-trained question-answering model, or a target answer corresponding to the search question can be found in the target feedback document based on text analysis or keyword matching.
[0068] In a specific implementation provided by the present application, the user's search question on the Internet is obtained through log record information, which is "How many people in the country participated in basic medical insurance in 2019", and the target feedback documents obtained at the same time include Document 1 (Document 1 records the introduction of the national infrastructure in 2019), Document 2 (Document 2 is an introduction to basic medical insurance) and Document 3 (Document 3 records the introduction of the national basic medical insurance situation over the years). Through semantic analysis of Document 1, Document 2 and Document 3, it can be determined that the answer corresponding to the search question is "1345412 million people", then the target question is "How many people in the country participated in basic medical insurance in 2019", and the target answer corresponding to the target question is "1345412 million people".
[0069] Step 204: extract keywords of the target question to form keyword combinations, and determine an initial document set based on at least one of the keyword combinations.
[0070] In actual applications, the target question is usually a sentence, and a sentence usually includes at least one keyword, such as "2019", "national", "participation", "basic medical insurance", "how many people". The target question in this example has a total of 5 keywords, and these 5 keywords form a keyword combination, that is, in actual search, keyword matching is performed in a large number of documents based on the keywords in the sentence, and documents matching the keywords are recalled. The keyword combination includes at least one keyword. In this specific embodiment, the keyword combination can be multiple keyword combinations. An initial document set is determined based on one or more keyword combinations, and the initial document set can include one or more initial documents.
[0071] Optionally, keywords of the target question are extracted to form a keyword combination, including:
[0072] Extracting at least one keyword of the target question;
[0073] A keyword combination is generated according to the at least one keyword.
[0074] Accordingly, determining an initial document set according to the at least one keyword combination includes:
[0075] Search and obtain the initial document corresponding to each keyword combination;
[0076] Each of the above initial documents is combined into an initial document set.
[0077] In practical applications, at least one keyword of the target question is first extracted, and then a keyword combination can be formed based on the at least one keyword. There are many methods for extracting keywords, such as keyword extraction based on the TF-IDF algorithm, keyword extraction based on the TextRank algorithm, and so on.
[0078] Take the TF-IDF algorithm as an example. TF-IDF is a commonly used weighting technology for information retrieval and data mining. TF refers to term frequency, IDF refers to inverse document frequency, and TF-IDF is the product of the two. The main idea of TF-IDF is: if a word or phrase appears in an article with a high TF value and rarely appears in other articles, it is considered that this word or phrase has good category distinction ability. Term frequency (TF) refers to the frequency of a given word in the document. This number is a normalization of the term count to prevent it from being biased towards long documents; inverse document frequency (IDF) is a measure of the general importance of a word. The IDF of a particular word can be obtained by dividing the total number of documents by the number of documents containing the word, and then taking the logarithm of the quotient to the base 10. The more important a word is to the article, the greater its TF-IDF value.
[0079] Calculate the TF-IDF value of each word in the target question, and sort each word in the target question in descending order according to the TF-IDF value. According to the preset number of selected words, determine the top-ranked words as keywords. For example, if the preset number of selected words is 2, the first two words with the highest TF-IDF value in the target question are selected as keywords of the target question.
[0080] After extracting at least one keyword, you can also form keyword combinations based on different keywords. For example, if the keyword is A, you can generate a keyword combination of "A"; for example, if the keywords are A and B, you can combine them into three keyword combinations of "A", "B" and "A, B"; for example, if the keywords are A, B and C, you can combine them into seven keyword combinations of "A", "B", "C", "A, B", "A, C", "B, C", "A, B, C"... and so on.
[0081] Then, the corresponding documents are searched for keyword matching according to each keyword combination, and 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 an initial document set. The initial document set is a combination of one or more recalled documents that have not been screened.
[0082] It should be noted that in actual applications, since the search engine will return a large number of initial documents for each keyword combination, when there are too many keyword combinations, the documents in the initial document combination will be very large, which will in turn cause a heavy load on the service. The server will need to spend more time calculating and screening the target answers. Therefore, in order to reduce the burden on the server, the initial documents corresponding to each keyword combination can be sorted according to the degree of correlation with the keyword combination, and then according to the preset document selection strategy, the top-ranked documents can be selected as the selected initial documents. For example, 5 documents with a higher correlation corresponding to each keyword combination can be selected, or the top 10 documents with a higher correlation corresponding to each keyword combination can be selected, and so on.
[0083] For example, if the keywords are A and B, the corresponding keyword combinations are "A", "B" and "A, B". Search for each keyword combination and obtain the search results. Figure 3 and as shown in the following Table 1. Figure 3 A schematic diagram of obtaining recalled documents after searching according to each keyword combination provided by an embodiment of the present application is shown.
[0084] Table 1
[0085]
[0086] As shown in Table 1 and Figure 3 As shown, a search is performed based on the keyword combination "A", and documents 11, document 12, document 13, document 17, document 18, document 19... are recalled; a search is performed based on the keyword combination "B", and documents 14, document 15, document 16, document 17, document 18, document 19... are recalled; a search is performed based on the keyword combination "A, B", and documents 17, document 18, document 19, document 111, document 117, document 120... are recalled.
[0087] If the preset document selection strategy is not used, the initial document set is {document 11, document 12, document 13, document 14, document 15, document 16, document 17, document 18, document 19... document 111, document 117, document 120}, that is, all the initial documents found. However, in this case, the number of initial documents in the initial document set is too large, which is not convenient for subsequent processing. Therefore, another specific embodiment is that the document selection strategy is determined to select the first 6 recalled documents corresponding to each keyword combination as the initial documents, that is, the 6 initial documents corresponding to the keyword combination "A" are "document 11, document 12, document 13, document 17, document 18, document 19", and the 6 initial documents corresponding to the keyword combination "B" are "document 14, document 15, document 16, document 17, document 18, document 19", and the 6 initial documents corresponding to the keyword combination "A, B" are "document 17, document 18, document 19, document 111, document 117, document 120", that is, in this case the initial document set is 12 documents {document 11, document 12, document 13, document 14, document 15, document 16, document 17, document 18, document 19, document 111, document 117, document 120}.
[0088] In a specific implementation provided in the present application, following the above example, according to the TF-IDF algorithm, the keywords of the target question are extracted to extract two keywords, "participate" and "medical insurance", instead of five keywords. According to the above two keywords, three keyword combinations are generated, namely keyword combination 1 "participate", keyword combination 2 "medical insurance" and keyword combination 3 "participate, medical insurance". According to keyword combination 1, the first three initial documents corresponding to keyword combination 1 are obtained as document 1, document 2 and document 3, all of which contain "participate"; according to keyword combination 2, the first three initial documents corresponding to keyword combination 2 are obtained as document 3, document 4 and document 5, all of which contain "medical insurance"; according to keyword combination 3, the first three initial documents corresponding to keyword combination 3 are obtained as document 5, document 6 and document 7, all of which contain "participate, medical insurance". Then the initial document set is {document 1, document 2, document 3, document 4, document 5, document 6, document 7}.
[0089] Step 206: Determine a target document set and a target keyword combination according to the target answer and the initial document set.
[0090] Get the initial document or selected initial document in the initial document set. Some of the contents of the initial document or selected initial document include the target answer corresponding to the target question, while some do not include the target answer corresponding to the target question. At this time, it is necessary to determine which documents include the target answer in the initial document set according to the target answer, and then form a target document set with the documents including the target answer. Therefore, 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. In other words, the target document is a group of target documents that include both more keywords in the target question and the target answer. This application uses the keyword combination corresponding to this group of target documents as the target keyword set.
[0091] Specifically, determining a target document set and a target keyword combination according to the target answer and the initial document set includes:
[0092] Determine a target document set from the initial document set according to the target answer;
[0093] A target keyword combination is determined according to the target document set.
[0094] Specifically, the step of determining a target document set in the initial document set according to the target answer includes:
[0095] Matching the target answer with an initial document in the initial document set;
[0096] An initial document matching the target answer is determined as a target document, and at least one or more target documents are combined to generate a target document set.
[0097] In practical applications, there are many methods for matching the target document set according to 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 the similarity between the answer vector and the document vector can be calculated, and the initial document whose similarity exceeds a preset threshold can be selected as the target document. For example, based on a pre-trained question-answer matching model, it can be determined whether each initial document in the initial document set includes the target answer corresponding to the target question, and the initial document containing the target answer can be used as the target document to determine the target document set.
[0098] In a specific implementation provided by the present application, following the above example, each initial document in the initial document set {Document 1, Document 2, Document 3, Document 4, Document 5, Document 6, Document 7} is matched according to the target answer "1345412 million people", and it is determined that Document 4, Document 5, Document 7 match the target answer, then the target document set is {Document 4, Document 5, Document 7}. Document 1, Document 2, Document 3, Document 6 include keywords A or B, but do not include the target answer 1345412 million people, so they cannot be used as target documents, so Document 1, Document 2, Document 3, Document 6 are eventually eliminated.
[0099] Specifically, the step of determining a target keyword combination according to the target document set includes:
[0100] The keyword combination corresponding to each target document is determined as the target keyword combination.
[0101] After determining the target document set, the target document set includes at least one target document, and determining the keyword combination corresponding to each target document as the target keyword combination.
[0102] In a specific implementation provided in the present application, after the target answer is matched with the initial document in the initial document set, the target documents are determined to be document 14, document 17 and document 111, see Table 2 below, which shows the keyword combination corresponding to each target document.
[0103] Table 2
[0104] Keyword combination Document 14 "B” Document 17 "A", "B" and "A,B" Document 111 "A, B"
[0105] Referring to Table 2 above, the keyword combination corresponding to document 14 is keyword combination "B", so the target keyword combination corresponding to document 14 is determined to be "B"; the keyword combination corresponding to document 17 is keyword combination "A", keyword combination "B" and keyword combination "A, B", so the target keyword combination corresponding to document 17 is determined to be "A", "B" and "A, B"; the target keyword combination corresponding to document 111 is keyword combination "A, B", so the target keyword combination corresponding to document 111 is determined to be "A, B". In summary, the three target keyword combinations of keyword combination "A", keyword combination "B" and keyword combination "A, B" are determined.
[0106] In another specific implementation provided in the present application, following the above example, the target document set is {Document 4, Document 5, Document 7}, wherein the target keyword combination corresponding to Document 4 is Keyword Combination 2 "Medical Insurance", the target keyword combination corresponding to Document 5 is Keyword Combination 2 "Medical Insurance", and the target keyword combination corresponding to Document 7 is Keyword Combination 3 "Participate, Medical Insurance", then Keyword Combination 2 "Medical Insurance" and Keyword Combination 3 "Participate, Medical Insurance" are determined as two target keyword combinations.
[0107] Step 208: Obtain a target weight value for each target keyword according to the target keyword combination.
[0108] The target weight value is the weight value corresponding to the target keyword in the current target question. The same keyword may have different weights in different sentences or texts. In this application, the target weight value of each keyword can be determined based on the target document set and the target keyword.
[0109] Specifically, the step of determining the target weight value of each target keyword according to the target document set and the target keyword set includes:
[0110] Determine a first weight value for each target keyword according to the number of times each target keyword appears in the target keyword set;
[0111] Taking the inverse document frequency of each target keyword in the target document set as a second weight value of each target keyword;
[0112] A target weight value of each target keyword is obtained according to the first weight value and the second weight value of each target keyword.
[0113] The first weight value is the number of times the target keyword appears in the target keyword set. For example, the target keyword combinations are "participate" and "participate, medical insurance", where the keyword "participate" appears in both target keyword sets, for a total of 2 times. The number of times is then normalized, and the first weight value of the keyword "participate" is 1; similarly, the keyword "medical insurance" appears in a target keyword set, and after the number of times is normalized, the first weight value of keyword B is 0.5.
[0114] The second weight value is the inverse document frequency (IDF) of each target keyword in the target document set. IDF is a measure of the general importance of a word. The IDF of a specific word can be obtained by dividing the total number of documents by the number of documents containing the word, and then taking the logarithm of the quotient to the base 10. For details, see the following formula 1:
[0115] IDF = Log (total number of documents in the corpus / (number of documents containing the word + 1)) Formula 1
[0116] Among them, (the number of documents containing the word + 1) is to avoid the problem of calculation error caused by division by 0 when the number of documents containing the word is 0. In this application, the total number of corpus documents is the number of target documents in the target document set.
[0117] After obtaining the first weight value and the second weight value of each target keyword, the target weight value of each target keyword can be obtained through a preset algorithm. In practical applications, since the IDF value reflects the importance of a word in an article, in order to highlight the difference between the weights of certain important keywords in the first weight value and the weights of ordinary keywords, preferably, in the method provided in the present application, the first weight value is multiplied by the second weight value to obtain the target weight value of each keyword. For example, the first weight value of the keyword "A" is A1, and the second weight value is A2, then the target weight value of the keyword "A" is A1*A2.
[0118] In a specific implementation provided in the present application, following the above example, the target keywords are "participation" and "medical insurance", and the target keyword combinations are "medical insurance" and "participation, medical insurance", where the target keyword "medical insurance" appears in each target keyword combination, and the first weight value of "medical insurance" is set to 1. At the same time, by calculating the IDF value of "medical insurance" in {document 4, document 5, document 7} as 3.63303, the second weight value of "medical insurance" is 3.63303. The first weight value and the second weight value of "medical insurance" are multiplied to determine the target weight value of "medical insurance" as 1×3.63303=3.63303.
[0119] The target keyword "participate" appears in one of the two target keyword combinations, so the first weight value of "participate" is 0.5. At the same time, by calculating that the IDF value of "participate" in {document 4, document 5, document 7} is 1.74471, the second weight value of "participate" is 1.74471. Multiplying the first weight value and the second weight value of "participate", it is determined that the target weight value of "participate" is 0.5×1.74471=0.87235.
[0120] Step 210: training a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached.
[0121] The target question, each target keyword corresponding to the target question, and the target weight value corresponding to each target keyword are used as training data for the training word weight generation model, wherein the target question and each target keyword corresponding to the target question are sample data, and the target weight value corresponding to each target keyword is the sample label. The word weight generation model is supervised trained according to the sample data and sample labels until the training stop condition of the model is reached.
[0122] The word weight generation model is used to generate a weight value corresponding to each target keyword according to the target question and each target keyword of the target question. Preferably, in the specific embodiment provided in the present application, the word weight generation model preferably uses a Bert model, and the word weight generation model includes an embedding layer, 12 sequentially connected encoding layers and a fully connected layer. The target question is input into the embedding layer to generate a target question vector, and then the target question vector is sequentially input into the 12 encoding layers to generate a target question encoding vector, and then the predicted keywords and predicted weight values of the target question are output through the fully connected layer, and then the loss value is calculated based on the predicted keywords and predicted weight values and the target keywords and target weight values to implement the training word weight generation model.
[0123] Specifically, a training word weight generation model is generated according to the target question, each target keyword and the target weight value, including:
[0124] Inputting the target question and each target keyword into a word weight model;
[0125] In response to the target question and each target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword;
[0126] The loss value is calculated based on the predicted weight value and target weight value corresponding to each target keyword;
[0127] The parameters of the word weight model are adjusted according to the loss value.
[0128] In practical applications, the target question and each target keyword are input into the word weight model to be trained for prediction processing. The word weight model generates a prediction weight value corresponding to each target keyword based on the target question and each target keyword. The loss value is calculated based on the prediction weight value and the target weight value of each target keyword, and the parameters of the word weight model are adjusted according to the loss value to train the word weight model.
[0129] Specifically, taking the search question "How many people in the country participated in the basic medical insurance in 2019?" as an example, the two target keywords corresponding to this question are "participate" and "medical insurance". The search question and the target keywords are concatenated to generate the input text "How many people in the country participated in the basic medical insurance in 2019@participate@medical insurance", and the input text is input into the word weight model. The word weight model outputs the predicted weight values 0.34532 and 2.85412 corresponding to the two target keywords, where the order of the output predicted weight values is related to the order of the target keywords in the input text, that is, the predicted weight value 0.34532 is the predicted weight value of the target keyword "participate", and the predicted weight value 2.85412 is the predicted weight value of the target keyword "medical insurance".
[0130] In this application, the method for calculating the loss value Loss is specifically to use the MSE mean square error loss function, see the following formula 2:
[0131]
[0132] Among them, MSE represents the loss value Loss, y i is the target weight value of the i-th target keyword, is the predicted weight value of the ith target keyword. In practical applications, the target keyword is marked with position information when it is input into the word weight model, and the generated predicted weight value also has position information. The loss value can be calculated based on the position information of the target keyword and the position information of the predicted weight value. For example, when the word weight model is input, the order of the target keywords is "participate, medical insurance", and the corresponding target weight values are "0.87235, 3.63303", and the predicted weight values are "0.34532, 2.85412". According to the position information, it can be determined that the target weight value corresponding to the target keyword "participate" is "0.87235", and the predicted weight value is "0.34532"; the target weight value corresponding to the target keyword "medical insurance" is "3.63303", and the predicted weight value is "2.85412". Then, the loss value can be calculated according to the above formula 2.
[0133] Optionally, in response to the target question as input, the word weight model generates a prediction weight value corresponding to each target keyword, including:
[0134] Obtain attribute information corresponding to each target keyword;
[0135] Concatenate each target keyword and the attribute information corresponding to each target keyword to generate keyword feature information corresponding to each target keyword;
[0136] The prediction weight value of each target keyword is predicted according to the target keyword feature information corresponding to each target keyword.
[0137] In the method provided in the present application, it is necessary to perform analysis in combination with the attribute information of each target keyword. Specifically, the attribute information may include semantic features, the length of the target keyword, part of speech, some keywords in the interpretation, source, character encoding number, etc. The attribute information of the target keyword can better represent the characteristics of the keyword and the meaning of the keyword in the sentence. The selection of attribute information is relatively flexible, and the corresponding attribute information can be selected according to actual needs.
[0138] Each target keyword and the attribute information corresponding to the target keyword are spliced through a preset connector. For example, if the preset connector is #, the target keyword and the attribute information corresponding to the target keyword are spliced to obtain the keyword feature information of the target keyword "target keyword # attribute information". The keyword feature information of the target keyword is used to represent the characteristics of the target keyword and the significance of the target keyword in the target question. The predicted weight value of each target keyword is then calculated based on each target keyword feature information. When constructing the keyword feature information of the target keyword, the attribute information of the target keyword is combined to better characterize the unique semantics and text information of each word, so that each keyword can be predicted with different weights in different texts, which is closer to real life and improves the accuracy of keyword weights.
[0139] In a specific implementation provided by the present application, following the above example, the target question "How many people in the country participated in the basic medical insurance in 2019" and the target keywords "participate, medical insurance" are concatenated through the concatenation symbol to generate the input text "How many people in the country participated in the basic medical insurance in 2019@participate@medical insurance". After the input text is input into the word weight model, the keyword length and keyword part of speech corresponding to each target keyword are obtained in the word weight model. For example, the keyword length corresponding to the target keyword "participate" is 2, and the part of speech is verb; the keyword length corresponding to the target keyword "medical insurance" is 2, and the part of speech is noun.
[0140] Each target keyword and the keyword length and keyword part of speech of each target keyword are concatenated to generate the keyword feature information corresponding to each target keyword, among which the keyword feature information corresponding to the target keyword "participate" is "participate#2#verb"; the keyword feature information corresponding to the target keyword "medical insurance" is "medical insurance#2#noun". The keyword feature information of each target keyword is predicted through the neural network model to obtain the prediction weight value corresponding to each target keyword, among which the prediction weight value corresponding to the target keyword "participate" is 0.58421, and the prediction weight value corresponding to the target keyword "medical insurance" is 2.56245.
[0141] The predicted weight value generated by the word weight model in response to the target question and the target keyword is {0.58421, 2.56245}, and the target weight value of the target keyword is {0.87235, 3.63303}. The loss value Loss is calculated by the above-mentioned MSE mean square error loss function, and the learning rate parameter, Batch_size parameter, etc. in the word weight model are adjusted by back propagation according to the Loss value, and the word weight model is continued to be trained until the loss value is less than the preset threshold and / or the number of training rounds reaches the preset number of rounds.
[0142] In a specific implementation provided in the present application, taking the example of stopping the training of the word weight model when the loss value is less than a preset threshold, the preset threshold is 0.3. When the calculated Loss value is less than 0.3, the word weight model training is deemed to be completed.
[0143] In another specific implementation provided in the present application, taking the preset training rounds to stop training the word weight as an example, the preset training rounds are 10 rounds. When the training rounds of the sample data reach 10 rounds, it is determined that the word weight model has been trained.
[0144] In another specific implementation provided in the present application, two training stop conditions, namely a preset threshold of the loss value and a preset number of training rounds, are set, and the loss value and the training rounds are monitored at the same time. When either the loss value or the training rounds meets the training stop condition, it is determined that the word weight model has been trained.
[0145] The embodiment of the present application proposes a method for automatically constructing term weight model training samples that combine actual retrieval recall results and word IDF, while improving the features of term weight model training.
[0146] The word weight generation model training method provided in the embodiment of the present application includes respectively obtaining a target question and a target answer corresponding to the target question; extracting keywords of the target question to form a keyword combination, and determining an initial document set according to at least one of the keyword combinations; determining a target document set and a target keyword combination according to the target answer and the initial document set; obtaining a target weight value for each target keyword according to the target keyword combination; training a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached. The word weight generation model training method utilizes the search and click data of online users, automatically constructs training samples through the questions searched by users and the related documents returned by the system, that is, the keywords of the user's question are arranged and combined, and the word weight is calculated according to whether the keyword combination can hit the answer, and then this value is multiplied by the IDF value of the word as the final term weight of the word. Among them, for the term weight model training process, the semantic features between words in the query, term length, term part of speech, etc. are considered as term features, and then these features are sent to the neural network model for training. The different weight values of the target keywords in different documents can be calculated, which improves the accuracy of the generated keyword weight values and solves the shortcoming that the unsupervised method cannot comprehensively utilize more semantic and text information.
[0147] Secondly, by automatically obtaining the target questions and answers from the log information, the problem of time-consuming and laborious manual data annotation is solved, and the disadvantage of the supervised method that requires manual data annotation is avoided. By clicking on the data online, the goal of automatic training sample construction without manual work is achieved.
[0148] Finally, in the word weight generation model, the keyword feature information of the target keyword is obtained by splicing the semantics and attribute information of the target keyword. More text semantics and text information features can be comprehensively utilized to better generate target keywords and keyword weights.
[0149] Figure 4 A flowchart of a word weight generation method according to an embodiment of the present application is shown. The word weight generation method includes steps 402 to 406.
[0150] Step 402: Obtain the problem to be processed, and extract the target keywords of the problem to be processed.
[0151] In a specific implementation manner provided in the present application, taking the example of obtaining a pending question "What is the total GDP value in the first quarter of 2020", a user asks the question "What is the total GDP value in the first quarter of 2020", and the server obtains the pending question raised by the user as "What is the total GDP value in the first quarter of 2020", and extracts the target keywords of the pending question "first quarter of 2020" and "total GDP value".
[0152] Step 404: input the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training using the word weight generation model training method described above or other training methods.
[0153] In a specific embodiment provided in the present application, following the above example, the question to be processed is "What is the total GDP value in the first quarter of 2020" and the target keywords "first quarter of 2020, total GDP value" are concatenated to generate the question to be input "What is the total GDP value in the first quarter of 2020@first quarter of 2020@total GDP value", and the question to be input is input into the word weight generation model.
[0154] Step 406: In response to the question to be processed and the target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword.
[0155] In a specific embodiment provided in the present application, following the above example, the word weight generation model responds to the question to be processed as "What is the total GDP value in the first quarter of 2020 @ the first quarter of 2020 @ the total GDP value" as input, and generates a predicted weight value corresponding to each target keyword of {2.23986, 3.25149}, wherein the predicted weight value corresponding to the first quarter of 2020 is 2.23986, and the predicted weight value corresponding to the total GDP value is 3.25149.
[0156] After obtaining the predicted weight value of each target keyword in the problem to be processed, subsequent business processing can be performed according to the predicted weight value of each target keyword, such as text question and answer, recall document, etc. The specific content of the subsequent business processing is not limited in this application and is subject to actual application.
[0157] The word weight generation method provided by the embodiment of the present application includes obtaining a problem to be processed and extracting the target keywords of the problem to be processed; inputting the problem to be processed and the target keywords into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training through the above-mentioned word weight generation model training method or other training methods; in response to the problem to be processed and the target keywords as input, the word weight model generates a predicted weight value corresponding to each target keyword. Through the word weight generation method provided by the present application, the problem to be processed and the target keywords of the problem to be processed are input into the word weight generation model to obtain the predicted weight value of each target keyword, thereby improving the accuracy and flexibility of generating keyword weights and facilitating the accuracy and efficiency of downstream tasks in subsequent processing.
[0158] Corresponding to the above-mentioned word weight generation model training method embodiment, the present application also provides a word weight generation model training device embodiment, Figure 5 The structure diagram of a word weight generation model training device according to an embodiment of the present application is shown. Figure 5 As shown, the device comprises:
[0159] An acquisition module 502 is configured to respectively acquire a target question and a target answer corresponding to the target question;
[0160] An extraction module 504 is configured to extract keywords of the target question, form keyword combinations, and determine an initial document set according to at least one of the keyword combinations;
[0161] A determination module 506, configured to determine a target document set and a target keyword combination according to the target answer and the initial document set;
[0162] A weight value obtaining module 508 is configured to obtain a target weight value of each target keyword according to the target keyword combination;
[0163] The training module 510 is configured to train a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached.
[0164] Optionally, the extraction module 504 is further configured to:
[0165] Extracting at least one keyword of the target question;
[0166] A keyword combination is generated according to the at least one keyword.
[0167] Optionally, the extraction module 504 is further configured to:
[0168] Search and obtain the initial document corresponding to each keyword combination;
[0169] Each of the above initial documents is combined into an initial document set.
[0170] Optionally, the determining module 506 is further configured to:
[0171] Determine a target document set from the initial document set according to the target answer;
[0172] A target keyword combination is determined according to the target document set.
[0173] Optionally, the determining module 506 is further configured to:
[0174] Matching the target answer with an initial document in the initial document set;
[0175] An initial document matching the target answer is determined as a target document, and at least one or more target documents are combined to generate a target document set.
[0176] Optionally, the determining module 506 is further configured to:
[0177] The keyword combination corresponding to each target document is determined as the target keyword combination.
[0178] Optionally, the weight value obtaining module 508 is further configured to:
[0179] Determine a first weight value for each target keyword according to the number of times each target keyword appears in the target keyword set;
[0180] Taking the inverse document frequency of each target keyword in the target document set as a second weight value of each target keyword;
[0181] A target weight value of each target keyword is obtained according to the first weight value and the second weight value of each target keyword.
[0182] Optionally, the training module 510 is further configured to:
[0183] Inputting the target question and each target keyword into a word weight model;
[0184] In response to the target question and each target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword;
[0185] The loss value is calculated based on the predicted weight value and target weight value corresponding to each target keyword;
[0186] The parameters of the word weight model are adjusted according to the loss value.
[0187] Optionally, the training module 510 is further configured to:
[0188] Obtain attribute information corresponding to each target keyword;
[0189] Concatenate each target keyword and the attribute information corresponding to each target keyword to generate keyword feature information corresponding to each target keyword;
[0190] The prediction weight value of each target keyword is predicted according to the target keyword feature information corresponding to each target keyword.
[0191] Optionally, the acquisition module 502 is further configured to:
[0192] Read log record information;
[0193] Obtaining the search question recorded in the log record information and the target feedback document of the search question;
[0194] A target answer corresponding to the search question is determined according to the search question and the target feedback document of the search question.
[0195] The word weight generation model training device provided in the embodiment of the present application includes respectively obtaining a target question and a target answer corresponding to the target question; extracting keywords of the target question to form a keyword combination, and determining an initial document set according to at least one of the keyword combinations; determining a target document set and a target keyword combination according to the target answer and the initial document set; obtaining a target weight value for each target keyword according to the target keyword combination; training a word weight generation model according to the target question, each target keyword and the target weight value until a training stop condition is reached. The word weight generation model training device uses the search and click data of online users, and automatically constructs training samples through the questions searched by users and the related documents returned by the system, that is, the keywords of the user's questions are arranged and combined, and the word weight is calculated according to whether the keyword combination can hit the answer, and then this value is multiplied by the IDF value of the word as the final term weight of the word. Among them, for the term weight model training process, the semantic features between words in the query, term length, term part of speech, etc. are considered as term features, and then these features are sent to the neural network model for training. The different weight values of the target keywords in different documents can be calculated, which improves the accuracy of the generated keyword weight values and solves the shortcoming that the unsupervised method cannot comprehensively utilize more semantic and text information.
[0196] Secondly, by automatically obtaining the target questions and answers from the log information, the problem of time-consuming and laborious manual data annotation is solved, and the disadvantage of the supervised method that requires manual data annotation is avoided. By clicking on the data online, the goal of automatic training sample construction without manual work is achieved.
[0197] Finally, in the word weight generation model, the keyword feature information of the target keyword is obtained by splicing the semantics and attribute information of the target keyword. More text semantics and text information features can be comprehensively utilized to better generate target keywords and keyword weights.
[0198] The above is a schematic scheme of a word weight generation model training device of this embodiment. It should be noted that the technical scheme of the word weight generation model training device and the technical scheme of the above-mentioned word weight generation model training method belong to the same concept, and the details not described in detail in the technical scheme of the word weight generation model training device can be found in the description of the technical scheme of the above-mentioned word weight generation model training method.
[0199] Corresponding to the above-mentioned word weight generation method embodiment, the present application also provides a word weight generation device embodiment, Figure 6 FIG. 1 is a schematic diagram showing the structure of a word weight generation device according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0200] The acquisition module 602 is configured to acquire the problem to be processed and extract the target keywords of the problem to be processed;
[0201] An input module 604 is configured to input the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training the word weight generation model training method or other training methods;
[0202] The generating module 606 is configured to generate a prediction weight value corresponding to each target keyword in response to the problem to be processed and the target keyword as inputs, and the word weight model generates a prediction weight value corresponding to each target keyword.
[0203] The word weight generation device provided by the embodiment of the present application includes obtaining a problem to be processed and extracting the target keywords of the problem to be processed; inputting the problem to be processed and the target keywords into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training through the above-mentioned word weight generation model training method or other training methods; in response to the problem to be processed and the target keywords as input, the word weight model generates a predicted weight value corresponding to each target keyword. Through the word weight generation device provided by the present application, the problem to be processed and the target keywords of the problem to be processed are input into the word weight generation model to obtain the predicted weight value of each target keyword, thereby improving the accuracy and flexibility of generating keyword weights and facilitating the accuracy and efficiency of downstream tasks in subsequent processing.
[0204] The above is a schematic scheme of a word weight generation device of this embodiment. It should be noted that the technical scheme of the word weight generation device and the technical scheme of the above-mentioned word weight generation method belong to the same concept, and the details not described in detail in the technical scheme of the word weight generation device can be referred to the description of the technical scheme of the above-mentioned word weight generation method.
[0205] It should be noted that the components in the device claim should be understood as the functional modules that must be established to implement the steps of the program flow or the steps of the method, and the functional modules are not actually divided or separated. The device claim defined by such a group of functional modules should be understood as the functional module architecture of the solution mainly implemented by the computer program recorded in the specification, and should not be understood as the physical device that mainly implements the solution by hardware.
[0206] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the word weight generation model training method or the word weight generation method are implemented.
[0207] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned word weight generation model training method or word weight generation method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned word weight generation model training method or word weight generation method.
[0208] An embodiment of the present application also provides a computer-readable storage medium storing 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.
[0209] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned word weight generation model training method or word weight generation method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned word weight generation model training method or word weight generation method.
[0210] An embodiment of the present application discloses a chip storing 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.
[0211] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0212] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased 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 do not include electric carrier signals and telecommunication signals.
[0213] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0214] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0215] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A word weight generation model training method, characterized in that: include: Respectively obtain a target question and a target answer corresponding to the target question; Extracting at least one keyword of the target question, generating a keyword combination according to the at least one keyword, and determining an initial document set according to the at least one keyword combination; Determine a target document set and at least one target keyword combination according to the target answer and the initial document set; Determine a first weight value for each target keyword according to the number of times each target keyword appears in the at least one target keyword combination, use the inverse document frequency of each target keyword in the target document set as a second weight value for each target keyword, and obtain a target weight value for each target keyword according to the first weight value and the second weight value of each target keyword; The word weight generation model is trained according to the target question, each target keyword and the target weight value until the training stop condition is reached, wherein the target question and each target keyword are sample data of the word weight generation model, and the target weight value is a sample label of the word weight generation model.
2. The word weight generation model training method according to claim 1, characterized in that: Determining an initial document set according to at least one of the keyword combinations includes: Search and obtain the initial document corresponding to each keyword combination; Each of the above initial documents is combined into an initial document set.
3. The word weight generation model training method according to claim 2, characterized in that: Determining a target document set and at least one target keyword combination according to the target answer and the initial document set includes: Determine a target document set from the initial document set according to the target answer; At least one target keyword combination is determined according to the target document set.
4. The word weight generation model training method according to claim 3, characterized in that: Determining a target document set from the initial document set according to the target answer includes: Matching the target answer with an initial document in the initial document set; An initial document matching the target answer is determined as a target document, and at least one or more target documents are combined to generate a target document set.
5. The word weight generation model training method according to claim 4, characterized in that: Determining at least one target keyword combination according to the target document set includes: The keyword combination corresponding to each target document is determined as the target keyword combination.
6. The word weight generation model training method according to claim 1, characterized in that: A training word weight generation model is generated according to the target question, each target keyword and the target weight value, including: Inputting the target question and each target keyword into a word weight model; In response to the target question and each target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword; The loss value is calculated based on the predicted weight value and target weight value corresponding to each target keyword; The parameters of the word weight model are adjusted according to the loss value.
7. The word weight generation model training method according to claim 6, characterized in that: In response to the target question and each target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword, including: Obtain attribute information corresponding to each target keyword; Concatenate each target keyword and the attribute information corresponding to each target keyword to generate keyword feature information corresponding to each target keyword; The prediction weight value of each target keyword is predicted according to the target keyword feature information corresponding to each target keyword.
8. The word weight generation model training method according to claim 1, characterized in that: Obtaining a target question and a target answer corresponding to the target question respectively, including: Read log record information; Obtaining the search question recorded in the log record information and the target feedback document of the search question; A target answer corresponding to the search question is determined according to the search question and the target feedback document of the search question.
9. A word weight generation method, characterized in that: include: Obtaining a problem to be processed, and extracting target keywords of the problem to be processed; Inputting the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training the word weight generation model training method according to any one of claims 1 to 8; In response to the question to be processed and the target keyword as input, the word weight model generates a prediction weight value corresponding to each target keyword.
10. A word weight generation model training device, characterized in that: include: An acquisition module is configured to respectively acquire a target question and a target answer corresponding to the target question; An extraction module is configured to extract at least one keyword of the target question, generate a keyword combination according to the at least one keyword, and determine an initial document set according to the at least one keyword combination; a determination module, configured to determine a target document set and at least one target keyword combination according to the target answer and the initial document set; A weight value obtaining module is configured to determine a first weight value of each target keyword according to the number of times each target keyword appears in the at least one target keyword combination, take the inverse document frequency of each target keyword in the target document set as the second weight value of each target keyword, and obtain a target weight value of each target keyword according to the first weight value and the second weight value of each target keyword; The training module is configured to train a word weight generation model according to the target question, each target keyword and the target weight value until the training stop condition is reached, wherein the target question and each target keyword are sample data of the word weight generation model, and the target weight value is a sample label of the word weight generation model.
11. A word weight generation device, characterized in that: include: An acquisition module is configured to acquire a problem to be processed and extract target keywords of the problem to be processed; An input module, configured to input the problem to be processed and the target keyword into a pre-trained word weight generation model, wherein the word weight generation model is obtained by training the word weight generation model training method according to any one of claims 1 to 8; The generating module is configured to generate a prediction weight value corresponding to each target keyword in response to the problem to be processed and the target keyword as inputs, and the word weight model generates a prediction weight value corresponding to each target keyword.
12. 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, the steps of the method described in any one of claims 1-8 or 9 are implemented.
13. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the method described in any one of claims 1-8 or 9 are implemented.
