Method and system for splitting a novel scene text

By using a scene entity extraction model trained by machine learning and similarity calculation, the problem of time-consuming and inconsistent manual editing of novel scene texts has been solved, achieving efficient and automatic scene segmentation and scene generation.

CN115408488BActive Publication Date: 2026-02-13HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211020489.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-02-13
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

In existing technologies, manual editing of novel scene text is time-consuming and inconsistent across scenes. Existing technologies cannot effectively solve this problem, especially since they cannot automatically identify information not defined in the dictionary.

Method used

A scene entity extraction model is trained using machine learning techniques. By configuring scene segmentation strategies, segmentation is performed using features such as dialogue, characters, and locations. Similarity calculations are then used to determine scene boundaries and generate theatrical scene scripts.

Benefits of technology

It significantly reduced the workload of manually adapting scripts, improved the consistency and efficiency of scene segmentation, and generated structured theatrical scene scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408488B_ABST
    Figure CN115408488B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of natural language processing, and particularly relates to a novel scene text segmentation method and system. The method comprises the following steps: S1, training of a scene entity extraction model; S2, configuration of a scene segmentation strategy; S3, initialization of a paragraph object set; S4, scene entity extraction; S5, determination of a scene boundary; S6, scene extraction; S7, production of a script; and S8, end determination. The present application can solve the problems of long time consumption and inconsistent scenes in manual script adaptation, and greatly reduces the workload of further adaptation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of natural language processing, and particularly relates to a novel scene text segmentation method and system. BACKGROUND

[0002] When a novel is adapted into a script, the materials in the novel to be adapted need to be sorted and refined, and finally a script with a specific structure is formed. The script is generally organized in scenes as a story unit. A scene is a plot that occurs in the same space range within a relatively linked physical time. Scene elements are scattered in the novel content and mainly include location, time, characters, dialogue and other information.

[0003] Under the manual editing mode of scene text, due to the subjective differences of editors in scene segmentation, the consistency of segmentation results is difficult to guarantee, it is time-consuming and inefficient, and technical means are needed to assist scene segmentation. At the same time, the existing scene information extraction technology is in the form of dictionary matching, which seriously depends on the dictionary and cannot identify information not defined in the dictionary.

[0004] Therefore, it is very important to design a novel scene text segmentation method and system that can solve the problems of long time consumption and inconsistent scenes in manual adaptation of scripts and greatly reduce the workload of further adaptation.

[0005] For example, the Chinese patent document with application number CN201911201695.9 describes a reader information extraction method and system based on Chinese novel text. The reader information extraction method divides the text that needs to extract keywords into text with word granularity and text with Chinese character granularity, and converts them into word vectors and character vectors respectively. A vector training neural network is used to extract text features in combination with an attention mechanism, and information extraction is completed according to the prediction results of the text features. Although the use of word vectors and character vectors in two granularities, the application of the two granularities of vector representation methods in the attention mechanism model at the same time, and the combination of the prediction results of the two can improve the information extraction accuracy of related tasks, help readers understand the text content, use natural language processing algorithms to meet the needs of readers to review previous chapters, and improve user experience, but its disadvantage is that it cannot be used for novel scene text segmentation, and it is still difficult to solve the problems of long time consumption and inconsistent scenes in manual adaptation of scripts. SUMMARY

[0006] The present application is to overcome the problems of long time consumption, inconsistent scenes and large adaptation workload in manual adaptation of scripts in the prior art, and provides a novel scene text segmentation method and system that can solve the problems of long time consumption and inconsistent scenes in manual adaptation of scripts and greatly reduce the workload of further adaptation.

[0007] To achieve the above object of the present application, the present application adopts the following technical solutions:

[0008] The method for splitting novel scene text comprises the following steps:

[0009] S1, scene entity extraction model training:

[0010] Obtain different category novel texts, make training data sets, and train the scene entity extraction model;

[0011] S2, scene splitting strategy configuration:

[0012] Configure the scene splitting strategy, and obtain the corresponding splitting basis feature value;

[0013] S3, paragraph object set initialization:

[0014] Iterate through the novel text, and initialize the paragraph object set;

[0015] S4, scene entity extraction:

[0016] Iterate through the novel text, extract the scene entity set of the novel, and update the paragraph object set;

[0017] S5, scene boundary determination:

[0018] Determine the scene boundary according to the paragraph object set, and obtain the boundary point index value;

[0019] S6, scene extraction:

[0020] According to the boundary point index value and the paragraph object set, extract the corresponding original paragraph text and full-text paragraph index, generate the scene original text, and update the paragraph object set;

[0021] S7, act generation:

[0022] Structurize the scene original text to generate the act scene script;

[0023] S8, end determination:

[0024] Determine whether the entire scene extraction is completed, if yes, output the entire act scene script, otherwise return to step S4.

[0025] As a preferred, step S1 comprises the following steps:

[0026] S11, obtain different category novel texts, make training data sets, and perform BIO annotation on the objects in the novel, wherein B represents the beginning character of the scene entity, I represents the middle or end character of the scene entity, and O represents the character not belonging to the scene entity;

[0027] S12, training a machine learning-based scene entity extraction model according to the training data set, for automatically identifying scene entities in the input text.

[0028] As a preferred, step S2 includes the following steps:

[0029] S21, configuring the scene separation strategy rule as dialogue;

[0030] The dialogue is a complete sentence containing double quotes or colons in the novel text.

[0031] S22, setting the segmentation basis feature value as double quotes and colons.

[0032] As a preferred, step S2 includes the following steps:

[0033] S21, configuring the scene separation strategy rule as a character;

[0034] S22, setting the segmentation basis feature value as a character in the novel, that is, detecting whether the text paragraph contains a character and associated feature information.

[0035] As a preferred, step S2 includes the following steps:

[0036] S21, configuring the scene separation strategy rule as a location;

[0037] S22, setting the segmentation basis feature value as location information in the novel, that is, detecting whether the text paragraph contains a location and associated feature information.

[0038] As a preferred, step S3 includes the following steps:

[0039] S31, novel text preprocessing:

[0040] The preprocessing includes index labeling, symbol processing, word segmentation, stop word removal, and scene counter initialization.

[0041] S32, paragraph object initialization:

[0042] Initialize the paragraph object set, and store the text paragraph after preprocessing and the corresponding full text paragraph index value to the paragraph object.

[0043] S33, segmentation basis feature value detection:

[0044] Determine whether the novel text contains the segmentation basis feature value, and update the corresponding segmentation feature flag in the paragraph object;

[0045] The segmentation feature flag is a state flag value set according to whether the corresponding original paragraph text contains the segmentation basis feature value.

[0046] As a preferred, step S5 includes the following steps:

[0047] S51, scene similarity calculation:

[0048] According to the segmentation basis feature value, the paragraph object is selected, and the scene entity set similarity of each paragraph object is calculated in turn;

[0049] S52, scene boundary determination:

[0050] By comparing the similarity value obtained in step S51 with the size of the set threshold, it is determined whether it is a scene boundary; if the result is yes, the boundary point index value is recorded.

[0051] As preferred, the scene boundary in step S5 includes the scene starting point and the scene ending point.

[0052] As preferred, the scene script in step S7 includes the scene, the scene entity and the scene original text.

[0053] The present application also provides a novel scene text segmentation system, comprising:

[0054] The scene entity extraction model training module is used for obtaining different categories of novel texts, making training data sets, and training scene entity extraction models;

[0055] The strategy configuration module is used for configuring the scene segmentation strategy and obtaining the corresponding segmentation basis feature value;

[0056] The paragraph object initialization module is used for traversing the novel text and initializing the paragraph object set;

[0057] The scene entity extraction module is used for traversing the novel text, extracting the scene entity set of the novel, and updating the paragraph object set;

[0058] The scene boundary determination module is used for determining the boundary of the scene according to the paragraph object set, and obtaining the boundary point index value;

[0059] The scene extraction module is used for extracting the corresponding original paragraph text and full text paragraph index according to the boundary point index value and the paragraph object set, generating the scene original text, and updating the paragraph object set;

[0060] The scene extraction module is used for extracting the corresponding original paragraph text and full text paragraph index according to the boundary point index value and the paragraph object set, generating the scene original text, and updating the paragraph object set;

[0061] The database module is used for storing the novel text training data set and the novel text data to be adapted.

[0062] Compared with the prior art, the present application has the beneficial effects that: (1) the present application proposes a method and system for novel scene segmentation assisted by machine learning technology, solves the problems of long time consumption and inconsistent scenes in manual adaptation script, and greatly reduces the workload of further adaptation; (2) the present application extracts scene entities in novel text paragraphs, and constructs a paragraph object set; configures a scene segmentation strategy; selects scene entities and calculates their similarity; completes novel scene segmentation, outputs scene original text; performs structuring, and generates a scene script; (3) the present application proposes a method for configuring a scene segmentation strategy, which is used to determine scene segmentation basis feature values, and according to the scene segmentation basis feature values, different algorithm models are used to segment the novel text; the scene segmentation strategy of the present application includes but is not limited to dialogue, character, location, and related feature information as the configuration object of the segmentation strategy. BRIEF DESCRIPTION OF DRAWINGS

[0063] Figure 1 A flowchart of the method for novel scene text segmentation provided by the embodiments of the present application;

[0064] Figure 2 A system architecture diagram of the novel scene text segmentation system provided by the embodiments of the present application;

[0065] Figure 3 A schematic diagram of the scene entity extraction model training module provided by the embodiments of the present application;

[0066] Figure 4 A schematic diagram of the paragraph object initialization module provided by the embodiments of the present application;

[0067] Figure 5 A schematic diagram of the scene entity extraction module provided by the embodiments of the present application;

[0068] Figure 6 A schematic diagram of the scene boundary determination module provided by the embodiments of the present application;

[0069] Figure 7 A schematic diagram of the scene extraction module provided by the embodiments of the present application;

[0070] Figure 8 A hardware device schematic diagram of the novel scene text segmentation system provided by the embodiments of the present application;

[0071] Figure 9 A schematic diagram of the key steps in the method for novel scene text segmentation provided by the embodiments of the present application. DETAILED DESCRIPTION

[0072] In order to more clearly illustrate the embodiments of the present application, the specific embodiments of the present application will be described below with reference to the drawings. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained according to these drawings without creative labor for those skilled in the art, and other embodiments can also be obtained.

[0073] Embodiments:

[0074] As shown in the following, the present application provides a segmentation method for novel scene text, comprising the following steps: Figure 1

[0075] Step (1), training a scene entity extraction model M based on BERT-BiLSTM-CRF.

[0076] The specific method of step (1) is:

[0077] Step (1.1), obtaining different categories of novel text, and making training data sets. For example: obtaining 20 novels of each of the following categories: fantasy, fantasy, martial arts, urban, science fiction, love, suspense, and performing BIO labeling. The object of labeling is the name, place, time and action in the novel;

[0078] Step (1.2), training a scene entity extraction model based on BERT-BiLSTM-CRF according to the training data set;

[0079] The specific method of step (1.2) is:

[0080] Step (1.2.1), obtaining the corresponding word vector by passing the labeled training data set through the BERT pre-training language model;

[0081] Step (1.2.2), inputting the obtained word vector into the BiLSTM module for encoding to obtain a score matrix;

[0082] Step (1.2.3), decoding the score matrix using the conditional random field CRF module to obtain a predicted annotation sequence, and then extracting and classifying each entity in the sequence; finally obtaining the scene entity extraction model M.

[0083] Step (2), scene segmentation strategy configuration. Configure the scene segmentation strategy to obtain the corresponding segmentation basis feature value. The example described in the embodiments of the present application takes "dialogue" as the scene segmentation strategy, but the method described in the present application is not limited to taking "dialogue" as the segmentation basis, but determines different segmentation basis feature values by configuring different scene segmentation strategy rules. The "dialogue" described in the embodiments of the present application is a complete sentence containing double quotation marks or a colon in the novel; the specific method is:

[0084] ​Step (2.1), configure the scene separation strategy rule as dialogue;

[0085] Step (2.2) sets the segmentation criteria feature values ​​to double quotes and colons.

[0086] Apart from dialogue, if the segmentation strategy is based on characters, then the segmentation is based on the characters in the novel, that is, detecting whether the text paragraph contains characters and related feature information; if the segmentation strategy is based on location, then the segmentation is based on the location information in the novel, that is, detecting whether the text paragraph contains location and related feature information.

[0087] Step (3) Construct a collection of paragraph objects in the novel.

[0088] The specific method for step (3) is as follows:

[0089] Step (3.1) involves preprocessing the novel text to be adapted, including index annotation, symbol processing, word segmentation, stop word removal, and initializing the scene counter count = 1; resulting in a set of novel text paragraphs P = {p1, p2, ..., p...}. m}, the element p in the set i (1≤i≤m) represents a text segment in the novel, indicating the i-th segment in the novel, and m represents the total number of natural segments in the novel.

[0090] Step (3.2) Initialize the collection of paragraph objects O = {o1, o2, ..., o m}, the element o in the set i (1≤i≤m) represents the paragraph object corresponding to the i-th paragraph of the novel text. This object contains idx, text, flag, and scenes attributes, representing the full-text paragraph index, paragraph text, segmentation feature flag, and scene entity set, respectively; and p i The value is assigned to the text property, and 'i' is assigned to the idx property;

[0091] Step (3.3) involves segmentation based on feature value detection. The novel text paragraph set P is traversed to determine whether each paragraph contains segmentation feature values. In this embodiment, the feature value is used to detect whether a paragraph contains quotation marks and colons; if so, the corresponding paragraph object o of the paragraph containing the sentence is set. i Set the flag attribute to 1 if it is not set to 0, and set o to 0 otherwise. i Store a subset of paragraph objects

[0092] Among them, the segmentation feature flag is a status flag value set according to whether the corresponding original paragraph text contains segmentation feature values.

[0093] Step (4): Extract scene entities.

[0094] The specific method of step (4) is:

[0095] Step (4.1), sequentially set the paragraph element p in the set P as the scene entity set scenes i Input the scene entity extraction model M to obtain the corresponding scene entity set, and update the paragraph object, and assign the scene entity set to the corresponding paragraph object o i The scenes attribute of the paragraph object o

[0096] Step (5), determine the boundary of a scene, and the scene boundary includes a scene starting point and a scene ending point. In the embodiment of the application, dialogue is used as the basis for dividing scenes to determine the scene boundary. In actual application, other scene dividing bases can also be used according to the rules configured by the division strategy, and different algorithm models can be used according to the corresponding characteristics.

[0097] The specific method of step (5) is:

[0098] Step (5.1), scene starting point initialization. The paragraph where the first dialogue is located is selected as the scene starting point, that is, the first paragraph object with the flag attribute value of 1 is selected from the paragraph object set O, and is recorded as the scene starting point paragraph object o s , and the corresponding attribute values of idx s , text s , flag s and scenes s are recorded.

[0099] Step (5.2), scene retrieval. According to o s , the paragraph object set O is reversely searched to obtain the scene entity set scenes (s-1) in the paragraph object o (s-1) ;

[0100] Step (5.3), scene similarity calculation. The similarity value of the scene entity set scenes (s-1) and scenes s is calculated. The specific method is as follows:

[0101] Step (5.3.1), scene entity vectorization. The scene entity set scenes (s-1) and scenes s are converted into feature vectors using the Wor2vec technology; the respective d-dimensional element feature vectors V ′ ={v1 ′ ,v2 ′ ,...,v ′ d} and V={v1,v2,...,v d} are obtained.

[0102] Step (5.3.2) calculates the similarity value. Calculate the scene entity set `scenes`. (s-1) with scenes s Similarity Sim(scenes) (s-1) ,scenes s The similarity value can be obtained by calculating the cosine distance; where Sim(scenes) (s-1) ,scenes s The formula for calculating ) is:

[0103]

[0104] Among them, v x and v x ′ Let the feature vectors V and V ′ The x-th element in the vector V, where d is the eigenvector V. ′ And the dimension of V.

[0105] Step (5.4), boundary determination. Compare the similarity values ​​Sim(scenes) (s-1) ,scenes s The relationship between Sim(scenes) and the threshold T, if Sim(scenes) (s-1) ,scenes s If )>T, then o s If it is not the scene's starting paragraph object, update the scene's starting paragraph object so that o s =o (s-1) Repeat step (5.2) until s < 0; otherwise o s This is the scene's starting paragraph object; the formula for calculating the threshold T is:

[0106]

[0107] Where u is the length of the paragraph object subset D, and scenes1 is the set of scene entities for the first paragraph object in D. p This is the collection of scene entities corresponding to the paragraph objects in D;

[0108] Step (5.5), scene start point confirmation. Record the scene start point segment object o. s The idx attribute value in s ;

[0109] Step (5.6), scene endpoint initialization. The last segment of the first consecutive dialogue paragraph is selected as the scene endpoint, and the corresponding scene endpoint paragraph object is denoted as o. e And record its corresponding attribute value as idx e text e, flag e , scenes e ;

[0110] Step (5.7), scene retrieval, according to o e , retrieve the set of scene entities scenes (e+1) in paragraph object o (e+1) ;

[0111] Step (5.8), similarity value calculation. Calculate the similarity value Sim(scenes (e+1) , scenes e ) of the set of scene entities scenes (e+1) and scenes e . The calculation method is as described in step (5.3).

[0112] Step (5.9), boundary determination. Compare the similarity value Sim(scenes (e+1) , scenes e ) with the threshold value T, if Sim(scenes (e+1) , scenes e )>T, then o e is not a scene end paragraph object, update the scene end paragraph object, make o e =o (e+1) , repeat step (5.7) until e>m; otherwise o e is a scene end paragraph object.

[0113] Step (5.10), scene end confirmation. Record the idx attribute value idx e in the scene end paragraph object o e ;

[0114] Step (6), scene extraction. According to the boundary point index values idx s and idx e confirmed in the above steps, extract the original paragraph text in the corresponding paragraph object set, that is, extract the scene original paragraph as the scene original text; at the same time, save the scene count counter count and the scene entity of the corresponding paragraph object; update the paragraph object set O and the paragraph object subset D, delete the extracted corresponding paragraph object; finally, update the scene count counter to make count=count+1.

[0115] Step (7), act generation. Structure the scene original text to generate an act scene script.

[0116] Step (8), end determination. Determine whether the extraction of all scenes in the novel text is completed, i.e. whether the paragraph object set O is empty. If yes, output the set of scene scripts of the act, otherwise return to step (4);

[0117] Step (9), send the set of scene scripts of the act back to the client.

[0118] As shown in the Figure 2 , the application also provides a segmentation system for novel scene text, which specifically comprises a scene entity extraction model training module, a strategy configuration module, a paragraph object initialization module, a scene entity extraction module, a scene boundary determination module, a scene extraction module, an act generation module, and a database module.

[0119] The scene entity extraction model training module, as shown in the Figure 3 , is used to train the scene entity extraction model; a certain number of novels of different categories are obtained to make a training data set and perform BIO labeling. Then the training data set is trained using the BERT pre-training language model to obtain the corresponding word vector; the word vector is input into the BiLSTM module for encoding to obtain a score matrix; the conditional random field CRF module is then used to decode the score matrix to obtain a predicted label sequence, and then each entity in the sequence is extracted and classified to finally obtain the scene entity extraction model M.

[0120] The strategy configuration module is used to configure the scene segmentation strategy and obtain the corresponding segmentation basis.

[0121] The paragraph object initialization module, as shown in the Figure 4 , is used to obtain the paragraph object in the novel; the novel text to be adapted is preprocessed to generate the paragraph of the preprocessed novel text, and then the paragraph object is initialized, the text paragraph and the corresponding full-text paragraph index value are saved, and then the segmentation feature value detection is performed to update the corresponding segmentation feature flag in the paragraph object; finally, the paragraph object and the preprocessed novel text paragraph are output;

[0122] The scene entity extraction module, as shown in the Figure 5 , is used to extract scene entities according to the input text paragraph via the scene entity extraction model, generate a scene entity set, and update the paragraph object, update the paragraph object set and output;

[0123] The scene boundary determination module, as shown in the Figure 6 , determines the scene boundary according to the input paragraph object set, the scene boundary includes the scene starting point and the scene ending point, after boundary point initialization, context scene retrieval, scene similarity calculation and boundary determination, the boundary point is determined, and the boundary point index value is output;

[0124] The scene extraction module, as shown in theFigure 7 As shown, for scene extraction; through the input boundary point index value and the paragraph object set, the corresponding original paragraph text and full text paragraph index are extracted, and the scene original text is generated;

[0125] The scene original text is structured to generate a scene script.

[0126] The database module is used for storing novel text training data set, and novel text to be adapted, etc.

[0127] As shown in the hardware device diagram of the present application, it comprises a public network, a firewall, a core switch, a user end and a service end, wherein: Figure 8

[0128] Public network: Internet, used to realize the interconnection of user end and service end;

[0129] Firewall: build a security barrier between user end and service end;

[0130] User end: user operation needs, interconnection with public network, used for communication with service end;

[0131] Service end: used for running system, completing user demand, and intercommunication with public network.

[0132] As shown in the key step diagram of the embodiment of the present application, wherein: Figure 9

[0133] After the novel original text is indexed and labeled, the indexed and labeled novel text is obtained, the scene extraction model is used for scene extraction, the scene entity set is obtained, and finally a series of processing is carried out to obtain the final scene script set.

[0134] In addition, the scene boundary in the present application includes scene starting point and scene ending point. The scene script includes scene, scene entity and scene original text.

[0135] ​​The application uses named entity recognition technology, constructs a novel text training data set, trains a scene entity extraction model, configures a scene segmentation strategy, determines a scene segmentation basis feature value, extracts scene entities in a novel text paragraph, and constructs a paragraph object set. The scene entities are names, places, times, and actions in the novel. The scene entity extraction model can automatically identify scene entities in the input text. The paragraph object includes a full-text paragraph index, an original paragraph text, a segmentation feature flag, and a scene entity set. The scene segmentation strategy is a method and rule for determining the scene segmentation basis feature value. For example, if the segmentation strategy is dialogue, the segmentation basis feature value is a double quotation mark or a colon. The text paragraph is detected to determine whether it contains a double quotation mark or a colon. If the segmentation strategy is a character, the segmentation basis feature value is a character in the novel. The text paragraph is detected to determine whether it contains a character and associated feature information. If the segmentation strategy is a location, the segmentation basis feature value is location information in the novel. The text paragraph is detected to determine whether it contains a location and associated feature information. The segmentation feature flag is a state flag value set according to whether the corresponding original paragraph text contains the segmentation basis feature value. The scene original text is the original text belonging to the same scene in the novel. The scene script includes a scene, a scene entity, and a scene original text.

[0136] The application proposes a method and system for assisting novel scene segmentation using machine learning technology, which solves the problems of long time consumption and inconsistent scenes in manual adaptation scripts, and greatly reduces the workload of further adaptation. The application extracts scene entities in a novel text paragraph, configures a scene segmentation strategy, selects scene entities and calculates their similarity, completes novel scene segmentation, outputs scene original text, and generates a scene script. The application proposes a method for configuring a scene segmentation strategy to determine a scene segmentation basis feature value and use different algorithm models to segment the novel text according to the scene segmentation basis feature value. The scene segmentation strategy includes but is not limited to dialogue, character, location, and associated feature information as configuration objects.

[0137] The above only describes the preferred embodiments and principles of the application. For those skilled in the art, the specific implementation methods will change according to the ideas provided by the application, and these changes should be considered as the protection scope of the application.

Claims

1. A method for segmenting scene text in novels, characterized in that, Includes the following steps: S1, Scene entity extraction model training: Acquire novel texts of different categories, create training datasets, and train scene entity extraction models; S2, Scene segmentation strategy configuration: Configure the scene segmentation strategy and obtain the corresponding segmentation feature values; S3, Initialization of the paragraph object collection: Iterate through the novel text and initialize a collection of paragraph objects; S4, Scene Entity Extraction: Traverse the novel text, extract the set of scene entities, and update the set of paragraph objects; S5, Scene boundaries defined: The boundaries of the scene are determined based on the collection of paragraph objects, and the boundary point index values ​​are obtained. S6, Scene Extraction: Based on the boundary point index values ​​and the paragraph object set, extract the corresponding original paragraph text and full-text paragraph index, generate the original scene text, and update the paragraph object set; S7, Scene Generation: The original scene text is structured to generate the scene script for the play; S8, End of Judgment: Determine whether all scene extractions have been completed. If yes, output all scene scripts; otherwise, return to step S4. Step S1 includes the following steps: S11. Obtain novel texts of different categories, create a training dataset, and perform BIO annotation on objects in the novel, where B represents the first character of a scene entity, I represents the middle or last character of a scene entity, and O represents characters that do not belong to scene entities. S12, Based on the training dataset, train a machine learning-based scene entity extraction model to automatically identify scene entities in the input text; Step S3 includes the following steps: S31, Novel Text Preprocessing: The preprocessing includes index annotation, symbol processing, word segmentation, stop word removal, and session counter initialization; S32, Paragraph object initialization: Initialize the collection of paragraph objects, storing the preprocessed text paragraphs and their corresponding full-text paragraph index values ​​into the paragraph objects; S33, Segmentation based on feature value detection: Determine whether the novel text contains segmentation feature values ​​and update the corresponding segmentation feature flags in the paragraph objects; The segmentation feature flag is a status flag value set according to whether the corresponding original paragraph text contains segmentation feature values; Step S5 includes the following steps: S51, Scene similarity calculation: Paragraph objects are selected based on the segmentation criteria feature values, and the similarity of the scene entity sets of each paragraph object is calculated sequentially. S52, Scene Boundary Determination: By comparing the similarity value obtained in step S51 with the set threshold, it is determined whether it is a scene boundary; if the determination result is yes, the boundary point index value is recorded.

2. The method for segmenting scene text in a novel according to claim 1, characterized in that, Step S2 includes the following steps: S21, Configure the scene separation strategy rule as dialogue; The dialogue refers to complete sentences in the novel text that contain quotation marks or colons; S22, set the segmentation criteria feature value to double quotes and colons.

3. The method for segmenting novel scene text according to claim 1, characterized in that, Step S2 includes the following steps: S21, Configure the scene separation strategy rule for characters; S22, set the segmentation criteria feature value as characters in the novel, that is, detect whether the text paragraph contains characters and related feature information.

4. The method for segmenting novel scene text according to claim 1, characterized in that, Step S2 includes the following steps: S21, Configure the scene separation strategy rule as location; S22, set the segmentation criteria feature value as location information in the novel, that is, detect whether the text paragraph contains location and related feature information.

5. The method for segmenting novel scene text according to claim 1, characterized in that, The scene boundary mentioned in step S5 includes the scene start point and the scene end point.

6. The method for segmenting novel scene text according to claim 1, characterized in that, The scene script mentioned in step S7 includes scene number, scene entity, and scene text.

7. A system for segmenting novel scene text, used to implement the method for segmenting novel scene text according to any one of claims 1-6, characterized in that, The segmentation system for novel scene text includes: The scene entity extraction model training module is used to acquire different categories of novel texts, create training datasets, and train the scene entity extraction model. The strategy configuration module is used to configure scene segmentation strategies and obtain the corresponding segmentation basis feature values. The paragraph object initialization module is used to iterate through the novel text and initialize a collection of paragraph objects. The scene entity extraction module is used to traverse the novel text, extract the novel's scene entity set, and update the paragraph object set; The scene boundary determination module is used to determine the scene boundary based on the collection of paragraph objects and obtain the boundary point index values; The scene extraction module is used to extract the corresponding original paragraph text and full-text paragraph index based on the boundary point index value and the paragraph object set, generate the original scene text, and update the paragraph object set. The scene generation module is used to structure the original scene text and generate scene scripts; The database module is used to store the training dataset of the novel text and the text data of the novel to be adapted.

Citation Information

Patent Citations

  • Reader information extraction method and system based on Chinese novel text

    CN111078822A

  • Scenario processing method and device, electronic equipment and computer storage medium

    CN113342829A