A community governance model construction method based on a convolutional neural network
By extracting keywords from the community database and using convolutional neural networks to construct a node tree, the problem of poor governance efficiency in the traditional community governance model was solved, and the informatization and intelligence of community governance were improved.
Patent Information
- Application Number
- CN202411347510.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The traditional community governance model has problems such as poor governance efficiency, uneven resource allocation, and insufficient information construction, which affect the effectiveness of community governance and residents' satisfaction.
By extracting keywords from the community database, establishing a keyword model, using convolutional neural networks to set fields for each tag, building a node tree, and taking keywords that meet the query conditions as input, the text labels of the materials that meet the query conditions are output to improve data support and analysis capabilities.
It has improved the level of informatization and intelligence in community governance, made governance more precise and efficient, and provided strong data support and analysis capabilities.
Smart Images

Figure CN118864210B_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a method for constructing a community governance model based on a convolutional neural network, which relates to the technical field of community governance model construction. Background Art
[0002] Traditional community governance models often suffer from ineffective governance, such as uneven resource allocation and delayed problem resolution. These issues seriously impact the effectiveness of community governance and resident satisfaction. Some communities also face deficiencies in information technology development, such as incomplete data collection and insufficient data analysis capabilities. These issues hinder the advancement of intelligent community governance. The application of information technology and intelligent technologies is an important means of improving the effectiveness of grassroots governance. This includes practices in digital government affairs and smart city development. For example, by building governance models and terminals, and leveraging information technology to achieve comprehensive coverage of community governance, while also improving information collection, feedback, and tracking mechanisms, the transparency and efficiency of the governance process can be enhanced. Summary of the Invention
[0003] In order to solve the above technical problems, the present invention proposes a method for constructing a community governance model based on a convolutional neural network, which includes the following steps:
[0004] Extract multiple keywords from each household's data text in the community database and establish a keyword model for each household's data text;
[0005] Set different preset fields for each tag, extract keywords that match the preset fields in the keyword model based on different preset fields, and assign tags to all keywords;
[0006] Each keyword model is constructed as a node tree with different labels as nodes. The keywords under the nodes that meet the query labels are used as the input of the convolutional neural network, and the labels of the information texts of each household that meets the query conditions are output.
[0007] Furthermore, all the words in each household’s data text are extracted, and the comprehensive weight of the selected words S j The top m words are used as keywords:
[0008]
[0009] in, , Represents the word frequency weight q j Comprehensive weight of word S j Contribution value; Represents the word length weight C j Comprehensive weight of word S j Contribution value; Represents the word position weight Z jComprehensive weight of word S j The contribution value of each weight is collected and normalized.
[0010] Furthermore, using the keyword model F s Information indicating the text of the sth user's data:
[0011] F s =[s,(F s1 , S s1 ;……;F si , S si ;……;F sn , S sn )];
[0012] Among them, s represents the label of the data text, F si Indicates the i-th keyword in the s-th user's data text, S si represents the comprehensive weight of the i-th keyword in the s-th user data text, and n is the keyword model F s The number of keywords in .
[0013] Furthermore, when setting different preset fields for each tag, the preset fields are defined as standard samples, the keywords that do not match the standard samples are defined as positive samples, and the keywords that match the standard sample A are defined as negative samples;
[0014] The loss function is used to calculate the positive sample so that the distance between the positive sample pair and the distance between the negative sample pair is less than or equal to a preset value. The positive sample is a keyword that meets the preset field, and the keyword is assigned to the label to which the standard sample belongs.
[0015] Furthermore, when the query condition is a numeric condition, the filtered number in the query condition is used as the first input of the convolutional neural network, and the keyword model F of each household data text under the label J targeted by the query condition is used as the first input of the convolutional neural network. s Keyword h in sJ As the second input of the convolutional neural network, the convolutional neural network uses the max function or min function to perform digital conditional screening.
[0016] Furthermore, when the query condition is to filter keywords that are greater than or equal to the filter number R, the max function is used for conditional filtering:
[0017] F(s)=max(h sJ / R,1);
[0018] If h sJ / R is greater than or equal to 1, then the calculated result F(s) is h sJ / R, and output the corresponding s value, if h sJIf / R is less than 1, the calculated result F(s) is 1.
[0019] Furthermore, when the query condition is to filter keywords that are less than the filter number R, use the min function for conditional filtering:
[0020] F(s)=min(h sJ / R,1);
[0021] If h sJ / R is less than 1, the calculated result F(s) is h sJ / R, and output the corresponding s value, if h sJ If / R is greater than or equal to 1, the calculation result F(s) is 1.
[0022] Furthermore, if the query condition is a text condition, the query keyword in the query condition is converted into query numeric characters, and the multiple keywords under the tag targeted in the query condition are converted into target numeric characters. The conversion formula is:
[0023]
[0024] Among them, w t is the number of strokes of the t-th character in the keyword, T represents the number of characters in the keyword, and the target digital character generated by the conversion formula is L M and query numeric characters for L N , if L M Equal to L N , then output the label s of the data text corresponding to the target digital character.
[0025] Furthermore, the number of results A for which the query condition is J1 is calculated J1 The number of calculation results B with query condition J2 J2 The formula for the correlation between them is as follows:
[0026]
[0027] Among them, D J1 The number of calculation results for query condition J1, B J2 The number of calculation results for query condition J2, the correlation degree sim(J1, J2) is equal to the number of calculation results D J1 and the calculated number B J2 The number of elements in the intersection of the two divided by the number of calculated results D J1 and the calculated number B J2 The quotient of the number of elements in the union of .
[0028] Furthermore, the same label nodes in the node tree of multiple household data texts are linked, and the keywords under the label nodes are linked together, so as to obtain a node link group with the same label, and find out whether each node link group contains the labels of all data texts. If there are missing labels, the missing label data of the data text needs to be supplemented.
[0029] Compared with the prior art, the present invention has the following beneficial technical effects:
[0030] Extract multiple keywords from the information text of each household in the community database and establish a keyword model for each household's information text; set different preset fields for each label, extract keywords that meet the preset fields in the keyword model according to different preset fields, and assign labels to all keywords; construct each keyword model into a node tree with different labels as nodes, use the keywords under the nodes that meet the query labels as the input of the convolutional neural network, and output the labels of the information text of each household that meets the query conditions, which improves the informatization and intelligence level of community governance, provides strong data support and analysis capabilities for community governance, and makes community governance more accurate and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 This is a flow chart of the method for constructing a community governance model based on a convolutional neural network of the present invention;
[0033] Figure 2 Schematic diagram of a node tree of the present invention;
[0034] Figure 3 Schematic diagram of the screening method of the convolutional neural network when the query conditions of the present invention are different situations;
[0035] Figure 4 This is a schematic diagram of the community governance model structure of the present invention;
[0036] Figure 5 It is a structural diagram of the community service model and distributed model terminal of the present invention. DETAILED DESCRIPTION
[0037] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0038] In the drawings of the specific embodiments of the present invention, in order to better and more clearly describe the working principles of the various components in the system, the connection relationship of the various parts in the device is shown, which only clearly distinguishes the relative position relationship between the various components, and does not constitute a limitation on the signal transmission direction, connection sequence and structural size, size and shape of each part within the component or structure. Example 1
[0039] like Figure 1 FIG2 is a flow chart of a method for constructing a community governance model based on a convolutional neural network according to the present invention. The method comprises the following steps:
[0040] First, multiple keywords are extracted from the text of each household in the community database to establish a keyword model for each household text.
[0041] Before this step, it is necessary to first obtain the information text of each household from the community database for data cleaning, removing irrelevant or redundant information such as HTML tags, URLs, special characters, stop words (such as "的", "是", etc.) in the text.
[0042] Use word segmentation tools to segment the text after data cleaning, divide the continuous text into separate words, and form a word list.
[0043] The frequency of occurrence of each word, the length of the word string, and the position of the word occurrence are measured to determine multiple keywords.
[0044] Specifically, the word frequency weight q j Indicates the frequency of word occurrence:
[0045] q j =n j / E;
[0046] Among them, n j represents the frequency of occurrence of the jth word; E represents the number of all words in the data text.
[0047] Define word length weight C j :
[0048]
[0049] Among them, L j Represents the length of the j-th word.
[0050] The word length weight indicates the accuracy of the word meaning. If the word length is too short, the word will not reflect the topic and the possibility of being a keyword is low.
[0051] Word position weight: Once a word appears in the most important position in the text, it can accurately reflect the text information and its contribution to the entire text information should also be strengthened.
[0052] Word position weight Z j The definition is as follows:
[0053]
[0054] The comprehensive weight of a word is calculated through the three different types of word weights mentioned above, and then it is measured whether the word is a keyword.
[0055] Comprehensive weight of word S j Calculated by the following formula:
[0056]
[0057] in, , Represents the word frequency weight q j Comprehensive weight of word S j Contribution value; Represents the word length weight C j Comprehensive weight of word S j Contribution value; Represents the word position weight Z j Comprehensive weight of word S j The function Fun collects the weight information and performs normalization. The above method calculates the comprehensive weight of each word, arranges them in descending order, and selects the words with the top m comprehensive weight rankings as keywords.
[0058] Keywords reflect the sth household data text p s Key information, {F s1 ,F s2 ,…F si ,…F sn} is the sth user data text p s A set of keywords; among them, F si (1≤i≤n) represents the i-th keyword in the keyword set, and n refers to the s-th user data text p s The number of keyword sets.
[0059] Use keyword model F sInformation indicating the text of the sth user's data:
[0060] F s =[s,(F s1 , S s1 ;……;F si , S si ;……;F sn , S sn )]
[0061] Among them, s represents the label of the sth household data text, F si Indicates the i-th keyword in the s-th user's data text, S si It represents the comprehensive weight of the i-th keyword in the s-th user's data text, and n is the number of keywords.
[0062] Secondly, set different preset fields for each tag, and extract keywords that meet the preset fields in the keyword model based on different preset fields, so as to assign tags to all keywords.
[0063] Determine the tags: First, determine the tags you want to assign to the keywords. For example, tags could be "age," "address," "occupation," etc.
[0064] Preset fields: Define feature fields that match keyword characteristics for each tag. These feature fields can be specific words, phrases, word patterns, or keyword score ranges calculated based on algorithms such as TF-IDF and TextRank.
[0065] Specifically, each keyword model F s In the example, different tags are set according to different preset fields. Tags are used to represent keyword models F s The content category of the keyword corresponding to the preset field. For example, if the first label is gender, then the preset field is male or female, and the keyword that matches the preset field is set as the first label. If the second label is age, then the preset field is the age number, and the keyword that matches the preset age number is set as the second label.
[0066] Specifically, the text of the preset field is defined as the standard sample, the keywords in the keyword model that do not match the preset field are defined as positive samples, and the keywords in the keyword model that match the preset field are defined as negative samples. The loss function is used to train the label learning model so that the distance between a positive sample and the standard sample is smaller than the distance between a negative sample and the standard sample.
[0067]
[0068] Where: A is the standard sample, P k represents the kth positive sample, N kdenotes the kth negative example sample, and M is the total number of samples.
[0069] d is a distance metric between samples, is a hyperparameter used to control the minimum distance between positive and negative sample pairs.
[0070] The goal of the loss function H is to make the distance between positive sample pairs Subtract the distance between negative sample pairs After that, it is also less than or equal to a preset value.
[0071] Using the keyword model with the set label to construct the node tree of each household profile text: the root node represents the label s of each household profile text, each node represents a label, and the data under each node J represents the keywords h set with the label sJ , such as the data under the age label node representing the ages of multiple members of the family, and the data under the gender label node representing the genders of multiple members of the family, as shown in the node tree diagram. Figure 2
[0072] In the preferred embodiment, the same label nodes in the node trees of multiple household profile texts are linked, and the data under the label nodes are also linked together, thereby obtaining the node link group of the same label, M is the total number of households in the community, each household corresponds to a profile text, and each profile text corresponds to a node tree.
[0073] The purpose of constructing the node link group of the same label is to find out whether each node link group contains the labels of all household profile texts. If there is a missing label, manual linking is required, or the household profile text is missing the keywords belonging to the label, and the missing label data of the household profile text needs to be supplemented.
[0074] Finally, the keywords under the node that meets the query label are used as the input of the convolutional neural network, and the labels of the profile texts of each household that meet the query condition are output, as shown in the convolutional neural network screening method diagram when the query condition is different. Figure 3
[0075] When the query condition is a numerical condition, the screening number R in the query condition is used as the first input of the convolutional neural network; and the keywords h sJ under the label node targeted by the query condition are used as the second input of the convolutional neural network.
[0076] The convolutional neural network uses the max function or the min function for conditional screening.
[0077] When the query condition is greater than or equal to the screening number R, the max function is used for conditional screening:
[0078] F(s) = max(h sJ / R, 1)
[0079] For example, if the query condition in the screening number R represents the selection of households containing people over 60 years old, let R = 60, if h sJ / R is greater than or equal to 1, then F(s) outputs h sJ / R and the corresponding s value, if h sJ / R is less than 1, then F(s) outputs 1. The output of the label s of each household data text can filter out households that meet the query condition R, that is, households with people over 60 years old.
[0080] When the query condition is less than the screening number R, use the min function to conditionally filter:
[0081] F(s) = min(h sJ / R, 1)
[0082] For example, if the query condition in the screening number R represents the selection of households containing people under 18 years old, let R = 18, if h sJ / R is less than 1, then F(s) outputs h sJ / R and the corresponding s value, if h sJ / R is greater than or equal to 1, then F(s) outputs 1. The output of the label s of each household data text can filter out households that meet the query condition, that is, households with members under 18 years old.
[0083] If the query condition is a text condition, then calculate whether the numeric characters of the keywords under the label targeted in the query condition are equal to the numeric characters of the query field in the text condition.
[0084] Convert multiple keywords under the label targeted in the query condition into target numeric characters using the conversion formula, and convert the query keywords in the query condition into query numeric characters. The conversion formula is:
[0085]
[0086] Where w t is the number of strokes in the tth word in the keyword, and T represents the number of words in the keyword. The target numeric character L M and the query numeric character L N generated using the above conversion formula, if L M is equal to L N , then it is proved that the data under the label node has data that matches the keywords of the query condition, and the label s of each household data text corresponding to the query condition is output.
[0087] According to the above screening purposes, a convolutional neural network is designed, which comprises:
[0088] Input layer: The input layer receives query conditions and keyword data under the tag nodes targeted by the query conditions.
[0089] Convolution layer: Use multiple convolution kernels to filter keywords that meet the query conditions. Preferably, the present invention needs to design three convolution layers to filter keywords that meet the query conditions. The first convolution layer is used to use the max function for conditional filtering when the query condition is to filter keywords greater than or equal to the filter number R; the second convolution layer is used to use the min function for conditional filtering when the query condition is to filter keywords less than the filter number R; the third convolution layer is used to convert the query keywords in the query condition into query digital characters if the query condition is a text condition, and convert multiple keywords under the label targeted in the query condition into target digital characters for filtering.
[0090] Pooling layer: Use the pooling layer to reduce the dimension of the output filtering results.
[0091] Fully connected layer: The results extracted by the convolutional layer and the pooling layer are passed to the fully connected layer, which outputs the label s of the document text that meets the query conditions.
[0092] It should be emphasized that since the label categories targeted by community governance are relatively simple, such as age, occupation, gender, etc., it is feasible to use the above-mentioned stroke count conversion formula to convert character strings into digital characters. When the number of labels is expanded, there will be situations where the digital characters are the same but the text strings are different. Therefore, the above-mentioned conversion formula is only applicable to the community governance model, and is only trained and set for labels and keywords that may appear in the direction of community governance.
[0093] The choice of transformation rules will affect the complexity and flexibility of the model. For more complex data queries, hash functions or encoding functions can be used. However, the main purpose of this invention is to simplify the calculation part of the model, improve query efficiency, and ensure that the transformation process accurately reflects the intent of the query conditions without causing unexpected matches or omissions. Example 2
[0094] Based on the method for constructing a community governance model based on a convolutional neural network in Example 1, this example proposes a community governance model based on a convolutional neural network, such as Figure 4 As shown, the community governance model includes: a community database, a word segmentation unit, a keyword model building unit, a label setting unit, a node tree building unit, and a convolutional neural network processing unit.
[0095] The word segmentation unit extracts a list of all words in the data text from the community database. The keyword model construction unit measures the frequency of occurrence of each word, the length of the word string, and the position of the word occurrence to determine multiple keywords and establish a keyword model for each household's data text.
[0096] The tag setting unit sets different preset fields for each tag, extracts keywords that meet the preset fields in the keyword model according to the different preset fields, and thus assigns tags to all keywords.
[0097] The node tree construction unit constructs each keyword model into a node tree with different labels as nodes.
[0098] The convolutional neural network processing unit takes the keywords under the nodes that meet the query label as the input of the convolutional neural network and outputs the labels of the information texts of each household that meets the query conditions.
[0099] The community governance model also links multiple distributed model terminals, which can query information from the community governance model. The specific steps are as follows:
[0100] Step 1: Submit query conditions. The distributed model terminal uses the terminal device to submit query conditions to retrieve the desired information.
[0101] Step 2: The community service model constructs a keyword model for the multi-household profile text. The community service model, based on a convolutional neural network, filters relevant data from the keyword model for the multi-household profile text. This operation presupposes that the keyword model has been constructed and data requests have been sent to the convolutional neural network for specific information filtering operations.
[0102] Step 3: Result return. After receiving the matched information from the keyword model of multiple household data texts, output the label s of each household data text and forward the result to the distributed model terminal. Figure 5 As shown, the above process is exemplarily demonstrated.
[0103] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0104] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for constructing a community governance model based on convolutional neural networks, characterized in that: include: Extract multiple keywords from each household's information text in the community database and establish a keyword model for each household's information text; set different preset fields for each tag, extract keywords that match the preset fields in the keyword model based on different preset fields, and assign tags to all keywords; The first label is gender, the preset field is male or female, and the keyword that matches the preset field is set as the first label; The second tag is age, the preset field is the age number, and the keyword that matches the preset age number is set as the second tag; Each keyword model is constructed as a node tree using different labels as nodes. The nodes with the same label in the node tree of multiple household data texts are linked together, and the keywords under the label nodes are linked together to obtain the same label node link group. Check whether each node link group contains the labels of all data texts. If there are missing labels, the missing label data of the data text are supplemented. The data under the age label node represents the ages of multiple family members, and the data under the gender label node represents the genders of multiple family members; The convolutional neural network uses the max function or min function to perform conditional screening; the keywords under the query label node are used as the input of the convolutional neural network, and the label of the information text of each household that meets the query conditions is output; when the query condition is a numeric condition, the screening number in the query condition is used as the first input of the convolutional neural network, and the keyword model F of each household information text under the label J targeted by the query condition is used. s Keyword h in sJ It is fed sequentially as the second input of the convolutional neural network; When the query condition is to filter keywords that are greater than or equal to the filter number R, perform conditional filtering: F(s)=max(h sJ / R,1); if h sJ / R is greater than or equal to 1, then the calculated result F(s) is h sJ / R, and output the corresponding s value, if h sJ / R is less than 1, the calculated result F(s) is 1; If the filter number R in the query condition indicates that families with age greater than 60 are selected, then let R=60. If h sJ / R is greater than or equal to 1, then F(s) outputs h sJ / R and the corresponding s value, if h sJ / If R is less than 1, then F(s) outputs 1; output the label s of each household's data text, and filter out households with elderly people over 60 years old; When the query condition is to filter keywords that are less than the filter number R, perform conditional filtering: F(s)=min(h sJ / R,1); if h sJ / R is less than 1, the calculated result F(s) is h sJ / R, and output the corresponding s value, if h sJ / R is greater than or equal to 1, the calculation result F(s) is 1; If the query condition indicates that families with children under 18 years old are selected, then let R=18. If h sJ / R is less than 1, then F(s) outputs h sJ / R and the corresponding s value, if h sJ / If R is greater than or equal to 1, then F(s) outputs 1; output the label s of each household's data text, and filter out households with members under the age of 18; When the query condition is a text condition, the query keyword in the query condition is converted into query numeric characters, and the multiple keywords under the target tag in the query condition are converted into target numeric characters: ; Among them, w t is the number of strokes of the t-th character in the keyword, T represents the number of characters in the keyword, and the target digital character generated by the conversion formula is L M and query numeric characters for L N , if L M Equal to L N , then output the label s of the data text corresponding to the target digital character.
2. The method for constructing a community governance model according to claim 1, characterized in that: Extract all the words in each household's data text, and filter the words with a comprehensive weight S j The top m words are used as keywords: ; in, , Represents the word frequency weight q j Comprehensive weight of word S j Contribution value; Represents the word length weight C j Comprehensive weight of word S j Contribution value; Represents the word position weight Z j Comprehensive weight of word S j The contribution value of each weight is collected and normalized.
3. The method for constructing a community governance model according to claim 2, characterized in that: Use keyword model F s Information indicating the text of the sth user's data: F s =[s,(F s1 ,S s1 ;……;F si ,S si ;……;F sn ,S sn )]; Among them, s represents the label of the data text, F si Indicates the i-th keyword in the s-th user's data text, S si represents the comprehensive weight of the i-th keyword in the s-th user data text, and n is the keyword model F s The number of keywords in .
4. The method for constructing a community governance model according to claim 1, characterized in that: When setting different preset fields for each tag, define the preset fields as standard samples, define keywords that do not match the standard samples as positive samples, and define keywords that match standard sample A as negative samples; The loss function is used to calculate the positive sample so that the distance between the positive sample pair and the distance between the negative sample pair is less than or equal to a preset value. The calculation formula of the loss function H is as follows: ; Where: P k represents the kth positive sample, N k represents the kth negative sample, M is the total number of samples; d is the distance measure between samples, It is a hyperparameter. The goal of the loss function H is to make the distance between the positive sample pairs Subtract the distance of the negative sample pair After less than or equal to a preset value; The positive example samples that meet the target of the loss function H are keywords that meet the preset fields, and the keywords are assigned to the labels to which the standard samples belong.
Citation Information
Patent Citations
Selection method of distributed information retrieval sets based on historical click data
CN102521350A
Semantic retrieval method and system for automatically extracting keywords
CN118468881A
Intelligent patent literature retrieval method and system based on knowledge graph
CN118606483A