Text setting content extraction method and device, storage medium and electronic equipment

By dividing the target text into paragraphs and using a large language model to extract the set content, the problem of low audit efficiency caused by manual analysis is solved, and text settings with automation, accuracy and efficiency are realized.

CN119378527APending Publication Date: 2025-01-28BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411540907.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the prior art, manual analysis of the setting content of text results in too low efficiency in novel review and consumes a lot of labor costs.

Method used

By dividing the target text into paragraphs, and using a large language model to set the text to extract each paragraph, obtain the object name, object information, and object category. Then find the object name in the original text, delete the non -existent object, and merge the information of the same object to get the content of the text.

Benefits of technology

The content of automatic analysis and accurate extraction of novels has been achieved, the review efficiency of text content is improved, and the time and costs of manual analysis are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378527A_ABST
    Figure CN119378527A_ABST
Patent Text Reader

Abstract

The invention relates to a text setting content extraction method and device, a storage medium and electronic equipment. The method comprises the following steps: dividing a target text into at least one text paragraph; inputting each text paragraph into a target large language model, and performing set extraction on each text paragraph to obtain object names, object information and object categories of all objects set by each text paragraph; searching each object name in the target text, and deleting objects of the object names which do not exist in the target text; and combining the object names and the object information of the same objects to obtain the set content of the target text. The technical problem that the novel auditing efficiency is too low due to the fact that the set content of the text is manually analyzed is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for extracting text setting content. Background Art

[0002] An excellent worldview setting is the cornerstone of a novel's success. It not only provides a vivid background for the characters, but also provides unlimited possibilities for the development of the plot. A rich and consistent worldview can enhance the immersion of the story, making readers feel as if they are there, and feel the authenticity and depth of the story. It can also naturally breed conflicts and contradictions, drive the story forward, and provide fertile soil for the growth of the characters. In addition, a unique worldview can also stimulate readers' imagination, provide a novel reading experience, and resonate with readers at the cultural and emotional levels. Therefore, the quality of the worldview setting is crucial for a novel, and it directly affects whether the novel can gain attention and success in the market. However, the existing technology usually relies on technicians to manually analyze the worldview of the novel, which greatly slows down the efficiency of novel review and consumes a lot of manpower costs. Summary of the invention

[0003] The present application provides a method, device, storage medium and electronic device for extracting text setting content, so as to solve the technical problem that manual analysis of the setting content of the text leads to low efficiency in novel review.

[0004] In a first aspect, the present application provides a method for extracting text setting content, comprising: dividing a target text into at least one text paragraph; inputting each of the above text paragraphs into a target large language model, performing setting extraction on each of the above text paragraphs, and obtaining object names, object information, and object categories of all objects set in each of the above text paragraphs; searching for each of the above object names in the above target text, and deleting objects whose object names do not exist in the above target text; merging the object names and object information of multiple identical objects to obtain the setting content of the above target text.

[0005] In the second aspect, the present application provides a device for extracting text setting content, including: a first division module, used to divide the target text into at least one text paragraph; an extraction module, used to input each of the above text paragraphs into a target large language model, set and extract each of the above text paragraphs, and obtain the object name, object information and object category of all objects set in each of the above text paragraphs; a search module, used to search for each of the above object names in the above target text, and delete the objects whose object names do not exist in the above target text; a merging module, used to merge the object names and object information of multiple identical objects to obtain the setting content of the above target text.

[0006] As an optional example, the above-mentioned division module includes: an analysis unit, used to perform plot node analysis on the above-mentioned target text to obtain at least one plot node; and a division unit, used to divide the above-mentioned target text into at least one text paragraph according to the above-mentioned plot nodes.

[0007] As an optional example, the above-mentioned device also includes: a second division module, which is used to divide the training text into multiple training text paragraphs before inputting each of the above-mentioned text paragraphs into the target large language model to obtain training data; a labeling module, which is used to label the training object name, training object information and training object category of all training objects in each of the above-mentioned training text paragraphs to obtain verification data; a construction module, which is used to construct an extraction instruction for the initial large language model, wherein the above-mentioned extraction instruction includes a rule for extracting the above-mentioned training object; an input module, which is used to input the above-mentioned training data into the above-mentioned initial large language model to obtain result data of the above-mentioned training data; a calculation module, which is used to calculate the difference between the above-mentioned result data and the above-mentioned verification data to obtain a loss value; an adjustment module, which is used to adjust the model parameters of the above-mentioned initial large language model according to the above-mentioned loss value, and recalculate the above-mentioned loss value until the recalculated above-mentioned loss value is less than the first threshold value to obtain the above-mentioned target large language model.

[0008] As an optional example, the merging module includes: a first determination unit, used to determine multiple objects with the same object name and the same object category as a first object group; a first merging unit, used to merge the first object group into a first object when the object names of all objects in the first object group are the first object names and the object categories of all objects in the first object group are the first object categories, wherein the object name of the first object is the first object name, the object category of the first object is the first object category, and the object information of the first object includes the object information of all objects in the first object group.

[0009] As an optional example, the merging module includes: a second determination unit, used to determine a plurality of objects having the same object name but different object categories as a second object group; a third determination unit, used to determine the object category of the second object group based on the object information of all objects in the second object group; a second merging unit, used to merge the second object group into a second object when it is determined that the object category of the second object group is the second object category and the object names of all objects in the second object group are the second object name, wherein the object name of the second object is the second object name, the object category of the second object is the second object category, and the object information of the second object includes the object information of all objects in the second object group.

[0010] As an optional example, the above-mentioned merging module includes: a fourth determination unit, used to determine a plurality of objects with different object names, object name similarity greater than a second threshold, and the same object category as a third object group; a fifth determination unit, used to determine the object name of the above-mentioned third object group based on the object information of all objects in the above-mentioned third object group; a third merging unit, used to merge the above-mentioned third object group into a third object when it is determined that the object name of the above-mentioned third object group is the third object name, and the object category of all objects in the above-mentioned third object group is the third object category, wherein the object name of the above-mentioned third object is the above-mentioned third object name, the object category of the above-mentioned third object is the above-mentioned third object category, and the object information of the above-mentioned third object includes the object information of all objects in the above-mentioned third object group.

[0011] As an optional example, the fifth determination unit includes: a determination subunit, used to determine the object name of the object whose object information in the third object group has the largest number of characters as the object name of the third object group; or to determine the object name of the object in the third object group whose object name appears the most times in the target text as the object name of the third object group.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned method for extracting text setting content when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for extracting text setting content through the computer program.

[0014] In the embodiment of the present application, the target text is divided into at least one paragraph of text; each paragraph of the above text is input into the target large language model, each paragraph of the above text is set and extracted, and the object name, object information and object category of all objects set in each paragraph of the above text are obtained; each of the above object names is searched in the above target text, and the objects of the object names that do not exist in the above target text are deleted; the object names and object information of the same multiple objects are merged to obtain the method of setting the content of the above target text, because in the above method, all objects set in each paragraph of the target text are extracted by the target large language model with the ability to extract the setting content, and then the objects that do not exist in the target text are deleted through the original text inspection, and finally the same objects are merged and processed to obtain the final setting content of the target text as a whole. Thereby realizing the purpose of automatically analyzing and comprehensively and accurately extracting the setting content of the text, improving the audit efficiency of the text content, and then solving the technical problem that the efficiency of novel audit is too low due to manual analysis of the setting content of the text. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 is a flowchart of an optional method for extracting text setting content according to an embodiment of the present application;

[0019] Figure 2 is a specific implementation flow chart of an optional method for extracting text setting content according to an embodiment of the present application;

[0020] Figure 3 is a schematic structural diagram of an optional device for extracting text setting content according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 making creative work are within the scope of protection of this application.

[0023] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0024] According to a first aspect of an embodiment of the present application, a method for extracting text setting content is provided, optionally, as follows: Figure 1 As shown, the above method includes:

[0025] S102, dividing the target text into at least one text paragraph;

[0026] S104, inputting each text paragraph into the target large language model, performing setting extraction on each text paragraph, and obtaining the object name, object information and object category of all objects set in each text paragraph;

[0027] S106, searching for each object name in the target text, and deleting the object whose object name does not exist in the target text;

[0028] S108, merging the object names and object information of the same multiple objects to obtain the setting content of the target text.

[0029] Optionally, in this embodiment, the target text may be an article such as a novel, and the setting content of the target text may include three dimensions, namely, function setting, artifact setting, and role setting. Therefore, all set objects may include three object categories, namely, function category, artifact category, and role category. A function object refers to a function that a character object can perform under specific conditions, and the object information of the function object may include a description or details of the object's skills and powers. An artifact object refers to a device with certain specific functions, and the object information of the artifact object may include a description or details of the specific functions of the object. A character object refers to a creature such as a person or animal set in the target text, and the object information of the character object may include a description or details of the functions and artifacts of the object.

[0030] Optionally, in this implementation, first, the target text is divided into independent paragraphs or small blocks of text. Each paragraph represents a relatively complete context, so as to ensure that the logical coherence and setting information within the paragraph can be captured when analyzing the setting. The text content of each paragraph is analyzed to extract the setting content. Specifically, the target large language model will identify functional objects, artifact objects, and role objects from the text paragraph according to the pre-trained knowledge base and setting rules, and extract the corresponding object names, object information, and object categories. Each extracted object name is searched and matched in the target text. If an object name does not appear in the original text, it means that it may be information that is mistakenly extracted by the large language model, so the object will be deleted to ensure that the final extracted information is completely consistent with the text content. For objects that appear repeatedly in multiple paragraphs or text fragments, the names and information of these objects are merged to obtain the final setting content. The merged setting information will contain all relevant details of the object in different text paragraphs, thereby forming a complete object description.

[0031] Optionally, in this implementation, the time and labor cost of manually analyzing settings are greatly reduced through an automated setting extraction process, especially for novels or complex texts, and setting information for functions, objects, and characters can be quickly identified. By verifying the existence of object names in the text, irrelevant or incorrect object names can be filtered out, improving the accuracy of extracted information. Multiple occurrences of the same object information will be merged to avoid duplication and redundancy, and by merging, a more complete setting description can be generated, making the content clearer and more readable.

[0032] As an optional example, dividing the target text into at least one text paragraph includes:

[0033] Analyze the plot points of the target text and obtain at least one plot point;

[0034] Divide the target text into at least one text paragraph according to the plot points.

[0035] Optionally, in this implementation, plot point analysis refers to finding key turning points, climaxes or other important logical nodes of the plot in the text. These plot points usually mark changes in the plot, decisions of the characters or the occurrence of an important event. Plot points can be when a character makes a major decision, a key dialogue occurs, a sudden change in the plot, etc. The text is analyzed by a target large language model or other natural language processing technology to automatically identify these plot points. After determining the plot points in the target text, the text is divided according to these plot points. The appearance of each plot point represents the beginning or end of a new text paragraph. For example, in a novel, a plot point may represent the character entering a battle, or the end of an important dialogue in the story. This plot point-based division method can ensure that the paragraphs are naturally divided in terms of emotion, plot or narrative logic. Through plot point analysis, the system can automatically divide paragraphs according to the plot development in the text, so that each paragraph has a complete narrative logic, thereby avoiding the information fragmentation problem caused by simple mechanical paragraph division.

[0036] As an optional example, before inputting each text paragraph into the target large language model, the method further includes:

[0037] Divide the training text into multiple training text paragraphs to obtain training data;

[0038] Marking the training object names, training object information and training object categories of all training objects in each training text paragraph to obtain verification data;

[0039] constructing extraction instructions for the initial large language model, wherein the extraction instructions include rules for extracting training objects;

[0040] Input the training data into the initial large language model to obtain result data of the training data;

[0041] Calculate the difference between the result data and the validation data to get the loss value;

[0042] The model parameters of the initial large language model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than the first threshold, thereby obtaining the target large language model.

[0043] Optionally, in this implementation, through the process of training and verification, the large language model is gradually optimized so that it can more accurately extract the set content in the target text. Specifically, a set of text data for training is first preprocessed, and the training text is divided into multiple training text paragraphs to ensure that each paragraph is relatively independent and has set information for model learning. The training text can be a text that already contains complete set content, such as a novel or a script. Each training text is annotated in detail to clarify the name, information and category of each set object (such as a role, an artifact, and a function). These annotated data will be used as verification data to measure the extraction effect of the model. The annotated data includes the categories of all training objects (such as function objects, artifact objects, and role objects), object names (such as the name of a certain role, the name of a certain artifact), and object information (the description of the object, function, etc.). A set of clear extraction instructions is constructed for the initial large language model. These instructions define the rules for how the model recognizes and extracts set objects when processing text. The extraction instructions will specify the extraction target based on the category, name and information of the training object, such as identifying a role with a certain specific function, a text fragment describing a certain artifact, etc. The processed and annotated training data is input into the initial large language model. The model extracts the set information in each paragraph of text according to the set extraction instructions. The result data output by the model contains the object name, object information and its category it recognizes. By comparing the result data generated by the model with the previously annotated verification data, the difference between the two is calculated, and this difference is quantified in the form of a loss value. The loss value measures the accuracy of the model in extracting the set content. The greater the difference, the higher the loss value. According to the calculated loss value, the parameters of the initial large language model are adjusted using gradient descent or other optimization algorithms. After each parameter adjustment, the loss value is recalculated to evaluate the improvement of the model. This process is repeated until the loss value of the model is lower than the pre-set threshold (that is, the loss value is small enough and the extraction effect of the model meets the expectations). Through the iterative process of training and verification, the target large language model can efficiently and accurately extract the set content in the text, reducing errors and omissions.

[0044] As an optional example, the object names and object information of the same multiple objects are merged to obtain the setting content of the target text, including:

[0045] Determine a plurality of objects having the same object name and the same object category as a first object group;

[0046] When the object names of all objects in the first object group are the first object name, and the object categories of all objects in the first object group are the first object category, the first object group is merged into a first object, wherein the object name of the first object is the first object name, the object category of the first object is the first object category, and the object information of the first object includes the object information of all objects in the first object group.

[0047] Optionally, in this implementation, in the extracted setting content, the same object may be mentioned multiple times in different paragraphs, but the information and details of the description may be different. First, these repeated objects are screened. If their object names are the same and the object categories are the same, then these objects are determined to belong to the same group, called the "first object group". For example, the same role "object A" may be mentioned in multiple paragraphs, and each time it is mentioned, it is an object of "role category". These "objects A" are classified as the first object group. After confirming that all objects in the first object group have the same name (first object name) and the same category (first object category), these objects are merged into a unified object, namely the "first object". For example, after multiple objects describing "object A" are merged, they will become a unified object with the name "object A" and the category "role category". The name of the merged first object remains "first object name", the category is "first object category", and the object information is the information of all objects in the first object group. In other words, the information of the first object is a summary of all descriptions of the object in different paragraphs. For example, if "Object A" exhibits different skills or personality traits in different paragraphs, this information will be integrated into the same "Object A" object to form a complete object information description.

[0048] As an optional example, the object names and object information of the same multiple objects are merged to obtain the setting content of the target text, including:

[0049] Determine a plurality of objects having the same object name but different object categories as a second object group;

[0050] determining an object category of the second object group according to object information of all objects in the second object group;

[0051] When it is determined that the object category of the second object group is the second object category, and the object names of all objects in the second object group are the second object name, the second object group is merged into a second object, wherein the object name of the second object is the second object name, the object category of the second object is the second object category, and the object information of the second object includes the object information of all objects in the second object group.

[0052] Optionally, in this implementation, in the extracted setting content, there may be a situation where the same object has the same name but different categories. For example, a role may be described differently in different contexts. These objects are screened out and determined to form a "second object group". In this way, "object A" as a role can be regarded as a "role category" or described as a function name in a "function category". For all objects in the second object group, the object category of the group is determined based on their specific information and description. This step determines which categories best represent the characteristics of the group by analyzing object information (such as description, function, etc.). For example, if "object A" has the attributes of a role in multiple descriptions, it can be inferred from the description that it may belong to the "role category". After confirming that all objects in the second object group have the same name and the category has been determined, these objects are merged into a unified object, namely the "second object". At this time, the name of the second object is the "second object name", the category is the "second object category", and the object information is the information of all objects in the second object group. For example, if "object A" is described as a role attribute in different paragraphs, after merging, a new object "object A" is formed with the category of "role", and the object information includes various descriptions of it as a role.

[0053] As an optional example, the object names and object information of the same multiple objects are merged to obtain the setting content of the target text, including:

[0054] Determine a plurality of objects having different object names, object name similarity greater than a second threshold, and the same object category as a third object group;

[0055] determining an object name of the third object group according to object information of all objects in the third object group;

[0056] When it is determined that the object name of the third object group is the third object name, and the object categories of all objects in the third object group are the third object category, the third object group is merged into a third object, wherein the object name of the third object is the third object name, the object category of the third object is the third object category, and the object information of the third object includes the object information of all objects in the third object group.

[0057] Optionally, in this implementation, in the set content, there may be objects with different names but similar meanings, such as "object A" and "object B". By calculating the similarity between the object names, if the similarity is greater than the set second threshold value, and the categories of these objects are the same (for example, all are "artifact categories"), they are classified into the "third object group". In the third object group, the specific information of all objects is analyzed to determine an object name that can represent the group. This can be achieved by selecting the most common names, merging the features of the names, or selecting a representative name. After confirming that all objects in the third object group are of the same category and the object names have been determined, these objects are merged into a unified object, namely the "third object". The name of the object is "third object name", the category is "third object category", and the object information is the integration of the information of all objects in the third object group. For example, after the merger, an object "object A" may be formed, the category is "artifact", and the object information contains all descriptions of "object A" and "object B".

[0058] As an optional example, determining the object name of the third object group according to the object information of all objects in the third object group includes:

[0059] Determine the object name of the object with the largest number of characters in the object information of the third object group as the object name of the third object group; or

[0060] The object name of the object in the third object group whose object name appears most times in the target text is determined as the object name of the third object group.

[0061] Optionally, in this implementation, in the third object group, the information of each object is analyzed and its character count is calculated. The object with the largest number of characters is selected, and the name of the object is used as the object name of the third object group. The richness of information is effectively utilized. Generally, objects with a larger number of characters may contain more detailed descriptions, thereby better representing the group. Or in the third object group, the number of times each object name appears in the target text is counted, and the object with the largest number of appearances is selected, and the name of the object is used as the object name of the third object group. The importance of objects in the text is emphasized. Generally, objects with a higher frequency of appearance have a more important position in the setting. Combining these two methods, the object name of the third object group can be effectively determined, thereby obtaining higher accuracy and rationality in the process of merging and integrating the text setting content.

[0062] With reference to an example, in order to solve the technical problem of low novel review efficiency caused by manual analysis of text setting content, this application relates to a method for extracting text setting content. A target large language model with the ability to extract setting content is used to extract all objects set in each text paragraph of the novel, and then the objects that do not exist in the novel are deleted through original text verification. Finally, the same objects are merged to obtain the final setting content of the novel as a whole. This achieves the purpose of automatically analyzing and comprehensively and accurately extracting the setting content of the novel, and improving the review efficiency of the novel content. The specific implementation process is as follows: Figure 2 As shown:

[0063] Step 1, training the large language module: divide the training text into multiple training text paragraphs to form training data, mark all objects in each training text paragraph to form verification data, build extraction instructions for the initial large language model, including rules for extracting training objects, input the training data into the initial large language model, obtain result data, calculate the difference between the result data and the verification data, obtain the loss value, adjust the model parameters according to the loss value until the loss value is less than the first threshold, and obtain the target large language model;

[0064] Step 2: Divide the novel into paragraphs: Analyze the plot points of the novel, identify at least one plot point, and divide the novel into at least one text paragraph according to the plot point;

[0065] Step 3: Set content extraction: Input each text paragraph into the target large language model for setting extraction, and obtain the object name, object information and object category of all objects set in each text paragraph.

[0066] Step 4: Original text verification: Search and match each extracted object name in the original text of the novel. If an object name does not appear in the original text, delete the object;

[0067] Step 5: Merge the same names within the same class: multiple objects with the same object name and the same object class are determined as a first object group and merged into a first object;

[0068] Step 6: Merge the same names between classes: determine multiple objects with the same object name but different object classes as a second object group, determine the object class according to the object information, and merge them into a second object;

[0069] Step 7, merging different names within the same class: multiple objects with different object names, similarities greater than a second threshold and the same object category are determined as a third object group, and the object name of the third object group is determined according to the object information in the third object group (the object name with the largest number of characters or the most occurrences can be selected), and when it is confirmed that the object name and category are the same, the third object group is merged into the third object;

[0070] Step 8. Output setting content: Integrate all merged objects to form the complete setting content of the novel.

[0071] Optionally, through the complete process from plot point analysis, training data preparation, setting content extraction to object merging. Each step is designed to ensure the accuracy and consistency of extraction and merging, thereby improving the model's understanding and processing capabilities of complex text content. This method is applicable to a variety of text contexts, especially in multi-role and multi-setting environments such as fantasy and science fiction, and can effectively extract and integrate complex setting information.

[0072] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0073] According to another aspect of the embodiment of the present application, a device for extracting text setting content is also provided. Figure 3 As shown, including:

[0074] A first division module 302, for dividing the target text into at least one text paragraph;

[0075] An extraction module 304 is used to input each text paragraph into the target large language model, set and extract each text paragraph, and obtain the object name, object information and object category of all objects set in each text paragraph;

[0076] A search module 306 is used to search for each object name in the target text and delete the object whose object name does not exist in the target text;

[0077] The merging module 308 is used to merge the object names and object information of the same multiple objects to obtain the set content of the target text.

[0078] It should be noted that the first division module 302 in this embodiment can be used to execute step S102 in the embodiment of the present application, the extraction module 304 in this embodiment can be used to execute step S104 in the embodiment of the present application, the search module 306 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the merging module 308 in this embodiment can be used to execute step S108 in the embodiment of the present application.

[0079] As an optional example, the partitioning module includes:

[0080] An analysis unit, used for performing plot point analysis on the target text to obtain at least one plot point;

[0081] The division unit is used to divide the target text into at least one text paragraph according to the plot nodes.

[0082] As an optional example, the above device further includes:

[0083] A second division module is used to divide the training text into multiple training text paragraphs before inputting each text paragraph into the target large language model to obtain training data;

[0084] A labeling module, used to label the training object names, training object information and training object categories of all training objects in each training text paragraph to obtain verification data;

[0085] A construction module, used to construct extraction instructions for the initial large language model, wherein the extraction instructions include rules for extracting training objects;

[0086] An input module, used to input the training data into the initial large language model to obtain result data of the training data;

[0087] The calculation module is used to calculate the difference between the result data and the verification data to obtain the loss value;

[0088] The adjustment module is used to adjust the model parameters of the initial large language model according to the loss value, and recalculate the loss value until the recalculated loss value is less than the first threshold, so as to obtain the target large language model.

[0089] As an optional example, the merge module includes:

[0090] A first determining unit, configured to determine a plurality of objects having the same object name and the same object category as a first object group;

[0091] A first merging unit is used to merge the first object group into a first object when the object names of all objects in the first object group are the first object name and the object categories of all objects in the first object group are the first object category, wherein the object name of the first object is the first object name, the object category of the first object is the first object category, and the object information of the first object includes the object information of all objects in the first object group.

[0092] As an optional example, the merge module includes:

[0093] A second determining unit, configured to determine a plurality of objects having the same object name but different object categories as a second object group;

[0094] a third determining unit, configured to determine an object category of the second object group according to object information of all objects in the second object group;

[0095] A second merging unit is used to merge the second object group into a second object when it is determined that the object category of the second object group is the second object category and the object names of all objects in the second object group are the second object name, wherein the object name of the second object is the second object name, the object category of the second object is the second object category, and the object information of the second object includes the object information of all objects in the second object group.

[0096] As an optional example, the merge module includes:

[0097] a fourth determining unit, configured to determine a plurality of objects having different object names, object name similarity greater than a second threshold, and the same object category as a third object group;

[0098] a fifth determining unit, configured to determine an object name of the third object group according to object information of all objects in the third object group;

[0099] A third merging unit is used to merge the third object group into a third object when it is determined that the object name of the third object group is the third object name and the object categories of all objects in the third object group are the third object category, wherein the object name of the third object is the third object name, the object category of the third object is the third object category, and the object information of the third object includes the object information of all objects in the third object group.

[0100] As an optional example, the fifth determining unit includes:

[0101] a determining subunit, configured to determine the object name of the object whose object information in the third object group has the largest number of characters as the object name of the third object group; or

[0102] The object name of the object in the third object group whose object name appears most times in the target text is determined as the object name of the third object group.

[0103] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0104] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,

[0105] Memory 406, used to store computer programs;

[0106] The processor 402 is used to implement the following steps when executing the computer program stored in the memory 406:

[0107] Divide the target text into at least one text paragraph;

[0108] Input each text paragraph into the target large language model, perform setting extraction on each text paragraph, and obtain the object name, object information and object category of all objects set in each text paragraph;

[0109] Find each object name in the target text and delete the object whose object name does not exist in the target text;

[0110] The object names and object information of the same multiple objects are merged to obtain the set content of the target text.

[0111] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The communication interface is used for communication between the above electronic device and other devices.

[0112] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0113] As an example, the memory 406 may include, but is not limited to, the first segmentation module 302, the extraction module 304, the search module 306, and the merging module 308 in the text setting content extraction device. In addition, it may also include, but is not limited to, other module units in the text setting content extraction device, which will not be repeated in this example.

[0114] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0115] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0116] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The device for implementing the above-mentioned text setting content extraction method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.

[0117] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0118] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned method for extracting text setting content when executed by a processor.

[0119] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0120] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0121] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0122] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0123] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0125] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0126] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for extracting text setting content, characterized in that: include: Divide the target text into at least one text paragraph; Inputting each of the text paragraphs into the target large language model, performing setting extraction on each of the text paragraphs, and obtaining object names, object information, and object categories of all objects set in each of the text paragraphs; Searching for each of the object names in the target text, and deleting objects whose object names do not exist in the target text; The object names and object information of the same multiple objects are merged to obtain the set content of the target text.

2. The method according to claim 1, characterized in that The step of dividing the target text into at least one text paragraph comprises: Performing plot point analysis on the target text to obtain at least one plot point; The target text is divided into at least one text paragraph according to the plot nodes.

3. The method according to claim 1, characterized in that Before inputting each of the text paragraphs into the target large language model, the method further includes: Divide the training text into multiple training text paragraphs to obtain training data; Marking the training object names, training object information and training object categories of all training objects in each training text paragraph to obtain verification data; Constructing an extraction instruction for the initial large language model, wherein the extraction instruction includes a rule for extracting the training object; Inputting the training data into the initial large language model to obtain result data of the training data; Calculate the difference between the result data and the verification data to obtain a loss value; The model parameters of the initial large language model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than a first threshold, thereby obtaining the target large language model.

4. The method according to claim 1, characterized in that: The step of merging the object names and object information of the same multiple objects to obtain the setting content of the target text includes: Determine a plurality of objects having the same object name and the same object category as a first object group; When the object names of all objects in the first object group are the first object name, and the object categories of all objects in the first object group are the first object category, the first object group is merged into a first object, wherein the object name of the first object is the first object name, the object category of the first object is the first object category, and the object information of the first object includes the object information of all objects in the first object group.

5. The method according to claim 1, characterized in that The step of merging the object names and object information of the same multiple objects to obtain the setting content of the target text includes: Determine a plurality of objects having the same object name but different object categories as a second object group; determining an object category of the second object group according to object information of all objects in the second object group; When it is determined that the object category of the second object group is the second object category, and the object names of all objects in the second object group are the second object names, the second object group is merged into a second object, wherein the object name of the second object is the second object name, the object category of the second object is the second object category, and the object information of the second object includes the object information of all objects in the second object group.

6. The method according to claim 1, characterized in that The step of merging the object names and object information of the same multiple objects to obtain the setting content of the target text includes: Determine a plurality of objects having different object names, object name similarity greater than a second threshold, and the same object category as a third object group; Determine the object name of the third object group according to the object information of all objects in the third object group; When it is determined that the object name of the third object group is the third object name, and the object category of all objects in the third object group is the third object category, the third object group is merged into a third object, wherein the object name of the third object is the third object name, the object category of the third object is the third object category, and the object information of the third object includes the object information of all objects in the third object group.

7. The method according to claim 6, characterized in that Determining the object name of the third object group according to the object information of all objects in the third object group includes: Determine the object name of the object with the largest number of characters in the object information of the third object group as the object name of the third object group; or The object name of the object in the third object group whose object name appears most times in the target text is determined as the object name of the third object group.

8. A device for extracting text setting content, characterized in that: include: A first segmentation module, used to segment the target text into at least one text paragraph; An extraction module, used for inputting each of the text paragraphs into a target large language model, performing setting extraction on each of the text paragraphs, and obtaining object names, object information, and object categories of all objects set in each of the text paragraphs; A search module, used for searching each of the object names in the target text, and deleting the objects whose object names do not exist in the target text; The merging module is used to merge the object names and object information of the same multiple objects to obtain the set content of the target text.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.