Text analysis method and device
By constructing and expanding directional acyclic graphs and analyzing the character growth trajectory in combination with reading data, the problem of lack of novel adaptation script assistance in the existing technology is solved, and detailed analysis results are provided to improve the quality of script creation.
Patent Information
- Application Number
- CN202210517692.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-05-12
AI Technical Summary
The existing technology lacks auxiliary support for novel adaptation scripts and cannot effectively guide screenwriters to adapt novels into scripts.
By constructing the first directed acyclic map of the growth trajectory of the target role in the first text, and expanding it according to the second text, a second directed acyclic map is generated, and the analysis results of the growth trajectory of the target role are obtained, and combined with reading user behavior data and attribute data, an evaluation index analysis of the character growth trajectory is provided.
It has achieved effective auxiliary support for novel adapted scripts, helping screenwriters optimize their character growth trajectory and providing detailed analysis results to improve the quality of script creation.
Smart Images

Figure CN114936289B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of novel-to-script adaptation, and in particular, relates to a text analysis method and device. Background Art
[0002] The existing technology provides screenwriters with analysis and research on the script itself, such as plot rhythm, conflict rationality, role relationship, and role growth analysis, and provides inspiration assistance for screenwriters to create scripts, such as associating massive story segments. However, the implementation scheme of the existing technology does not provide sufficient auxiliary guidance for screenwriters who want to adapt novels into scripts.
[0003] The existing technology only conducts rational analysis on the growth and destiny of characters, and lacks auxiliary support for the adaptation of novels into scripts. Summary of the invention
[0004] The embodiments of the present application provide a text analysis method and device, which can solve the problem that existing implementation methods lack auxiliary support for novel adaptation scripts.
[0005] In order to solve the above technical problems, the present application embodiment provides a text analysis method, including:
[0006] Acquire a first directed acyclic graph of a growth trajectory of a target character in the first text according to the feature data of the first text;
[0007] According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value;
[0008] According to the second directed acyclic graph, an analysis result of the growth trajectory of the target character is obtained.
[0009] Optionally, the feature data includes: at least one of reading behavior data of a reading user on the first text and attribute data of the first text.
[0010] Optionally, the obtaining of a first directed acyclic graph of the growth trajectory of the target character in the first text includes:
[0011] According to the feature data, a target text block in the first text is acquired, where the target text block is a paragraph or a chapter;
[0012] According to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph;
[0013] The first directed acyclic graph is generated according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks.
[0014] Optionally, acquiring a target text block in the first text according to the feature data includes:
[0015] Obtaining weights of feature data of all text blocks corresponding to the first text;
[0016] According to the weights, selecting a plurality of target text blocks from all text blocks;
[0017] The weight of the target text block is greater than or equal to a second preset value.
[0018] Optionally, generating the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks includes:
[0019] Determining, according to the content of a first target text block in two adjacent target text blocks, an event between nodes corresponding to the two adjacent target text blocks;
[0020] Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes;
[0021] The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
[0022] Optionally, the step of expanding the first directed acyclic graph according to the second text to obtain a second directed acyclic graph includes:
[0023] Obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text;
[0024] Comparing different role states of the first role in the third directed acyclic graph with role states of the target role in the first directed acyclic graph respectively;
[0025] Selecting K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value;
[0026] splicing the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph;
[0027] Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph;
[0028] Wherein, K is an integer greater than or equal to 1.
[0029] Optionally, obtaining an analysis result of the growth trajectory of the target character according to the second directed acyclic graph includes:
[0030] Obtaining a first analysis result of the growth trajectory of the target character in the second directed acyclic graph, wherein the first analysis result includes an analysis result of an evaluation index of a character state included in the growth trajectory;
[0031] According to the first analysis result, an analysis result of the growth trajectory of the target character is determined.
[0032] Optionally, determining the analysis result of the growth trajectory of the target character according to the first analysis result includes:
[0033] The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
[0034] The present application also provides a text analysis device, including:
[0035] A first acquisition module, configured to acquire a first directed acyclic graph of a growth trajectory of a target character in the first text according to feature data of the first text;
[0036] A second acquisition module, configured to expand the first directed acyclic graph according to a second text to acquire a second directed acyclic graph, wherein a correlation between the second text and the first text is greater than or equal to a first preset value;
[0037] The third acquisition module is used to obtain the analysis result of the growth trajectory of the target character according to the second directed acyclic graph.
[0038] The embodiment of the present application also provides a text analysis device, including a transceiver and a processor;
[0039] The processor is used to: obtain a first directed acyclic graph of the growth trajectory of the target character in the first text according to the feature data of the first text;
[0040] According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value;
[0041] According to the second directed acyclic graph, an analysis result of the growth trajectory of the target character is obtained.
[0042] An embodiment of the present application also provides a text analysis device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned text analysis method when executing the program.
[0043] The beneficial effects of this application are:
[0044] The above scheme obtains a first directed acyclic graph of the growth trajectory of the target character in the first text according to the characteristic data of the first text, expands the first directed acyclic graph, and then obtains the analysis result of the growth trajectory in the expanded directed acyclic graph; thereby realizing the analysis of the first text and achieving the purpose of auxiliary support for the novel adaptation script. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of the text analysis method of the embodiment of the present application;
[0046] Figure 2 It is a schematic diagram showing the scores corresponding to the evaluation indicators of each trajectory and the total score of the trajectory;
[0047] Figure 3 It is a detailed flow chart of a specific application of the embodiment of the present application;
[0048] Figure 4 It is a schematic diagram showing the directed acyclic graph of the character's growth trajectory;
[0049] Figure 5 It is a schematic diagram showing the details of the directed acyclic graph after clicking the Expand Details button;
[0050] Figure 6 It is a schematic diagram showing the directed acyclic graph of the expanded character growth trajectory;
[0051] Figure 7 is a module schematic diagram of a text analysis device according to an embodiment of the present application;
[0052] Figure 8 A structural diagram showing a text analysis device according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0055] The text analysis method and device provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0056] like Figure 1 As shown, at least one embodiment of the present application provides a text analysis method, which is applied to a text analysis device, including:
[0057] Step 101: Obtain a first directed acyclic graph of the growth trajectory of a target character in the first text according to feature data of the first text.
[0058] It should be noted that the first text mentioned in the embodiment of the present application, that is, the story or novel that the user wants to analyze, is usually in text form during actual analysis. If the user inputs content in voice or video form, it needs to be converted into text form.
[0059] Optionally, the growth trajectory refers to the state of the target character in the first text at different periods on the timeline, and the state may be the character's emotional experience, work experience, learning experience, etc.
[0060] Step 102: Expand the first directed acyclic graph according to the second text to obtain a second directed acyclic graph.
[0061] It should be noted that the correlation between the second text and the first text is greater than or equal to a first preset value, which can be understood as the second text being a text with a relatively high similarity to the first text; of course, a text that has been read by the reading user of the first text can also be selected as the second text, that is, the second text and the first text have been read by the same user.
[0062] Step 103: Obtain analysis results of the growth trajectory of the target character according to the second directed acyclic graph.
[0063] It should be noted that usually after obtaining the analysis result, the analysis result needs to be displayed so that the user can better view the analysis result.
[0064] In the embodiment of the present application, an expanded directed acyclic graph is used to analyze the growth trajectory contained therein, so as to assist users in understanding and using the text. For example, users can select the growth trajectory of better characters based on the analysis results. The embodiment of the present application can provide auxiliary support for screenwriters in adapting novels into scripts.
[0065] Optionally, in at least one embodiment of the present application, an optional implementation of step 101 includes:
[0066] Step 1011, obtaining information of the first text input by the user.
[0067] It should be noted that the information of the first text may be the name, author, etc. of the first text, or may be a search keyword of the first text.
[0068] Step 1012: Acquire feature data corresponding to the first text according to the information of the first text.
[0069] Typically, the feature data is stored in a database, and the feature data includes at least one of the reading behavior data of the reading user on the first text and the attribute data of the first text.
[0070] Optionally, in at least one embodiment of the present application, the reading behavior data includes but is not limited to at least one of the following:
[0071] A11, reading time of the text block of the first text by the reading user;
[0072] It should be noted that the text block includes at least one of a paragraph and a chapter.
[0073] A12, reading features of the text block of the first text;
[0074] It should be noted that the reading characteristics include but are not limited to: the number of readers.
[0075] Optionally, in at least one embodiment of the present application, the attribute data includes but is not limited to: paragraph information, chapter information, and author information.
[0076] For example, the paragraph information may include but is not limited to: the total number of paragraphs, the number of words in each paragraph, the number of readers of each paragraph, etc.; the chapter information may include but is not limited to: the total number of chapters, the number of words in each chapter, the number of readers of each chapter, etc.; the author information includes but is not limited to: the author's name, age, life experience, etc.
[0077] Normally, the user needs to input the identifier of the text to be analyzed, such as the text name and author, into the analysis client (or the server). Based on the user's input, the client determines whether the feature data of the text (which can also be understood as the relevant feature data of the text) exists in the database. If so, the feature data is directly obtained. If not, a prompt message indicating that the data cannot be obtained can be returned to the user.
[0078] Step 1013: Obtain a first directed acyclic graph of the growth trajectory of the target character in the first text according to the feature data.
[0079] It should be noted that the target character mentioned in at least one embodiment of the present application refers to the main character in the text. Optionally, the user can choose to set up the analysis of several main characters. For example, when the user sets to analyze only one character, a directed acyclic graph of the growth trajectory of the protagonist (i.e., the character that appears most frequently in the text) is usually generated; and when the user sets to analyze multiple characters, when analyzing the characters in the text, multiple characters with high frequency of appearance are selected to generate a directed acyclic graph of their growth trajectories. It should be noted here that the directed acyclic graph mentioned in the embodiments of the present application is for one character. If there are multiple characters in the first text, a directed acyclic graph corresponding to each character will be obtained.
[0080] Optionally, in at least one embodiment of the present application, a specific implementation method of obtaining a first directed acyclic graph of the growth trajectory of the target character in the first text includes:
[0081] Step S11, acquiring a target text block in the first text according to the feature data;
[0082] The target text block is a paragraph or a chapter.
[0083] Optionally, in at least one embodiment of the present application, a specific implementation method of acquiring a target text block in the first text according to the feature data is:
[0084] Obtaining weights of feature data of all text blocks corresponding to the first text;
[0085] According to the weights, selecting a plurality of target text blocks from all text blocks;
[0086] The weight of the feature data of the target text block is greater than or equal to a second preset value.
[0087] It should be noted that in the embodiments of the present application, the feature data can be analyzed through a seq2seq model, a long short-term memory network (LSTM) model, an attention mechanism model, etc., to obtain the weight of each target text block, and then the target text blocks whose weights meet the requirements are selected for subsequent generation of a directed acyclic graph.
[0088] Step S12: according to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph;
[0089] It should be noted that the role status mentioned in the embodiments of the present application can be understood as a role tag, which may include but is not limited to at least one of the following parameters:
[0090] Social status, personality, emotional state, etc. It should be noted that the social status can be understood as the life stage of the character, or it can be understood as a social role.
[0091] Normally, each target text block can extract a role state, that is, the number of role states obtained is the number of target text blocks selected in at least one embodiment of the present application, that is, the target text blocks correspond one-to-one to the role states.
[0092] Step S13, generating the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks;
[0093] Optionally, in at least one embodiment of the present application, according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks, a specific implementation method of generating the first directed acyclic graph is:
[0094] Step S131, determining events between nodes corresponding to the two adjacent target text blocks according to the content of the first target text block in the two adjacent target text blocks;
[0095] The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
[0096] It should be noted here that when generating events between character state 1 and character state 2, the content of the target text block corresponding to character state 1 is selected for implementation. By analyzing and organizing the content of the target text block corresponding to character state 1, the events between character state 1 and character state 2 are obtained.
[0097] Step S132, generating the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes;
[0098] It should be noted that, in the embodiment of the present application, the nodes are sorted in the order in which the character states appear in the corresponding target text block, and then the nodes are associated with each other through events to form a first directed acyclic graph.
[0099] Optionally, in at least one embodiment of the present application, a further implementation of step 102 includes:
[0100] Step 1021, obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text;
[0101] It should be noted that the first role may be one or more roles in the second text, and the selection method thereof is similar to the selection method of the target role in the first text.
[0102] Step 1022, comparing different role states of the first role in the third directed acyclic graph with the role state of the target role in the first directed acyclic graph;
[0103] Step 1023, selecting K first role states in the third directed acyclic graph;
[0104] Wherein, K is an integer greater than or equal to 1.
[0105] Wherein, the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value;
[0106] It should be noted that this step in at least one embodiment of the present application is to obtain a character state in the growth trajectory corresponding to the second text that is similar to the character state in the growth trajectory in the first text. The similar character state can be obtained by comparing one or more parameters contained in the character state, for example, selecting a character state whose social state and personality are the same as those of the target character (it should be noted that the same here can be understood as a similarity higher than a specific value) as the first character state.
[0107] Step 1024, concatenating the character state of the target character in the first directed acyclic graph with the second character state to obtain a newly added growth trajectory of the target character;
[0108] The second character state is adjacent to the first character state in the third directed acyclic graph and is located after the first character state.
[0109] For example, the first directed acyclic graph includes a growth trajectory, which includes character state 11, character state 12, character state 13 and character state 14 in sequence; the third directed acyclic graph includes a growth trajectory, which includes character state 21, role state 22, role state 23 and role state 24 in sequence; after comparison, it is found that role state 12 and role state 22 are similar, then the new growth trajectory that can be formed includes: role state 11, role state 12, role state 23 and role state 14 in sequence.
[0110] Step 1025: Add the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph.
[0111] Optionally, in at least one embodiment of the present application, the implementation of step 103 includes:
[0112] Step 1031, obtaining a first analysis result of the growth trajectory of the target character in the second directed acyclic graph;
[0113] The first analysis result includes an analysis result of an evaluation index of the character status included in the growth trajectory.
[0114] It should be noted that the evaluation index may be, for example, the number of comments on different role states, or the number of readers of relevant content corresponding to the role in different role states.
[0115] For each character state, there is a corresponding score of an evaluation index. For example, the score may be obtained by normalizing the values corresponding to different evaluation indexes.
[0116] Step 1032: Determine an analysis result of the growth trajectory of the target character based on the first analysis result.
[0117] Optionally, in at least one embodiment of the present application, step 1032 is implemented as follows:
[0118] The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
[0119] It should be noted that after obtaining the evaluation indicators of each character status, the weighted sum of all evaluation indicators of the character status under the growth trajectory can be performed according to the evaluation indicators to obtain the analysis result of the growth trajectory; of course, if there are multiple evaluation indicators, the analysis results of all character statuses under each evaluation indicator can be obtained first, and then the analysis results of all evaluation indicators can be weighted summed to obtain the analysis result of the growth trajectory.
[0120] After obtaining the final analysis results, the analysis results need to be displayed so that users can analyze each growth trajectory. Optionally, when displaying, the analysis results corresponding to the evaluation indicators and the final analysis results can be presented in the form of numerical values, that is, the scores of the analysis results are displayed; they can also be presented in the form of text, that is, the grading of the analysis results is displayed, for example, the analysis results are graded as excellent, good, medium, and poor, and the analysis results are displayed as text description information such as excellent, good, medium, and poor; they can also be displayed in the form of icons, for example, the icon can be a check mark icon or a difference icon, and the analysis results are displayed as a check mark icon or a difference icon.
[0121] like Figure 2 As shown, taking the analysis results in numerical form as an example, the score of each evaluation indicator and the final total score are displayed for each trajectory.
[0122] Taking the analysis of a novel as an example, the specific application process of at least one embodiment of the present application is described in detail as follows.
[0123] like Figure 3 As shown, the specific process of novel analysis includes:
[0124] S10, the user inputs the identifier of the novel that he wishes to adapt into a screenplay to the client (which may also be a server) that assists in novel-to-screenplay adaptation;
[0125] For example, the title of the novel and the author.
[0126] S20, the client determines whether the feature data of the novel exists in the database based on the user's input, and if so, the client reads the corresponding feature data from the database;
[0127] S30, constructing a first directed acyclic graph of the protagonist's growth trajectory based on the feature data;
[0128] Here, we take the directed acyclic graph that generates growth trajectories through chapters as an example. For example, we obtain several chapters with higher weights in the novel, generate a character state for each chapter, and then use the novel content between the previous chapter and the next chapter (including the previous chapter, excluding the next chapter) between adjacent high-weight chapters, and generate event descriptions between character states through technologies including but not limited to text summarization methods based on deep learning. For example, a novel has Chapter 1, Chapter 2, Chapter 3, and Chapter 4, of which Chapter 2 and Chapter 4 are high-weight chapters. Then, according to Chapter 2 and Chapter 4, the character states will be extracted respectively, and nodes (specifically the nodes are character states) A0 and A1 will be constructed. According to the novel content of Chapter 2 and Chapter 3, the event between nodes A0 and A1 is constructed.
[0129] Figure 4This is an example of a directed acyclic graph of a character's growth trajectory. It should be noted that: Figure 3 There is also a button 31 for the user to expand the details of the growth trajectory. Figure 5 This is a detailed diagram of the directed acyclic graph after clicking button 31. It should be noted that, in this application, only one event number is taken as an example, and of course it is not limited to one, and can be more than one.
[0130] S40, expanding the first directed acyclic graph of the protagonist's growth trajectory according to similar novels to the novel to be adapted, to obtain a second directed acyclic graph;
[0131] It should be noted that the method of obtaining similar novels is: based on the novel reading big data, through the calculation method of text processing, such as collaborative filtering, to obtain other novels that people who have read the novel to be adapted also like to read; for another example, by the number of times the novel to be adapted and other novels appear in the user's reading favorites at the same time, to determine the similar novels of the novel to be adapted. The methods of determining similar novels include but are not limited to the above two methods.
[0132] Using the method in S30 again, for similar novels, a directed acyclic graph of the protagonist’s growth trajectory is constructed.
[0133] S50, using the second directed acyclic graph to expand the first directed acyclic graph;
[0134] It should be noted that this process is to compare the character states of different characters in the directed acyclic graph corresponding to similar novels with a character state of a character in the novel to be adapted, select one or more character states that are closest to the character state of the novel to be adapted, and splice the next character state of the selected one or more character states.
[0135] For example, the character status of the novel to be adapted is: A0→A1→A2.
[0136] There is a similar novel whose character status is: B0→B1→B2→B3.
[0137] The character status of another similar novel is: C0→C1→C2.
[0138] Through the aforementioned character status comparison method, character statuses of different novels are compared in pairs, and the character status closest to A1 is B2, and the character status closest to A0 is C0. Then the growth trajectory of the character of the novel to be adapted is expanded. Specifically, 301 represents the next character status C1 of C0. Because C0 is closest to A0, the next character status C1 of C0 is added to the next character status of the character status A0 of the novel to be adapted; 302 represents the next character status B3 of B2. Because B2 is closest to A1, the next character status B3 of B2 is added to the next character status of the character status A1 of the novel to be adapted.
[0139] Through the above methods, the character growth trajectory is expanded. Figure 6 As shown, three character growth tracks have been successfully added, namely New Track 1, New Track 2, and New Track 3.
[0140] S60: Obtain and display the analysis results of the evaluation indicators of each growth trajectory in the second directed acyclic graph and the final analysis results.
[0141] For example, you can choose a discussion popularity index, count the number of comments for different role states, and add up the number of comments for all role states on the growth trajectory to get the score of the discussion popularity index for the growth trajectory; finally, get the final analysis result based on the score of the evaluation index through equal or unequal weighting, linear or nonlinear weighting.
[0142] In summary, the method proposed in the embodiment of the present application to construct a directed acyclic graph of the character's growth trajectory and further expand the character's growth trajectory based on big data is not available in the prior art; because the prior art lacks auxiliary support for novel adaptation scripts and lacks application of novel reading big data; the embodiment of the present application constructs a directed acyclic graph of the character's growth trajectory based on the characteristic data of the novel, and further combines the novel reading big data to expand the directed acyclic graph of the protagonist's growth trajectory based on similar novels, and can provide analysis results of the evaluation indicators of each growth trajectory, so as to achieve the purpose of auxiliary support for novel adaptation scripts.
[0143] like Figure 7 As shown, at least one embodiment of the present application further provides a text analysis device 700, comprising:
[0144] A first acquisition module 701 is used to acquire a first directed acyclic graph of the growth trajectory of a target character in the first text according to feature data of the first text;
[0145] A second acquisition module 702 is used to expand the first directed acyclic graph according to a second text to acquire a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value;
[0146] The third acquisition module 703 is used to acquire the analysis result of the growth trajectory of the target character according to the second directed acyclic graph.
[0147] Optionally, the feature data includes: at least one of reading behavior data of a reading user on the first text and attribute data of the first text.
[0148] Optionally, the first acquisition module 701 includes:
[0149] A first acquisition unit, configured to acquire a target text block in the first text according to the feature data, wherein the target text block is a paragraph or a chapter;
[0150] An extraction unit, configured to extract, according to the target text block, the role states corresponding to the target role as nodes of a first directed acyclic graph;
[0151] A generating unit is used to generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks.
[0152] Optionally, the first acquiring unit is used to:
[0153] Obtaining weights of feature data of all text blocks corresponding to the first text;
[0154] According to the weights, selecting a plurality of target text blocks from all text blocks;
[0155] The weight of the target text block is greater than or equal to a second preset value.
[0156] Optionally, the generating unit is used to:
[0157] Determining, according to the content of a first target text block in two adjacent target text blocks, an event between nodes corresponding to the two adjacent target text blocks;
[0158] Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes;
[0159] The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
[0160] Optionally, the second acquisition module 702 includes:
[0161] A second acquisition unit, configured to acquire a third directed acyclic graph of a growth trajectory of the first character of the second text;
[0162] A comparing unit, used for comparing different role states of the first role in the third directed acyclic graph with the role states of the target role in the first directed acyclic graph respectively;
[0163] A selection unit, configured to select K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value;
[0164] A third acquisition unit is used to splice the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph;
[0165] Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph;
[0166] Wherein, K is an integer greater than or equal to 1.
[0167] Optionally, the third acquisition module 703 includes:
[0168] a fourth acquisition unit, configured to acquire a first analysis result of the growth trajectory of the target character in the second directed acyclic graph, wherein the first analysis result includes an analysis result of an evaluation index of a character state included in the growth trajectory;
[0169] A determination unit is used to determine an analysis result of the growth trajectory of the target character according to the first analysis result.
[0170] Optionally, the determining unit is used to:
[0171] The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
[0172] It should be noted that the device provided in at least one embodiment of the present application is a device capable of executing the above-mentioned text analysis method, then all embodiments of the above-mentioned text analysis method are applicable to the device and can achieve the same or similar beneficial effects.
[0173] At least one embodiment of the present application further provides a text analysis device, including a transceiver and a processor;
[0174] The processor is used to: obtain a first directed acyclic graph of the growth trajectory of the target character in the first text according to the feature data of the first text;
[0175] According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value;
[0176] According to the second directed acyclic graph, an analysis result of the growth trajectory of the target character is obtained.
[0177] Optionally, the feature data includes: at least one of reading behavior data of a reading user on the first text and attribute data of the first text.
[0178] Optionally, the processor is configured to:
[0179] According to the feature data, a target text block in the first text is acquired, where the target text block is a paragraph or a chapter;
[0180] According to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph;
[0181] The first directed acyclic graph is generated according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks.
[0182] Optionally, the processor is configured to:
[0183] Obtaining weights of feature data of all text blocks corresponding to the first text;
[0184] According to the weights, selecting a plurality of target text blocks from all text blocks;
[0185] The weight of the target text block is greater than or equal to a second preset value.
[0186] Optionally, the processor is configured to:
[0187] Determining, according to the content of a first target text block in two adjacent target text blocks, an event between nodes corresponding to the two adjacent target text blocks;
[0188] Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes;
[0189] The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
[0190] Optionally, the processor is configured to:
[0191] Obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text;
[0192] Comparing different role states of the first role in the third directed acyclic graph with role states of the target role in the first directed acyclic graph respectively;
[0193] Selecting K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value;
[0194] splicing the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph;
[0195] Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph;
[0196] Wherein, K is an integer greater than or equal to 1.
[0197] Optionally, the processor is configured to:
[0198] Obtaining a first analysis result of the growth trajectory of the target character in the second directed acyclic graph, wherein the first analysis result includes an analysis result of an evaluation index of a character state included in the growth trajectory;
[0199] According to the first analysis result, an analysis result of the growth trajectory of the target character is determined.
[0200] Optionally, the processor is configured to:
[0201] The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
[0202] like Figure 8 As shown, an embodiment of the present invention further provides a text analysis device, including a processor 800, a transceiver 810, a memory 820, and a program stored in the memory 820 and executable on the processor 800; wherein the transceiver 810 is connected to the processor 800 and the memory 820 via a bus interface, wherein the processor 800 is used to read the program in the memory and execute the following process:
[0203] Acquire a first directed acyclic graph of a growth trajectory of a target character in the first text according to the feature data of the first text;
[0204] According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value;
[0205] According to the second directed acyclic graph, an analysis result of the growth trajectory of the target character is obtained.
[0206] The transceiver 810 is configured to receive and send data under the control of the processor 800 .
[0207] Among them, Figure 8 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 800 and memory represented by memory 820. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 810 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including transmission media such as wireless channels, wired channels, optical cables, and the like.
[0208] The processor 800 is responsible for managing the bus architecture and general processing, and the memory 820 can store data used by the processor 800 when performing operations.
[0209] Optionally, the processor 800 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.
[0210] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.
[0211] Optionally, the feature data includes: at least one of reading behavior data of a reading user on the first text and attribute data of the first text.
[0212] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0213] According to the feature data, a target text block in the first text is acquired, where the target text block is a paragraph or a chapter;
[0214] According to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph;
[0215] The first directed acyclic graph is generated according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks.
[0216] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0217] Obtaining weights of feature data of all text blocks corresponding to the first text;
[0218] According to the weights, selecting a plurality of target text blocks from all text blocks;
[0219] The weight of the target text block is greater than or equal to a second preset value.
[0220] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0221] Determining, according to the content of a first target text block in two adjacent target text blocks, an event between nodes corresponding to the two adjacent target text blocks;
[0222] Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes;
[0223] The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
[0224] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0225] Obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text;
[0226] Comparing different role states of the first role in the third directed acyclic graph with role states of the target role in the first directed acyclic graph respectively;
[0227] Selecting K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value;
[0228] splicing the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph;
[0229] Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph;
[0230] Wherein, K is an integer greater than or equal to 1.
[0231] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0232] Obtaining a first analysis result of the growth trajectory of the target character in the second directed acyclic graph, wherein the first analysis result includes an analysis result of an evaluation index of a character state included in the growth trajectory;
[0233] According to the first analysis result, an analysis result of the growth trajectory of the target character is determined.
[0234] Furthermore, when the processor 800 executes the program, the following steps are implemented:
[0235] The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
[0236] At least one embodiment of the present application further provides a text analysis device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process in the text analysis method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0237] It can be understood that the above-mentioned text analysis device is located in a network device (eg, a forwarding device).
[0238] At least one embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, each process in the text analysis method embodiment described above is implemented, and the same technical effect can be achieved. To avoid repetition, it is not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0239] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0240] 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 application, 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, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0241] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A text analysis method, characterized in that: include: Acquire a first directed acyclic graph of a growth trajectory of a target character in the first text according to the feature data of the first text; According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value; Acquire, according to the second directed acyclic graph, an analysis result of the growth trajectory of the target character; The step of obtaining a first directed acyclic graph of the growth trajectory of the target character in the first text includes: According to the feature data, a target text block in the first text is acquired, where the target text block is a paragraph or a chapter; According to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph; Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks; The step of expanding the first directed acyclic graph according to the second text to obtain a second directed acyclic graph includes: Obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text; Comparing different role states of the first role in the third directed acyclic graph with role states of the target role in the first directed acyclic graph respectively; Selecting K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value; splicing the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph; Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph; Wherein, K is an integer greater than or equal to 1.
2. The method according to claim 1, characterized in that The characteristic data includes at least one of: reading behavior data of a reading user on the first text and attribute data of the first text.
3. The method according to claim 1, characterized in that The step of acquiring a target text block in the first text according to the feature data includes: Obtaining weights of feature data of all text blocks corresponding to the first text; According to the weights, selecting a plurality of target text blocks from all text blocks; Wherein, the weight of the target text block is greater than or equal to a second preset value.
4. The method according to claim 1, characterized in that: The generating the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between the multiple target text blocks includes: Determining, according to the content of a first target text block in two adjacent target text blocks, an event between nodes corresponding to the two adjacent target text blocks; Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the events between nodes; The first target text block is the target text block that comes earlier in time between the two adjacent target text blocks.
5. The method according to claim 1, characterized in that The obtaining, according to the second directed acyclic graph, an analysis result of the growth trajectory of the target character includes: Obtaining a first analysis result of the growth trajectory of the target character in the second directed acyclic graph, wherein the first analysis result includes an analysis result of an evaluation index of a character state included in the growth trajectory; According to the first analysis result, an analysis result of the growth trajectory of the target character is determined.
6. The method according to claim 5, characterized in that Determining the analysis result of the growth trajectory of the target character according to the first analysis result includes: The analysis results of the evaluation indicators of the character status included in the growth trajectory are weighted and summed to determine the analysis result of the growth trajectory.
7. A text analysis device, characterized in that: include: A first acquisition module, configured to acquire a first directed acyclic graph of a growth trajectory of a target character in the first text according to feature data of the first text; A second acquisition module, configured to expand the first directed acyclic graph according to a second text to acquire a second directed acyclic graph, wherein a correlation between the second text and the first text is greater than or equal to a first preset value; a third acquisition module, configured to acquire an analysis result of the growth trajectory of the target character according to the second directed acyclic graph; Wherein, the first acquisition module includes: A first acquisition unit, configured to acquire a target text block in the first text according to the feature data, wherein the target text block is a paragraph or a chapter; An extraction unit, configured to extract, according to the target text block, the role states corresponding to the target role as nodes of a first directed acyclic graph; A generating unit, configured to generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between the multiple target text blocks; The second acquisition module includes: A second acquisition unit, configured to acquire a third directed acyclic graph of a growth trajectory of the first character of the second text; A comparing unit, used for comparing different role states of the first role in the third directed acyclic graph with the role states of the target role in the first directed acyclic graph respectively; A selection unit, configured to select K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value; A third acquisition unit is used to splice the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph; Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph; Wherein, K is an integer greater than or equal to 1.
8. A text analysis device, characterized in that: including a transceiver and a processor; The processor is used to: obtain a first directed acyclic graph of the growth trajectory of the target character in the first text according to the feature data of the first text; According to the second text, the first directed acyclic graph is expanded to obtain a second directed acyclic graph, wherein the correlation between the second text and the first text is greater than or equal to a first preset value; Acquire, according to the second directed acyclic graph, an analysis result of the growth trajectory of the target character; Wherein, the processor is used for: According to the feature data, a target text block in the first text is acquired, where the target text block is a paragraph or a chapter; According to the target text block, extracting the role states corresponding to the target role as nodes of a first directed acyclic graph; Generate the first directed acyclic graph according to the order in which each character state appears in the corresponding target text block and the order between multiple target text blocks; The processor is configured to: Obtaining a third directed acyclic graph of the growth trajectory of the first character of the second text; Comparing different role states of the first role in the third directed acyclic graph with role states of the target role in the first directed acyclic graph respectively; Selecting K first character states in the third directed acyclic graph, wherein the similarity between the first character state and the character state of the target character in the first directed acyclic graph is greater than or equal to a third preset value; splicing the character state of the target character in the first directed acyclic graph with the second character state to obtain a new growth trajectory of the target character, wherein the second character state is adjacent to the first character state and is located after the first character state in the third directed acyclic graph; Adding the newly added growth trajectory to the first directed acyclic graph to form a second directed acyclic graph; Wherein, K is an integer greater than or equal to 1.
9. A text analysis device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the text analysis method according to any one of claims 1 to 6 when executing the program.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Statement word segmentation method and device, computer equipment and storage medium
CN112765963A
Event extraction method and device, computer equipment and computer readable storage medium
CN113255322A