Text analysis method, device, storage medium and electronic device
By constructing a target entity network and clustering algorithm, determining the time window and core knowledge population, and conducting evolutionary analysis based on an ecological perspective, it solves the problem of low efficiency in obtaining information on text development and changes in massive information, and achieves efficient knowledge extraction and analysis. .
Patent Information
- Application Number
- CN202210244264.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-03-11
AI Technical Summary
Existing technology is difficult to efficiently obtain text development and change information in a short period of time, and lacks effective analysis methods when faced with massive amounts of information.
By obtaining the text data set to be analyzed and publication time, we extract knowledge entities, build a target entity network, use clustering algorithms to determine the time window and core knowledge populations, and conduct evolutionary analysis based on an ecological perspective. We apply biological evolution theory to core knowledge populations. Analyze the units.
It achieves efficient acquisition of text development and change information in a short period of time, establishes a target entity network based on text structure, uses core knowledge populations to perform evolutionary analysis, and improves the efficiency and accuracy of knowledge extraction.
Smart Images

Figure CN114741522B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a text analysis method, device, storage medium and electronic device. Background Art
[0002] A piece of text may contain a large amount of knowledge and information, which is an important and common data format. Using computer algorithms to extract and mine the key points of text data can help us obtain a large amount of refined knowledge entity data in a short time. The evolution analysis of knowledge entities in the time dimension can help us quickly capture key information, improve the efficiency and quality of text reading, and grasp the trend and progress of knowledge development. However, with the continuous development of information technology, a large amount of information resources continue to emerge, from scientific and technological literature, books to news, blogs, web pages, etc. Faced with massive amounts of information, it is urgent to propose a method to efficiently obtain information on text development and changes in a short time. Summary of the invention
[0003] In view of this, the embodiments of the present invention provide a text analysis method, device, storage medium and electronic device to solve the technical problem in the prior art of facing massive information and lacking the ability to efficiently obtain text development and change information in a short time.
[0004] The technical solution proposed by the present invention is as follows:
[0005] A first aspect of an embodiment of the present invention provides a text analysis method, which includes: obtaining a text data set to be analyzed and the publication time of each text to be analyzed in the text data set to be analyzed; extracting corresponding knowledge entities from each text to be analyzed; constructing a target entity network based on the knowledge entities contained in the text data set to be analyzed and the relationships between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong; clustering the knowledge entities contained in the target entity network according to a preset clustering algorithm based on the publication time of the text to be analyzed to which the knowledge entities belong; determining a time window for text analysis according to the clustering result and determining a core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; and performing evolution analysis on the core knowledge populations corresponding to any two adjacent time windows according to a target calculation method.
[0006] Optionally, extracting corresponding knowledge entities from each of the texts to be analyzed includes: constructing a sliding window in each of the texts to be analyzed according to a preset window size and calculating the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed; calculating the discrimination of the knowledge entity based on the text data set to be analyzed and the text to be analyzed containing the knowledge entity; and extracting corresponding knowledge entities from each of the texts to be analyzed according to the importance and the discrimination.
[0007] Optionally, determining the time window of text analysis according to the clustering result and determining the core knowledge population corresponding to each time window includes: determining the core knowledge population corresponding to each time window according to the GN algorithm
[0008] Optionally, performing evolution analysis on the core knowledge populations corresponding to any two adjacent time windows according to the target calculation method includes: calculating the influence value of the evolution analysis on the core knowledge populations between adjacent time windows according to the following formula:
[0009]
[0010]
[0011] Where E represents the influence of the knowledge entity itself on the evolution analysis of the core knowledge population between adjacent time windows; M represents the influence of the changes in the core knowledge population between adjacent time windows and the relationship between knowledge entities on the evolution analysis of the core knowledge population between adjacent time windows; ΔS represents the total number of changes in the knowledge entities contained in the core knowledge population between adjacent time windows; ΔWS represents the number of changes in the importance of the knowledge entities contained in the core knowledge population between adjacent time windows; Δidf i represents the change in the discrimination of knowledge entities contained in the core knowledge population between adjacent time windows; ΔC represents the change in the clustering coefficient of the core knowledge population between adjacent time windows; ΔL represents the change in the relationship between knowledge entities between adjacent time windows;
[0012] When ΔS>0 and ΔL>0 and E>0 and ΔM′>0, it is determined that the core knowledge population between adjacent time windows is a genetic knowledge population; when ΔS>0 and ΔL>0 and E<0 and ΔM′<0, it is determined that the core knowledge population between adjacent time windows is in the early stage of transformation; when ΔS>0 and ΔL>0 and E<0 and ΔM′>0, it is determined that there is a knowledge mutation cluster in the core knowledge population between adjacent time windows and it is in the mutation challenge period; when ΔS<0 and ΔL<0 and E<0 and ΔM′>0, it is determined that the core knowledge population between adjacent time windows is in the extinction period.
[0013] Optionally, the method also includes: determining a core knowledge entity that meets the conditions in each time window according to the importance and discrimination of the knowledge entity; calculating the coreness of the core knowledge entity; calculating the average importance and average discrimination of knowledge entities adjacent to the core knowledge entity; and visualizing the coreness, the importance and discrimination, and the average importance and average discrimination corresponding to the core knowledge entity.
[0014] A second aspect of an embodiment of the present invention provides a text analysis device, which includes: an acquisition module, used to acquire a text data set to be analyzed and the publication time of each text to be analyzed in the text data set to be analyzed; an extraction module, used to extract corresponding knowledge entities in each text to be analyzed; a construction module, used to construct a target entity network based on the knowledge entities contained in the text data set to be analyzed and the relationship between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong; a clustering module, used to cluster the knowledge entities contained in the target entity network according to a preset clustering algorithm based on the publication time of the text to be analyzed to which the knowledge entities belong; a determination module, used to determine the time window of text analysis according to the clustering result and determine the core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; and an analysis module, used to perform evolution analysis on the core knowledge populations corresponding to any two adjacent time windows according to a target calculation method.
[0015] Optionally, the device also includes: a first calculation module, used to construct a sliding window according to a preset window size in each text to be analyzed and calculate the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed; a second calculation module, used to calculate the discrimination of the knowledge entity based on the text data set to be analyzed and the text to be analyzed containing the knowledge entity; a first extraction module, used to extract the corresponding knowledge entity in each text to be analyzed according to the importance and the discrimination.
[0016] Optionally, the device further includes: a first determination module, configured to determine a core knowledge population corresponding to each time window according to a GN algorithm.
[0017] A third aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the text analysis method as described in the first aspect of the embodiment of the present invention and any one of the first aspects.
[0018] A fourth aspect of an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the text analysis method as described in the first aspect of the embodiment of the present invention and any one of the first aspects.
[0019] The technical solution provided by the present invention has the following effects:
[0020] The text analysis method provided by the embodiment of the present invention obtains a text data set to be analyzed and the publication time of each text to be analyzed in the text data set to be analyzed; extracts corresponding knowledge entities from each text to be analyzed; constructs a target entity network according to the knowledge entities contained in the text data set to be analyzed and the relationship between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong; clusters the knowledge entities contained in the target entity network according to a preset clustering algorithm based on the publication time of the text to be analyzed to which the knowledge entities belong; determines the time window of text analysis according to the clustering result and determines the core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; and performs evolution analysis on the core knowledge population corresponding to any two adjacent time windows according to the target calculation method. The method establishes a target entity network based on text structure, and performs evolution analysis based on the core knowledge population as the analysis unit from an ecological perspective, applies biological evolution theory to the knowledge extraction algorithm, and realizes the efficient acquisition of text development and change information in a short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a flowchart of a text analysis method according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of the result of text analysis provided according to an embodiment of the present invention;
[0024] Figure 3 is a structural block diagram of a text analysis device according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of the structure of a computer-readable storage medium provided according to an embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] The embodiment of the present invention provides a text analysis method, such as Figure 1 As shown, the method comprises the following steps:
[0029] Step S101: Obtain the text data set to be analyzed and the publication time of each text to be analyzed in the text data set to be analyzed. Specifically, a text may contain a large amount of knowledge and information, which is an important and common data format. According to the obtained publication time of the text, the user can quickly capture the key information in the text among a large amount of knowledge and information, and grasp the development trend of knowledge information in the text more quickly.
[0030] In one embodiment, the Internet text data is usually obtained, which is a forum post on a certain topic, a speech draft of a certain theme or a certain class, or a blog content on a certain theme, etc. Among them, each document can correspond to a publication date in the form of "year-month-day" and content.
[0031] Step S102: extracting corresponding knowledge entities from each of the texts to be analyzed. Specifically, capturing key information, namely, knowledge entities, from each of the texts to be analyzed. The key information may be pre-specified by the user.
[0032] Step S103: construct a target entity network based on the knowledge entities contained in the text data set to be analyzed and the relationships between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong. Specifically, the relationships between knowledge entities can be divided into two types: hierarchical relationships and co-occurrence relationships. In the method provided by the present invention, in order to establish a directed graph (target entity network) based on knowledge entities and the relationships between knowledge entities, only the hierarchical relationships between knowledge entities can be considered.
[0033] First calculate the following formula:
[0034]
[0035] Among them, P(V1|V2) represents the probability of knowledge entity V1 appearing in the text where knowledge entity V2 appears; N(V1V2) represents the number of texts where knowledge entity V1 and knowledge entity V2 appear at the same time; N(V2) represents the number of texts where knowledge entity V2 appears.
[0036] When P(V1|V2)≥0.8, it indicates that the knowledge entity V1 and the knowledge entity V2 have a hierarchical relationship.
[0037] Then the refinement degree of knowledge entity V is calculated according to the following formula:
[0038]
[0039] In the formula, N(V) represents the refinement value; N represents the total number of entities in the entity library;
[0040] Among them, when the knowledge entity V and any entity in the entity library satisfy P(V0|V)≥0.8, N(V) increases by 1; the entity library is constructed according to the knowledge entities contained in the text data set to be analyzed.
[0041] When R v1 <R v2 , it means that knowledge entity V1 is the superordinate entity of knowledge entity V2; when R v1 >R v2 , it means that knowledge entity V1 is a subordinate entity of knowledge entity V2; other cases indicate that knowledge entity V1 and knowledge entity V2 have a level relationship.
[0042] Finally, according to the hierarchical relationship between knowledge entities, a directed graph of knowledge entities (target entity network) is established with knowledge entities as nodes (the attribute information of the knowledge entity includes the publication time of the text to be analyzed to which the knowledge entity belongs) and the relationship between knowledge entities as edges, with arrows pointing from the superordinate entity to the subordinate entity. Specifically, the target entity network can be constructed using Gephi software.
[0043] Step S104: clustering the knowledge entities contained in the target entity network based on the publication time of the text to be analyzed to which the knowledge entity belongs according to a preset clustering algorithm, specifically, using K-means clustering based on the time dimension.
[0044] First, we perform cluster analysis on the knowledge entities contained in the text to be analyzed within the target number of days. Specifically, we use the SVD dimension reduction technique to extract the feature vectors in the daily entity network graph, denoted as U kThen, the knowledge entities in the target entity network are calculated, and finally the knowledge entities contained in the target entity network are clustered using K-means clustering. The daily entity network diagram represents the target entity network constructed based on the knowledge entities contained in the text data set to be analyzed within the target days and the relationships between the knowledge entities; the SVD dimensionality reduction technology is used to solve the difficulties of data sample sparsity and distance calculation in high-dimensional data situations, and can remove redundant features in the target entity network.
[0045] In one embodiment, a daily entity network graph N is constructed based on the acquired Internet text data in units of "days". x , and calculate the Euclidean distance between the Nth day and the N+1th day, and then cluster the daily entity network graph N based on the K-means clustering method. x The knowledge entities contained in the cluster are clustered, and after clustering, forum posts containing the same or similar topics, speeches or blog contents containing the same or similar topics, etc. can be obtained.
[0046] Step S105: Determine the time window of text analysis based on the clustering results and determine the core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities. Specifically, the time windows T1, T2, ..., T K , the multiple knowledge entities contained in each time window are the knowledge entities after clustering, and the multiple knowledge entities constitute the core knowledge population corresponding to each time window.
[0047] In one embodiment, after clustering, forum posts on the same or similar topics within 5 consecutive days can be obtained, and the 5 days can be used as a time window; or similar text data in different time periods (such as the 2nd day and the 5th day) can be divided into one time window.
[0048] Step S106: Perform evolutionary analysis on the core knowledge populations corresponding to any two adjacent time windows according to the target calculation method. Specifically, based on the target calculation method, the core knowledge populations between adjacent time windows can be analyzed for evolution by calculating the core knowledge populations corresponding to any two adjacent time windows. The target calculation method can be any algorithm that can identify the differences or similarities of the core knowledge populations between adjacent time windows, such as a machine learning model, etc. The evolutionary analysis results are determined by identifying the differences between the core knowledge populations in adjacent time windows. The greater the difference, the greater the possibility that the knowledge population is in a transition or mutation period.
[0049] The text analysis method provided by the embodiment of the present invention establishes a target entity network based on the text structure, performs evolutionary analysis based on the core knowledge population as the analysis unit from an ecological perspective, applies the biological evolution theory to the knowledge extraction algorithm, and realizes the efficient acquisition of text development and change information in a short time.
[0050] As an optional implementation of an embodiment of the present invention, step S102 includes: constructing a sliding window according to a preset window size in each text to be analyzed and calculating the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed; calculating the discrimination of the knowledge entity based on the text data set to be analyzed and the text to be analyzed containing the knowledge entity; extracting the corresponding knowledge entity in each text to be analyzed according to the importance and the discrimination.
[0051] First, select a pane with a window size of 20 (set according to actual computing requirements) in the text to be analyzed to build a sliding window W K , and then calculate the knowledge entity weight to assign its importance. Specifically, first use Word2Vec in natural language processing to calculate the word vector of each keyword (knowledge entity), and then calculate the window W K The number of predecessor entities (predecessor nodes of knowledge entity V in the target entity network) and the number of successor entities (successor nodes of knowledge entity V in the target entity network), as well as the distance between word vectors of knowledge entities, are taken into account. Finally, the following formula is used to iteratively calculate the weight of each node (knowledge entity) in the target entity network until convergence:
[0052]
[0053] Among them, WS(V i ) represents the weight or importance of the knowledge entity; In(V i ) represents the number of predecessor entities; Out(V j ) represents the number of successor entities; D represents the distance between word vectors; d represents the damping coefficient, which ranges from 0 to 1 and represents the probability of pointing from a specific node to any other node, and is generally taken as 0.85.
[0054] Then the discrimination of the corresponding knowledge entity is calculated. Specifically, it is calculated by the following formula:
[0055]
[0056] Among them, idf i The measure of the general importance of knowledge entity i is used to characterize the distinguishing ability of knowledge entities, i.e., the degree of discrimination; |D| represents the total number of texts to be analyzed in the text dataset to be analyzed; |{j:t i ∈d j}| represents the number of texts to be analyzed that contain knowledge entity i.
[0057] Finally, the calculated importance and discrimination of the knowledge entity are used to extract the corresponding knowledge entity in each text to be analyzed. Specifically, knowledge entities whose importance and discrimination indexes are in the top 80% (set according to actual needs) can be extracted in each text to be analyzed.
[0058] As an optional implementation of the embodiment of the present invention, step S105 includes: determining the core knowledge population corresponding to each time window according to the GN algorithm. Specifically, in a complex network, the betweenness of an edge is the number of shortest paths passing through the edge. Intuitively, the edges between networks have a higher betweenness, while the betweenness of the edges within the network is relatively small. When using the GN algorithm to calculate the core knowledge population corresponding to each time window, first calculate the betweenness of each edge, then remove the edge with the highest betweenness based on the calculation result, and finally determine whether a partition result greater than 1 appears. If so, end the extraction and obtain the core knowledge population corresponding to the time window; if not, recalculate the betweenness of each edge and remove the edge with the highest betweenness based on the calculation result until a partition result greater than 1 appears. The partition result greater than 1 is used as the core knowledge population.
[0059] As an optional implementation of the embodiment of the present invention, when performing evolutionary analysis on the core knowledge populations corresponding to any two adjacent time windows according to the target calculation method, the influence value of the evolutionary analysis on the core knowledge populations between the adjacent time windows is first calculated according to the following formula:
[0060]
[0061]
[0062] Where E represents the influence of the knowledge entity itself on the evolution analysis of the core knowledge population between adjacent time windows; M represents the influence of the changes in the core knowledge population between adjacent time windows and the relationship between knowledge entities on the evolution analysis of the core knowledge population between adjacent time windows; ΔS represents the total number of changes in the knowledge entities contained in the core knowledge population between adjacent time windows; ΔWS represents the number of changes in the importance of the knowledge entities contained in the core knowledge population between adjacent time windows; Δidf i represents the change in the discrimination of knowledge entities contained in the core knowledge population between adjacent time windows; ΔC represents the change in the clustering coefficient of the core knowledge population between adjacent time windows; ΔL represents the change in the relationship between knowledge entities between adjacent time windows;
[0063] Specifically, in the evolution of knowledge entities reflected in different time windows, a series of relationships can be defined through the changes in knowledge entities (nodes) and edges. The basic situation is shown in Table 1 below.
[0064] Table 1
[0065] Serial number entity side Explanation of the situation 1 constant New Knowledge population development period 2 constant disappear Knowledge population decline 3 constant Change direction - 4 Increase New Knowledge population development period 5 Increase disappear Knowledge population transition period 6 Increase Change direction - 7 reduce New Knowledge population upgrade period 8 reduce disappear Knowledge population decline 9 reduce Change direction -
[0066] When more edges have "changed direction", it means that the knowledge population is not stable, but is in a changing and more chaotic stage. The characteristics are not restricted, so it is not considered.
[0067] Then the adjacent window T k and T k+1 The core population of , calculate:
[0068] Step 1: Calculate the total number of changes of the entity ΔS;
[0069] Step 2: Calculate the change ΔL of the edge;
[0070] Step 3: Calculate the entity importance change ΔWS and the discrimination change Δidf i ;
[0071] Step 4: Calculate the change value of the core population clustering coefficient ΔC;
[0072] Step 4: Substitute the following equation to calculate the impact value of the evolution analysis of the core knowledge population between adjacent time windows:
[0073]
[0074]
[0075] Among them, the influence value E is calculated based on the number of changes in entity importance, the number of changes in discrimination, and the total number of changes in the entity. The number of changes in entity importance and discrimination can be used to determine whether the knowledge population is stable. The total number of changes in the entity can be used to determine the increase or decrease of the knowledge entities contained in the knowledge population. The two determination results can be used to more accurately analyze the evolution of the knowledge population.
[0076] The influence value M is calculated based on the changes in edges and the changes in the clustering coefficient of the population. The changes in these two indicators can be used to determine the degree of clustering of the knowledge population in the time window. The higher the degree, the more knowledge populations there are and the better the development. Otherwise, the development will be worse and the population may quickly die out.
[0077] Therefore, based on the analysis results, the calculation results are used to perform an evolution analysis on the core knowledge population between adjacent time windows.
[0078] Specifically, when ΔS>0 and ΔL>0:
[0079] If E>0 and ΔM′>0, it means that the knowledge population is in a good development period: the core theme is prominent, and the knowledge entities related to the core theme are increasing, which is a hereditary knowledge population;
[0080] If E<0 and ΔM′<0, it means that the knowledge population is in a transition period. The knowledge entities increase but the differentiation decreases, or the differentiation increases but the importance of knowledge entities decreases. This means that there are internal unstable factors in this knowledge population and it is in the early stage of transformation.
[0081] If E<0 and ΔM′>0, it means that there may be a knowledge mutation cluster in the knowledge population. The new mutation challenges the position of the core knowledge population and has the possibility of replacing it. Therefore, the knowledge population is in the mutation challenge period.
[0082] When ΔS<0 and ΔL<0:
[0083] If E<0 and ΔM′>0, it means that the internal entity activity of the knowledge population is insufficient and it is in a period of rapid extinction.
[0084] As an optional implementation of the embodiment of the present invention, the method also includes: determining a core knowledge entity that meets the conditions in each time window based on the importance and discrimination of the knowledge entity; calculating the coreness of the core knowledge entity; calculating the average importance and average discrimination of knowledge entities adjacent to the core knowledge entity; and visualizing the coreness, the importance and discrimination, and the average importance and average discrimination corresponding to the core knowledge entity.
[0085] Core knowledge entities represent knowledge entities with high knowledge entity importance and high knowledge entity distinction. These core knowledge entities represent the core of the text. The study of the evolution trend of knowledge entities can quickly grasp the core trend. Therefore, after the evolution analysis of the core knowledge population between adjacent time windows, the text to be analyzed can be further analyzed based on the core knowledge entity.
[0086] Specifically, we first screen the WS and idf in the core knowledge population corresponding to each time window. i One knowledge entity whose indicators are in the top 10% is regarded as the core knowledge entity.
[0087] Then calculate the coreness of the core knowledge entity in the core knowledge population. Specifically, calculate the out-degree O and in-degree I of the core knowledge entity in the core knowledge population. The ratio R=I / O of the out-degree O and in-degree I is the coreness of the core knowledge entity in the core knowledge population. Among them, the out-degree O represents the number of edges pointing to the core knowledge entity in the target entity network graph, that is, the number of upper-level knowledge entities corresponding to the core knowledge entity; the in-degree I represents the number of edges emitted from the core knowledge entity in the target entity network graph, that is, the number of lower-level knowledge entities corresponding to the core knowledge entity.
[0088] When the core knowledge population is dying out or merging with other populations, the core knowledge entities of the new population are re-screened and the corresponding coreness is calculated according to the above process.
[0089] Secondly, calculate the average importance WS of the knowledge entities of the adjacent nodes (adjacent knowledge entities) of the core knowledge entity k and average discrimination idf k .
[0090] Finally, the core, importance and discrimination, and average importance and discrimination of the core knowledge entity are visualized. Specifically, the core, importance and discrimination of the core knowledge entity at different development stages of the core knowledge population are calculated, and then these indicators are directly input into a graphic database (such as neo4j) to obtain the corresponding visualization result diagram, as shown in the figure below: Figure 2 shown.
[0091] The embodiment of the present invention also provides a text analysis device, such as Figure 3 As shown, the device comprises:
[0092] The acquisition module 301 is used to acquire a text data set to be analyzed and the publishing time of each text to be analyzed in the text data set to be analyzed; for details, please refer to the relevant description of step S101 in the above method embodiment.
[0093] The extraction module 302 is used to extract the corresponding knowledge entity from each of the texts to be analyzed; for details, please refer to the relevant description of step S102 in the above method embodiment.
[0094] Construction module 303 is used to construct a target entity network based on the knowledge entities contained in the text data set to be analyzed and the relationships between the knowledge entities. The attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong. For details, please refer to the relevant description of step S103 in the above method embodiment.
[0095] The clustering module 304 is used to cluster the knowledge entities included in the target entity network according to a preset clustering algorithm based on the publication time of the text to be analyzed to which the knowledge entity belongs; for details, please refer to the relevant description of step S104 in the above method embodiment.
[0096] The determination module 305 is used to determine the time window of text analysis according to the clustering results and determine the core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; for details, see the relevant description of step S105 in the above method embodiment.
[0097] The analysis module 306 is used to perform evolution analysis on the core knowledge populations corresponding to any two adjacent time windows according to the target calculation method; for details, please refer to the relevant description of step S106 in the above method embodiment.
[0098] The text analysis device provided in the embodiment of the present invention establishes a target entity network based on the text structure, and performs evolutionary analysis based on the core knowledge population as the analysis unit from an ecological perspective, applies the biological evolution theory to the knowledge extraction algorithm, and realizes the efficient acquisition of text development and change information in a short time.
[0099] As an optional implementation of the embodiment of the present invention, the device also includes: a first calculation module, used to construct a sliding window according to a preset window size in each text to be analyzed and calculate the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed; a second calculation module, used to calculate the discrimination of the knowledge entity based on the text data set to be analyzed and the text to be analyzed containing the knowledge entity; a first extraction module, used to extract the corresponding knowledge entity in each text to be analyzed according to the importance and the discrimination.
[0100] As an optional implementation of the embodiment of the present invention, the device further includes: a first determination module, configured to determine the core knowledge population corresponding to each time window according to the GN algorithm.
[0101] As an optional implementation of the embodiment of the present invention, the device further includes: a third calculation module, which is used to calculate the influence value of the evolution analysis of the core knowledge population between adjacent time windows according to the following formula:
[0102]
[0103]
[0104] Where E represents the influence of the knowledge entity itself on the evolution analysis of the core knowledge population between adjacent time windows; M represents the influence of the changes in the core knowledge population between adjacent time windows and the relationship between knowledge entities on the evolution analysis of the core knowledge population between adjacent time windows; ΔS represents the total number of changes in the knowledge entities contained in the core knowledge population between adjacent time windows; ΔWS represents the number of changes in the importance of the knowledge entities contained in the core knowledge population between adjacent time windows; Δidf i represents the change in the discrimination of knowledge entities contained in the core knowledge population between adjacent time windows; ΔC represents the change in the clustering coefficient of the core knowledge population between adjacent time windows; ΔL represents the change in the relationship between knowledge entities between adjacent time windows;
[0105] The second determination module is used to determine that the core knowledge population between adjacent time windows is a genetic knowledge population when ΔS>0 and ΔL>0 and E>0 and ΔM′>0; the third determination module is used to determine that the core knowledge population between adjacent time windows is in the early stage of transformation when ΔS>0 and ΔL>0 and E<0 and ΔM′<0; the fourth determination module is used to determine that there is a knowledge mutation cluster in the core knowledge population between adjacent time windows and it is in the mutation challenge period when ΔS>0 and ΔL>0 and E<0 and ΔM′>0; the fifth determination module is used to determine that the core knowledge population between adjacent time windows is in the extinction period when ΔS<0 and ΔL<0 and E<0 and ΔM′>0.
[0106] As an optional implementation of the embodiment of the present invention, the device also includes: a sixth determination module, used to determine the core knowledge entity that meets the conditions in each time window according to the importance and discrimination of the knowledge entity; a fourth calculation module, used to calculate the coreness of the core knowledge entity; a fifth calculation module, used to calculate the average importance and average discrimination of knowledge entities adjacent to the core knowledge entity; a visualization processing module, used to visualize the coreness, the importance and discrimination, and the average importance and average discrimination corresponding to the core knowledge entity.
[0107] For a detailed description of the functions of the text analysis device provided in the embodiment of the present invention, please refer to the description of the text analysis method in the above embodiment.
[0108] The embodiment of the present invention also provides a storage medium, such as Figure 4As shown, a computer program 401 is stored thereon, and when the instruction is executed by the processor, the steps of the text analysis method in the above embodiment are implemented. The storage medium also stores audio and video stream data, feature frame data, interaction request signaling, encrypted data, and preset data size, etc. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0109] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0110] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, the electronic device may include a processor 51 and a memory 52, wherein the processor 51 and the memory 52 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0111] The processor 51 may be a central processing unit (CPU). The processor 51 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0112] The memory 52 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the corresponding program instructions / modules in the embodiment of the present invention. The processor 51 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 52, that is, implements the text analysis method in the above method embodiment.
[0113] The memory 52 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device and at least one function; the data storage area may store data created by the processor 51, etc. In addition, the memory 52 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 52 may optionally include a memory remotely arranged relative to the processor 51, and these remote memories may be connected to the processor 51 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] The one or more modules are stored in the memory 52 and when executed by the processor 51, perform the following steps: Figure 1 -2 is the text analysis method in the embodiment shown in FIG.
[0115] For details of the above electronic equipment, please refer to Figure 1 to Figure 2 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0116] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A text analysis method, characterized in that: The steps include: Acquire a text data set to be analyzed and the publication time of each text to be analyzed in the text data set to be analyzed; Extracting corresponding knowledge entities from each of the texts to be analyzed; Constructing a target entity network according to the knowledge entities contained in the text data set to be analyzed and the relationships between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong; Based on the publication time of the text to be analyzed to which the knowledge entity belongs, clustering the knowledge entities included in the target entity network according to a preset clustering algorithm; Determine a time window for text analysis based on clustering results and determine a core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; Perform evolution analysis on the core knowledge population corresponding to any two adjacent time windows according to the target calculation method; Among them, the time window of text analysis is determined according to the clustering results, and the core knowledge population corresponding to each time window is determined, including: Determine the core knowledge population corresponding to each time window according to the GN algorithm; The core knowledge population corresponding to any two adjacent time windows is subjected to evolutionary analysis according to the target calculation method, including: The impact value of the evolution analysis of the core knowledge population between adjacent time windows is calculated according to the following formula: Where E represents the influence of the knowledge entity itself on the evolution analysis of the core knowledge population between adjacent time windows; M represents the influence of the changes in the core knowledge population between adjacent time windows and the relationship between knowledge entities on the evolution analysis of the core knowledge population between adjacent time windows; ΔS represents the total number of changes in the knowledge entities contained in the core knowledge population between adjacent time windows; ΔWS represents the number of changes in the importance of the knowledge entities contained in the core knowledge population between adjacent time windows; Δidf i represents the change in the discrimination of knowledge entities contained in the core knowledge population between adjacent time windows; ΔC represents the change in the clustering coefficient of the core knowledge population between adjacent time windows; ΔL represents the change in the relationship between knowledge entities between adjacent time windows; When ΔS>0 and ΔL>0 and E>0 and ΔM′>0, the core knowledge population between adjacent time windows is determined to be the hereditary knowledge population; When ΔS>0 and ΔL>0 and E<0 and ΔM′<0, it is determined that the core knowledge population between adjacent time windows is in the early stage of transformation; When ΔS>0 and ΔL>0 and E<0 and ΔM′>0, it is determined that there is a knowledge mutation cluster in the core knowledge population between adjacent time windows, and it is in the mutation challenge period; When ΔS<0 and ΔL<0 and E<0 and ΔM′>0, it is determined that the core knowledge population between adjacent time windows is in the extinction period.
2. The method according to claim 1, characterized in that Extracting corresponding knowledge entities from each of the texts to be analyzed includes: In each text to be analyzed, a sliding window is constructed according to a preset window size and the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed is calculated; Calculating the discrimination degree of the knowledge entity according to the text data set to be analyzed and the text to be analyzed containing the knowledge entity; Corresponding knowledge entities are extracted from each of the texts to be analyzed according to the importance and the distinction.
3. The method according to claim 1, characterized in that The method further comprises: Determine a core knowledge entity that meets the conditions in each time window according to the importance and distinction of the knowledge entity; Calculating the coreness of the core knowledge entity; Calculate the average importance and average discrimination of knowledge entities adjacent to the core knowledge entity; The coreness, the importance and the discrimination, and the average importance and the average discrimination corresponding to the core knowledge entity are visualized.
4. A text analysis device, characterized in that: include: An acquisition module, used for acquiring a text data set to be analyzed and a publishing time of each text to be analyzed in the text data set to be analyzed; An extraction module, used for extracting corresponding knowledge entities from each of the texts to be analyzed; A construction module, used to construct a target entity network according to the knowledge entities contained in the text data set to be analyzed and the relationships between the knowledge entities, wherein the attribute information of the knowledge entities in the target entity network includes the publication time of the text to be analyzed to which the knowledge entities belong; A clustering module, used to cluster the knowledge entities contained in the target entity network according to a preset clustering algorithm based on the publication time of the text to be analyzed to which the knowledge entity belongs; A determination module, used to determine a time window for text analysis according to the clustering results and determine a core knowledge population corresponding to each time window, wherein the core knowledge population is composed of multiple knowledge entities; An analysis module is used to perform evolution analysis on the core knowledge population corresponding to any two adjacent time windows according to a target calculation method; Wherein, the device further comprises: The first determination module is used to determine the core knowledge population corresponding to each time window according to the GN algorithm; The device also includes: The third calculation module is used to calculate the impact value of the evolution analysis of the core knowledge population between adjacent time windows according to the following formula: Where E represents the influence of the knowledge entity itself on the evolution analysis of the core knowledge population between adjacent time windows; M represents the influence of the changes in the core knowledge population between adjacent time windows and the relationship between knowledge entities on the evolution analysis of the core knowledge population between adjacent time windows; ΔS represents the total number of changes in the knowledge entities contained in the core knowledge population between adjacent time windows; ΔWS represents the number of changes in the importance of the knowledge entities contained in the core knowledge population between adjacent time windows; Δidf i represents the change in the discrimination of knowledge entities contained in the core knowledge population between adjacent time windows; ΔC represents the change in the clustering coefficient of the core knowledge population between adjacent time windows; ΔL represents the change in the relationship between knowledge entities between adjacent time windows; The second determination module is used to determine that the core knowledge population between adjacent time windows is a hereditary knowledge population when ΔS>0 and ΔL>0 and E>0 and ΔM′>0; The third determination module is used to determine that the core knowledge population between adjacent time windows is in the early stage of transformation when ΔS>0 and ΔL>0 and E<0 and ΔM′<0; The fourth determination module is used when ΔS>0 and ΔL>0 and E<0 and ΔM ′ >0, it is determined that there are knowledge mutation clusters in the core knowledge population between adjacent time windows, and it is in the mutation challenge period; The fifth determination module is used when ΔS<0 and ΔL<0 and E<0 and ΔM ′ >0, it is determined that the core knowledge population between adjacent time windows is in the extinction period.
5. The device according to claim 4, characterized in that The device also includes: A first calculation module is used to construct a sliding window according to a preset window size in each text to be analyzed and calculate the importance of the knowledge entity in any sliding window in the corresponding text to be analyzed; A second calculation module, used for calculating the discrimination degree of the knowledge entity according to the text data set to be analyzed and the text to be analyzed containing the knowledge entity; The first extraction module is used to extract corresponding knowledge entities from each of the texts to be analyzed according to the importance and the distinction.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the text analysis method according to any one of claims 1 to 3.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the text analysis method according to any one of claims 1 to 3 by executing the computer instructions.
