[go: up one dir, main page]

CN104572820B - The generation method and device of model, importance acquisition methods and device - Google Patents

The generation method and device of model, importance acquisition methods and device Download PDF

Info

Publication number
CN104572820B
CN104572820B CN201410723276.2A CN201410723276A CN104572820B CN 104572820 B CN104572820 B CN 104572820B CN 201410723276 A CN201410723276 A CN 201410723276A CN 104572820 B CN104572820 B CN 104572820B
Authority
CN
China
Prior art keywords
entries
model
output value
entry
model output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410723276.2A
Other languages
Chinese (zh)
Other versions
CN104572820A (en
Inventor
石磊
连荣忠
张鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201410723276.2A priority Critical patent/CN104572820B/en
Publication of CN104572820A publication Critical patent/CN104572820A/en
Application granted granted Critical
Publication of CN104572820B publication Critical patent/CN104572820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiments of the invention provide a kind of generation method of model and device, importance acquisition methods and device.On the one hand, for the embodiment of the present invention by least one in the discrimination accuracy rate between the sequence accuracy rate between the importance accuracy rate according to the entry obtained, entry and entry, M candidate family of structure, M is the integer more than 0;So as to using the M candidate family, obtain the individual normalized candidate family output valves of M of the entry;And then the M normalized candidate family output valves are assessed using assessment models, to obtain object module output valve, using the candidate family corresponding to the object module output valve as object module.Therefore, technical scheme provided in an embodiment of the present invention can solve the problems, such as that the Reliability comparotive of the model for the importance information for obtaining entry in the prior art is low.

Description

Model generation method and device and importance acquisition method and device
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of computer application, in particular to a method and a device for generating a model and a method and a device for acquiring importance.
[ background of the invention ]
For a given text, the importance of each entry in the text is accurately calculated, and the method can be applied to subsequent searching, semantic analysis and the like. For example, in a search scenario, when a user inputs a query text, the query text includes several entries, where redundant entries may exist, and if a search is performed using a real query text, the search efficiency may be affected and the quality of a search result may be reduced. Therefore, it is necessary to perform importance calculation on the entries in the query text, and then search by using some entries with higher importance to remove redundant entries therein.
In the prior art, there are models capable of outputting importance or ordering importance according to a given entry, and these models can ensure accuracy of numerical values of importance of the output entries or accuracy of ordering importance between two entries belonging to the same text. However, if the importance value of the entry needs to be obtained and the importance ranking of the entry needs to be performed at the same time, the current model cannot meet the requirements, and in addition, other information of the importance of the entry, such as the distinction between the importance of the entry, the value range of the importance, and the like, cannot be obtained, so that the reliability of the current model for obtaining the importance information of the entry is low.
[ summary of the invention ]
In view of this, embodiments of the present invention provide a method and an apparatus for generating a model, and a method and an apparatus for acquiring importance, which can solve the problem in the prior art that the reliability of a model for acquiring importance information of an entry is low.
In one aspect of the embodiments of the present invention, a method for generating a model is provided, including:
constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ordering accuracy among the entries and the obtained distinguishing accuracy among the entries, wherein M is an integer larger than 0;
obtaining M normalized candidate model output values of the entry by using the M candidate models;
and evaluating the M normalized candidate model output values by utilizing an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as a target model.
As to the above-mentioned aspects and any possible implementation manner, there is further provided an implementation manner, before constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ranking accuracy between the entries, and the obtained discrimination accuracy between the entries, the method further includes:
obtaining an initial model output value of the entry by using an initial model;
obtaining normalized initial model output values of the entries according to the initial model output values of the entries and the initial model output values of other entries in the text where the entries are located;
obtaining the importance accuracy of the entry according to the normalized initial model output value of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
As described in the above aspect and any possible implementation manner, there is further provided an implementation manner, where the number of importance accuracy rates of the entries is N, the number of ranking accuracy rates between the entries is P, the number of discrimination accuracy rates between the entries is Q, N, P and Q are both positive integers and are not 0 at the same time, and at least one of N, P and Q is greater than or equal to 2, and the M candidate models are constructed according to at least one of the obtained importance accuracy rates of the entries, the ranking accuracy rates between the entries, and the discrimination accuracy rates between the entries, including:
obtaining K target accuracy rates according to at least one of the importance accuracy rate of the entries, the sequencing accuracy rate between the entries and the discrimination accuracy rate between the entries, wherein K is more than 1 and less than or equal toAn integer of (d);
adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters;
and constructing the M candidate models according to the M second model parameters.
The foregoing aspect and any possible implementation manner further provide an implementation manner, where adjusting the first model parameter of the initial model according to the K target accuracy rates to obtain M second model parameters includes:
obtaining M target accuracy rates which are greater than or equal to the accuracy rate threshold value according to the K target accuracy rates and a preset accuracy rate threshold value;
performing derivation operation on each target accuracy rate in the M target accuracy rates to obtain M gradient values;
and adjusting the first model parameters of the initial model respectively according to each gradient value in the M gradient values to obtain M second model parameters.
The above aspect and any possible implementation manner further provide an implementation manner, where obtaining M normalized candidate model output values of the entry by using the M candidate models includes:
obtaining M candidate model output values of the entry by using the M candidate models;
and obtaining M normalized candidate model output values of the entries according to each candidate model output value of the entries and the candidate model output values of other entries in the text where the entries are located.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the evaluation model includes standard output values of all terms in a text where the terms are located, and the evaluating the M normalized candidate model output values by using the evaluation model to obtain a target model output value includes:
for each candidate model, determining K entries with the highest normalized candidate model output value in the text;
determining R entries with the highest standard output value in the text, wherein R is an integer larger than K;
obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text;
and selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result.
In one aspect of the embodiments of the present invention, a method for obtaining importance is provided, including:
obtaining a text to be processed;
performing word segmentation on the text to be processed to obtain at least one entry;
obtaining a target model output value of each entry in the at least one entry by using a target model, wherein the target model output value is used as the importance of each entry;
wherein the target model is generated by the model generation method.
In one aspect of the embodiments of the present invention, an apparatus for generating a model is provided, including:
the construction unit is used for constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ordering accuracy among the entries and the obtained distinguishing accuracy among the entries, wherein M is an integer larger than 0;
a first obtaining unit, configured to obtain M normalized candidate model output values of the entry by using the M candidate models;
and the evaluation unit is used for evaluating the M normalized candidate model output values by using an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as the target model.
The above-described aspects and any possible implementations further provide an implementation, where the apparatus further includes:
the second acquisition unit is used for acquiring an initial model output value of the entry by using the initial model; the initial model output value of the entry is used for obtaining the normalized initial model output value of the entry according to the initial model output value of the entry and the initial model output values of other entries in the text where the entry is located; and obtaining the importance accuracy of the entry according to the normalized initial model output value of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
As to the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, where the number of importance accuracy rates of the entries is N, the number of ranking accuracy rates between the entries is P, the number of discrimination accuracy rates between the entries is Q, N, P and Q are both positive integers and are not 0 at the same time, and at least one of N, P and Q is greater than or equal to 2, and the construction unit is specifically configured to:
obtaining K target accuracy rates according to at least one of the importance accuracy rate of the entries, the sequencing accuracy rate between the entries and the discrimination accuracy rate between the entries, wherein K is more than 1 and less than or equal toAn integer of (d);
adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters;
and constructing the M candidate models according to the M second model parameters.
As to the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, where the constructing unit is configured to, according to the K target accuracy rates, adjust a first model parameter of an initial model to obtain M second model parameters, specifically configured to:
obtaining M target accuracy rates which are greater than or equal to the accuracy rate threshold value according to the K target accuracy rates and a preset accuracy rate threshold value;
performing derivation operation on each target accuracy rate in the M target accuracy rates to obtain M gradient values;
and adjusting the first model parameters of the initial model respectively according to each gradient value in the M gradient values to obtain M second model parameters.
As for the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, where the first obtaining unit is specifically configured to:
obtaining M candidate model output values of the entry by using the M candidate models;
and obtaining M normalized candidate model output values of the entries according to each candidate model output value of the entries and the candidate model output values of other entries in the text where the entries are located.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the evaluation model includes standard output values of all terms in a text where the terms are located, and the evaluation unit is specifically configured to:
for each candidate model, determining K entries with the highest normalized candidate model output value in the text;
determining R entries with the highest standard output value in the text, wherein R is an integer larger than K;
obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text;
and selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result.
In one aspect of the embodiments of the present invention, an importance obtaining apparatus is provided, including:
the acquisition unit is used for acquiring a text to be processed;
the word cutting unit is used for carrying out word cutting processing on the text to be processed so as to obtain at least one entry;
the processing unit is used for obtaining a target model output value of each entry in the at least one entry by using a target model, and the target model output value is used as the importance of each entry;
wherein the target model is generated by the model generation device.
According to the technical scheme, the embodiment of the invention has the following beneficial effects:
compared with the technical scheme that the model can only ensure the accuracy of the numerical value of the importance of the output entries or only ensure the accuracy of the importance ranking between two entries belonging to the same text in the prior art, the model constructed and determined by the embodiment of the invention can simultaneously meet the relevant conditions of multiple importance and ensure the accuracy of relevant data of the entries, such as the numerical value of the importance, the ranking of the entries or the discrimination between the entries, so that the problem of low reliability of the model for obtaining the importance information of the entries in the prior art can be solved, the reliability of the model is improved, and the accuracy of the output data is improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a schematic flow chart diagram of a method for generating a model according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for acquiring importance according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a model generation apparatus according to an embodiment of the present invention;
fig. 4 is a functional block diagram of an apparatus for obtaining importance according to an embodiment of the present invention.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, etc. may be used to describe model parameters in embodiments of the present invention, these keywords should not be limited to these terms. These terms are only used to distinguish model parameters from each other. For example, the first model parameters may also be referred to as second model parameters, and similarly, the second model parameters may also be referred to as first model parameters, without departing from the scope of embodiments of the present invention.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
Example one
An embodiment of the present invention provides a method for generating a model, please refer to fig. 1, which is a schematic flow chart of the method for generating a model according to the embodiment of the present invention, and as shown in the figure, the method includes the following steps:
s101, constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ordering accuracy among the entries and the obtained distinguishing accuracy among the entries, wherein M is an integer larger than 0.
S102, obtaining M normalized candidate model output values of the entry by using the M candidate models.
S103, evaluating the M normalized candidate model output values by utilizing an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as a target model.
Based on the above model generation method, before S101, the method in the embodiment of the present invention may further include: at least one of importance accuracy of the entries, sorting accuracy between the entries, and discrimination accuracy between the entries is obtained.
The step may specifically include:
firstly, a preset initial model is utilized to obtain an initial model output value of the entry. And then, acquiring normalized initial model output values of the entries according to the initial model output values of the entries and the initial model output values of other entries in the text where the entries are located. Finally, according to the normalized initial model output value of the entry, obtaining the importance accuracy of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
For example, for entry xijUsing the initial model, the following initial model output values for the entry may be obtained:
wherein the feature vector xijRepresenting the jth entry in the ith text.
Wherein,the initial model output value of the jth entry in the ith text is represented.
Wherein, αkRepresenting the weight of the kth decision tree.
The initial model may be a Gradient-enhanced ranking tree (GBRank) model, and the GBRank model may be composed of a plurality of decision trees, and each decision tree may be based on an input xijObtaining an output value hk(xij) Then, the output value of each decision tree is multiplied by the weighted value of the decision tree and then accumulated to obtain the output value of the initial model
Wherein, the output value h of the kth decision treek(xij) The decision tree is determined by the model parameters of the decision tree itself, which may include, but are not limited to, splitting features of the decision tree, feature values of the decision tree, regression values corresponding to leaf nodes, and the like.
For example, for an initial model output value of an entry, the initial model output value may be normalized using the following formula to obtain a normalized initial model output value of the entry:
wherein,and outputting the normalized initial model output value of the jth entry in the ith text.
Wherein,the initial model output value of the jth entry in the ith text is represented.
It should be noted that, in the process of obtaining the normalized initial model output value of the jth entry in the ith text, the initial model output values of other entries in the text where the entry is located also need to be used, so the initial model output values of other entries may be obtained by using the above formula.
For example, normalized initial model output values by termOr initial model output value of the entryThe importance accuracy of the entry is obtained using, but not limited to, any of the following formulas:
the above mentionedIn the formula,and the importance accuracy of the jth entry in the ith text is represented, and the importance accuracy is used for optimizing the model, so that the model can meet the accuracy condition of the numerical value of the importance of the output entry. n isiIndicates the total number of terms in the ith text; y isijThe preset standard model output value of the jth entry in the ith text is represented;and (3) an initial model output value representing the normalization of the jth entry in the ith text obtained by the method.
For example, normalized initial model output values by termOr initial model output valueObtaining the ranking accuracy between the entries using, but not limited to, any of the following formulas:
in the above-mentioned formula,and the ranking accuracy rate of the importance between the jth entry and the kth entry in the ith text is represented, and the model is optimized so that the model can meet the condition of the ranking accuracy of the importance between the output entries. n isiIndicates the total number of terms in the ith text;the normalized initial model output value of the jth entry in the ith text obtained by the method is shown, and similarly, the normalized initial model output value of the kth entry in the ith text can also be obtained by the methodAn initial model output value representing the jth entry in the ith text,the initial model output value of the k entry in the ith text is represented. τ denotes a preset fixed parameter.
For example, normalized initial model output values by termThe discrimination accuracy between the entries is obtained using, but not limited to, any of the following formulas:
in the above-mentioned formula,and the accuracy rate of the discrimination of the importance between the jth entry and the kth entry in the ith text is expressed, and the method is used for optimizing the model so that the model can meet the accuracy condition of the discrimination of the importance between the output entries. n isiIndicates the total number of terms in the ith text;the normalized initial model output value of the jth entry in the ith text obtained by the method is shown, and similarly, the normalized initial model output value of the kth entry in the ith text can also be obtained by the methodyijA preset standard model output value, y, representing the jth entry in the ith textikAnd the preset standard model output value of the kth entry in the ith text is represented.Of all entries representing the ith textVariance of the value found, Var (y)i*) Y representing all entries of the ith texti*The variance of the value solution.
Based on the above model generation method, the embodiment of the present invention specifically describes the method of S101. The step may specifically include:
since the number of formulas used to obtain the importance accuracy rates of the terms may be N (N is equal to 5 as in the above example), the number of formulas used to obtain the ranking accuracy rates between the terms may be P (P is equal to 6 as in the above example), the number of formulas used to obtain the discrimination accuracy rates between the terms may be Q (Q is equal to 6 as in the above example), N, P and Q are both positive integers, and N, P and Q are not both 0, and at least one of N, P and Q is greater than or equal to 2, accordingly, the number of importance accuracy rates of the terms may be N (e.g., N is equal to 5), the number of ranking accuracy rates between the terms may be P (e.g., P is equal to 6), and the number of discrimination accuracy rates between the terms may be Q (e.g., Q is equal to 6).
First, K target accuracies, K being greater than 1 and less than or equal to K, may be obtained according to at least one of the importance accuracy of the entries, the ranking accuracy between the entries, and the discrimination accuracy between the entriesIs an integer of (1). And then, adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters. And finally, constructing the M candidate models according to the M second model parameters.
For example, according to the importance accuracy of the entries, the ranking accuracy between the entries, and the discrimination accuracy between the entries, a target accuracy is obtained using the following formula:
in the above-mentioned formula,representing the target accuracy.
Wherein, αpoint、αpair、αlistThe sum of the three preset fixed parameters is 1.
It can be understood that since the number of importance accuracy rates of the entries may be N, the number of ranking accuracy rates between the entries may be P, and the number of discrimination accuracy rates between the entries may be Q, K target accuracy rates may be obtained according to the importance accuracy rate of the entries, the ranking accuracy rate between the entries, and the discrimination accuracy rate between the entries, and the permutation and combination principle, and the value of K may be greater than 1 and less than or equal toIs an integer of (1).
For example, in the embodiment of the present invention, the method for adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain the M second model parameters may include, but is not limited to:
firstly, judging whether each target accuracy rate is greater than or equal to a preset accuracy rate threshold value according to the K target accuracy rates and the preset accuracy rate threshold value so as to obtain M target accuracy rates which are greater than or equal to the accuracy rate threshold value in the K target accuracy rates, wherein K is greater than M. Then, each target accuracy rate in the M target accuracy rates is subjected to a derivation operation, so as to obtain M gradient values. And finally, respectively adjusting the first model parameters of the initial model according to each gradient value in the M gradient values to obtain M second model parameters. Conversely, for a target accuracy rate less than the accuracy rate threshold, it means that the first model parameter of the initial model does not need to be adjusted, and the initial model may be directly used as one of the M candidate models.
For example, the target accuracy may be derived using the following formula to obtain a gradient value:
in the above-mentioned formula,representing a target accuracy rate;representing the initial model output value of the jth entry in the ith text αpoint、αpair、αlistThe sum of the three preset fixed parameters is 1.Indicating the importance accuracy of the jth entry in the ith text,indicating the sorting accuracy between the jth entry and the kth entry in the ith text,and the discrimination accuracy between the jth entry and the kth entry in the ith text is represented.
It should be noted that different candidate models may be obtained for different second model parameters. For example, a GBRank algorithm may be used to perform model training according to each second model parameter to construct a candidate model including a plurality of decision trees, and therefore, M candidate models may be constructed using M second model parameters. Wherein, the second model parameters may include, but are not limited to, the following parameters: the splitting characteristic of the decision tree, the characteristic value of the decision tree and the regression value corresponding to the leaf node in the decision tree.
Based on the above model generation method, the embodiment of the present invention specifically describes the method of S102. The step may specifically include:
firstly, M candidate model output values of the entry are obtained by utilizing the M candidate models. And then obtaining M normalized candidate model output values of the vocabulary entry according to each candidate model output value of the vocabulary entry and the candidate model output values of other vocabulary entries in the text where the vocabulary entry is located.
For example, for entry xijUsing the initial model, the following candidate model output values may be obtained:
wherein the feature vector xijRepresenting the jth entry in the ith text.
In the present step, the first step is carried out,and representing the output value of the candidate model of the jth entry in the ith text.
In this step, αkRepresenting the weight of the kth decision tree in a candidate model.
The candidate model may be a GBRank model, which may be composed of a plurality of decision trees, and each decision tree may be based on an input xijObtaining an output value hk(xij) Then, the output value of each decision tree is multiplied by the weighted value of the decision tree and then accumulated to obtain the resultCandidate model output value
For example, for a candidate model output value of a term, the candidate model output value may be normalized using the following formula to obtain a normalized candidate model output value of the term:
wherein,and outputting the normalized candidate model output value of the jth entry in the ith text.
Wherein,and representing the output value of the candidate model of the jth entry in the ith text.
It can be understood that, in the process of obtaining the normalized candidate model output value of the jth entry in the ith text, the candidate model output values of other entries in the text where the entry is located need to be used.
It will be appreciated that for each of the M candidate models, a corresponding normalized candidate model output value may be obtained using the two equations, and thus M normalized candidate model output values may be obtained.
The above two formulas are the same as the formulas for calculating the initial model output value of the entry and the normalized initial model output value using the initial model, that is, the method for obtaining the output value of the model using the model is the same, but the model used is different, and therefore the value of the model output is also different.
Based on the above model generation method, the embodiment of the present invention specifically describes the method of S103. The step may specifically include:
in the embodiment of the present invention, the evaluation model may include, but is not limited to, a standard output value of each entry in each text.
For example, the method of evaluating the M normalized candidate model output values using the evaluation model to obtain the target model output value may include, but is not limited to:
firstly, determining K entries with the highest normalized candidate model output value in the text aiming at each candidate model; and determining R entries with the highest standard output value in the text, wherein R is an integer larger than K. And then, obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text. And finally, selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result, and after determining the target model output value, taking the candidate model corresponding to the target model output value as the target model.
For example, for each candidate model, the 2 terms in the text with the highest normalized candidate model output value are determined, and then the 2 terms in the text with the highest normalized output value are determined. Then, the hit rate of the 2 entries with the highest normalized candidate model output value and the highest normalized candidate model output value corresponding to each candidate model is calculated, the variance of the 2 entries with the highest normalized candidate model output value and the corresponding normalized candidate model output value of each candidate model is calculated, and the hit rate and/or the variance are/is used as the evaluation result. And finally, according to the evaluation result, selecting an optimal normalized candidate model output value from the M normalized candidate model output values, wherein the candidate model outputting the optimal normalized candidate model output value is the optimal model, and therefore the optimal model can be used as the target model in the embodiment of the invention.
It can be understood that in the embodiment of the present invention, all combinations can be enumerated by different combinations of the N importance accuracy rates, the P ranking accuracy rates, and the Q discrimination accuracy rates of the vocabulary entry, different candidate models are constructed according to different combination results, then the constructed candidate models are used as test samples, and the vocabulary entry is respectively calculated by using the candidate models, so as to obtain the candidate model output value. And finally, the evaluation of the candidate model is realized by utilizing the evaluation model to output values of the candidate model so as to obtain an optimal candidate model, so that when the candidate model is utilized to obtain the importance information of the entries, the importance values of the entries, the sorting results among the entries or the discrimination among the entries can be obtained, and further, the accuracy of the search results can be improved when the search results are obtained according to the importance information of the entries, or the accuracy of the semantic analysis results is improved when the semantic analysis is carried out according to the importance information of the entries.
It should be noted that, for the terms in a given text, the prior art models can only ensure the accuracy of the ranking of the importance between the output terms, or only ensure the accuracy of the importance of the output terms, for example, the importance of the terms a, b, and c output by the model is 1, 0, and-1, respectively, or the ranking of the importance of outputting several terms is that the term a is 1> the term b is 0> the term c is-1. However, many search systems currently require that the obtained importance level be non-negative and the sum of the importance levels is 1, or, for example, sometimes the importance level of the entry is required to satisfy a certain condition, for example, the importance level is required to be 0.2, and in these situations, the models in the prior art cannot meet the requirements. In the technical scheme provided by the embodiment of the invention, the normalized output value obtained after the output value of the model is normalized is used as the final output value of the model, so that the value of the importance of the entry can be ensured to be positive, and the value of the importance of the entry is between 0 and 1, so as to meet the requirements.
Example two
An embodiment of the present invention provides a method for obtaining importance, please refer to fig. 2, which is a schematic flow chart of the method for obtaining importance according to the embodiment of the present invention, and as shown in the figure, the method includes the following steps:
s201, obtaining a text to be processed.
S202, performing word segmentation processing on the text to be processed to obtain at least one entry.
S203, obtaining a target model output value of each entry in the at least one entry by using a target model, wherein the target model output value is used as the importance of each entry; wherein the target model is generated by using the model generation method.
For example, the method for obtaining the text to be processed may be receiving the text input by the user, such as a Query word (Query); or, voice information input by the user can be received, and the corresponding text can be obtained according to the voice information.
Preferably, the word segmentation process may be performed on the text to be processed by using a word segmentation dictionary to obtain at least one entry included in the text to be processed.
Preferably, after at least one entry is obtained, each entry is used as an input of the target model generated by the model generation method, so that the target model obtains a target model output value for each entry, and the target model output value can be used as the importance of the corresponding entry.
For example, with the target model, the obtained importance of the terms can be applied to search the input text, for example, the search is performed according to the part of terms with higher importance, rather than according to all terms, so that the search efficiency can be improved, and the quality and accuracy of the search result can be improved. Or, the importance of the obtained entry may also be applied to implement semantic analysis by using the target model, for example, the semantics of the user is analyzed according to the partial entry with higher importance to analyze the intention of the user, and then corresponding operations are executed according to the semantic analysis result, which is not particularly limited in the embodiment of the present invention.
The embodiment of the invention further provides an embodiment of a device for realizing the steps and the method in the embodiment of the method.
EXAMPLE III
Please refer to fig. 3, which is a functional block diagram of a model generation apparatus according to an embodiment of the present invention. As shown, the apparatus comprises:
a constructing unit 301, configured to construct M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ranking accuracy between the entries, and the obtained discrimination accuracy between the entries, where M is an integer greater than 0;
a first obtaining unit 302, configured to obtain M normalized candidate model output values of the entry by using the M candidate models;
the evaluating unit 303 is configured to evaluate the M normalized candidate model output values by using an evaluation model to obtain target model output values, and use the candidate model corresponding to the target model output values as the target model.
Optionally, the apparatus further comprises:
a second obtaining unit 304, configured to obtain an initial model output value of the entry by using an initial model; the initial model output value of the entry is used for obtaining the normalized initial model output value of the entry according to the initial model output value of the entry and the initial model output values of other entries in the text where the entry is located; and obtaining the importance accuracy of the entry according to the normalized initial model output value of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
Preferably, the number of importance accuracy rates of the entries is N, the number of ranking accuracy rates between the entries is P, the number of discrimination accuracy rates between the entries is Q, N, P and Q are positive integers and are not 0 at the same time, and at least one of N, P and Q is greater than or equal to 2, the constructing unit 301 is specifically configured to:
obtaining K target accuracy rates according to at least one of the importance accuracy rate of the entries, the sequencing accuracy rate between the entries and the discrimination accuracy rate between the entries, wherein K is more than 1 and less than or equal toAn integer of (d);
adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters;
and constructing the M candidate models according to the M second model parameters.
Preferably, the constructing unit 301 is configured to, when adjusting the first model parameter of the initial model according to the K target accuracy rates to obtain M second model parameters, specifically:
obtaining M target accuracy rates which are greater than or equal to the accuracy rate threshold value according to the K target accuracy rates and a preset accuracy rate threshold value;
performing derivation operation on each target accuracy rate in the M target accuracy rates to obtain M gradient values;
and adjusting the first model parameters of the initial model respectively according to each gradient value in the M gradient values to obtain M second model parameters.
Preferably, the first obtaining unit 302 is specifically configured to:
obtaining M candidate model output values of the entry by using the M candidate models;
and obtaining M normalized candidate model output values of the entries according to each candidate model output value of the entries and the candidate model output values of other entries in the text where the entries are located.
Preferably, the evaluation model includes standard output values of all the entries in the text where the entry is located, and the evaluation unit 303 is specifically configured to:
for each candidate model, determining K entries with the highest normalized candidate model output value in the text;
determining R entries with the highest standard output value in the text, wherein R is an integer larger than K;
obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text;
and selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result.
Since each unit in the present embodiment can execute the method shown in fig. 1, reference may be made to the related description of fig. 1 for a part of the present embodiment that is not described in detail.
Example four
Please refer to fig. 4, which is a functional block diagram of an apparatus for obtaining importance according to an embodiment of the present invention. As shown, the apparatus comprises:
an obtaining unit 401, configured to obtain a text to be processed;
a word segmentation unit 402, configured to perform word segmentation on the text to be processed to obtain at least one entry;
a processing unit 403, configured to obtain, by using a target model, a target model output value of each entry in the at least one entry, as an importance of each entry;
wherein the target model is generated by the model generation device described in fig. 3.
Since each unit in the present embodiment can execute the method shown in fig. 2, reference may be made to the related description of fig. 2 for a part of the present embodiment that is not described in detail.
The technical scheme of the embodiment of the invention has the following beneficial effects:
according to the embodiment of the invention, M candidate models are constructed according to at least one of the obtained importance accuracy of the entries, the sequencing accuracy among the entries and the discrimination accuracy among the entries, wherein M is an integer greater than 0; thereby, obtaining M normalized candidate model output values for the entry using the M candidate models; and then, evaluating the M normalized candidate model output values by utilizing an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as a target model. Therefore, the embodiment of the invention realizes the construction of the model by fusing a plurality of importance degree targets of the entries, and further determines an optimal model by evaluating the output value of the model, compared with the technical scheme that the model can only ensure the accuracy of the numerical value of the importance degree of the output entries or the accuracy of the importance degree sequencing between two entries belonging to the same text in the prior art, the constructed and determined model of the embodiment of the invention can simultaneously meet the relevant conditions of a plurality of importance degrees, and ensure the accuracy of the relevant data of the entries, such as the numerical value of the importance degree, the sequencing of the entries or the degree of distinction between the entries, thereby solving the problem that the reliability of the model for obtaining the importance degree information of the entries in the prior art is low, improving the reliability of the model, and improving the accuracy of the output data.
In addition, since multiple targets are considered to be fused simultaneously, the complexity of the problem is reduced for a single target among them. For example, in one text, the importance sequence of three entries, namely, entry a, entry b and entry c is a > b > c, and if the importance sequence is learned accurately, the importance value of b is inevitably between a and c, so that the optimization space for the goal of accuracy of the importance value is greatly reduced, the optimization complexity is reduced, and the learning of the importance of the entries is more accurate. And simultaneously, a plurality of targets are considered to be fused, so that the convergence of the learning process is faster, and overfitting is avoided to a certain extent. The advantages cannot be brought about by considering a certain target independently.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A method of generating a model, the method comprising:
constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ordering accuracy among the entries and the obtained distinguishing accuracy among the entries, wherein M is an integer larger than 0;
obtaining M normalized candidate model output values of the entry by using the M candidate models;
evaluating the M normalized candidate model output values by utilizing an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as a target model;
the obtaining M normalized candidate model output values for the entry using the M candidate models includes:
obtaining M candidate model output values of the entry by using the M candidate models;
and obtaining M normalized candidate model output values of the entries according to each candidate model output value of the entries and the candidate model output values of other entries in the text where the entries are located.
2. The method of claim 1, wherein before constructing the M candidate models based on at least one of the obtained importance accuracy of the terms, the ranking accuracy between the terms, and the discrimination accuracy between the terms, the method further comprises:
obtaining an initial model output value of the entry by using an initial model;
obtaining normalized initial model output values of the entries according to the initial model output values of the entries and the initial model output values of other entries in the text where the entries are located;
obtaining the importance accuracy of the entry according to the normalized initial model output value of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
3. The method according to claim 1 or 2, wherein the number of importance accuracy rates of the entries is N, the number of ranking accuracy rates between the entries is P, the number of discrimination accuracy rates between the entries is Q, N, P and Q are both 0 or positive integers and are not 0 at the same time, and at least one of N, P and Q is greater than or equal to 2, and the M candidate models are constructed according to at least one of the obtained importance accuracy rates of the entries, the ranking accuracy rates between the entries, and the discrimination accuracy rates between the entries, including:
obtaining K target accuracy rates according to at least one of the importance accuracy rate of the entries, the sequencing accuracy rate between the entries and the discrimination accuracy rate between the entries, wherein K is more than 1 and less than or equal toAn integer of (d);
adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters;
and constructing the M candidate models according to the M second model parameters.
4. The method of claim 3, wherein adjusting the first model parameters of the initial model to obtain M second model parameters according to the K target accuracy rates comprises:
obtaining M target accuracy rates which are greater than or equal to the accuracy rate threshold value according to the K target accuracy rates and a preset accuracy rate threshold value;
performing derivation operation on each target accuracy rate in the M target accuracy rates to obtain M gradient values;
and adjusting the first model parameters of the initial model respectively according to each gradient value in the M gradient values to obtain M second model parameters.
5. The method of claim 1, wherein the evaluation model comprises standard output values of all entries in the text in which the entry is located, and wherein evaluating the M normalized candidate model output values using the evaluation model to obtain target model output values comprises:
for each candidate model, determining K entries with the highest normalized candidate model output value in the text;
determining R entries with the highest standard output value in the text, wherein R is an integer larger than K;
obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text; and selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result.
6. An importance acquisition method, comprising:
obtaining a text to be processed;
performing word segmentation on the text to be processed to obtain at least one entry;
obtaining a target model output value of each entry in the at least one entry by using a target model, wherein the target model output value is used as the importance of each entry;
wherein the target model is generated by the generation method of the model according to any one of claims 1 to 5.
7. An apparatus for generating a model, the apparatus comprising:
the construction unit is used for constructing M candidate models according to at least one of the obtained importance accuracy of the entries, the obtained ordering accuracy among the entries and the obtained distinguishing accuracy among the entries, wherein M is an integer larger than 0;
a first obtaining unit, configured to obtain M normalized candidate model output values of the entry by using the M candidate models;
the evaluation unit is used for evaluating the M normalized candidate model output values by using an evaluation model to obtain a target model output value, and taking the candidate model corresponding to the target model output value as a target model;
the first obtaining unit is specifically configured to:
obtaining M candidate model output values of the entry by using the M candidate models;
and obtaining M normalized candidate model output values of the entries according to each candidate model output value of the entries and the candidate model output values of other entries in the text where the entries are located.
8. The apparatus of claim 7, further comprising:
the second acquisition unit is used for acquiring an initial model output value of the entry by using the initial model; the initial model output value of the entry is used for obtaining the normalized initial model output value of the entry according to the initial model output value of the entry and the initial model output values of other entries in the text where the entry is located; and obtaining the importance accuracy of the entry according to the normalized initial model output value of the entry; and/or obtaining the sequencing accuracy rate among the entries according to the normalized initial model output value of the entries or the initial model output value of the entries; and/or obtaining the discrimination accuracy between the entries according to the normalized initial model output value of the entries.
9. The apparatus according to claim 7 or 8, wherein the number of importance accuracies of the terms is N, the number of ranking accuracies between the terms is P, the number of discrimination accuracies between the terms is Q, N, P and Q are both 0 or positive integers and are not both 0, and at least one of N, P and Q is greater than or equal to 2, the construction unit is specifically configured to:
obtaining K target accuracy rates according to at least one of the importance accuracy rate of the entries, the sequencing accuracy rate between the entries and the discrimination accuracy rate between the entries, wherein K is more than 1 and less than or equal toAn integer of (d);
adjusting the first model parameters of the initial model according to the K target accuracy rates to obtain M second model parameters;
and constructing the M candidate models according to the M second model parameters.
10. The apparatus according to claim 9, wherein the constructing unit is configured to, when adjusting the first model parameter of the initial model according to the K target accuracy rates to obtain M second model parameters, specifically:
obtaining M target accuracy rates which are greater than or equal to the accuracy rate threshold value according to the K target accuracy rates and a preset accuracy rate threshold value;
performing derivation operation on each target accuracy rate in the M target accuracy rates to obtain M gradient values;
and adjusting the first model parameters of the initial model respectively according to each gradient value in the M gradient values to obtain M second model parameters.
11. The apparatus according to claim 7, wherein the evaluation model includes standard output values of all entries in a text in which the entry is located, and the evaluation unit is specifically configured to:
for each candidate model, determining K entries with the highest normalized candidate model output value in the text;
determining R entries with the highest standard output value in the text, wherein R is an integer larger than K;
obtaining an evaluation result of each normalized candidate model output value according to the K entries with the highest normalized candidate model output value in the text and the R entries with the highest standard output value in the text;
and selecting one normalized candidate model output value from the M normalized candidate model output values as the target model output value according to the evaluation result.
12. An apparatus for acquiring importance, the apparatus comprising:
the acquisition unit is used for acquiring a text to be processed;
the word cutting unit is used for carrying out word cutting processing on the text to be processed so as to obtain at least one entry;
the processing unit is used for obtaining a target model output value of each entry in the at least one entry by using a target model, and the target model output value is used as the importance of each entry;
wherein the object model is generated by the generation device of the model of any one of claims 7 to 11.
CN201410723276.2A 2014-12-03 2014-12-03 The generation method and device of model, importance acquisition methods and device Active CN104572820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410723276.2A CN104572820B (en) 2014-12-03 2014-12-03 The generation method and device of model, importance acquisition methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410723276.2A CN104572820B (en) 2014-12-03 2014-12-03 The generation method and device of model, importance acquisition methods and device

Publications (2)

Publication Number Publication Date
CN104572820A CN104572820A (en) 2015-04-29
CN104572820B true CN104572820B (en) 2017-11-24

Family

ID=53088882

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410723276.2A Active CN104572820B (en) 2014-12-03 2014-12-03 The generation method and device of model, importance acquisition methods and device

Country Status (1)

Country Link
CN (1) CN104572820B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107515876B (en) * 2016-06-16 2020-12-04 阿里巴巴集团控股有限公司 Feature model generation and application method and device
CN106503231B (en) * 2016-10-31 2020-02-04 北京百度网讯科技有限公司 Search method and device based on artificial intelligence
CN109919931B (en) * 2019-03-08 2020-12-25 数坤(北京)网络科技有限公司 Coronary stenosis degree evaluation model training method and evaluation system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043843A (en) * 2010-12-08 2011-05-04 百度在线网络技术(北京)有限公司 Method and obtaining device for obtaining target entry based on target application
CN102789451A (en) * 2011-05-16 2012-11-21 北京百度网讯科技有限公司 Individualized machine translation system, method and translation model training method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120005566A1 (en) * 2010-06-30 2012-01-05 International Business Machines Corporation Adding a comprehension marker to a social network text entry

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043843A (en) * 2010-12-08 2011-05-04 百度在线网络技术(北京)有限公司 Method and obtaining device for obtaining target entry based on target application
CN102789451A (en) * 2011-05-16 2012-11-21 北京百度网讯科技有限公司 Individualized machine translation system, method and translation model training method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Estimation and Evaluation of Conditional Asset Pricing Models;STEFAN NAGEL等;《The Journal of Finance》;20110523;第66卷(第3期);第873-909页 *
基于支持向量机的聚类及文本分类研究;平源;《中国博士学位论文全文数据库信息科技辑》;20130115(第01期);第1-130页 *

Also Published As

Publication number Publication date
CN104572820A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
US11288444B2 (en) Optimization techniques for artificial intelligence
CN108804641B (en) Text similarity calculation method, device, equipment and storage medium
US11397772B2 (en) Information search method, apparatus, and system
CN106815252B (en) Searching method and device
CN108509463B (en) Question response method and device
CN112487173B (en) Man-machine conversation method, device and storage medium
US20220092416A1 (en) Neural architecture search through a graph search space
CN110188172A (en) Text-based event detection method, device, computer equipment and storage medium
EP3617952A1 (en) Information search method, apparatus and system
CN109300050A (en) Insurance method for pushing, device and storage medium based on user's portrait
CN110019832B (en) Method and device for acquiring language model
CN108108347B (en) Dialogue pattern analysis system and method
KR20190128246A (en) Searching methods and apparatus and non-transitory computer-readable storage media
CN117931991B (en) Training sample acquisition and large model optimization training method and device
CN105302882A (en) Keyword obtaining method and apparatus
CN104536979A (en) Generation method and device of topic model and acquisition method and device of topic distribution
CN114037003A (en) Training method, device and electronic device for question answering model
CN111178537A (en) A feature extraction model training method and device
CN113408280A (en) Negative example construction method, device, equipment and storage medium
CN104572820B (en) The generation method and device of model, importance acquisition methods and device
CN111881293B (en) Risk content identification method and device, server and storage medium
CN113642727A (en) Training method of neural network model and processing method and device of multimedia information
CN119025685B (en) A knowledge graph relationship prediction method, device, equipment and storage medium
CN116050516A (en) Text processing method and device, equipment and medium based on knowledge distillation
CN111554275A (en) Speech recognition method, apparatus, device, and computer-readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant