Method, device, electronic device and storage medium for automatically generating news event topics
Through the theme model, the keywords and time intervals within the probability distribution range are selected, and the news event themes are automatically generated, which solves the problems of inefficient and poor readability of topic generation in the existing technology, and realizes efficient and readable news event theme generation.
Patent Information
- Application Number
- CN202011245129.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-10
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-11-10
AI Technical Summary
In the prior art, the keywords in the bag of news events are difficult to read by users due to the messy and disorganized rules, resulting in inefficient generation of news events topics and requires manual redefinition of the topic.
Through the theme model, the probability distribution and time interval distribution of the keywords in multiple topics and each topic are obtained. Keywords within the preset probability distribution range are selected to form a reduced word bag, and the time interval range is determined based on the keywords of the reduced word bag, and the corresponding news article title is obtained as the topic through similarity calculation.
It realizes automatic generation of news event topics, improves the efficiency of topic generation, and meets the readability requirements of topics.
Smart Images

Figure CN114461790B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet information mining, and in particular to a method, device, electronic device and storage medium for automatically generating news event topics. Background Art
[0002] Existing news event text classification can obtain multiple topics, and these topics are often in the form of word bags consisting of multiple keywords of news events. However, the keywords in the word bags of news events are difficult for users to read because they are disorganized. In the prior art, the word bags of news events are often manually redefined to meet the requirements of readability. However, manually determining the topics of news events is inefficient. Summary of the invention
[0003] In view of the above, it is necessary to propose a method, device, electronic device and storage medium for automatically generating news event topics to automatically generate news event topics.
[0004] The first aspect of the present application provides a method for automatically generating news event topics, the method comprising the steps of:
[0005] Get the text content of news events;
[0006] Analyze the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords;
[0007] Selecting keywords within a preset probability distribution range from the word bag of each subject to form a reduced word bag, and determining the time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each subject; and
[0008] A similarity operation is performed on the text in the database according to the reduced word bag of each of the topics and the time interval range of the reduced word bag to obtain a news article corresponding to each of the topics, and the title of the news article is used as the topic of the news event text content.
[0009] Preferably, the news event text content is analyzed by a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords including:
[0010] The number of topics in the topic model is set, the text content of the news event is imported into the topic model, and the topics of the set number of topics, the probability distribution of the keywords in each topic and the time interval distribution are obtained through Topic over time algorithm analysis.
[0011] Preferably, selecting keywords within a preset probability distribution range from the word bag of each topic to form a reduced word bag, and determining the time interval range of the reduced word bag according to the keywords of the reduced word bag includes:
[0012] Obtaining the maximum probability value of the keywords in the word bag of each of the topics;
[0013] Selecting a value range from 1 / 2 of the maximum probability value to the maximum probability value as the preset probability distribution range;
[0014] Selecting keywords within a preset probability distribution range from the word bag of each topic to form a reduced word bag; and
[0015] The keyword corresponding to the maximum probability value of 1 / 2 in the reduced word bag is taken as the target keyword, and the time interval range of the reduced word bag is determined according to the time interval of the target keyword.
[0016] Preferably, the probability distribution of the keywords in each of the topics is a normal distribution, the number of target keywords with a probability value of 1 / 2 and a maximum probability value in the word bag of each topic is two, and the time period between the time intervals corresponding to the two target keywords in the word bag of each topic is determined as the time interval range of the reduced word bag.
[0017] Preferably, obtaining the news event text content includes:
[0018] The news event text content is obtained from the database of the backend server.
[0019] A second aspect of the present application provides a device for automatically generating a news event theme, the device comprising:
[0020] The acquisition module is used to obtain the text content of news events;
[0021] A topic analysis module, used to analyze the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords;
[0022] A selection module, configured to select keywords within a preset probability distribution range from the word bag of each subject to form a reduced word bag, and determine a time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each subject; and
[0023] The search module is used to perform similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each topic, and use the title of the news article as the topic of the news event text content.
[0024] Preferably, the topic analysis module is also used for:
[0025] The number of topics in the topic model is set, the text content of the news event is imported into the topic model, and the topics of the set number of topics, the probability distribution of the keywords in each topic and the time interval distribution are obtained through Topic over time algorithm analysis.
[0026] Preferably, the selection module is also used for:
[0027] Obtaining the maximum probability value of the keywords in the word bag of each of the topics;
[0028] Selecting a value range from 1 / 2 of the maximum probability value to the maximum probability value as the preset probability distribution range;
[0029] Selecting keywords within a preset probability distribution range from the word bag of each topic to form a reduced word bag; and
[0030] The keyword corresponding to the maximum probability value of 1 / 2 in the reduced word bag is taken as the target keyword, and the time interval range of the reduced word bag is determined according to the time interval of the target keyword.
[0031] Preferably, the probability distribution of the keywords in each of the topics is a normal distribution, the number of target keywords with a probability value of 1 / 2 and a maximum probability value in the word bag of each topic is two, and the selection module is further used for:
[0032] The time period between the time intervals corresponding to the two target keywords in the word bag of each topic is determined as the time interval range of the reduced word bag.
[0033] A third aspect of the present application provides an electronic device, comprising a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the above-mentioned method for automatically generating news event topics.
[0034] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for automatically generating news event topics.
[0035] The present invention analyzes the news event text content through a topic model to obtain multiple topics, performs similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each of the topics, and uses the title of the news article as the topic of the news event text content, thereby realizing automatic generation of the topic of the news event text content, improving the efficiency of topic generation of the news event text content, and meeting the requirements of topic readability. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 The present invention is a flowchart of a method for automatically generating news event topics in one embodiment of the present invention.
[0037] Figure 2 It is a structural diagram of a device for automatically generating news event topics in one embodiment of the present invention.
[0038] Figure 3 FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0042] Preferably, the method for automatically generating news event topics of the present invention is applied in one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0043] The electronic device may be a computing device such as a desktop computer, a laptop computer, a tablet computer, a cloud server, etc. The device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0044] Example 1
[0045] Figure 1 This is a flow chart of a method for automatically generating news event topics in one embodiment of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0046] See also Figure 1 As shown, the method for automatically generating news event topics specifically includes the following steps.
[0047] Step S11, obtaining the text content of the news event.
[0048] In this embodiment, the method is applied in an electronic device 1. The electronic device 1 obtains the news event text content from a database of a background server. In one embodiment, the electronic device 1 obtains the news event text content from the Internet. In one embodiment, the news event text content is obtained by searching and filtering through a target search term from a database or from the Internet.
[0049] Step S12, analyzing the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag consisting of multiple keywords.
[0050] In this embodiment, the analysis of the news event text content through the topic model to obtain multiple topics, the probability distribution of keywords in each topic and the time interval distribution includes: setting the number of topics of the topic model; importing the news event text content into the topic model, and analyzing the topics of the set number of topics, the probability distribution of keywords in each topic and the time interval distribution through the Topic over time algorithm. In this embodiment, the topic model includes a latent Dirichlet distribution topic model.
[0051] Step S13, respectively selecting keywords within a preset probability distribution range from the word bag of each subject to form a reduced word bag, and determining the time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each subject.
[0052] In this embodiment, selecting keywords within a preset probability distribution range from the word bag of each of the topics to form a reduced word bag, and determining the time interval range of the reduced word bag according to the keywords of the reduced word bag includes: obtaining the maximum probability value of the keywords in the word bag of each of the topics; selecting a value range from 1 / 2 of the maximum probability value to the maximum probability value as the preset probability distribution range; selecting keywords within a preset probability distribution range from the word bag of each of the topics to form a reduced word bag; using the keywords corresponding to the probability value of 1 / 2 of the maximum probability value in the reduced word bag as target keywords, and determining the time interval range of the reduced word bag according to the time interval of the target keywords. In one embodiment, the probability distribution of the keywords in each of the topics is a normal distribution, the number of target keywords with a probability value of 1 / 2 of the maximum probability value in the word bag of each of the topics is two, and the time period between the time intervals corresponding to the two target keywords in the word bag of each of the topics is determined as the time interval range of the reduced word bag.
[0053] Step S14, performing similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each topic, and taking the title of the news article as the topic of the news event text content.
[0054] The present invention analyzes the news event text content through a topic model to obtain multiple topics, performs similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each of the topics, and uses the title of the news article as the topic of the news event text content, thereby realizing automatic generation of the topic of the news event text content, improving the efficiency of topic generation of the news event text content, and meeting the requirements of topic readability.
[0055] Example 2
[0056] Figure 2 1 is a structural diagram of a news event topic automatic generation device 20 in one embodiment of the present invention.
[0057] In some embodiments, the news event theme automatic generation device 20 runs in the electronic device 1. The news event theme automatic generation device 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the news event theme automatic generation device 20 may be stored in a memory and executed by at least one processor to perform the function of automatically generating news event themes.
[0058] In this embodiment, the news event topic automatic generation device 20 can be divided into multiple functional modules according to the functions it performs. Figure 2 As shown, the news event theme automatic generation device 20 may include an acquisition module 201, a theme analysis module 202, a selection module 203, and a search module 204. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In some embodiments, the functions of each module will be described in detail in subsequent embodiments.
[0059] The acquisition module 201 acquires the text content of the news event.
[0060] In this embodiment, the acquisition module 201 acquires the news event text content from the database of the backend server. In one embodiment, the acquisition module 201 acquires the news event text content from the Internet. In one embodiment, the news event text content is obtained by searching and screening from a database or from the Internet through a target search term.
[0061] The topic analysis module 202 analyzes the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag consisting of multiple keywords.
[0062] In this embodiment, the topic analysis module 202 sets the number of topics of the topic model; imports the text content of the news event into the topic model, and obtains the topics of the set number of topics, the probability distribution of keywords in each topic, and the time interval distribution through the Topic over time algorithm. In this embodiment, the topic model includes a latent Dirichlet distribution topic model.
[0063] The selection module 203 selects keywords within a preset probability distribution range from the word bag of each topic to form a reduced word bag, and determines the time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each topic.
[0064] In this embodiment, the selection module 203 obtains the maximum probability value of the keywords in the word bag of each of the topics; selects 1 / 2 of the maximum probability value and the maximum probability value as the preset probability distribution range; selects keywords within the preset probability distribution range from the word bag of each of the topics to form a reduced word bag; uses the keyword corresponding to the probability value of 1 / 2 of the maximum probability value in the reduced word bag as the target keyword, and determines the time interval range of the reduced word bag according to the time interval of the target keyword. In one embodiment, the probability distribution of the keywords in each of the topics is a normal distribution, the number of target keywords with a probability value of 1 / 2 of the maximum probability value in the word bag of each of the topics is two, and the time period between the time intervals corresponding to the two target keywords in the word bag of each of the topics is determined as the time interval range of the reduced word bag.
[0065] The search module 204 performs similarity calculation on the text in the database according to the reduced word bag of each topic and the time range of the reduced word bag to obtain news articles corresponding to each topic, and uses the title of the news article as the topic of the news event text content.
[0066] The present invention analyzes the news event text content through a topic model to obtain multiple topics, performs similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each of the topics, and uses the title of the news article as the topic of the news event text content, thereby realizing automatic generation of the topic of the news event text content, improving the efficiency of topic generation of the news event text content, and meeting the requirements of topic readability.
[0067] Example 3
[0068] Figure 3 FIG. 1 is a schematic diagram of an electronic device 1 according to an embodiment of the present invention.
[0069] The electronic device 1 includes a memory 101, a processor 102, and a computer program 103 stored in the memory 101 and executable on the processor 102. When the processor 102 executes the computer program 103, the steps in the above-mentioned method for automatically generating news event topics are implemented, for example: Figure 1Alternatively, when the processor 102 executes the computer program 103, the functions of each module / unit in the above-mentioned news event topic automatic generation device embodiment are realized, for example Figure 2 Modules 201 to 204 in.
[0070] Exemplarily, the computer program 103 may be divided into one or more modules / units, which are stored in the memory 101 and executed by the processor 102 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 103 in the electronic device 1. For example, the computer program 103 may be divided into Figure 2 The acquisition module 201, the topic analysis module 202, the selection module 203, and the search module 204, the specific functions of each module refer to Example 2.
[0071] In this embodiment, the electronic device 1 may be a computing device such as a desktop computer, a notebook, a PDA, a cloud terminal device, etc. Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 1 and does not limit the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.
[0072] The processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 102 may also be any conventional processor, etc. The processor 102 is the control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1.
[0073] The memory 101 can be used to store the computer program 103 and / or modules / units. The processor 102 implements various functions of the electronic device 1 by running or executing the computer program and / or modules / units stored in the memory 101 and calling the data stored in the memory 101. The memory 101 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 1 (such as audio data, a phone book, etc.), etc. In addition, the memory 101 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0074] If the module / unit integrated in the electronic device 1 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0075] In the several embodiments provided by the present invention, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the electronic device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0076] In addition, the functional modules in the various embodiments of the present invention may be integrated into the same processing module, or each module may exist physically separately, or two or more modules may be integrated into the same module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0077] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or electronic devices stated in the electronic device claim can also be implemented by the same module or electronic device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for automatically generating news event topics, characterized in that: The method comprises: Get the text content of news events; Analyze the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords; Select keywords within a preset probability distribution range from the word bag of each of the topics to form a reduced word bag, and determine the time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each topic, including: obtaining the maximum probability value of the keywords in the word bag of each topic; selecting a value range from 1 / 2 of the maximum probability value to the maximum probability value as the preset probability distribution range; selecting keywords within a preset probability distribution range from the word bag of each topic to form a reduced word bag; and taking the keyword corresponding to the probability value of 1 / 2 of the maximum probability value in the reduced word bag as the target keyword, and determining the time interval range of the reduced word bag according to the time interval of the target keyword; and A similarity operation is performed on the text in the database according to the reduced word bag of each of the topics and the time interval range of the reduced word bag to obtain a news article corresponding to each of the topics, and the title of the news article is used as the topic of the news event text content.
2. The method for automatically generating news event topics as claimed in claim 1, characterized in that: The news event text content is analyzed by the topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords including: The number of topics in the topic model is set, the text content of the news event is imported into the topic model, and the topics of the set number of topics, the probability distribution of the keywords in each topic and the time interval distribution are obtained through Topic over time algorithm analysis.
3. The method for automatically generating news event topics as claimed in claim 1, characterized in that: The probability distribution of the keywords in each of the topics is a normal distribution. The number of target keywords with a probability value of 1 / 2 and a maximum probability value in the word bag of each topic is two. The time period between the time intervals corresponding to the two target keywords in the word bag of each topic is determined as the time interval range of the reduced word bag.
4. The method for automatically generating news event topics as claimed in claim 1, characterized in that: The obtaining of news event text content includes: The news event text content is obtained from the database of the backend server.
5. A device for automatically generating news event topics, characterized in that: The news event theme automatic generation device comprises: The acquisition module is used to obtain the text content of news events; A topic analysis module, used to analyze the news event text content through a topic model to obtain multiple topics, probability distribution and time interval distribution of keywords in each topic, wherein each topic includes a word bag composed of multiple keywords; A selection module is used to select keywords within a preset probability distribution range from the word bag of each of the topics to form a reduced word bag, and determine the time interval range of the reduced word bag according to the time interval of the keywords in the reduced word bag of each topic, including: obtaining the maximum probability value of the keywords in the word bag of each topic; selecting a value range from 1 / 2 of the maximum probability value to the maximum probability value as the preset probability distribution range; selecting keywords within the preset probability distribution range from the word bag of each topic to form a reduced word bag; and taking the keyword corresponding to the probability value of 1 / 2 of the maximum probability value in the reduced word bag as the target keyword, and determining the time interval range of the reduced word bag according to the time interval of the target keyword; and The search module is used to perform similarity calculation on the text in the database according to the reduced word bag of each topic and the time interval range of the reduced word bag to obtain news articles corresponding to each topic, and use the title of the news article as the topic of the news event text content.
6. The apparatus for automatically generating news event topics as claimed in claim 5, characterized in that: The topic analysis module is also used to: The number of topics in the topic model is set, the text content of the news event is imported into the topic model, and the topics of the set number of topics, the probability distribution of the keywords in each topic and the time interval distribution are obtained through Topic over time algorithm analysis.
7. An electronic device, characterized in that: The electronic device includes a processor and a memory, and the processor is used to execute a computer program stored in the memory to implement the method for automatically generating news event topics as described in any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for automatically generating news event topics as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Keyword extraction method and device, electronic equipment and medium
CN110852100A