Embodiment
At above-mentioned defective of the prior art, the technical scheme that the embodiment of the invention provides a kind of language material of classifying to determine.In this technical scheme, the seed word of the known class by choosing some in advance, and the input sample that obtains some from database is formed the input sample set; From the input sample set, obtain feature samples composition characteristic sample set according to default seed word, and determine the characteristic of division word according to the feature samples collection that gets access to; Determine classification language material and classification thereof according to the characteristic of division word that gets access to and text to be selected, improved efficient and accuracy rate that the classification language material obtains.
Wherein, in the technical scheme that the embodiment of the invention provides, the database that obtains the input sample set can be Baidu's encyclopaedia, wikipedia, WordNet etc.The input sample set that gets access to from database can comprise entry name, classified information and the relevant entry information of entry, and its form can be as shown in table 1:
Table 1
Below in conjunction with the accompanying drawing in the embodiments of the invention, the technical scheme in the embodiments of the invention is clearly and completely described, obviously, the embodiments described below only are the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that obtains under the creative work prerequisite, all belong to the scope of embodiments of the invention protection.
As shown in Figure 1, a kind of language material of classifying that provides for the embodiment of the invention is determined the schematic flow sheet of method, can may further comprise the steps:
Step 101, from database, obtain the input sample of predetermined number, form the input sample set.
Concrete, be example from Baidu's encyclopaedia, to excavate the classification language material.In the technical scheme that the embodiment of the invention provides, can from Baidu's encyclopaedia, obtain the input sample of predetermined number (as 1000), its form can be as shown in table 1.
Step 102, the default seed word of basis obtain feature samples, the composition characteristic sample set from the input sample set.
Concrete, in the technical scheme that the embodiment of the invention provides, when needs obtain the classification language material, can choose a quantity of seeds word in advance.For example, when needs obtain sport category classification language material, can choose the seed word of 10 sport category in advance, as physical culture, football, sportsman, track and field, world cup, the Olympic Games etc.Obtain input sample and choosing after the seed word, can from the input sample set, obtain feature samples, the composition characteristic sample set according to the seed word.
Wherein, in the technical scheme that the embodiment of the invention provides, the flow process of obtaining feature samples can may further comprise the steps as shown in Figure 2:
Step 102A, obtain the feature samples that comprises current seed word from input the sample set.
For example, the seed word of choosing in advance is football, basketball, sportsman, then obtains the feature samples that comprises current seed word according to this seed word from the input sample set.Wherein, the feature samples that comprises this seed word can be that entry is football, basketball or sportsman, also can be to comprise the respective seed word in the relevant entry.
Whether the quantity of step 102B, judging characteristic sample surpasses first threshold, is then to finish this flow process if be judged as; Otherwise, go to step 102C.
Wherein, the feature samples amount threshold can be determined according to the actual requirements, as 10000.
Step 102C, obtain entry and relevant entry in the feature samples, and entry and the relevant entry that gets access to added the seed word, upgrade current seed word; Go to step 102A.
Concrete, when the feature samples quantity that gets access to is lower than predetermined threshold value, the entry in the feature samples that gets access to all can be joined in the seed word with relevant entry, and from the input sample set, obtain more feature samples according to the seed word after upgrading.
Can get access to the feature samples of sufficient amount by above flow process.
The feature samples collection that step 103, basis get access to is determined the characteristic of division word.
Concrete, in embodiments of the present invention, get access to feature samples after, can further determine the weights of the entry that comprises in each feature samples, and determine the characteristic of division word according to the weights of each entry.
Be example with the weights of entry for the discrimination of this entry, in embodiments of the present invention, will import sample set as complete or collected works, and according to further definite two set of feature samples collection:
Set 1: comprise all entries that feature samples is concentrated;
Set 2: comprise all relevant entries that feature samples is concentrated.
Certain word W in the pair set 2 defines its discrimination and is:
Q
wThe number of times that number of times/W that=W occurs in set 2 occurs in complete or collected works
For certain the word x in the set 1, define its discrimination and be the average of its all relevant entry discriminations:
Wherein, n is that entry is the number of relevant entry in the feature samples of x, is the discrimination of i relevant entry.
After determining that feature samples is concentrated the discrimination of each entry, the entry that discrimination can be surpassed threshold value (as K) is defined as the characteristic of division word.
Step 104, determine classification language material and classification thereof according to characteristic of division word and text to be selected.
Concrete, determine the characteristic of division word after, can choose a text to be selected wantonly, and this text to be selected is cut word, obtain the characteristic of division word that comprises in this text to be selected, and determine the weights of text to be selected according to the characteristic of division word that gets access to; When the weights of text to be selected surpass threshold value, determine that this text to be selected is the classification language material, and with the classification of the classification under the corresponding seed word as this classification language material.
Wherein, determine the weights of text to be selected according to characteristic of division word and the feature word that gets access to, can specifically realize by following formula:
Wherein, tf is the word frequency of characteristic of division word in this text to be selected that occurs in the described text to be selected; Described i is the number of characteristic of division word; Described Q
iBe the weights of i characteristic of division word; Described N is the number of words of described text to be selected.
In order further to improve the accuracy rate of the classification language material that gets access to, in the technical scheme that the embodiment of the invention provides, after having determined the classification language material, determined classification language material can also be divided into many parts; Carry out the language material cross validation according to each part classification language material, and determine final classification language material and classification thereof.
Wherein, carry out the language material cross validation according to described each part classification language material, can specifically realize by following flow process:
Steps A
1, from each part classification language material, select a non-selected classification language material as test data;
Step B
1, use all the other each part classification language materials that the classification of described test data is verified respectively;
Step C
1, number of times that statistical testing of business cycles is correct, and when it surpasses the 5th threshold value, determine that test data is final classification language material;
Step D
1, judge whether also to exist non-selected classification language material; If to be judged as be then to go to steps A
1Otherwise, finish this flow process.
For example, the classification language material of determining can be divided into 10 parts, in turn will be wherein 9 parts as training data, 1 part as test data, the classification of test data is verified namely every part of test data has been carried out the test of 9 subseries; In test data, the number of times that the classification checking is correct surpasses the final classification language material that is defined as of threshold value.
It should be noted that, the method of the definite discrimination that provides in the above-mentioned flow process only is that a kind of embodiment of entry weights is provided in the technical scheme that provides of the embodiment of the invention, and in the technical scheme that the embodiment of the invention provides, determine that the mode of entry weights is not limited to this a kind of embodiment.For example, in the technical scheme that the embodiment of the invention provides, can also compose power to entry or use that common hit algorithm comes power composed in the feature word in the link analysis according to the parameter preset of each entry, and when the weights of entry during above threshold value, determine that this entry is the characteristic of division word.Wherein, this parameter preset comprises one of following or combination in any at least: the click volume of entry, favorable comment number and editor's number of times.
Below in conjunction with concrete accompanying drawing and concrete application scenarios the technical scheme that the embodiment of the invention provides is carried out more detailed description.
Be illustrated in figure 3 as classification language material under a kind of concrete application scenarios that the embodiment of the invention provides and determine the schematic flow sheet of method, in this embodiment, need obtain the classification language material of 5000 sport category; The seed word of preliminary election comprises: physical culture, football, sportsman, track and field, world cup, the Olympic Games; Language material mining data storehouse is Baidu's encyclopaedia; This method can comprise:
Step 301, from Baidu's encyclopaedia, obtain 10000 input samples and form the input sample sets.
Wherein, the form of input sample set can be as shown in table 1.
Step 302, the default seed word of basis obtain 1000 feature samples, the composition characteristic sample set from the input sample set.
Wherein, this feature samples can be as shown in table 2:
Table 2
When the feature samples that gets access to according to seed words such as physical culture, football, sportsman, track and field, world cup, the Olympic Games is counted less than 1000, can obtain more feature samples according to the relevant entry that comprises in the feature samples.
Step 303, determine the characteristic of division word according to the feature samples collection.
Concrete, in this embodiment, can determine the weights of each entry in the feature samples by determining the mode of discrimination, and with weights greater than 0.05 entry as the characteristic of division word.
Be example with the feature samples shown in the table 2.The discrimination of supposing basketball is 0.08, and the discrimination of billiard ball is 0.03, and the discrimination of world cup is 0.07, and then the discrimination of football is 0.06, and namely football belongs to the characteristic of division word.
Step 304, determine the classification language material according to characteristic of division word and text to be selected.
Concrete, can from the internet, obtain 50000 texts to be selected, and each text to be selected is cut word and weights calculating respectively, and the text to be selected that definite weights surpass certain threshold value in this step, obtains 5000 classification language materials for the classification language material.
Step 305,5000 classification language materials determining are carried out the language material cross validation, and determine 1000 final classification language materials.
Concrete, in this step, 5000 classification language materials determining in the step 304 can be divided into 5 parts, and to select a copy of it successively be test data, with remaining 4 parts this test data carried out classification checking respectively, and to choose the classification language material that the rate of being proved to be successful sorts preceding 1000 from high to low be final classification language material.Wherein, be proved to be successful between the identical classification language material of rate randomly ordered.
By above description as can be seen, in the technical scheme that the embodiment of the invention provides, the seed word of the known class by choosing some in advance, and the input sample that obtains some from database is formed the input sample set; From the input sample set, obtain feature samples composition characteristic sample set according to default seed word, and determine the characteristic of division word according to the feature samples collection that gets access to; Determine classification language material and classification thereof according to the characteristic of division word that gets access to and text to be selected, improved efficient and accuracy rate that the classification language material obtains.
Determine the inventive concept that method is identical based on above-mentioned classification language material, the embodiment of the invention also provides a kind of classification language material to determine equipment, can be applied in the said method flow process.
As shown in Figure 4, the classification language material that provides for the embodiment of the invention is determined the structural representation of equipment, can comprise:
First acquisition module 41 for the input sample that obtains predetermined number from database, is formed the input sample set; Wherein, described input sample comprises entry name, classified information and the relevant entry information of entry;
Second acquisition module 42 is used for obtaining feature samples from described input sample set, the composition characteristic sample set according to default seed word;
First determination module 43 is used for determining the characteristic of division word according to described feature samples collection;
Second determination module 44 is used for determining classification language material and classification thereof according to described characteristic of division word and text to be selected.
Wherein, described second acquisition module 42 obtains feature samples according to default seed word from described input sample set, specifically realize by following flow process:
Steps A, from described input sample set, obtain the feature samples that comprises current seed word;
Whether the quantity of step B, judging characteristic sample surpasses first threshold; If to be judged as be then to finish this flow process; Otherwise, go to step C;
Step C, obtain entry and relevant entry in the described feature samples, and the described entry that gets access to and relevant entry are added the seed word, upgrade current seed word; Go to steps A.
Wherein, described first determination module 43 specifically is used for, and obtains the entry that this feature samples is concentrated; Determine the weights of each entry in this entry; Determine the characteristic of division word according to the weights of described each entry.
Wherein, the weights of described entry are the discrimination of described entry;
Described first determination module 43 specifically is used for, and obtains the relevant entry that described feature samples is concentrated; Determine the discrimination of each relevant entry in this relevant entry; Determine the discrimination of each entry in this entry according to the discrimination of described relevant entry; Determine the characteristic of division word according to the discrimination of described entry.
Wherein, the discrimination of each relevant entry is specially in the described entry of should being correlated with, and each relevant entry concentrates the relevant entry with this of number of times that occurs in the relevant entry information importing the ratio of the number of times that occurs in the sample set at feature samples in the described relevant entry; The discrimination of each entry in described this entry is specially the average of the discrimination of the relevant entry that comprises in this entry place feature samples;
Described first determination module 43 specifically is used for, and when the discrimination of described entry surpasses second threshold value, determines that this entry is the characteristic of division word.
Wherein, described first determination module 43 specifically is used for, and determines the weights of each entry according to parameter preset, when the weights of described entry surpass the 3rd threshold value, determines that this entry is the characteristic of division word; Or, determine the weights of each entry according to the hit algorithm, when the weights of described entry surpass the 3rd threshold value, determine that this entry is the characteristic of division word;
Wherein, described parameter preset comprises one of following or combination in any:
The click volume of entry, favorable comment number and editor's number of times.
Wherein, described second determination module 44 specifically is used for, and described text to be selected is cut word, and obtains the characteristic of division word that comprises in this text to be selected; Determine the weights of described text to be selected according to the characteristic of division word that gets access to; When the weights of described text to be selected surpass the 4th threshold value, determine that described text to be selected is the classification language material, and the affiliated classification of will be described default seed word is as the classification of described classification language material.
Wherein, described second determination module 44 is determined the weights of described text to be selected according to described characteristic of division word and the feature word that gets access to, specifically realizes by following formula:
Wherein, tf is the word frequency of characteristic of division word in this text to be selected that occurs in the described text to be selected; Described i is the number of characteristic of division word; Described Q
iBe the weights of i characteristic of division word; Described N is the number of words of described text to be selected.
Wherein, described second determination module 44 also is used for, and described definite classification language material is divided into many parts; Carry out the language material cross validation according to described each part classification language material, and determine final classification language material and classification thereof.
Wherein, steps A
1, from described each part classification language material, select a non-selected classification language material as test data;
Step B
1, use all the other each part classification language materials that the classification of described test data is verified respectively;
Step C
1, number of times that statistical testing of business cycles is correct, and when it surpasses the 5th threshold value, determine that described test data is final classification language material;
Step D
1, judge whether also to exist non-selected classification language material; If to be judged as be then to go to steps A
1Otherwise, finish this flow process.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
It will be appreciated by those skilled in the art that accompanying drawing is the synoptic diagram of a preferred embodiment, the module in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of above-described embodiment can be merged into a module, also can further split into a plurality of submodules.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.