Public data storytelling method, device, equipment and storage medium
By constructing feature sets of rules and standards and generating storytelling texts, the problem of low public data publishing and popularization is solved, the public's access and understanding ability is improved, and more efficient rules and standards publicity is achieved.
Patent Information
- Application Number
- CN202411795054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing technology is difficult to effectively improve the efficiency of public data, especially the publication and popularization of regulations and standards, and there are difficulties in the public obtaining and understanding these data.
By obtaining the target regulations and standard documents of the new regulations and standard information and the previous comparative regulations and standard documents, a feature set that distinguishes keywords and key elements is constructed, a story-based framework is generated based on the areas of the regulations and standards, and a training story generation model is used to generate story-based text for publicity.
It has improved the attractiveness of the publicity copy of regulations and standards, reduced the threshold and cost of public understanding and understanding, and improved the efficiency of public announcement and popularization of regulations and standards.
Smart Images

Figure CN119271807B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for storytelling of public data. Background Art
[0002] The publication of public data (such as rules and regulations, standard documents, department reports, maps, statistics, meteorological information and scientific research data) has multiple meanings and importance. It plays a significant role and helps in promoting scientific research and innovation, promoting economic development, enhancing social transparency and facilitating the public.
[0003] In actual applications, some public data (such as regulations, standards, etc.) have the following limitations when they are released to the public: (1) The content of regulations and standards is numerous and complex, which is not conducive to public access and understanding; (2) Regulations and standards have strict time specifications and requirements. Regulations and standards within different time ranges may be different, which affects the public's compliance with and implementation of regulations and standards; (3) Regulations and standards may have different revised versions, which raises the threshold for the public to update and understand regulations and standards in real time. In response to the above problems, the current approach is usually to increase the publicity intensity, publicity time and publicity breadth of news and social media to popularize the newly promulgated regulations and standards as comprehensively as possible. However, this approach has problems such as high cost, poor effect, duplicate publicity copy, and the public's habitual neglect, and cannot truly improve the efficiency of public data release and popularization.
[0004] Therefore, how to improve the attractiveness of promotional copy for regulations and standards, lower the threshold and cost for the public to know and understand regulations and standards, and improve the efficiency of publishing and popularizing regulations and standards is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for storytelling of public data, aiming to solve at least one of the above-mentioned technical problems.
[0006] To achieve the above object, the present invention provides a method for storytelling of public data, comprising the following steps:
[0007] Acquire new regulations and standards information issued by the target department, and extract the target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number;
[0008] Determine the comparative regulatory standards document of the new regulatory standards information based on the regulatory standards identification number;
[0009] Extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulation standard file and the comparison regulation standard file;
[0010] Using the second feature set and the regulatory standards action area, a story composition framework of the new regulatory standards information is generated; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements;
[0011] According to a plurality of distinguishing keyword pairs in the first feature set, adjusting the composition of elements in the corresponding story nodes in the story composition framework so that conflict requirements are met between different story nodes in the story composition framework;
[0012] The adjusted story composition framework is input into the trained story generation model to obtain the story-based text of the new regulations and standards information output by the story generation model.
[0013] Optionally, the step of obtaining new regulations and standards information issued by the target department and extracting target regulations and standards files and regulations and standards related information from the new regulations and standards information specifically includes:
[0014] Accessing the regulations and standards publishing page to obtain new regulations and standards information provided by the regulations and standards publishing page; wherein the new regulations and standards information includes a file download link and page text information;
[0015] Utilizing the file download link to execute a download action of the target regulation standard file, and obtaining the target regulation standard file of the new regulation standard information;
[0016] The natural language processing tool is called to perform word segmentation, keyword recognition and extraction on the text information of the page to obtain the regulatory standard application area and regulatory standard identification number.
[0017] Optionally, the step of determining the comparison regulatory standard file of the new regulatory standard information based on the regulatory standard identification number specifically includes:
[0018] Based on the regulatory standard identification number, matching a regulatory standard list of a corresponding type in a regulatory standard database; wherein the regulatory standard list stores a plurality of regulatory standard files of a corresponding type updated and arranged according to revision time;
[0019] The target regulatory standard files corresponding to the regulatory standard identification numbers are sequentially stored in a regulatory standard list of corresponding types, and the regulatory standard files last revised in the regulatory standard list are extracted as comparison regulatory standard files.
[0020] Optionally, the step of extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulatory standard file and the comparison regulatory standard file specifically includes:
[0021] Convert the target regulatory standard file into an image, and use OCR recognition and OpenCV recognition to convert the text content and graphic content in the target regulatory standard file into text information as the first text content, and convert the text content and graphic content in the comparison regulatory standard file into text information as the second text content;
[0022] Using a semantic recognition model, matching sentences in the first text content and the second text content based on the scale of sentence semantics to obtain a plurality of sentence matching pairs;
[0023] Calling a natural language processing tool to perform word segmentation processing and keyword recognition and extraction on the sentences in each sentence matching pair, using the keywords corresponding to the extracted first text content as key elements to form a second feature set, and obtaining the position of each keyword in the sentence;
[0024] The keywords at the same position of the first text content and the second text content in the same sentence matching pair are compared, and different keywords at the same position are used as distinguishing keyword pairs to form a first feature set.
[0025] Optionally, the step of generating a story structure framework of the new regulatory standards information by using the second feature set and the regulatory standards action area specifically includes:
[0026] Based on the regulatory standards application area, a plurality of event information whose publishing locations match the regulatory standards application area is collected from a social media database and a news database; wherein the event information includes the time of event occurrence and the content of the event occurrence;
[0027] Extracting and constructing a keyword set of the event content in each event information, classifying a number of event information into types, obtaining a number of initial event information types, and selecting a number of candidate event information types whose matching degree exceeds a preset matching degree from the initial event information types based on the matching degree between the keywords in the keyword set of each initial event information type and the key elements in the second feature set;
[0028] The frequency of occurrence of each keyword in each candidate event information type is counted as the event hotspot quantification value, and the time interval between the event occurrence time of each event information and the current time is converted into an event hotspot quantification weight according to a preset negative correlation change relationship. The total hotspot quantification value of each candidate event information type is calculated based on the cumulative weight sum of the event hotspot quantification value of each keyword and the event hotspot quantification weight of the keyword in the corresponding event information;
[0029] Taking each keyword in the target event information type with the highest total hot spot quantization value to calculate the relevance of each key element in the second feature set, taking keywords with a relevance higher than a preset relevance as related elements of each key element, generating a story node for each key element, and merging the key elements of the story nodes with the same related elements to obtain a story composition framework containing several story nodes;
[0030] Based on the logical relationship between each key element in the story composition framework in each event information, a logical sequence number is assigned to each key element, and the story nodes in the story composition framework are arranged in logical order according to the average logical sequence number of all key elements in each story node.
[0031] Optionally, according to a plurality of distinguishing keyword pairs in the first feature set, adjusting the composition of elements in the corresponding story nodes in the story composition framework so that different story nodes in the story composition framework meet the conflict requirement step specifically includes:
[0032] Extracting a plurality of distinguishing keyword pairs from the first feature set, and writing the keyword corresponding to the second text content in the distinguishing keyword pairs into other story nodes after the keyword corresponding to the first text content in the story composition framework as conflict elements, so that the conflict requirements are met between different story nodes in the story composition framework;
[0033] The conflict requirement is configured such that the total number of story nodes between all conflicting elements and the corresponding keywords of the first text content within the story composition framework is not less than a target value.
[0034] Optionally, the step of inputting the adjusted story composition framework into a trained story generation model to obtain the story-based text of the new regulations and standards information output by the story generation model specifically includes:
[0035] Extracting the logical sequence information and story content information of each story node in the adjusted story composition framework; wherein the logical sequence information includes the contextual relationship between the story nodes, and the story content information includes a number of key elements, related elements, and conflict elements within the story nodes;
[0036] Annotate and extract the story start text and keywords of each training story in the story sample to construct a story training set; wherein the keywords include key elements, related elements and conflict elements;
[0037] Input the story training set of each training story into the pre-built LSTM model structure, predict the next word of the story starting text in the input story training set based on the randomly initialized hyperparameters of the LSTM layer in the LSTM model structure, calculate the loss function of the predicted next word and the actual word, use the back-propagation algorithm to calculate the gradient value and use the optimizer to update the hyperparameters of the LSTM layer;
[0038] Repeat the above steps until the loss converges or the preset number of training rounds is reached to obtain a trained story generation model;
[0039] The contextual relationships between story nodes are mapped to a number of key elements, related elements and conflicting elements in the corresponding story nodes, story generation element features are generated, and the story generation element features are input into a trained story generation model to obtain a story-based text of the new regulations and standards information output by the story generation model.
[0040] In addition, in order to achieve the above-mentioned purpose, the present invention also provides a public data storytelling device, comprising:
[0041] An acquisition module, used to acquire new regulations and standards information issued by a target department, and extract target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number;
[0042] A determination module, configured to determine a comparison regulation and standard file of new regulation and standard information based on the regulation and standard identification number;
[0043] An extraction module, configured to extract, based on the target regulation standard file and the comparison regulation standard file, a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements;
[0044] A generating module, configured to generate a story composition framework of the new regulatory standard information by using the second feature set and the regulatory standard action area; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements;
[0045] An adjustment module, configured to adjust the composition of elements in the corresponding story nodes in the story composition framework according to the plurality of distinguishing keyword pairs in the first feature set, so that the conflict requirements between different story nodes in the story composition framework are satisfied;
[0046] The output module is used to input the adjusted story composition framework into the trained story generation model to obtain the story-based text of the new regulations and standards information output by the story generation model.
[0047] In addition, in order to achieve the above-mentioned purpose, the present invention also provides a public data storytelling device, which includes: a memory, a processor, and a public data storytelling program stored in the memory and executable on the processor, and when the public data storytelling program is executed by the processor, the steps of the public data storytelling method described above are implemented.
[0048] In addition, in order to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a public data storytelling program is stored, and when the public data storytelling program is executed by a processor, the steps of the above-mentioned public data storytelling method are implemented.
[0049] The beneficial effects of the present invention are as follows: a method, device, equipment and storage medium for storytelling of public data are proposed, by acquiring the target regulations and standards files of the new regulations and standards information and the comparison regulations and standards files before the amendment, a first feature set containing distinguishing keywords and a second feature set containing key elements are constructed, the area of action of the new regulations and standards is considered, the hot events in the current area of action are integrated with the new regulations and standards information, a story composition framework of the new regulations and standards information is generated, based on the story nodes with key elements, related elements and conflicting elements in the story composition framework, a story text of the new regulations and standards information is generated using a trained story generation model. The generated story text is used to edit the publicity copy, and by broadcasting it to television, radio and official media, it can attract public attention, improve the attractiveness of the publicity copy of regulations and standards, reduce the threshold and cost for the public to know and understand regulations and standards, and improve the efficiency of the publication and popularization of regulations and standards. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0051] Figure 2 It is a flowchart of an embodiment of a method for storytelling of public data of the present invention;
[0052] Figure 3 4 is a structural block diagram of a public data storytelling device in an embodiment of the present invention.
[0053] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0057] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0058] Those skilled in the art will understand that Figure 1 The structure of the device shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0059] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a public data storytelling program.
[0060] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the public data storytelling program stored in the memory 1005 and perform the following operations:
[0061] Acquire new regulations and standards information issued by the target department, and extract the target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number;
[0062] Determine the comparative regulatory standards document of the new regulatory standards information based on the regulatory standards identification number;
[0063] Extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulation standard file and the comparison regulation standard file;
[0064] Using the second feature set and the regulatory standards action area, a story composition framework of the new regulatory standards information is generated; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements;
[0065] According to a plurality of distinguishing keyword pairs in the first feature set, adjusting the composition of elements in the corresponding story nodes in the story composition framework so that conflict requirements are met between different story nodes in the story composition framework;
[0066] The adjusted story composition framework is input into the trained story generation model to obtain the story-based text of the new regulations and standards information output by the story generation model.
[0067] The specific embodiments of the present invention applied to the device are basically the same as the embodiments of the method for storytelling of public data described below, and will not be described in detail here.
[0068] The embodiment of the present invention provides a method for storytelling of public data, referring to Figure 2 , Figure 2 It is a flowchart of an embodiment of the method for storytelling of public data of the present invention.
[0069] In this embodiment, the method for converting public data into a story includes the following steps:
[0070] S100: Acquire new regulations and standards information issued by the target department, and extract the target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number;
[0071] S200: Determine a comparison regulation and standard file for new regulation and standard information based on the regulation and standard identification number;
[0072] S300: extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulation standard file and the comparison regulation standard file;
[0073] S400: Generate a story composition framework of the new regulatory standard information by using the second feature set and the regulatory standard action area; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements;
[0074] S500: adjusting the composition of elements in the corresponding story nodes in the story composition framework according to the plurality of distinguishing keyword pairs in the first feature set, so that the conflict requirements between different story nodes in the story composition framework are satisfied;
[0075] S600: Inputting the adjusted story composition framework into the trained story generation model to obtain the story-based text of the new regulations and standards information output by the story generation model.
[0076] It should be noted that some public data (such as regulations, standards, etc.) have the following limitations when they are released to the public: (1) The content of regulations and standards is numerous and complex, which is not conducive to public access and understanding; (2) Regulations and standards have strict time specifications and requirements. Regulations and standards within different time frames may be different, which affects the public's compliance with and implementation of regulations and standards; (3) Regulations and standards may have different revised versions, which raises the threshold for the public to update and understand regulations and standards in real time. In response to the above problems, the current approach is usually to increase the publicity intensity, publicity time and publicity breadth of news and social media to popularize the newly promulgated regulations and standards as comprehensively as possible. However, this approach has problems such as high cost, poor effect, duplicate publicity copy, and the public's habitual neglect, and cannot truly improve the efficiency of the release and popularization of public data.
[0077] In order to solve the above problems, this embodiment obtains the target regulations and standards files of the new regulations and standards information and the comparison regulations and standards files before the revision, constructs a first feature set containing distinguishing keywords and a second feature set containing key elements, considers the area of action of the new regulations and standards, integrates the hot events in the current area of action with the new regulations and standards information, generates a story composition framework for the new regulations and standards information, and generates a story text for the new regulations and standards information based on the story nodes with key elements, related elements and conflicting elements in the story composition framework using the trained story generation model. The generated story text is used to edit the publicity copy, and by broadcasting it to television, radio and official media, it can attract public attention, increase the attractiveness of the publicity copy for regulations and standards, reduce the threshold and cost for the public to know and understand regulations and standards, and improve the efficiency of the publication and popularization of regulations and standards.
[0078] In a preferred embodiment, the steps of obtaining new regulatory standards information issued by a target department and extracting target regulatory standards files and regulatory standards related information from the new regulatory standards information specifically include:
[0079] S110: Accessing a regulations and standards publishing page to obtain new regulations and standards information provided by the regulations and standards publishing page; wherein the new regulations and standards information includes a file download link and page text information;
[0080] S120: Utilize the file download link to execute a download action of the target regulation standard file, and obtain the target regulation standard file of the new regulation standard information;
[0081] S130: calling a natural language processing tool to perform word segmentation processing and keyword recognition and extraction on the page text information to obtain the regulatory standard application area and regulatory standard identification number.
[0082] On this basis, based on the regulatory standard identification number, the steps of comparing regulatory standard files with new regulatory standard information are determined, including:
[0083] S210: Based on the regulation and standard identification number, matching a regulation and standard list of corresponding types in a regulation and standard database; wherein the regulation and standard list stores a plurality of regulation and standard files of corresponding types updated and arranged according to revision time;
[0084] S220: sequentially storing the target regulatory standard files corresponding to the regulatory standard identification numbers in a regulatory standard list of corresponding types, and extracting the regulatory standard files of the last revision in the regulatory standard list as comparison regulatory standard files.
[0085] In this embodiment, obtaining the new regulations and standards information released by the target department mainly refers to: the new regulations and standards files published by the target department on the regulations and standards release page and the regulations and standards related information including the regulations and standards effective area and the regulations and standards identification number. The regulations and standards identification number can be used to query the regulations and standards file of the previous revision corresponding to the current new regulations and standards file in the regulations and standards list, and then analyze the difference between the two regulations and standards before and after the revision. This difference is used as the plot conflict point for generating a story text for the public, which can improve the matching degree between the story text and the new regulations and standards and strengthen the public's understanding of the new regulations and standards; the regulations and standards effective area can be used to locate the area where the story text is generated for the public, and the area is used to match the hot events for which the story text is to be feature-fused, which can enhance the attractiveness of the finally generated story text to the public in the area and enhance the release and popularization effect of the new regulations and standards.
[0086] In a preferred embodiment, based on the target regulatory standard file and the comparison regulatory standard file, the step of extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements specifically includes:
[0087] S310: converting the target regulation standard file into an image, and using OCR recognition and OpenCV recognition to convert the text content and the graphic content in the target regulation standard file into text information as the first text content, and converting the text content and the graphic content in the comparison regulation standard file into text information as the second text content;
[0088] S320: using a semantic recognition model, matching sentences in the first text content and the second text content based on the scale of sentence semantics to obtain a plurality of sentence matching pairs;
[0089] S330: calling a natural language processing tool to perform word segmentation processing and keyword recognition and extraction on the sentences in each sentence matching pair, using the keywords corresponding to the extracted first text content as key elements to form a second feature set, and obtaining the position of each keyword in the sentence;
[0090] S340: Compare the keywords at the same position of the first text content and the second text content in the same sentence matching pair, and use different keywords at the same position as distinguishing keyword pairs to form a first feature set.
[0091] In this embodiment, after obtaining the target regulations and standards file and the comparison regulations and standards file, sentence matching is first performed on the two regulations and standards before and after the revision. Through the semantic recognition model and keyword recognition and extraction, the second feature set composed of the keywords in the first text content as key elements and the different keywords in the same position of the first text content and the second text content as the distinguishing keyword pairs are finally obtained as the first feature set. The first feature set is used to obtain and analyze the difference between the two regulations and standards before and after the revision, and the second feature set is used to extract the key content of the new regulations and standards.
[0092] In a preferred embodiment, the step of generating a story structure framework of the new regulatory standard information by using the second feature set and the regulatory standard action area specifically includes:
[0093] S410: Based on the regulatory standards application area, a plurality of event information whose publishing locations match the regulatory standards application area is collected from a social media database and a news database; wherein the event information includes the event occurrence time and event occurrence content;
[0094] S420: extracting and constructing a keyword set of the event content in each event information, classifying the multiple event information into types, obtaining multiple initial event information types, and selecting multiple candidate event information types whose matching degrees exceed a preset matching degree from the initial event information types based on the matching degree between the keywords in the keyword set of each initial event information type and the key elements in the second feature set;
[0095] S430: Count the frequency of occurrence of each keyword in each candidate event information type as an event hotspot quantization value, convert the time interval between the event occurrence time of each event information and the current time into an event hotspot quantization weight according to a preset negative correlation change relationship, and calculate the total hotspot quantization value of each candidate event information type according to the cumulative weight sum of the event hotspot quantization value of each keyword and the event hotspot quantization weight of the keyword in the corresponding event information;
[0096] S440: taking each keyword in the target event information type with the highest total hot spot quantization value to calculate the relevance of each key element in the second feature set, taking keywords with a relevance higher than a preset relevance as related elements of each key element, generating a story node for each key element, and merging the key elements of the story nodes with the same related elements to obtain a story composition framework containing a plurality of story nodes;
[0097] S450: Based on the logical relationship between each key element in the story composition framework in each event information, a logical sequence number is assigned to each key element, and the story nodes in the story composition framework are arranged in a logical sequence according to the average logical sequence number of all key elements in each story node.
[0098] It should be noted that, when performing type classification, this embodiment can be based on a comparison table of pre-prepared keywords and corresponding types, and can classify the type of each event information according to the overlap ratio of different types of keywords in the comparison table of keywords of the event content in each event information, and finally obtain several types of initial event information. When calculating the matching degree of the keyword set and key elements of the event information type, this embodiment can use the method of calculating cosine similarity to determine the similarity between each keyword in the keyword set and the key element, define keywords with similarity exceeding a certain value as similar words of the key element, and determine the matching degree of the keyword set and the key element by counting the ratio of similar words. When calculating the correlation between each keyword and the key element in the target event information type, this embodiment can determine the correlation by counting the number of times each keyword and key element appears in the same text, paragraph or sentence in the sample database.
[0099] In this embodiment, after obtaining the area of application of regulations and standards, several pieces of event information in the area can be queried in the social media database and the news database. First, the types of event information are screened by type matching (events whose matching degree with the key elements in the second feature set does not meet the requirements are excluded) to obtain several candidate event information types, and then each candidate event information type is screened by heat (the event information type with the highest total hot spot quantization value calculated based on the time interval and the frequency of occurrence is retained, and other types are excluded). Finally, the keywords in the target event information type with the highest total hot spot quantization value are extracted, and the correlation degree of the keywords is calculated for each key element. The keywords with the correlation degree meeting the requirements are used as the related elements of the corresponding key elements to obtain a story composition framework containing several story nodes (each story node contains at least one key element and several related elements). The story composition framework integrates the key elements of the target regulatory standard document and the related elements of the hot events, and logically sorts the story nodes in the story composition framework according to the logical relationship between each key element in each event information, so that the story composition framework finally obtained has the strong logic of the event information characteristics, and ensures the logic and authenticity of the story text generated by the story composition framework.
[0100] In a preferred embodiment, according to a plurality of distinguishing keyword pairs in the first feature set, adjusting the composition of elements in the corresponding story nodes in the story composition framework so that different story nodes in the story composition framework meet the conflict requirements, specifically includes:
[0101] S510: extracting a plurality of distinguishing keyword pairs from the first feature set, and writing the keyword corresponding to the second text content in the distinguishing keyword pairs into other story nodes after the keyword corresponding to the first text content in the story composition framework as conflict elements, so that the conflict requirements are met between different story nodes in the story composition framework;
[0102] The conflict requirement is configured such that the total number of story nodes between all conflicting elements and the corresponding keywords of the first text content within the story composition framework is not less than a target value.
[0103] In this embodiment, after obtaining the story composition framework, the keywords corresponding to the second text content of several distinguishing keyword pairs in the first feature set are written after the story nodes corresponding to the keywords in the first text content, so as to form two different conflicting elements before and after the story composition framework. When the story composition framework is used to generate a story text, these two conflicting elements can form a dramatic conflict, thereby enhancing the attractiveness and interest of the promotional copy (such as a short video, public service advertisement or radio broadcast text) finally edited using the story text, and improving the efficiency of the release and popularization of new regulations and standards.
[0104] In a preferred embodiment, the step of inputting the adjusted story composition framework into a trained story generation model to obtain the story-based text of the new regulatory standard information output by the story generation model specifically includes:
[0105] S610: extracting the logical sequence information and story content information of each story node in the adjusted story composition framework; wherein the logical sequence information includes the contextual relationship between the story nodes, and the story content information includes a number of key elements, related elements, and conflict elements in the story nodes;
[0106] S620: Annotate and extract the story start text and keywords of each training story in the story sample to construct a story training set; wherein the keywords include key elements, related elements and conflict elements;
[0107] S630: input the story training set of each training story into the pre-built LSTM model structure, predict the next word of the story start text in the input story training set based on the hyperparameters of the LSTM layer randomly initialized in the LSTM model structure, calculate the loss function of the predicted next word and the actual word, use the back propagation algorithm to calculate the gradient value and use the optimizer to update the hyperparameters of the LSTM layer;
[0108] S640: Repeat the above steps until the loss converges or reaches a preset number of training rounds, and obtain a trained story generation model;
[0109] S650: Map the contextual relationships between story nodes to a number of key elements, related elements, and conflicting elements within corresponding story nodes, generate story generation element features, input the story generation element features into a trained story generation model, and obtain a story-based text of the new regulations and standards information output by the story generation model.
[0110] In this embodiment, a large number of story samples marked with key elements, related elements and conflicting elements need to be input into the recurrent neural network for training in advance to obtain a story generation model. Finally, the features of the story generation elements are input into the trained story generation model to obtain the story-based text of the new regulations and standards information. In this way, the generated story-based text is used to edit the promotional copy, and by broadcasting it to television, radio, and official media, it can attract public attention, increase the attractiveness of the promotional copy of the regulations and standards, reduce the threshold and cost for the public to know and understand the regulations and standards, and improve the efficiency of the publication and popularization of regulations and standards.
[0111] Reference Figure 3 , Figure 3 It is a structural block diagram of an embodiment of a public data storytelling device of the present invention.
[0112] like Figure 3 As shown, the public data storytelling device proposed in the embodiment of the present invention includes:
[0113] The acquisition module 10 is used to acquire new regulations and standards information issued by the target department, and extract the target regulations and standards files and regulations and standards related information in the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number;
[0114] A determination module 20, configured to determine a comparison regulation and standard file of new regulation and standard information based on the regulation and standard identification number;
[0115] An extraction module 30, for extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulation standard file and the comparison regulation standard file;
[0116] A generating module 40 is used to generate a story composition framework of the new regulatory standard information by using the second feature set and the regulatory standard action area; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements;
[0117] An adjustment module 50, configured to adjust the composition of elements in the corresponding story nodes in the story composition framework according to the plurality of distinguishing keyword pairs in the first feature set, so that the conflict requirements between different story nodes in the story composition framework are satisfied;
[0118] The output module 60 is used to input the adjusted story composition framework into the trained story generation model to obtain the story-based text of the new regulatory standard information output by the story generation model.
[0119] Other embodiments or specific implementations of the public data storytelling device of the present invention can refer to the above-mentioned method embodiments, which will not be described in detail here.
[0120] In addition, the present invention also proposes a public data storytelling device, which includes: a memory, a processor, and a public data storytelling program stored in the memory and executable on the processor, and when the public data storytelling program is executed by the processor, the steps of the public data storytelling method described above are implemented.
[0121] The specific implementation of the public data storytelling device of the present application is basically the same as the various embodiments of the above-mentioned public data storytelling method, and will not be repeated here.
[0122] In addition, the present invention also proposes a readable storage medium, the readable storage medium includes a computer readable storage medium, on which a public data storytelling program is stored. The readable storage medium may be Figure 1 The memory 1005 in the terminal may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The readable storage medium includes a number of instructions for enabling a public data storytelling device having a processor to execute the public data storytelling method described in each embodiment of the present invention.
[0123] The specific implementation methods in the readable storage medium of the present application are basically the same as the above-mentioned embodiments of the public data storytelling method, and will not be repeated here.
[0124] It is understood that, in the description of this specification, the description with reference to the terms "one embodiment", "another embodiment", "other embodiments", or "first to Nth embodiments" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0125] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0126] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0128] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for storytelling of public data, characterized in that: The following steps are involved: Acquire new regulations and standards information issued by the target department, and extract the target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number; Determine the comparative regulatory standards document of the new regulatory standards information based on the regulatory standards identification number; Extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulation standard file and the comparison regulation standard file; Using the second feature set and the regulatory standards action area, a story composition framework of the new regulatory standards information is generated; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements; specifically including: Based on the area of application of the regulations and standards, several event information whose publishing locations match the area of application of the regulations and standards are collected from the social media database and the news database; wherein the event information includes the time of event occurrence and the content of event occurrence; extract and construct a keyword set of the event content in each event information, classify the several event information into types, obtain several initial event information types, and based on the matching degree between the keywords in the keyword set of each initial event information type and the key elements in the second feature set, select several candidate event information types whose matching degree exceeds the preset matching degree from the initial event information type; count the frequency of occurrence of each keyword in each candidate event information type as the event hotspot quantification value, convert the time interval between the event occurrence time of each event information and the current time into the event hotspot quantification weight according to the preset negative correlation change relationship, and The total hot spot quantization value of each candidate event information type is calculated by the cumulative weighted sum of the event hot spot quantization value of the keyword and the event hot spot quantization weight of the keyword in the corresponding event information; each keyword in the target event information type with the highest total hot spot quantization value is taken to calculate the relevance of each key element in the second feature set, and the keywords with a relevance higher than the preset relevance are used as the related elements of each key element, a story node is generated for each key element, and the key elements of the story nodes with the same related elements are merged to obtain a story composition framework containing several story nodes; based on the logical relationship between each key element in each event information in the story composition framework, a logical sequence number is assigned to each key element, and the story nodes in the story composition framework are arranged in logical order according to the average logical sequence number of all key elements in each story node; According to a plurality of distinguishing keyword pairs in the first feature set, adjusting the composition of elements in the corresponding story nodes in the story composition framework so that the conflict requirements between different story nodes in the story composition framework are met; specifically comprising: Extracting a plurality of distinguishing keyword pairs from the first feature set, writing the keyword corresponding to the second text content in the distinguishing keyword pair into other story nodes after the corresponding story node of the keyword corresponding to the first text content in the story composition framework as a conflict element, so that the conflict requirements are met between different story nodes in the story composition framework; wherein the conflict requirement is configured such that the total number of story nodes separated by all conflict elements and the corresponding keyword of the first text content in the story composition framework is not less than a target value; Inputting the adjusted story composition framework into the trained story generation model to obtain the story text of the new regulations and standards information output by the story generation model; specifically including: Extract the logical sequence information and story content information of each story node in the adjusted story composition framework; wherein the logical sequence information includes the contextual relationship between story nodes, and the story content information includes several key elements, associated elements and conflicting elements in the story nodes; annotate and extract the story starting text and keywords of each training story in the story sample to construct a story training set; wherein the keywords include key elements, associated elements and conflicting elements; input the story training set of each training story into a pre-constructed LSTM model structure, perform next word prediction on the story starting text in the input story training set based on the hyperparameters randomly initialized by the LSTM layer in the LSTM model structure, calculate the loss function of the predicted next word and the actual word, use the back propagation algorithm to calculate the gradient value and use the optimizer to update the hyperparameters of the LSTM layer; repeat the above steps until the loss converges or reaches a preset number of training rounds, and obtain a trained story generation model; map the contextual relationship between story nodes to several key elements, associated elements and conflicting elements in the corresponding story nodes, generate story generation element features, input the story generation element features into the trained story generation model, and obtain the story-based text of the new regulations and standards information output by the story generation model.
2. The method for storytelling of public data according to claim 1, characterized in that: The steps of obtaining new regulations and standards information issued by the target department and extracting target regulations and standards documents and regulations and standards related information from the new regulations and standards information specifically include: Accessing the regulations and standards publishing page to obtain new regulations and standards information provided by the regulations and standards publishing page; wherein the new regulations and standards information includes a file download link and page text information; Utilizing the file download link to execute a download action of the target regulation standard file, and obtaining the target regulation standard file of the new regulation standard information; The natural language processing tool is called to perform word segmentation, keyword recognition and extraction on the text information of the page to obtain the regulatory standard application area and regulatory standard identification number.
3. The method for storytelling of public data according to claim 1, characterized in that: Based on the regulatory standard identification number, the steps of comparing regulatory standard files to determine the new regulatory standard information specifically include: Based on the regulatory standard identification number, matching a regulatory standard list of a corresponding type in a regulatory standard database; wherein the regulatory standard list stores a plurality of regulatory standard files of a corresponding type updated and arranged according to revision time; The target regulatory standard files corresponding to the regulatory standard identification numbers are sequentially stored in a regulatory standard list of corresponding types, and the regulatory standard files last revised in the regulatory standard list are extracted as comparison regulatory standard files.
4. The method for storytelling of public data according to claim 1, characterized in that: The step of extracting a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements based on the target regulatory standard file and the comparison regulatory standard file specifically includes: Convert the target regulatory standard file into an image, and use OCR recognition and OpenCV recognition to convert the text content and graphic content in the target regulatory standard file into text information as the first text content, and convert the text content and graphic content in the comparison regulatory standard file into text information as the second text content; Using a semantic recognition model, matching sentences in the first text content and the second text content based on the scale of sentence semantics to obtain a plurality of sentence matching pairs; Calling a natural language processing tool to perform word segmentation processing and keyword recognition and extraction on the sentences in each sentence matching pair, using the keywords corresponding to the extracted first text content as key elements to form a second feature set, and obtaining the position of each keyword in the sentence; The keywords at the same position of the first text content and the second text content in the same sentence matching pair are compared, and different keywords at the same position are used as distinguishing keyword pairs to form a first feature set.
5. A public data storytelling device, characterized in that: include: An acquisition module, used to acquire new regulations and standards information issued by a target department, and extract target regulations and standards files and regulations and standards related information from the new regulations and standards information; wherein the regulations and standards related information includes the regulations and standards application area and the regulations and standards identification number; A determination module, configured to determine a comparison regulation and standard file of new regulation and standard information based on the regulation and standard identification number; An extraction module, configured to extract, based on the target regulation standard file and the comparison regulation standard file, a first feature set consisting of a plurality of distinguishing keyword pairs and a second feature set consisting of a plurality of key elements; A generating module, used to generate a story composition framework of the new regulatory standard information by using the second feature set and the regulatory standard action area; wherein the story composition framework includes a plurality of story nodes, each of which is composed of at least one key element and a plurality of associated elements; specifically including: Based on the area of application of the regulations and standards, several event information whose publishing locations match the area of application of the regulations and standards are collected from the social media database and the news database; wherein the event information includes the time of event occurrence and the content of event occurrence; extract and construct a keyword set of the event content in each event information, classify the several event information into types, obtain several initial event information types, and based on the matching degree between the keywords in the keyword set of each initial event information type and the key elements in the second feature set, select several candidate event information types whose matching degree exceeds the preset matching degree from the initial event information type; count the frequency of occurrence of each keyword in each candidate event information type as the event hotspot quantification value, convert the time interval between the event occurrence time of each event information and the current time into the event hotspot quantification weight according to the preset negative correlation change relationship, and The total hot spot quantization value of each candidate event information type is calculated by the cumulative weighted sum of the event hot spot quantization value of the keyword and the event hot spot quantization weight of the keyword in the corresponding event information; each keyword in the target event information type with the highest total hot spot quantization value is taken to calculate the relevance of each key element in the second feature set, and the keywords with a relevance higher than the preset relevance are used as the related elements of each key element, a story node is generated for each key element, and the key elements of the story nodes with the same related elements are merged to obtain a story composition framework containing several story nodes; based on the logical relationship between each key element in each event information in the story composition framework, a logical sequence number is assigned to each key element, and the story nodes in the story composition framework are arranged in logical order according to the average logical sequence number of all key elements in each story node; An adjustment module is used to adjust the composition of elements in the corresponding story nodes in the story composition framework according to a plurality of distinguishing keyword pairs in the first feature set, so that the conflict requirements between different story nodes in the story composition framework are met; specifically comprising: Extracting a plurality of distinguishing keyword pairs from the first feature set, writing the keyword corresponding to the second text content in the distinguishing keyword pair into other story nodes after the corresponding story node of the keyword corresponding to the first text content in the story composition framework as a conflict element, so that the conflict requirements are met between different story nodes in the story composition framework; wherein the conflict requirement is configured such that the total number of story nodes separated by all conflict elements and the corresponding keyword of the first text content in the story composition framework is not less than a target value; The output module is used to input the adjusted story composition framework into the trained story generation model to obtain the story text of the new regulations and standards information output by the story generation model; specifically includes: Extract the logical sequence information and story content information of each story node in the adjusted story composition framework; wherein the logical sequence information includes the contextual relationship between story nodes, and the story content information includes several key elements, associated elements and conflicting elements in the story nodes; annotate and extract the story starting text and keywords of each training story in the story sample to construct a story training set; wherein the keywords include key elements, associated elements and conflicting elements; input the story training set of each training story into a pre-constructed LSTM model structure, perform next word prediction on the story starting text in the input story training set based on the hyperparameters randomly initialized by the LSTM layer in the LSTM model structure, calculate the loss function of the predicted next word and the actual word, use the back propagation algorithm to calculate the gradient value and use the optimizer to update the hyperparameters of the LSTM layer; repeat the above steps until the loss converges or reaches a preset number of training rounds, and obtain a trained story generation model; map the contextual relationship between story nodes to several key elements, associated elements and conflicting elements in the corresponding story nodes, generate story generation element features, input the story generation element features into the trained story generation model, and obtain the story-based text of the new regulations and standards information output by the story generation model.
6. A public data storytelling device, characterized in that: The public data storytelling device includes: a memory, a processor, and a public data storytelling program stored in the memory and executable on the processor. When the public data storytelling program is executed by the processor, the steps of the public data storytelling method as described in any one of claims 1 to 4 are implemented.
7. A storage medium, characterized in that: The storage medium stores a public data storytelling program, which, when executed by a processor, implements the steps of the public data storytelling method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Article generation method and device based on deep learning and related equipment
CN113919336A
Main event duplicate removal method based on graph node selection and optimization
CN114764440A