A method and system for automatically acquiring collocation construction, and a visualization method
By extracting and clustering of coordinated construct examples from the corpus, a highly interpretable language knowledge base is generated, which solves the problem of lack of coordinated construct acquisition and visualization methods in the existing technology, and meets the needs of online language education and grammar correction. .
Patent Information
- Application Number
- CN202011413473.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-02
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-12-02
AI Technical Summary
The existing technology lacks strict formal definitions and mature automatic acquisition and visualization methods to obtain collocation structures, resulting in insufficient time-consuming, coverage and consistency in the construction of language knowledge bases, and lack of interpretability in deep learning methods.
By extracting collocation construct examples of target words or syntactic patterns from the corpus, collocation constructs are automatically generated using dependent syntactic analysis and clustering methods, and providing visualization methods. The generated knowledge base is highly interpretable and is suitable for language online education and Automatic grammar correction.
Automatic acquisition and visualization of collocation structures is realized, the problems of insufficient information and poor interpretability are overcome, and the language knowledge base is provided to meet the needs of online education and grammar correction.
Smart Images

Figure CN112395871B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and more specifically, relates to an automatic acquisition method and system for collocation construction, and a visualization method. Background Art
[0002] Information applications based on natural language processing technology, including automatic grammar correction systems and online education systems, rely on explicit language knowledge bases. Due to the complexity of language itself, manually constructing language knowledge bases, such as dictionaries and grammar knowledge bases, requires a lot of time, manpower and financial resources, and has defects in coverage and consistency. Automatic acquisition of language knowledge is an effective way to build a language knowledge base. At the same time, knowledge acquisition based on deep learning is not yet interpretable. The current types of interpretable language knowledge that can be automatically acquired are mainly collocation knowledge. Cognitive linguistics has proposed a new basic unit of language knowledge-construction. Construction is a "form-meaning" complex, and collocation construction is a construction representation proposed by corpus-based cognitive linguistics research, which contains multiple types of knowledge such as syntax, vocabulary, and the strength of the association between words and constructions. Existing theoretical research shows that collocation construction is highly interpretable and can be used to explain a variety of language phenomena. It has broad application prospects in automatic grammar correction, online education, etc.
[0003] However, there is no strict formal method for collocation construction, nor is there a mature automatic acquisition and visualization method. Summary of the invention
[0004] In view of the defects and improvement needs of the prior art, the present invention provides a method and system for automatically acquiring collocation constructions, and a visualization method, the purpose of which is to propose a strict formal definition of collocation constructions, a corresponding automatic acquisition method, and a visualization method.
[0005] Given a target word or syntactic pattern, and a specific corpus that has undergone dependency syntax analysis, the present invention can automatically obtain collocation construction instances of the target word or syntactic pattern from the corpus, and automatically generate collocation constructions through a clustering method, and a visualization method is provided. The generated knowledge base is highly interpretable and can be used in the fields of online language education, automatic grammar correction, and the like.
[0006] To achieve the above object, according to a first aspect of the present invention, a method for automatically acquiring a collocation structure is provided, the method comprising the following steps:
[0007] S1. extracting a set of collocation construction instances of a target word or a target syntactic pattern from a corpus, wherein the target syntactic pattern is in the form of a dependency tree;
[0008] S2. Cluster the set of collocation construction instances into multiple communities;
[0009] S3. For each clustering community, obtain the collocation construction corresponding to the community.
[0010] Preferably, a set of collocation construction instances of the target word is extracted from the corpus, specifically as follows:
[0011] (A1) Search the corpus to obtain all sentence instances containing the target word, and convert each sentence instance obtained into a dependency tree through dependency syntactic analysis. All dependency trees constitute a dependency tree set;
[0012] (A2) For each dependency tree in the dependency tree set, perform the following operations to construct a collocation construction instance set:
[0013] Initialize a dependency subtree to be empty, traverse each triple in the dependency tree, select triples whose central word or dependency word is the same as the target word, add them to the dependency subtree, and after the traversal, use the dependency subtree as the collocation construction instance corresponding to the dependency tree.
[0014] Beneficial effects: The acquisition of collocation construction examples of target words in the present invention is centered on the target words, and the syntactic components that depend on the syntactic components of the target words are acquired through dependency grammar connection, thereby comprehensively reflecting the specific syntactic usage pattern of the target words.
[0015] Preferably, a set of collocation construction instances of the target syntactic pattern is extracted from the corpus, specifically as follows:
[0016] (B1) extracting search terms from the target syntactic pattern and constructing a search term set;
[0017] (B2) searching the corpus to obtain sentence instances containing all the search terms in the search term set, and converting each of the obtained sentence instances into a dependency tree through dependency syntactic analysis to form a dependency tree set;
[0018] (B3) For each dependency tree in the dependency tree set, determine whether all triples in the target dependency tree are contained in the dependency tree, and whether the order in the target dependency tree is consistent with the order in the dependency tree. If so, proceed to step (B4); otherwise, do not obtain; thereby constructing a collocation construction instance set:
[0019] (B4) comparing the dependency tree with the target dependency tree to determine matching items of the wildcard;
[0020] (B5) Initialize a dependency subtree to be empty, traverse each triple in the dependency tree, select triples that satisfy any of the following conditions and add them to the dependency subtree. After the traversal is completed, the dependency subtree is used as the collocation construction instance corresponding to the dependency tree. The conditions are as follows:
[0021] 1) The triple exists in the target dependency tree;
[0022] 2) The dependency of the triple is a match;
[0023] 3) The central word of the triple is the matching item.
[0024] Beneficial effect: The collocation construction instance of the syntactic pattern of the present invention obtains the key syntactic part through dependency grammatical connection, and uses wildcard technology to determine the content words related to the syntactic pattern, and then obtains the dependent syntactic components and dependent syntactic components of the content words, forming specific usage information that comprehensively reflects the syntactic pattern.
[0025] Preferably, in step S2, given a collocation construction instance set Γ′={C i} and its corresponding maximum clustering distance D = {ε i}, cluster Γ′ in the following way:
[0026] (C1) Inspect C i , will include C i The clustering community is initialized to I i ={C i}, and set C i The access value is True, and go to step (C2);
[0027] (C2) Get C i Neighbors in, It is C j Relative to C i , r is the maximum search distance, and go to step (C3);
[0028] (C3) Examine C in N one by one j , if C j The access value is False, and if for community I i All collocations in C k , both have in, C k Relative to C j The distance, ε j C j The maximum cluster distance of C j Add to Community I i , set C j The access value is True and C is obtained j Neighbors And update N so that N=N∪N′.
[0029] Beneficial effects: The present invention clusters collocation construction instances based on the calculation of the ordered similarity of collocation construction instances, and determines the typical semantic usage scope of collocation construction by calculating the association strength between words and collocation constructions, thereby simulating the process of human beings accumulating, abstracting, summarizing and finally acquiring language knowledge during the reading process, and forming a language knowledge form that is similar to human language knowledge and easy to understand and interpret.
[0030] Preferably, with construction example C i The maximum clustering distance calculation process is as follows:
[0031] (D1) Get C i The distance set relative to each collocation construction instance in the collocation construction instance set Γ′ n is the number of collocation construction instances included in Γ′;
[0032] (D2) With distance as the horizontal axis and the number of collocation constructions in the distance value interval as the vertical axis, make a histogram of D, define the distance value corresponding to the 15th percentile as p1, and the distance value p2 with the first distance value after p1 being 0;
[0033] (D3) Obtain the mean square error σ of D;
[0034] (D4)C i The maximum clustering distance value calculation formula is as follows:
[0035]
[0036] Wherein, δ is the multiplication parameter, 1≤δ≤5.
[0037] Beneficial effect: The present invention takes the distance between a specific collocation construction instance and all collocation construction instances as a random variable, examines the distribution of its probability mass function, and takes 15% as an empirical value, thereby better obtaining the maximum clustering distance of the collocation construction instances.
[0038] Preferably, with construction example C j Relative to collocation construction example C k Distance The calculation process is as follows:
[0039] (E1) Based on C j and C k The similarity of the triples in C is calculated j and C k The similarity of features
[0040] (E2) Based on C j and C k The similarity of features Calculate Cj Relative to C k Order similarity
[0041]
[0042] Among them, len(C) is the number of triples contained in C, α and β represent C j or C k The weights of different features in similarity calculation, α+β=1;
[0043] (E3) Based on C j Relative to C k Order similarity Calculate C j Relative to C k Distance
[0044]
[0045] Beneficial effects: The present invention introduces an asymmetric similarity calculation method based on Amos Tversky, and utilizes the setting of feature weights of different parts in asymmetric similarity calculation to achieve ordered similarity between collocation construction instances, thereby solving the inclusive relationship between collocation construction instances.
[0046] Preferably, based on the similarity of the triples, C is calculated j and C k The similarity of features Among them, C j =(e1=<t1,h1,c1> , e2=<t2,h2,c2> ,...e J = <t J ,h J , c J >), C k =(e1=<t1,h1,c1> , e2=<t2,h2,c2> ,...e K = <t K ,h K , c K >), t in the triple is the dependency type, h is the center word, and c is the dependent word. The calculation process is as follows:
[0047] Initialize the matrix M of size (J+1)×(K+1), set the cell values in the first row and first column to 0; start from the second cell in the second row, calculate the cell values row by row, so that:
[0048]
[0049] Among them, sim(ep , e q ) represents the triple e p and e q The similarity is calculated using the following formula:
[0050]
[0051] in:
[0052]
[0053] sim(h p ,h q )=cosine(vec(h p ), vec(h q ))
[0054] sim(c p , c q )=cosine(vec(c p ), vec(c q ))
[0055] Among them, cosine(·) is the cosine function, vec(·) is the word vector;
[0056] After the calculation is completed, C j and C k The similarity of features
[0057] Beneficial effect: The present invention adopts a dynamic programming algorithm. Since the dynamic programming algorithm can take into account the costs of different paths of the process, the maximum feature similarity of two collocation construction instances can be obtained while taking into account the present and post-sequence order of triples in the collocation construction instance.
[0058] Preferably, step S3 includes the following sub-steps:
[0059] (1) Cluster community I i All collocation construction examples in C i , according to the order of the triplets, a sequence of two-tuples of triplets is formed, as shown in the following formula:
[0060] g i =(<e1,e2> ,<e2,e3> ,... <e k-1 , e k >)
[0061] (2) Merge from I i For all the obtained two-tuple sequences, a directed graph G is constructed, in which the nodes are triples, the node directions are determined by the two-tuples, and the two-tuple connection weights are calculated as
[0062] (3) Select the node n with in-degree 0 and the largest arc weight as the initial node, traverse G using the depth-first method to obtain all subgraphs, and select the subgraph G′ with the highest average connection weight and containing the target structure as the syntactic pattern of the collocation construction;
[0063] (4) For any node b in G′, from I i Get the word set W={w i}, then word w i The strength of association with the construction G′ is the P value of Fisher's exact test express;
[0064] (5) G′ and the word set W corresponding to the nodes in the graph and their association strength Together they form a cluster community I i The collocation construction obtained.
[0065] Beneficial effect: The present invention selects the initial node by weight and adopts a weight-first strategy in the depth-first traversal process, thereby obtaining the optimal path from the directed cyclic graph as a typical representative syntactic pattern of the collocation construction.
[0066] To achieve the above object, according to a second aspect of the present invention, a method for visualizing collocation construction is provided, the method comprising the following steps:
[0067] Using the method described in the first aspect, automatically obtaining the collocation construction;
[0068] For each obtained collocation construction, the dependency type and the central word are used as nodes, and they are arranged linearly from left to right according to their appearance order in G′. For example, the connection arcs between nodes are directional, where the starting node is the central word node, the arrow points to the dependency word node, and the connection arcs show the connection weights.
[0069] Beneficial effects: The present invention transforms collocation construction into a directed graph by utilizing the inherent property of collocation construction that is based on a dependency tree framework. Due to the directionality of the directed graph, the collocation construction knowledge base generated is highly interpretable and can be used in the fields of online language education, automatic grammar correction, etc.
[0070] To achieve the above-mentioned object, according to a third aspect of the present invention, there is provided a system for automatically acquiring a collocation configuration, comprising: a computer-readable storage medium and a processor;
[0071] The computer-readable storage medium is used to store executable instructions;
[0072] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the method for automatically acquiring the collocation structure described in the first aspect.
[0073] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0074] The present invention uses a clustering method to simulate the cognitive laws of human language acquisition and obtain collocation constructions, taking specific words or specific sentence patterns as units. The collocation construction gives a typical semantic communication function of a specific language, including syntactic patterns, words, and information such as the strength of association between words and the collocation construction. On the one hand, it overcomes the defect of insufficient information in collocation, and on the other hand, it has strong explanatory power, which can meet the needs of online language education and grammar correction. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 A flow chart of a method for automatically acquiring a collocation structure provided by the present invention;
[0076] Figure 2 A visualization result of a collocation structure provided by the present invention;
[0077] Figure 3 This is a visualization result of a specific collocation structure provided by the present invention. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0079] like Figure 1 As shown, the present invention provides a method for automatically acquiring collocation constructions, the method comprising the following steps: inputting a target word / target syntactic pattern and a dependency syntactic tree set (corpus), extracting collocation construction instances, calculating the similarity of the collocation construction instances, clustering the collocation construction instances based on a clustering algorithm based on community voting, generating a collocation construction for each clustering community, and finally, graphically representing the collocation construction.
[0080] 1. Input format definition
[0081] The input includes the retrieval target structure and the dependency tree set.
[0082] The retrieval target structure is the first input, which has two forms: (1) a single word, which can be a verb, noun, adjective, or adverb, called the core word w, such as the adjective "happy" in Chinese; (2) a dependency subtree. A dependency subtree contains multiple triples, where a triple is defined as <t, h, c>, where t is the dependency type, h is the head word, and c is the dependent word. Thus, a dependency subtree can be expressed as an ordered triple sequence:
[0083] K = (e1 = <t1, h1, c1>, e2 = <t2, h2, c2>,... e n = <t n , h n , c n )
[0084] Among them, it contains a core word wildcard, denoted as CORE, and CORE can be h i or c i . For example, the dependency subtree "auxpass(CORE, 被)aspect(CORE, 了)" contains two triples, where CORE is the core word wildcard, auxpass and aspect are the dependency types respectively, CORE is the head word, and "被" and "了" are the dependent words.
[0085] The second input is a set of dependency trees Γ = {T j}}. Given a corpus, if the input target structure is a single word, the corpus can be directly retrieved to obtain sentence instances, and Γ can be obtained through dependency syntactic analysis; if the input target structure is a dependency subtree, the retrieval words need to be extracted from the dependency subtree first, then the corpus is retrieved to obtain sentence instances, and after dependency syntactic analysis, the dependency tree of the sentence instance containing the dependency subtree is selected as Γ. Similar to the dependency subtree, a single dependency tree is expressed as:
[0086] T j = (e1 = <t1, h1, c1>, e2 = <t2, h2, c2>,... e m = <t m , h m , c m )
[0087] 2. Extraction of collocation construction instances
[0088] (1) If the input target structure is a single word, to obtain collocation construction instances, traverse the set of dependency trees Γ and analyze each dependency tree T j one by one, and select the triples with the core word as the head word or the dependent word to jointly form a dependency subtree.
[0089] The selection condition is: for each triple e j in the dependency tree T i = <ti ,h i , c i >, if h i =w, or c i =w, then e i Add to the dependency subtree. The dependency subtree formed is the j The collocation construction examples obtained from . That is:
[0090] C=(e1=<t1,h1,c1> , e2=<t2,h2,c2> ,...e k = <t k ,h k , c k >)
[0091] Among them, for any e i = <t i ,h i , c i >,h i =w or c i =w.
[0092] (2) If the input target structure is a dependency subtree K, traverse the dependency tree set Γ and analyze the dependency trees T one by one j , to obtain collocation construction examples.
[0093] For the dependency tree T j , if for a triple e in K i = <t i ,h i , c i >, both have e i ∈T j , and the order of the triples in K is the same as T j If the order is consistent, then we can j For the dependency tree T that can obtain collocation instances, j , comparing K can determine the matching item of the wildcard CORE, denoted as w core , define its collocation construction instance as C, and check T one by one j The triplet e in i = <t i ,h i , c i >, add to C if the following conditions are met:
[0094] (1)e i ∈K;
[0095] (2) or c i =w core ;
[0096] (3) or h i =w core .
[0097] 3. Similarity calculation of collocation construction examples
[0098] Two triples e1 =<t1,h1,c1> and e2=<t2,h2,c2> The similarity calculation method is:
[0099]
[0100] in:
[0101]
[0102] sim(h1,h2)=cosine(vec(h1),vec(h2))
[0103] sim(c1,c2)=cosine(vec(c1),vec(c2))
[0104] Among them, cosine(·) is the cosine function, and vec(·) is the word vector. The word vector can be obtained by using the current popular algorithm, such as the word2vec algorithm.
[0105] Given two collocation construction instances C1 and C2, they are:
[0106] C1=(e1=<t1,h1,c1> , e2=<t2,h2,c2> ,...e k = <t k ,h k , c k >)
[0107] C2=(e1=<t1,h1,c1> , e2=<t2,h2,c2> ,...e l = <t l ,h l , c l >)
[0108] The similarity of features between C1 and C2 The calculation method is: Initialize the matrix M with a size of (k+1)×(l+1). Set the cell values in the first row and the first column to 0; start from the second cell in the second row, and calculate the cell values row by row, so that:
[0109]
[0110] Among them, sim(e i , e j ) The triple similarity calculation method defined above is used. After the calculation is completed, let the feature similarity of C1 and C2
[0111] Based on the feature similarity of C1 and C2, calculate the ordered similarity of C1 relative to C2:
[0112]
[0113] In the above formula, the minimum similarity between two collocation construction instances is set to 0.05, len(C) is the number of triples contained in C, Indicates the feature similarity between C1 and C2 α and β represent the weights of different features of C1 or C2 in similarity calculation, α+β=1. The ordered similarity of C1 relative to C2 is different from the ordered similarity of C2 relative to C1.
[0114] 4. Clustering method based on collocation construction community
[0115] Based on the ordered similarity of C1 relative to C2, calculate the distance between C1 and C2
[0116]
[0117] Given a dependency tree set Γ, obtain collocation construction instances one by one, and obtain a collocation construction instance set Γ′={C i}.
[0118] C i The maximum cluster distance value is calculated as follows:
[0119] (1) Get C i The set of distances relative to each collocation construction instance in Γ′ n is the number of collocation instances included in Γ′;
[0120] (2) Make a histogram of D, with the horizontal axis representing distance, ranging from [0-1], and the vertical axis representing the number of collocations in the distance interval. i The maximum number of collocation construction instances that can form collocations is 15%, so the distance value corresponding to the 15th percentile is defined as p1, and the first distance value after p1 is 0, the distance value p2;
[0121] (3) Obtain the mean square error σ of D;
[0122] (4) Define construction C i The maximum clustering distance value is:
[0123]
[0124] Wherein, δ is the multiplication parameter, 1≤δ≤5.
[0125] In step S2, given a collocation construction instance set Γ′={C i} and its corresponding maximum clustering distance D = {ε i}, cluster Γ′ in the following way:
[0126] (C1) Inspect C i , will include C i The clustering community is initialized to I i ={C i}, and set C i The access value is True, and go to (C2);
[0127] (C2) Get C i Neighbors in, It is C j Relative to C i , r is the maximum search distance, and go to (C3);
[0128] (C3) Examine C in N one by one j , if C j The access value is False, and if for community I i All collocations in C k , both in, C k Relative to C j The distance, ε j C j The maximum cluster distance of C j Add to Community I i , set C j The access value is True and C is obtained j Neighbors And update N so that N=N∪N′.
[0129] In this embodiment, the maximum search distance r is set to 0.6.
[0130] 5. Generation of collocation construction
[0131] For each cluster community I i , use the following method to obtain the collocation construction:
[0132] (1) Put I i All collocation construction examples in C i , according to the order of the triplets, a sequence of two-tuples of triplets is formed, as shown in the following formula:
[0133] g i =(<e1,e2> ,<e2,e3> ,... <ek-1 , e k >)
[0134] The following will <e i , e i+1 > is called a tuple.
[0135] (2) Merge from I i For all the obtained two-tuple sequences, a directed graph G is constructed, in which the nodes are triples, the node directions are determined by the two-tuples, and the two-tuple connection weights are calculated as
[0136] (3) Select a node n with an in-degree of 0 and the largest arc weight, take n as the initial node, traverse G using a depth-first approach and obtain all subgraphs, and select the subgraph G′ with the highest average connection weight and containing the target structure as the syntactic pattern of the collocation construction. The average connection weight is the sum of the weights of all connections in the path from the starting node to the destination node / the number of connections in the path.
[0137] (4) For any node b in G′, from I i Get the word set W={w i}, then word w i The strength of the association with the construction G′ is expressed as the P value of Fisher's exact test, which is calculated as:
[0138] Assume w i The number of times this node appears is f i 1 , w i The frequency of occurrence in the given corpus is f i 2 , I i The number of collocation construction instances contained in is n, the number of sentences contained in the given corpus is N, and the average length of the collocation construction instances is 20. Let a = f i 1 , b = n × (20-f i 1 ), c=f i 2 -f i 1 , d = Nf i 1 , then P can be calculated using Fisher's exact test method as follows:
[0139]
[0140] (5) G′ and the word set corresponding to the nodes in the graph and their association strength constitute I i The collocation construction obtained.
[0141] 6. Visualization of collocational constructions
[0142] For the following collocational constructions:
[0143] (<D1, X1, CORE-WORD>,
[0144] <D2, CORE-WORD, X2>
[0145] <D3, CORE-WORD, X3>
[0146] X1 = {(W_1, V_1, F_1)}
[0147] X2 = {(W_2, V_2, F_2), (W_3, V_3, F_3)}
[0148] X3 = {(W_4, V_4, F_4)}
[0149] CORE-WORD = {(W_5, V_5, F_5), (W_6, V__6, F_6), (W_7, V__7, F_7)})
[0150] where D1, D2, and D3 are dependency types, X1, X2, and X3 are syntactic slot placeholders respectively pointing to three sets of word information structures, and each word information structure includes part of speech (W_·), association strength (V_·), and frequency (F_·), and the frequency (F_·) is the frequency of the word appearing in the community.
[0151] The visualization rules are as follows: Taking the dependency type and CORE-WORD as nodes, and linearly arranging them from left to right in the order they appear in G’. If the connecting arcs between nodes have directions, the starting node is the central word node, that is, the first placeholder in the triple, and the arrow points to the dependent word node, that is, the second placeholder in the triple, and the connecting arc shows the connection weight. The visualization result is as Figure 2 shown.
[0152] Specifically, taking the dependency subtree "auxpass(CORE, 被)aspect(CORE, 了)" as the input format and the corpus as the People's Daily corpus, multiple collocational constructions can be obtained, and one of them is as Figure 3 shown. This collocational construction gives a typical usage pattern of the "被" sentence in Chinese and has good interpretability: The ROOT node indicates that this collocational construction cannot be embedded as other syntactic components. The words and their association strengths given in the NSUBJ node indicate that the semantic type of the subject component is human, and the semantics in another NSUBJ node is also centered on humans. The CORE-WORD node is the predicate verb, which includes not only transitive verbs but also some idioms.
[0153] This technology overcomes the shortcomings of the two existing technologies for automatic acquisition of language knowledge: the first type of automatic acquisition technology for language knowledge originates from the field of corpus linguistics, and its main knowledge form is limited to the collocation information between two words. The amount of information is too small to meet the needs of online language education, automatic grammar correction, etc. The second type of automatic language knowledge acquisition method originates from natural language processing technology based on deep learning, which exists in the form of ultra-large-scale parameters, has low interpretability, and cannot meet the needs of language education and grammar correction feedback for explicit language rules. The present invention uses specific words or specific sentence patterns as units, and adopts clustering methods to simulate the cognitive laws of human language acquisition to obtain collocation constructions. Figure 3 As shown in the figure, the collocation construction gives a typical semantic communication function of a specific language (Chinese in the figure), including syntactic patterns, words, and the strength of the association between words and the collocation construction. This overcomes the defect of insufficient information in collocation and has strong explanatory power, which can meet the needs of online language education and grammar correction.
[0154] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for automatically acquiring collocation constructions, It is characterized in that The method comprises the following steps: S1. extracting a set of collocation construction instances of a target word or a target syntactic pattern from a corpus, wherein the target syntactic pattern is in the form of a dependency tree; S2. Cluster the set of collocation construction instances into multiple communities; S3. For each cluster community, obtain the collocation construction corresponding to the community; The set of collocation construction instances of the target words is extracted from the corpus, as follows: (A1) Search the corpus to obtain all sentence instances containing the target word, and convert each sentence instance obtained into a dependency tree through dependency syntactic analysis. All dependency trees constitute a dependency tree set; (A2) For each dependency tree in the dependency tree set, perform the following operations to construct a collocation construction instance set: Initialize a dependency subtree to be empty, traverse each triple in the dependency tree, select triples whose central word or dependency word is the same as the target word, add them to the dependency subtree, and after the traversal is completed, use the dependency subtree as the collocation construction instance corresponding to the dependency tree; A set of collocation construction instances of the target syntactic pattern is extracted from the corpus, as follows: (B1) extracting search terms from the target syntactic pattern and constructing a search term set; (B2) searching the corpus to obtain sentence instances containing all the search terms in the search term set, and converting each of the obtained sentence instances into a dependency tree through dependency syntactic analysis to form a dependency tree set; (B3) For each dependency tree in the dependency tree set, determine whether all triples in the target dependency tree are contained in the dependency tree, and whether the order in the target dependency tree is consistent with the order in the dependency tree. If so, proceed to step (B4); otherwise, do not obtain; thereby constructing a collocation construction instance set: (B4) comparing the dependency tree with the target dependency tree to determine matching items of the wildcard; (B5) Initialize a dependency subtree to be empty, traverse each triple in the dependency tree, select triples that satisfy any of the following conditions and add them to the dependency subtree. After the traversal is completed, the dependency subtree is used as the collocation construction instance corresponding to the dependency tree. The conditions are as follows: 1) The triple exists in the target dependency tree; 2) The dependency of the triple is a match; 3) The central word of the triple is a matching item; In step S2, given a collocation construction instance set Γ′={C i } and its corresponding maximum clustering distance D = {ε i }, cluster Γ′ in the following way: (C1) Inspect C i , will include C i The clustering community is initialized to I i ={C i }, and set C i The access value is True, and go to step (C2); (C2) Get C i Neighbors in, It is C j Relative to C i , r is the maximum search distance, and go to step (C3); (C3) Examine C in N one by one j , if C j The access value is False, and if for community I i All collocations in C k , both in, C k Relative to C j The distance, ε j C j The maximum cluster distance of C j Add to Community I i , set C j The access value is True and C is obtained j Neighbors And update N so that N = N ∪ N′; Collocation Construction Example C i The maximum clustering distance calculation process is as follows: (D1) Get C i The distance set relative to each collocation construction instance in the collocation construction instance set Γ′ n is the number of collocation construction instances included in Γ′; (D2) With distance as the horizontal axis and the number of collocation constructions in the distance value interval as the vertical axis, make a histogram of D and define the distance value corresponding to the 15th percentile as p 1 , p 1 The first distance value after that is 0. 2 ; (D3) Obtain the mean square error σ of D; (D4)C i The maximum clustering distance value calculation formula is as follows: Among them, δ is the multiplication parameter, 1≤δ≤5; Collocation Construction Example C j Relative to collocation construction example C k Distance The calculation process is as follows: (E1) Based on C j and C k The similarity of the triples in C is calculated j and C k The similarity of features (E2) Based on C j and C k The similarity of features Calculate C j Relative to C k The ordered similarity Among them, len(C) is the number of triples contained in C, α and β represent C j or C k The weights of different features in similarity calculation, α+β=1; (E3) Based on C j Relative to C k The ordered similarity Calculate C j Relative to C k Distance Based on the similarity of the triples, calculate C j and C k The similarity of features Among them, C j =(e 1 = <t 1 ,h 1 ,c 1 >,e 2 = <t 2 ,h 2 ,c 2 >,…e J = <t J ,h J ,c J >), C k =(e 1 = <t 1 ,h 1 ,c 1 >,e 2 = <t 2 ,h 2 ,c 2 >,…e K = <t K ,h K ,c K >), t in the triple is the dependency type, h is the center word, and c is the dependent word. The calculation process is as follows: Initialize the matrix M of size (J+1)×(K+1), set the cell values in the first row and first column to 0; start from the second cell in the second row, calculate the cell values row by row, so that: Among them, sim(e p ,e q ) represents the triple e p and e q The similarity is calculated using the following formula: in: sim(h p ,h q )=cosine(vec(h p ),thing(h q )) sim(c p ,c q )=cosine(vec(c p ),vec(c q )) Where cosine(·) is the cosine function, vec(·) is the word vector; p and q are the p-th row and q-th column in the matrix M, respectively; After the calculation is completed, C j and C k The similarity of features Step S3 includes the following sub-steps: (F1) Cluster community I i All collocation construction examples in C i , according to the order of the triplets, a sequence of two-tuples of triplets is formed, as shown in the following formula: g i =( <e 1 ,e 2 >, <e 2 ,e 3 >,… <e k-1 ,e k >) (F2) Merge from I i For all the obtained two-tuple sequences, a directed graph G is constructed, in which the nodes are triples, the node directions are determined by the two-tuples, and the two-tuple connection weights are calculated as (F3) Select the node n with in-degree 0 and the largest connection weight as the initial node, traverse G with a depth-first method and obtain all subgraphs, and select the subgraph G′ with the highest average connection weight and containing the target word as the syntactic pattern of the collocation construction; (F4) For any node b in G′, from I i Get the word set W={w i }, then word w i The P value of the association strength between G′ and express; (F5) G′ and the word set W corresponding to the nodes in the graph and their association strength Together they form a cluster community I i The collocation construction obtained.
2. A visualization method for collocation construction, It is characterized in that The method comprises the following steps: Using the method as claimed in claim 1, automatically obtaining the collocation construction; For each collocation construction obtained, the dependent words and the central word are used as nodes, and are arranged linearly from left to right according to their appearance order in G′. The connection arcs between nodes are directional, where the starting node is the central word node, the arrow points to the dependent word node, and the connection arcs show the connection weights.
3. An automatic acquisition system for collocation construction, It is characterized in that include: A computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the method for automatically acquiring the collocation structure according to claim 1.
