Method, system and electronic device for accurate region recognition based on contextual semantics

Through context semantic learning and multi-layer neural network generation of regional intention recognition models, combining article structure and word weights, the problem of inaccurate regional recognition in the existing technology is solved, and higher recognition accuracy is achieved.

CN114282535BActive Publication Date: 2024-12-17BEIJING ZHIHUI XINGGUANG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110364502.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-05
Publication Date
2024-12-17
Estimated Expiration
2041-04-05

AI Technical Summary

Technical Problem

In the prior art, the region identification is inaccurate, especially when the article contains multiple regions or has twists and turns, it is difficult to accurately identify specific regions.

Method used

Using a method based on context semantics, word embedding representation is performed through pre-trained word vectors, and context semantic learning is used for multi-layer fully connected neural network, to generate a regional intention recognition model, and to combine the article structure division module to calculate the weight and weight of regional words. The intention direction determination value is determined, and the fusion calculation obtains accurate regional information.

Benefits of technology

It improves the accuracy of regional recognition, can accurately identify regional information in complex texts, and reduces the possibility of inaccurate identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114282535B_ABST
    Figure CN114282535B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and electronic device for accurate region recognition based on context semantics. The method comprises: training a training set through trained word vectors to obtain a region intention recognition model; obtaining articles to be recognized and region words of the articles to be recognized; dividing the articles to be recognized into multiple article modules; determining region word sentences according to the region words; determining article modules corresponding to the region word sentences according to the region word sentences; inputting the region word sentences into the region intention recognition model to obtain a region intention recognition result of each region word; performing intention direction determination on the region intention recognition result to obtain a region intention direction determination value; determining the weight of each region word in the article module according to multiple article modules; determining accurate region information of the articles to be recognized according to the region intention direction determination value of the region word and the corresponding weight; obtaining accurate region word weights according to the region intention direction determination value and the corresponding weight, thereby improving region recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet data processing, and in particular to a method, system, electronic device and storage medium for accurate region recognition based on contextual semantics. Background Art

[0002] With the popularization of the Internet and the rise of mobile Internet, the advent of the media and self-media era, the content of the Internet has increased dramatically. Today, the rapid development of the Internet and mobile Internet has made the network platform the mainstream platform for people to obtain information, communicate and share knowledge.

[0003] The existing solution counts the number of times a regional word appears. The higher the number, the more the region the article describes. This method has low accuracy in region identification when there are multiple regions in a text or when the article has a transition. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a method, system, electronic device and storage medium for accurate region identification based on contextual semantics to solve the problem of inaccurate region identification in the prior art.

[0005] To this end, the embodiment of the present invention provides the following technical solutions:

[0006] According to the first aspect, an embodiment of the present invention provides a method for accurate region identification based on contextual semantics, including: obtaining a training set; representing the training set with word embedding through pre-trained word vectors, and performing contextual semantic learning training through a multi-layer fully connected neural network to obtain a region intent identification model, wherein the region intent identification model is used to identify the region intent in the article, and the recognition result of the region intent identification model includes the probability value of no region intent, the probability value of leaving the region intent, and the probability value of going to the region intent; obtaining the article to be identified and the region words in the article to be identified; dividing the article to be identified into modules according to the article structure to obtain multiple article modules; and The method comprises the following steps: determining the regional word sentences in the article to be identified, wherein the regional word sentences are sentences containing the regional words of the article to be identified; determining the article module corresponding to the regional word sentences according to the regional word sentences; inputting the regional word sentences in the article to be identified into the regional intention recognition model to obtain the regional intention recognition result of each regional word in the article to be identified; performing intention direction judgment on the regional intention recognition result to obtain the regional intention direction judgment value of each regional word in the article module; determining the weight of each regional word in the article module to be identified according to multiple article modules; and determining the precise regional information of the article to be identified according to the regional intention direction judgment value of each regional word in the article module and the corresponding weight.

[0007] Optionally, the step of determining the precise regional information of the article to be identified based on the regional intention direction judgment value and the corresponding weight of each regional word in the article module includes: obtaining the weight of each regional word in the article to be identified based on the weight of each regional word in the article module; performing regional weight fusion calculation on the weight of each regional word in the article to be identified and the regional intention direction judgment value in the article module to obtain the final regional weight of each regional word in the article to be identified; sorting the final regional weights of all regional words in the article to be identified by weight value, and taking the regional word with the highest weight value as the precise regional information of the article to be identified.

[0008] Optionally, the calculation formula for the weight of each regional word in the article to be identified is as follows:

[0009]

[0010] Among them, t wl is the weight of the regional word wl in the article to be identified; λ1 is the weight parameter of the first article module; m1 is the number of times the regional word wl appears in the first article module; λ2 is the weight parameter of the second article module; m2 is the number of times the regional word wl appears in the second article module; λ n is the weight parameter of the nth article module; mn is the number of times the regional word wl appears in the nth article module.

[0011] Optionally, the calculation formula for the final regional weight of each regional word in the article to be identified is as follows:

[0012]

[0013] Among them, score wl is the final regional weight of the regional word wl in the article to be identified; d1 is the regional intention direction judgment value of the regional word wl in the first article module; d2 is the regional intention direction judgment value of the regional word wl in the second article module; dn is the regional intention direction judgment value of the regional word wl in the nth article module.

[0014] Optionally, the multiple article modules include 4 modules, namely, an article title module, a first article body module, a second article body module and a third article body module; the first article body module includes the position from the starting position of the article body to the first preset number of words in the article body, and the first preset number of words is less than 0.5 times the total number of words in the article body; the second article body module includes the position from the first preset number of words in the article body to the middle position of the article body; the third article body module includes the position from the middle position of the article body to the end position of the article body.

[0015] Optionally, the weight of the article title module is greater than the weight of the second article body module, and greater than the weight of the third article body module;

[0016] The weight of the first article body module is greater than the weight of the second article body module, and greater than the weight of the third article body module.

[0017] Optionally, the step of performing intent direction determination on the regional intent recognition result to obtain the regional intent direction determination value of each regional word in the article module includes: finding the maximum probability value among the probability values ​​of no regional intent, leaving regional intent and going to regional intent in the regional intent recognition result; matching in preset regional intent direction categories according to the maximum probability value to obtain the regional intent direction category corresponding to the regional intent recognition result of each regional word; and obtaining the regional intent direction determination value of each regional word in the article module according to the regional intent direction category.

[0018] According to the second aspect, an embodiment of the present invention provides a precise region identification system based on contextual semantics, including: a first acquisition module, used to acquire a training set; a first processing module, used to represent the training set with word embedding through pre-trained word vectors, and to perform contextual semantic learning training through a multi-layer fully connected neural network to obtain a region intention identification model, wherein the region intention identification model is used to identify the region intention in the article, and the recognition result of the region intention identification model includes the probability value of no region intention, the probability value of leaving the region intention and the probability value of going to the region intention; a second acquisition module, used to acquire the article to be identified and the region words in the article to be identified; a second processing module, used to divide the article to be identified into modules according to the article structure to obtain multiple article modules; a third processing module, used to identify the region intention of the article to be identified according to the region The word determines the regional word sentence in the article to be identified, and the regional word sentence is a sentence containing the regional word of the article to be identified; the fourth processing module is used to determine the article module corresponding to the regional word sentence according to the regional word sentence; the fifth processing module is used to input the regional word sentence in the article to be identified into the regional intention recognition model to obtain the regional intention recognition result of each regional word in the article to be identified; the sixth processing module is used to determine the intention direction of the regional intention recognition result to obtain the regional intention direction determination value of each regional word in the article module; the seventh processing module is used to determine the weight of each regional word in the article module to be identified according to multiple article modules; the eighth processing module is used to determine the precise regional information of the article to be identified according to the regional intention direction determination value of each regional word in the article module and the corresponding weight.

[0019] Optionally, the eighth processing module includes: a first processing unit, used to obtain the weight of each regional word in the article to be identified according to the weight of each regional word in the article module; a second processing unit, used to perform regional weight fusion calculation on the weight of each regional word in the article to be identified and the regional intention direction judgment value in the article module, to obtain the final regional weight of each regional word in the article to be identified; a third processing unit, used to sort the final regional weights of all regional words in the article to be identified, and take the regional word with the highest weight value as the precise regional information of the article to be identified.

[0020] Optionally, the calculation formula for the weight of each regional word in the article to be identified is as follows:

[0021]

[0022] Among them, t wl is the weight of the regional word wl in the article to be identified; λ1 is the weight parameter of the first article module; m1 is the number of times the regional word wl appears in the first article module; λ2 is the weight parameter of the second article module; m2 is the number of times the regional word wl appears in the second article module; λ n is the weight parameter of the nth article module; mn is the number of times the regional word wl appears in the nth article module.

[0023] Optionally, the calculation formula for the final regional weight of each regional word in the article to be identified is as follows:

[0024]

[0025] Among them, score wl is the final regional weight of the regional word wl in the article to be identified; d1 is the regional intention direction judgment value of the regional word wl in the first article module; d2 is the regional intention direction judgment value of the regional word wl in the second article module; dn is the regional intention direction judgment value of the regional word wl in the nth article module.

[0026] Optionally, the multiple article modules include 4 modules, namely, an article title module, a first article body module, a second article body module and a third article body module; the first article body module includes the position from the starting position of the article body to the first preset number of words in the article body, and the first preset number of words is less than 0.5 times the total number of words in the article body; the second article body module includes the position from the first preset number of words in the article body to the middle position of the article body; the third article body module includes the position from the middle position of the article body to the end position of the article body.

[0027] Optionally, the weight of the article title module is greater than the weight of the second article body module, and greater than the weight of the third article body module;

[0028] The weight of the first article body module is greater than the weight of the second article body module, and greater than the weight of the third article body module.

[0029] Optionally, the sixth processing module includes: a fourth processing unit, used to find the maximum probability value among the probability values ​​of no regional intent, the probability value of leaving the regional intent, and the probability value of going to the regional intent in the regional intent recognition result; a fifth processing unit, used to match in the preset regional intent direction category according to the maximum probability value, and obtain the regional intent direction category corresponding to the regional intent recognition result of each regional word; a sixth processing unit, used to obtain the regional intent direction judgment value of each regional word in the article module according to the regional intent direction category.

[0030] According to the third aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the context-semantic-based precise region identification method described in any one of the first aspects above.

[0031] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the context-semantic based precise region identification method described in any one of the first aspects above.

[0032] The technical solution of the embodiment of the present invention has the following advantages:

[0033] The embodiment of the present invention provides a method, system, electronic device and storage medium for accurate region recognition based on contextual semantics, wherein the method comprises: obtaining a training set; representing the training set by word embedding through pre-trained word vectors, and performing contextual semantic learning training through a multi-layer fully connected neural network to obtain a region intention recognition model, wherein the region intention recognition model is used to recognize the region intention in the article, and the recognition result of the region intention recognition model includes the probability value of no region intention, the probability value of leaving the region intention and the probability value of going to the region intention; obtaining the article to be recognized and the region words in the article to be recognized; dividing the article to be recognized into modules according to the article structure to obtain multiple article modules; and The method comprises the following steps: determining the regional word sentences in the article to be identified based on the regional words in the article to be identified, wherein the regional word sentences are sentences containing the regional words in the article to be identified; determining the article module corresponding to the regional word sentences based on the regional word sentences; inputting the regional word sentences in the article to be identified into the regional intention recognition model to obtain the regional intention recognition result of each regional word in the article to be identified; performing intention direction judgment on the regional intention recognition result to obtain the regional intention direction judgment value of each regional word in the article module; determining the weight of each regional word in the article module to be identified based on multiple article modules; determining the precise regional information of the article to be identified based on the regional intention direction judgment value of each regional word in the article module and the corresponding weight. In the above steps, the training set is trained with pre-trained word vectors to obtain a regional intent recognition model; the articles to be recognized are divided into different article modules according to the article results, and the article modules are respectively input into the regional intent recognition model to obtain the regional intent recognition results, and the recognition results are directionally determined to obtain the regional intent direction determination values ​​of the regional words in each article module; the weights of the regional words in each article module are determined according to each article module; the precise regional information of the article to be recognized is jointly determined according to the weights of the regional words in each article module and the regional intent direction determination values. The directionality of the region is determined by regional intent recognition, the weight is calculated according to the distribution of the regional words in the article, and the final weight of the regional words is calculated by integrating the direction weight weighting to obtain a more accurate regional word weight, thereby improving the accuracy of regional recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of a specific example of a method for accurate region identification based on contextual semantics according to an embodiment of the present invention;

[0036] Figure 2 A flowchart of another specific example of the contextual semantics-based precise region identification method according to an embodiment of the present invention;

[0037] Figure 3 A block diagram of a specific example of a contextual semantics-based precise region identification system according to an embodiment of the present invention;

[0038] Figure 4 Schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] The embodiment of the present invention provides a method for accurate region identification based on contextual semantics, such as Figure 1 As shown, the method includes steps S1-S10.

[0041] Step S1: Obtain a training set.

[0042] As an exemplary embodiment, the text data is first obtained, and then the text data is matched according to the preset intention words to obtain the matching results of each sentence in the text data. The preset intention words are words that represent the intention of going from one place to another, and can be specifically words such as go, fly, leave, go to, arrive, and arrive; of course, in other embodiments, the preset intention words can also be other words that represent the intention, which is only schematically illustrated in this embodiment and is not limited to this. The matching results include no regional intention, intention to go to a region, and intention to leave a region. The text data includes several sentences without regional intention, several sentences with intention to go to a region, and several sentences with intention to leave a region. The regional intention label also includes three labels, which correspond to the three matching results one by one, namely, no intention label, going intention label, and leaving intention label. Each sentence is matched with the intention label corresponding to each sentence to form a two-tuple data set of (sentence, intention label), and the two-tuple data set is used as a training set.

[0043] Step S2: The training set is represented by word embedding through pre-trained word vectors, and contextual semantic learning training is performed through a multi-layer fully connected neural network to obtain a regional intent recognition model. The regional intent recognition model is used to recognize the regional intent in the article. The recognition results of the regional intent recognition model include the probability value of no regional intent, the probability value of leaving the region, and the probability value of going to the region.

[0044] As an exemplary embodiment, the word2vector model is used to perform unsupervised training on a massive historical text data set. The historical data is segmented by the Jieba word segmenter, and the word is regarded as the smallest semantic unit. The semantic features of each word are learned through the contextual understanding of the massive text data, and the model is saved. The pre-trained word vector can be obtained through the model.

[0045] The training set is represented by word embedding through pre-trained word vectors, and contextual semantic learning training is performed through a multi-layer fully connected neural network. The training flow chart is as follows: Figure 2 shown.

[0046] Text word vectorization refers to mapping each word in the text with a word vector, so that the text in the data set is converted into a vector and input into the model. Assuming a text S has v words W, and the word vector dimension of each word is d, then S is mapped to W as follows:

[0047]

[0048] Where W is each word in S, v refers to the number of words in S, and the vector dimension of W is d. is the concatenation of vectors. The input dimension is

[0049] The full connection formula is as follows:

[0050] y=tanh(wx+b)

[0051] Among them, w is the training parameter, x is the word vector input of the above dimension, and b is the bias.

[0052] Three fully connected layers are added here for stacking.

[0053] The classification layer uses the softmax function as follows:

[0054] t y =softmax(wx+b)

[0055] t y is the category weight.

[0056] After training, the trained model is saved to obtain a regional intent recognition model. The regional intent recognition model is used to recognize the regional intent in the article. The recognition results of the regional intent recognition model include the probability value of no regional intent, the probability value of leaving the regional intent, and the probability value of going to the regional intent.

[0057] Specifically, the output of the regional intent recognition model is the probability value of all categories. For example, the probability value of a triplet of (0.1, 0.4, 0.5) is 0.1, which is predicted to be category 0, 0.4, which is predicted to be category 1, and 0.5, which is predicted to be category 2. Category 0 represents no regional intent, category 1 represents the intention to leave the region, and category 2 represents the intention to go to the region.

[0058] Step S3: Obtain the article to be identified and the regional words in the article to be identified.

[0059] As an exemplary embodiment, named entity recognition is performed on the article to be identified to obtain the regional words of the article to be identified.

[0060] Step S4: Divide the article to be identified into modules according to the article structure to obtain multiple article modules.

[0061] As an exemplary embodiment, according to the article structure, that is, according to the context structure of an article, the article is divided into several parts, each part corresponds to an article module. Specifically, the article structure includes a title and a body, so the article is divided into an article title module and several article body modules.

[0062] In this embodiment, the multiple article modules include 4 modules, namely, an article title module, a first article body module, a second article body module and a third article body module; the first article body module includes the position from the starting position of the article body to the first preset number of words in the article body, and the first preset number of words is less than 0.5 times the total number of words in the article body; the second article body module includes the position from the first preset number of words in the article to the middle position of the article body; the third article body module includes the position from the middle position of the article body to the end position of the article body.

[0063] The first preset word count is based on experience. Specifically, a batch of text data can be counted to find out how many of the first words can contain the core regional information of the article as much as possible. The first p words containing the core regional information of the article can be used as the first preset word count. Specifically, the first preset word count can be 100. Of course, in other embodiments, the first preset word count can also be other values. The first preset word count in this embodiment is only used for schematic illustration and is not limited thereto.

[0064] The first word of the body of the article is the starting position of the body of the article, that is, the starting position of the body of the article; the 1 / 2 position of the length of the body of the article is the middle position of the body of the article; the last word of the body of the article is the ending position of the body of the article, that is, the ending position of the body of the article.

[0065] Step S5: determining the regional word sentences in the article to be identified according to the regional words in the article to be identified, wherein the regional word sentences are sentences containing the regional words in the article to be identified.

[0066] As an exemplary embodiment, the articles to be identified are searched according to the regional words in the articles to be identified to obtain sentences containing regional words, and these sentences containing regional words in the articles to be identified are formed into regional word sentences.

[0067] Step S6: Determine the article module corresponding to the regional word sentence according to the regional word sentence.

[0068] As an exemplary embodiment, the position of a sentence in the article to be identified can be determined based on the regional word sentence, and then the article module corresponding to the regional word sentence can be determined.

[0069] Step S7: Input the regional word sentences in the article to be identified into the regional intent recognition model to obtain the regional intent recognition result of each regional word in the article to be identified.

[0070] As an exemplary embodiment, the sentences containing regional words in the article to be identified are respectively input into the regional intent recognition model to obtain the model output results corresponding to each regional word in the sentence, that is, the regional intent recognition results of each regional word. Specifically, the regional intent recognition model outputs the probability value of no regional intent, the probability value of leaving the regional intent, and the probability value of going to the regional intent for each regional word.

[0071] Step S8: Determine the intention direction of the regional intention recognition result to obtain the regional intention direction determination value of each regional word in the article module.

[0072] As an exemplary embodiment, according to the regional intent recognition result of the regional intent recognition model, the one with the largest probability value is taken as the intent direction of the regional word, thereby obtaining the regional intent direction determination value corresponding to the regional word. In this embodiment, the regional intent direction determination value includes three values, namely 0, 1 and 2; wherein 0 indicates no regional intent direction, and no directional processing is performed on the regional word; 1 indicates a leaving regional intent direction, and the regional word is directional weakened; 2 indicates a leaving or heading regional intent direction, and the regional word is directional enhanced.

[0073] For example, the output result of a regional word output by the regional intention recognition model is (0.1, 0.4, 0.5). The maximum probability value 0.5 represents the probability of going to the regional intention. If the intention map direction is the direction of going to the regional intention, then the regional intention direction judgment value of the regional word is 2.

[0074] Step S9: Determine the weight of each regional word in the article to be identified in the article module according to multiple article modules.

[0075] Specifically, the weight of the regional word wl in the i-th article module is:

[0076]

[0077] Among them, λ i is the weight parameter of the i-th article module; mi is the number of times the regional word wl appears in the i-th article module.

[0078] Step S10: Determine the precise regional information of the article to be identified based on the regional intention direction determination value of each regional word in the article module and the corresponding weight.

[0079] As an exemplary embodiment, a weighted sum is performed on the weight of each regional word, that is, the regional intention direction determination value obtained by intent recognition is used to perform direction enhancement and weakening related processing on the regional word weight to obtain a weight that better represents the importance of the regional word. The weights of all regional words are calculated through the above-mentioned regional word final weight calculation formula, and sorted by weight. The one with the highest weight is the precise region.

[0080] In the above steps, the training set is trained with pre-trained word vectors to obtain a regional intent recognition model; the articles to be recognized are divided into different article modules according to the article results, and the article modules are respectively input into the regional intent recognition model to obtain the regional intent recognition results, and the recognition results are directionally determined to obtain the regional intent direction determination values ​​of the regional words in each article module; the weights of the regional words in each article module are determined according to each article module; the precise regional information of the article to be recognized is jointly determined according to the weights of the regional words in each article module and the regional intent direction determination values. The directionality of the region is determined by regional intent recognition, the weight is calculated according to the distribution of the regional words in the article, and the final weight of the regional words is calculated by integrating the direction weight weighting to obtain a more accurate regional word weight, thereby improving the accuracy of regional recognition.

[0081] As an exemplary embodiment, step S10 includes steps S1001-S1003 in which the precise regional information of the article to be identified is determined according to the regional intention direction determination value and the corresponding weight of each regional word in the article module.

[0082] Step S1001: Obtain the weight of each regional word in the article to be identified according to the weight of each regional word in the article module.

[0083] In this embodiment, the weights of a certain regional word in each article module are added together to obtain the weight of the regional word in the article to be identified.

[0084] The calculation formula of the weight of the regional word wl in the article to be identified is as follows:

[0085]

[0086] Among them, t wl is the weight of the regional word wl in the article to be identified; λ1 is the weight parameter of the first article module; m1 is the number of times the regional word wl appears in the first article module; λ2 is the weight parameter of the second article module; m2 is the number of times the regional word wl appears in the second article module; λ n is the weight parameter of the nth article module; mn is the number of times the regional word wl appears in the nth article module.

[0087] According to the statistics of the core semantic distribution of batch articles, different weights are assigned to the above-mentioned article modules. According to the distribution of regional words in the above-mentioned different article modules, the importance of regional words corresponds to different importance, so as to calculate the weight importance of regional words. n They are all values ​​between 0 and 1, and the specific values ​​can be reasonably determined according to actual needs.

[0088] In this embodiment, the article module is divided into four modules, and the weight of the regional word is calculated as follows:

[0089]

[0090] In this embodiment, the weight of the article title module is greater than the weight of the second article body module, and greater than the weight of the third article body module; the weight of the first article body module is greater than the weight of the second article body module, and greater than the weight of the third article body module.

[0091] Specifically, the weight of the article title module may be 0.9, the weight of the first article body module may be 0.9, the weight of the second article body module may be 0.5, and the weight of the third article body module may be 0.5. This embodiment only provides an illustrative description of each weight, and is not limited thereto; in other embodiments, they may be reasonably set as needed.

[0092] The weights of the article title module and the first article body module are set larger, and the regional words appearing in the above two modules are more important; the weights of the second article body module and the third article body module are set smaller, and the regional words appearing in these two modules are less important; the situation where the regional words appear in the entire article is taken into consideration, so that the weight of the regional words in the entire article to be identified is more accurate.

[0093] Step S1002: Perform regional weight fusion calculation on the weight of each regional word in the article to be identified and the regional intention direction judgment value in the article module to obtain the final regional weight of each regional word in the article to be identified.

[0094] As an exemplary embodiment, the calculation formula for the final regional weight of each regional word in the article to be identified is as follows:

[0095]

[0096] Among them, score wl is the final regional weight of the regional word wl in the article to be identified; d1 is the regional intention direction judgment value of the regional word wl in the first article module; d2 is the regional intention direction judgment value of the regional word wl in the second article module; dn is the regional intention direction judgment value of the regional word wl in the nth article module.

[0097] Step S1003: sorting the final regional weights of all regional words in the article to be identified by weight value, and taking the regional word with the highest weight value as the precise regional information of the article to be identified.

[0098] In this embodiment, the final regional weights of all regional words in the article to be identified obtained in the above steps are sorted in descending order. The larger the final weight value of the regional word, the greater the importance of the regional word in the article to be identified. Therefore, the regional word with the largest final weight is used as the precise regional information of the article to be identified.

[0099] The weight of the regional word in the article to be identified is obtained by adding up the weights of the regional word in each article module. Then, the weight of the regional word is directionally enhanced or weakened according to the regional intention direction judgment value of the regional word in each article module to obtain the final regional weight of each regional word in the article to be identified. The highest weight value is used as the precise regional information of the article to be identified, making the regional identification result more accurate.

[0100] As an exemplary embodiment, step S8 determines the intention direction of the regional intention recognition result, and obtains the regional intention direction determination value of each regional word in the article module, including steps S81-S83.

[0101] Step S81: Find the maximum probability value among the probability values ​​of no regional intention, leaving regional intention and going to regional intention in the regional intention recognition results.

[0102] Specifically, the regional intention recognition result includes the probability value of no regional intention, the probability value of leaving the region and the probability value of going to the region. These three probability values ​​are compared to find the maximum value among the three probabilities.

[0103] Step S82: matching is performed in preset regional intent direction categories according to the maximum probability value to obtain the regional intent direction category corresponding to the regional intent recognition result of each regional word.

[0104] Specifically, the maximum probability value indicates the maximum possibility of the regional intent of the regional word. The preset regional intent direction categories include three intent direction categories, including no regional intent direction category, leaving regional intent direction category, and going to regional intent direction category. The above three intent direction categories correspond to the three recognition results output by the regional intent recognition model. Therefore, by searching the maximum probability value in the regional word in the preset regional intent direction categories, the regional intent direction category corresponding to the regional intent recognition result of each regional word can be found.

[0105] Step S83: Obtaining the regional intent direction determination value of each regional word in the article module according to the regional intent direction category.

[0106] Specifically, each regional intent direction category corresponds to a regional intent direction determination value, and the directionality of the regional word is enhanced or weakened according to the regional intent direction determination value.

[0107] In this embodiment, the regional intention direction determination value includes three values, namely 0, 1 and 2; wherein 0 indicates no regional intention direction, and no directional processing is performed on the regional word; 1 indicates a leaving regional intention direction, and a directional weakening processing is performed on the regional word; 2 indicates a leaving or heading regional intention direction, and a directional strengthening processing is performed on the regional word. Of course, this embodiment is only for illustrative purposes and is not limited thereto. In other embodiments, the leaving regional intention direction may also be other even numbers greater than 2, and the heading regional intention direction may also be an odd number greater than 1.

[0108] Through the above steps, the directionality of the regional words is enhanced or weakened, so as to obtain a weight value that can better represent the importance of the regional words and improve the accuracy of regional recognition.

[0109] The following is a detailed description using a specific example.

[0110] The precise region identification method in this embodiment mainly includes three parts: region intention identification, region word importance weight calculation, and region weight fusion calculation. Among them, intention identification includes word vector pre-training, intention classification training, and intention prediction.

[0111] Step 1: Regional intent identification

[0112] 1. Pre-trained word vectors

[0113] Through the word2vector model, unsupervised training and learning are performed on massive text data sets. The Jieba word segmenter is used to segment historical data, treating words as the smallest semantic unit. Through the contextual understanding of massive text data, the semantic features of each word are learned and the model is saved.

[0114] 2. Regional Intent Identification

[0115] (1) Regional Intent Training and Prediction

[0116] Through the preset intention words, such as "go", "fly", "leave", "go to" and other words that contain the intention of going from one place to another, sentences with intention words and sentences without intention words are matched from the text dataset to form a three-classification training set of the (sentence, intention label) two-tuple dataset. The training set is represented by word embedding through the pre-trained word vector, and contextual semantic learning training is performed through a multi-layer fully connected neural network. The training flow chart is as follows: Figure 2 shown.

[0117] Text word vectorization refers to mapping each word in the text with a word vector, so that the text in the data set is converted into a vector and input into the model. Assuming a text S has v words W, and the word vector dimension of each word is d, then S is mapped to W as follows:

[0118]

[0119] Where W is each word in S, v refers to the number of words in S, and the vector dimension of W is d. is the concatenation of vectors. The input dimension is

[0120] The full connection formula is as follows:

[0121] y=tanh(wx+b)

[0122] Among them, w is the training parameter, x is the word vector input of the above dimension, and b is the bias.

[0123] Three fully connected layers are added here for stacking.

[0124] The classification layer uses the softmax function as follows:

[0125] t y =softmax(wx+b)

[0126] t y is the category weight.

[0127] Save the trained model and load the model to predict the intent of new data.

[0128] The prediction process is the same as the training process.

[0129] Step 2: Calculate the importance weight of regional words

[0130] According to the context structure of a text, the article is divided into four parts, namely the title, the first n words of the text, the first n words of the text to the middle of the text, and the middle of the text to the end of the text. According to the core semantic distribution statistics of batch articles, different weights are assigned to the above four parts. According to the distribution of regional words in the above parts, the corresponding importance is different, so as to calculate the weight importance of regional words.

[0131]

[0132] Among them, λ1, λ2, λ3, and λ4 correspond to the above-mentioned title, the first n words of the text, the first n words of the text to the middle of the text, and the middle of the text to the end of the text, respectively. They are preset weight parameters obtained through statistics of massive data. The values ​​of λ1 and λ2 parameters will be greater than λ3 and λ4, indicating that they are more important. wl is a regional word, and m1 to m4 are the number of times the regional word appears in different positions. The final calculated t wl is the weight of the regional word.

[0133] Step 3: Regional weight fusion calculation

[0134] The weights of the regional words in steps 1 and 2 are weighted and summed, that is, the regional intent direction obtained by intent recognition is brought into step 2, and the directionality is enhanced or weakened to obtain a weight that better represents the importance of the regional word. The final weight calculation formula of a regional word is as follows:

[0135]

[0136] Among them, d1 to d4 are the regional intent label categories of the regional words at the four different positions of t1 to t4 mentioned above, and the categories are 0, 1, and 2. 0 indicates no regional intent, 1 indicates an intent to leave the region, and 2 indicates an intent to go to or head to the region.

[0137] The above regional word final weight calculation formula is used to calculate the weights of all regional words, and the weights are sorted. The one with the highest weight is the precise region.

[0138] First, we identify the intent of the article context to reduce the interference of regions not involved in the article content. Secondly, based on the statistics of the semantic importance distribution of the article structure of batch texts, we derive a reasonable core semantic distribution and distribution weights. Through the semantic understanding of the context and the core semantic distribution of the full text, we can count and calculate the precise regions involved in the text content, without the need for labeled data, feature engineering, or complex semantic network training, and achieve the best results.

[0139] The method in this embodiment uses a pre-trained word vector model and a multi-layer fully connected neural network to learn contextual semantics, extract text semantic features, and then combine the softmax function to perform semantic Figure 3 Classification is performed to determine the semantic regional intent; different weights are given to regional words according to their distribution in the article to calculate the weight of regional words; the regional intent and the distribution of regions in the article are integrated to calculate the final weight of the region, thereby improving the accuracy of region identification.

[0140] In this embodiment, a precise region recognition system based on contextual semantics is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0141] This embodiment also provides a context-based semantic accurate region recognition system, such as Figure 3 As shown, including:

[0142] The first acquisition module 1 is used to acquire a training set;

[0143] The first processing module 2 is used to embed the training set with pre-trained word vectors, and perform context semantic learning training with a multi-layer fully connected neural network to obtain a regional intent recognition model, wherein the regional intent recognition model is used to recognize the regional intent in the article. The recognition result of the regional intent recognition model includes the probability value of no regional intent, the probability value of leaving the regional intent, and the probability value of going to the regional intent;

[0144] The second acquisition module 3 is used to acquire the article to be identified and the regional words in the article to be identified;

[0145] The second processing module 4 is used to divide the article to be identified into modules according to the article structure to obtain multiple article modules;

[0146] The third processing module 5 is used to determine the regional word sentences in the article to be identified according to the regional words in the article to be identified, wherein the regional word sentences are sentences containing the regional words in the article to be identified;

[0147] The fourth processing module 6 is used to determine the article module corresponding to the regional word sentence according to the regional word sentence;

[0148] The fifth processing module 7 is used to input the regional word sentences in the article to be identified into the regional intention recognition model to obtain the regional intention recognition result of each regional word in the article to be identified;

[0149] The sixth processing module 8 is used to determine the intention direction of the regional intention recognition result, and obtain the regional intention direction determination value of each regional word in the article module;

[0150] The seventh processing module 9 is used to determine the weight of each regional word in the article to be identified in the article module according to the multiple article modules;

[0151] The eighth processing module 10 is used to determine the precise regional information of the article to be identified according to the regional intention direction determination value of each regional word in the article module and the corresponding weight.

[0152] Optionally, the eighth processing module includes: a first processing unit, used to obtain the weight of each regional word in the article to be identified according to the weight of each regional word in the article module; a second processing unit, used to perform regional weight fusion calculation on the weight of each regional word in the article to be identified and the regional intention direction judgment value in the article module, to obtain the final regional weight of each regional word in the article to be identified; a third processing unit, used to sort the final regional weights of all regional words in the article to be identified, and take the regional word with the highest weight value as the precise regional information of the article to be identified.

[0153] Optionally, the calculation formula for the weight of each regional word in the article to be identified is as follows:

[0154]

[0155] Among them, t wl is the weight of the regional word wl in the article to be identified; λ1 is the weight parameter of the first article module; m1 is the number of times the regional word wl appears in the first article module; λ2 is the weight parameter of the second article module; m2 is the number of times the regional word wl appears in the second article module; λ n is the weight parameter of the nth article module; mn is the number of times the regional word wl appears in the nth article module.

[0156] Optionally, the calculation formula for the final regional weight of each regional word in the article to be identified is as follows:

[0157]

[0158] Among them, score wl is the final regional weight of the regional word wl in the article to be identified; d1 is the regional intention direction judgment value of the regional word wl in the first article module; d2 is the regional intention direction judgment value of the regional word wl in the second article module; dn is the regional intention direction judgment value of the regional word wl in the nth article module.

[0159] Optionally, the multiple article modules include 4 modules, namely, an article title module, a first article body module, a second article body module and a third article body module; the first article body module includes the position from the starting position of the article body to the first preset number of words in the article body, and the first preset number of words is less than 0.5 times the total number of words in the article body; the second article body module includes the position from the first preset number of words in the article body to the middle position of the article body; the third article body module includes the position from the middle position of the article body to the end position of the article body.

[0160] Optionally, the weight of the article title module is greater than the weight of the second article body module, and greater than the weight of the third article body module;

[0161] The weight of the first article body module is greater than the weight of the second article body module, and greater than the weight of the third article body module.

[0162] Optionally, the sixth processing module includes: a fourth processing unit, used to find the maximum probability value among the probability values ​​of no regional intent, the probability value of leaving the regional intent, and the probability value of going to the regional intent in the regional intent recognition result; a fifth processing unit, used to match in the preset regional intent direction category according to the maximum probability value, and obtain the regional intent direction category corresponding to the regional intent recognition result of each regional word; a sixth processing unit, used to obtain the regional intent direction judgment value of each regional word in the article module according to the regional intent direction category.

[0163] The context-semantic-based precise region recognition system in this embodiment is presented in the form of functional units, where the units refer to ASIC circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0164] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0165] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, the electronic device includes one or more processors 71 and a memory 72. Figure 4A processor 71 is taken as an example.

[0166] The controller may further include: an input device 73 and an output device 74 .

[0167] The processor 71, the memory 72, the input device 73 and the output device 74 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0168] The processor 71 may be a central processing unit (CPU). The processor 71 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips. A general-purpose processor may be a microprocessor or any conventional processor.

[0169] The memory 72 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the context-based semantics precise region identification method in the embodiment of the present application. The processor 71 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 72, that is, the context-based semantics precise region identification method in the above method embodiment is implemented.

[0170] The memory 72 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of a processing device operated by the server, etc. In addition, the memory 72 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 72 may optionally include a memory remotely arranged relative to the processor 71, and these remote memories may be connected to a network connection device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0171] The input device 73 can receive input digital or character information, and generate key signal input related to user settings and function control of the processing device of the server. The output device 74 can include display devices such as a display screen.

[0172] One or more modules are stored in the memory 72, and when executed by one or more processors 71, the execution is as follows: Figure 1-2 The method shown.

[0173] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the executed program can be stored in a computer-readable storage medium. When the program is executed, it can include the process of the embodiment of the above-mentioned context-based semantic precise region identification method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0174] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for accurate region identification based on contextual semantics, characterized in that: include: Get the training set; The training set is represented by word embedding using pre-trained word vectors, and contextual semantic learning training is performed using a multi-layer fully connected neural network to obtain a regional intent recognition model. The regional intent recognition model is used to recognize the regional intent in the article. The recognition results of the regional intent recognition model include the probability value of no regional intent, the probability value of leaving the region, and the probability value of going to the region; Obtaining articles to be identified and regional words in the articles to be identified; Divide the article to be identified into modules according to the article structure to obtain multiple article modules; Determining a regional word sentence in the article to be identified based on the regional word in the article to be identified, wherein the regional word sentence is a sentence containing the regional word in the article to be identified; Determine the article module corresponding to the regional word sentence according to the regional word sentence; Input the regional word sentences in the article to be identified into the regional intent recognition model to obtain the regional intent recognition result of each regional word in the article to be identified; Determine the intention direction of the regional intention recognition results to obtain the regional intention direction determination value of each regional word in the article module; Determine the weight of each regional word in the article to be identified in the article module based on multiple article modules. The multiple article modules include 4 modules, namely, an article title module, a first article body module, a second article body module and a third article body module; the first article body module includes a position from the beginning of the article body to a position with a first preset number of words in the article body, and the first preset number of words is less than 0.5 times the total number of words in the article body; the second article body module includes a position from the first preset number of words in the article body to the middle of the article body; The third article body module includes the position from the middle of the article body to the end of the article body; Determine the precise regional information of the article to be identified based on the regional intention direction judgment value and the corresponding weight of each regional word in the article module. The steps include: The weight of each regional word in the article to be identified is obtained according to the weight of each regional word in the article module; Perform regional weight fusion calculation on the weight of each regional word in the article to be identified and the regional intention direction judgment value in the article module to obtain the final regional weight of each regional word in the article to be identified; The final regional weights of all regional words in the article to be identified are sorted by weight value, and the regional word with the highest weight value is used as the precise regional information of the article to be identified.

2. The context-based semantic accurate region identification method according to claim 1 is characterized in that: The weight of the article title module is greater than the weight of the second article body module, and greater than the weight of the third article body module; The weight of the first article body module is greater than the weight of the second article body module, and greater than the weight of the third article body module.

3. The context-based semantic accurate region identification method according to claim 1 or 2, characterized in that: The step of determining the direction of the regional intent recognition result to obtain the regional intent direction determination value of each regional word in the article module includes: Find the maximum probability value among the probability values ​​of no regional intent, leaving regional intent, and going to regional intent in the regional intent recognition results; Matching is performed in the preset regional intent direction categories according to the maximum probability value to obtain the regional intent direction category corresponding to the regional intent recognition result of each regional word; According to the regional intent direction category, the regional intent direction judgment value of each regional word in the article module is obtained.

4. A context-based semantics accurate region identification system, used to implement the context-based semantics accurate region identification method according to any one of claims 1 to 3, characterized in that: include: A first acquisition module is used to acquire a training set; The first processing module is used to embed the training set with pre-trained word vectors, and perform context semantic learning training with a multi-layer fully connected neural network to obtain a regional intent recognition model. The regional intent recognition model is used to recognize the regional intent in the article. The recognition results of the regional intent recognition model include the probability value of no regional intent, the probability value of leaving the region, and the probability value of going to the region; The second acquisition module is used to acquire the articles to be identified and the regional words in the articles to be identified; The second processing module is used to divide the article to be identified into modules according to the article structure to obtain multiple article modules; The third processing module is used to determine the regional word sentences in the article to be identified according to the regional words in the article to be identified, wherein the regional word sentences are sentences containing the regional words in the article to be identified; A fourth processing module is used to determine the article module corresponding to the regional word sentence according to the regional word sentence; The fifth processing module is used to input the regional word sentences in the article to be identified into the regional intention recognition model to obtain the regional intention recognition result of each regional word in the article to be identified; The sixth processing module is used to determine the intention direction of the regional intention recognition result, and obtain the regional intention direction determination value of each regional word in the article module; A seventh processing module is used to determine the weight of each regional word in the article to be identified in the article module according to the multiple article modules; The eighth processing module is used to determine the precise regional information of the article to be identified according to the regional intention direction determination value of each regional word in the article module and the corresponding weight.

5. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the context-semantic-based precise region identification method described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the context-semantic-based precise region identification method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for recommending routes

    CN106052704A

  • Chinese minority region name identification method based on deep learning

    CN106383816A