Text retrieval method and device, computer equipment and storage medium

By dividing text into structural units and building a tree-like index structure, the problem of low retrieval efficiency in the existing technology is solved, and efficient and accurate text retrieval effect is achieved, especially in complex texts such as novels to quickly locate specific content.

CN120448470APending Publication Date: 2025-08-08SHANGHAI IQIYI NEW MEDIA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510530563.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Existing text retrieval technology is difficult to provide efficient, accurate, and consistent contextual retrieval capabilities for structured long text content, especially in rich-level and complex narrative texts such as online novels, making it difficult to quickly locate specific characters, events and plot nodes.

Method used

The target text is divided into multiple structural units according to the text content, structure marks and content labels are generated, and a tree-like index structure is constructed, including summary information, character relationship information, plot development information and emotional change information to support efficient retrieval.

Benefits of technology

It significantly improves the search efficiency and accuracy of complex and long texts, supports cross-grained jumps and rapid positioning of specific content, and meets the search needs of high-demand scenarios such as film and television adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448470A_ABST
    Figure CN120448470A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a text retrieval method and device, computer equipment and a storage medium. The method comprises the steps that a target text is divided into a plurality of structural units according to text content; generating a structure mark and a content label for each structure unit; generating corresponding unit attribute information for each structure unit, wherein the unit attribute information comprises summary information, character relationship information, plot development information and emotion change information; constructing a tree-shaped index structure corresponding to the target text according to the structure mark, the content label and the unit attribute information; and when a query request for the target text is received, retrieving a retrieval result corresponding to the query request from the tree index structure. Therefore, structured analysis can be performed on the text to construct the tree index structure, the query request is retrieved through the tree index structure, and the retrieval efficiency and accuracy for the complex long text are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of file retrieval technology, and in particular to a text retrieval method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the widespread adoption of digital reading, especially amidst the ongoing growth of online novels, IP incubation, and film and television adaptations, the demand for in-depth search of novel content is rapidly increasing. When promoting the conversion of novels into film and television content on video platforms, there is a frequent need to quickly locate specific characters, events, plot points, and other details within the vast amount of original works for adaptation creation, script evaluation, or content consistency verification.

[0003] However, existing text retrieval technologies are mostly based on keyword matching or basic semantic embedding. These methods are primarily targeted at simple, short texts like news and encyclopedias. They struggle to provide efficient, accurate, and context-consistent retrieval for long texts with rich layers and complex narratives, such as novels. Therefore, efficient semantic retrieval of structured text has become a pressing challenge. Summary of the Invention

[0004] In view of this, in order to solve the above technical problems or part of the technical problems, the embodiments of the present invention provide a text retrieval method, apparatus, computer equipment and storage medium.

[0005] In a first aspect, an embodiment of the present invention provides a text retrieval method, comprising:

[0006] Divide the target text into multiple structural units according to the text content;

[0007] generating a structure tag and a content tag for each of the structural units;

[0008] Generating corresponding unit attribute information for each of the structural units, the unit attribute information including: summary information, character relationship information, plot development information, and emotional change information;

[0009] Constructing a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information;

[0010] When a query request for the target text is received, a search result corresponding to the query request is retrieved from the tree index structure.

[0011] In one possible implementation, dividing the target text into a plurality of structural units according to text content includes:

[0012] Identifying a hierarchical structure of paragraphs in the target text based on the text content of the target text;

[0013] The target text is divided into multiple structural units according to the hierarchical structure, and the structural units include: bottom-level structural units, middle-level structural units and top-level structural units. The bottom-level structural units represent paragraphs of the target text, the middle-level structural units contain at least one bottom-level structural unit, and the top-level structural units contain at least one middle-level structural unit.

[0014] In a possible implementation, generating a structure tag and a content tag for each structural unit includes:

[0015] Obtaining the unit type of each of the structural units;

[0016] generating the structure tag according to the unit type;

[0017] For each of the structural units, identifying key entity information of the text content, the key entity information including: person, place, time, and event;

[0018] The content tag is generated according to the key entity information.

[0019] In one possible implementation, the summary information is generated in the following manner:

[0020] Generating a bottom-level summary for the bottom-level structural unit to obtain a bottom-level summary set;

[0021] Generating a mid-level summary for the mid-level structural unit to obtain a mid-level summary set;

[0022] Generating a top-level summary for the top-level structural unit to obtain a top-level summary set;

[0023] The bottom-level summary set, the middle-level summary set, and the top-level summary set are used as the summary information.

[0024] In a possible implementation, constructing the tree index structure corresponding to the target text according to the structure tag, the content tag, and the unit attribute information includes:

[0025] According to the structure mark, the top-level structure unit is used as the top-level node of the tree index structure, the middle-level structure unit is used as the intermediate node of the tree index structure, and the bottom-level structure unit is used as the leaf node of the tree index structure to construct the tree index structure;

[0026] Storing the top-level summary set, content tags, character relationship information, plot development information, and emotional change information corresponding to the top-level structural units, and text attribute information of the target text in the top-level node;

[0027] Storing the middle-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, and emotional change information in the middle node;

[0028] The bottom-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, emotional change information and original text are stored in the leaf nodes.

[0029] In a possible implementation, retrieving the search result corresponding to the query request from the tree index structure includes:

[0030] Analyzing the query intent of the query request through a target model;

[0031] Determine the query entity and constraint conditions corresponding to the query intent;

[0032] Determining a search strategy corresponding to the query request according to the query entity and the constraint condition;

[0033] Determine the query level and query scope of the structural unit corresponding to the tree index structure according to the retrieval strategy;

[0034] The search is performed within the query level and query scope according to the search strategy to obtain the search result.

[0035] In a possible implementation, after generating corresponding unit attribute information for each structural unit, the method further includes:

[0036] Obtain the application platform where the target text is located;

[0037] When the application platform includes video information corresponding to the target text, the unit attribute information is optimized according to the video information.

[0038] In a second aspect, an embodiment of the present invention provides a text search device, comprising:

[0039] A division module is used to divide the target text into multiple structural units according to the text content;

[0040] A generating module, configured to generate a structure tag and a content tag for each of the structural units;

[0041] The generating module is further configured to generate corresponding unit attribute information for each structural unit, wherein the unit attribute information includes summary information, character relationship information, plot development information, and emotional change information;

[0042] A construction module, configured to construct a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information;

[0043] The retrieval module is configured to retrieve a retrieval result corresponding to a query request for the target text from the tree index structure when a query request for the target text is received.

[0044] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a processor and a memory, wherein the processor is configured to execute a text retrieval program stored in the memory to implement the text retrieval method described in any one of the first aspects above.

[0045] In a fourth aspect, an embodiment of the present invention provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the text retrieval method described in any one of the first aspects above.

[0046] The text retrieval solution provided by the embodiment of the present invention divides the target text into multiple structural units according to the text content; generates a structural tag and a content tag for each structural unit; generates corresponding unit attribute information for each structural unit, and the unit attribute information includes: summary information, character relationship information, plot development information, and emotional change information; constructs a tree index structure corresponding to the target text based on the structural tags, the content tags, and the unit attribute information; when a query request for the target text is received, retrieves the retrieval results corresponding to the query request from the tree index structure. In this way, the text can be structuredly parsed to construct a tree index structure, and the query request can be retrieved through the tree index structure, significantly improving the retrieval efficiency and accuracy for complex and long texts (such as novels). BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a text retrieval method provided by an embodiment of the present invention;

[0048] Figure 2 A flowchart of another text retrieval method provided by an embodiment of the present invention;

[0049] Figure 3 A schematic structural diagram of a text search device provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of a tree index structure in a text retrieval method provided by an embodiment of the present invention;

[0052] Figure 6 A flowchart of another text retrieval method provided by an embodiment of the present invention;

[0053] Figure 7 A structural diagram of a text retrieval system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0055] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below with reference to the accompanying drawings. The embodiments do not limit the embodiments of the present invention.

[0056] Figure 1 A flowchart of a text retrieval method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method specifically includes:

[0057] S11. Divide the target text into multiple structural units according to the text content.

[0058] The text retrieval method provided by the embodiment of the present invention is applied to computer devices, which may include but are not limited to: servers, desktop computers, etc. Specifically, the text can be structured parsed to construct a tree index structure, and the query request can be retrieved through the tree index structure.

[0059] In this embodiment, the target text can be a complex and long text such as a novel or a film or television script. The target text typically includes multiple volumes, chapters, and sections. After obtaining the target text, preprocessing is first performed, including but not limited to removing irrelevant symbols, correcting typographical errors, and standardizing the format.

[0060] Regular expressions are used to identify chapter and volume titles (such as "Chapter 1," "Volume 1," etc.), and the target text is structurally analyzed at different levels, with a preliminary division into explicit structures such as "volume," "chapter," "section," and "paragraph," while retaining the original structural hierarchy. For texts lacking an explicit structure, the paragraph segmentation strategy used in natural language processing is combined with semantic segmentation based on rules such as text segmentation, logical transition words, and paragraph length. Clustering algorithms (such as K-means and BERTembedding+clustering) can be used to semantically group paragraphs, treating each volume, chapter, section, and paragraph as a structural unit.

[0061] This parsing method is different from traditional flat text processing. It makes full use of the inherent structural characteristics of novels to restore the logical structure of long texts, laying the foundation for subsequent semantic modeling and index construction; it improves the controllability and systematicness of text processing, and solves the problem of complex structure and difficulty in processing long content in genres such as novels.

[0062] S12. Generate a structure tag and content tag for each structural unit.

[0063] In this embodiment, a unique structure ID and / or hierarchical information (such as vol_1.chap_2.sec_3.para_4, or volume 1, section 3, paragraph 2) of each structural unit is generated according to a preset naming rule as a structural tag to identify the hierarchy and position of the structural unit in the text.

[0064] Named Entity Recognition (NER) models (such as BERT-NER and LSTM-CRF) are used to extract basic entities such as people, places, and time. Event extraction algorithms are used to annotate key events and actions (for example, what a character did and where it occurred). Dependency parsing and inter-sentence relationship recognition techniques are used to identify plot clues, such as conflicts, turning points, and climaxes. Content labels are generated for each structural unit according to pre-set naming rules to identify the textual content of the structural unit.

[0065] S13. Generate corresponding unit attribute information for each structural unit. The unit attribute information includes: summary information, character relationship information, plot development information, and emotion change information.

[0066] In this example, the system adopts a bottom-up summary generation strategy, first generating a basic summary for each paragraph, then gradually integrating it to form summaries at the section, chapter, volume, and book levels. This approach preserves local details while also extracting the overall theme and context, addressing the information loss problem in summarizing long texts.

[0067] Specifically, a generative summary model (such as T5, BART, ChatGLM) or an extractive summary model (TextRank, BERTSum) is used to generate summary information for each structural unit at a level from paragraph to the entire book.

[0068] Combining knowledge graph construction technology and co-occurrence analysis, a character co-occurrence matrix is constructed; using contextual analysis of character interactions in the text, relationships such as "friends", "enemies", and "relatives" are extracted to obtain character relationship information for each structural unit.

[0069] Use event chain modeling (e.g., based on OpenIE and event template matching) to track plot progression; construct an event timeline and map it to the chapter structure. Identify key events and turning points in the text, analyze the causal and temporal relationships between events, construct primary and secondary plot lines, and generate a plot development diagram as plot development information for each structural unit.

[0070] Use sentiment analysis models (such as RoBERTa classifier, sentiment dictionary) to identify the content theme and emotional tone of the text, identify the emotional polarity and intensity of each structural unit, and mark the emotional peak (climax, trough) nodes as the emotional change information of each structural unit.

[0071] In this way, the semantic feature dimension of each structural unit can be enriched, providing necessary information support for high-level semantic retrieval, context tracking, user intent matching, etc.

[0072] S14. Construct a tree index structure corresponding to the target text according to the structure tag, content tag and unit attribute information.

[0073] In this embodiment, a multi-layer tree data structure is constructed, including: top-level nodes (root nodes): used to store global information (book title, author, introduction, etc.) and unit attribute information of structural units of volume or whole book type. Intermediate nodes: used to store unit attribute information of structural units of chapter, section, etc.; leaf nodes: used to store unit attribute information of structural units of paragraph type and the original text of the paragraph. Each node is bound to a structure ID, content label and unit attribute information; parent-child (structural hierarchy) relationship and brother (adjacent content) relationship are established; vector index support is added, and nodes are embedded in the vector space through sentence vectors (such as Sentence-BERT) to improve semantic search efficiency. A tree-like index structure is generated through top-level nodes, intermediate nodes and leaf nodes, thereby providing a complete hierarchical semantic indexing system; cross-granularity jump capabilities from "volume chapter" to "character / event" are achieved; and support is provided for the rapid construction of global and local semantic maps of novel content.

[0074] S15. When a query request for the target text is received, a search result corresponding to the query request is retrieved from the tree index structure.

[0075] In this embodiment, a large language model is used to analyze the query request input by the user, identify the query type (such as character query, plot query, theme tracing, etc.); extract keywords and implicit constraints (such as time interval, character relationship, etc.). A combination of keyword matching (inverted index) + semantic vector retrieval (vector index) is performed on the tree index structure; a sorting mechanism based on structural position priority or semantic relevance priority; if a single node is hit, it can be automatically extended to its context node (such as the previous and next two chapters) to enhance semantic coherence. The retrieval results obtained in this way significantly improve the retrieval accuracy and response speed under complex queries; it supports tracking content segments with complete context based on any query intention, meeting the high requirements for detailed verification in scenarios such as film and television adaptations.

[0076] The text retrieval method provided by an embodiment of the present invention divides a target text into multiple structural units according to the text content; generates a structural tag and a content tag for each structural unit; generates corresponding unit attribute information for each structural unit, and the unit attribute information includes: summary information, character relationship information, plot development information, and emotional change information; constructs a tree index structure corresponding to the target text based on the structural tags, content tags, and unit attribute information; and when a query request for the target text is received, retrieves the search results corresponding to the query request from the tree index structure. In this way, the text can be structurally parsed to construct a tree index structure, and the query request can be retrieved through the tree index structure, significantly improving the retrieval efficiency and accuracy of complex and long texts (such as novels).

[0077] Figure 2 A flowchart of another text retrieval method provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method specifically includes:

[0078] S21. Identify the hierarchical structure of paragraphs in the target text according to the text content of the target text; and divide the target text into a plurality of structural units according to the hierarchical structure.

[0079] In this example, text preprocessing is first performed. The original target text is input and cleaned, including removing special characters and correcting typographical errors. Regular expressions are then used to identify chapter titles, segmenting the target text into a preliminary chapter structure, and outputting the preprocessed structured text. Hierarchical structure identification and extraction are then performed. Based on the preprocessed text, a large language model is used to assist in identifying the novel's hierarchical structure, including volumes, chapters, sections, and paragraphs. For structures lacking clear labeling, a semantically based paragraph clustering algorithm is used to identify them. The output is structured text with hierarchical labeling.

[0080] Specifically, the target text (for example, novel text) is obtained from a data source (such as a database, user upload, web crawling, etc.), and the input format can be .txt, .epub, .pdf, etc. The target text can be preprocessed first. If it is not in plain text format, the content is converted into a plain text format encoded in UTF-8 through a format conversion tool. Furthermore, text cleaning is performed (including removing special characters, correcting typesetting errors, etc.). Regular expressions or text processing libraries can be used to perform cleaning operations. Cleaning operations can include: removing special characters: such as tabs, garbled symbols, illegal Unicode characters, web page tags (such as ), repeat blank lines, etc.; unify punctuation marks: unify full-width punctuation marks to half-width or vice versa, unify quotation marks, commas and other symbols; correct formatting errors: detect line break symbols and merge sentences that are mistakenly segmented; identify situations where line breaks are missing between paragraphs and automatically segment them; remove disruptive text: such as copyright statements, advertising information, and chapter redundancy (repeated content such as "Previous Chapter Review").

[0081] Output cleaned text as standardized input. Use regular expressions to identify chapter and volume titles, segmenting the novel into a preliminary chapter structure. Regular expression templates for various common chapter naming rules can be pre-defined. Chapters are divided according to the templates, and the pre-processed structured text is output after segmentation.

[0082] Furthermore, based on the preprocessed text, a large language model is used to assist in identifying the novel's hierarchical structure (volume, chapter, section, paragraph, etc.). Prompt Engineering for the large language model is constructed: Each chapter text is used as an input segment, and prompt information is constructed for structural identification. For example, "The following is a novel text. Please identify its structural level (e.g., volume, chapter, section, paragraph) and assign appropriate structural tags." After constructing the input prompt, a large language model (e.g., GPT, BERT+classification head, LLM API) is invoked. The LLM analyzes chapter titles, semantic logic, and transition language to determine whether the content is at the volume, chapter, section, or paragraph level. Keywords such as "Volume 1" or "Chapter 10" appear in the title, and are explicitly labeled. If structural clues are missing from the title or content, the model makes reasonable guesses based on contextual thematic changes and paragraph transitions. The model automatically annotates the structural levels and outputs structural tags, resulting in multiple well-defined structural units. Each structural unit represents a volume, chapter, section, or paragraph.

[0083] For structures that lack clear labeling, a semantic-based paragraph clustering algorithm is used for identification. Pre-trained language models (such as Sentence-BERT, RoBERTa, and GPT embedding) are used to generate semantic vectors for each paragraph in the chapter. Each paragraph is converted into a high-dimensional semantic vector v_i for paragraph vectorization. Unsupervised clustering algorithms (such as K-means, DBSCAN, and Agglomerative Clustering) are used to cluster paragraphs. Similar paragraphs are grouped together, with each group representing a potential "section" or "sub-chapter." The number of clusters is automatically evaluated using indicators such as the silhouette coefficient and the elbow rule. A "topic switching point detection" model can also be integrated to identify transition locations (such as the TextTiling algorithm). A section-level structure ID is generated for each group of paragraphs, such as "section_3_2" (Chapter 3, Section 2). The clustering results are visualized as a structural hierarchy diagram to assist in subsequent processing.

[0084] Finally, multiple structural units after division are output, and the types of structural units are divided into: bottom-level structural units, middle-level structural units and top-level structural units. The bottom-level structural units represent the paragraphs divided into the target text, the middle-level structural units represent the chapters or sections divided into the target text, the middle-level structural units contain at least one bottom-level structural unit, the top-level structural units represent the volumes divided into the target text, and the top-level structural units contain at least one middle-level structural unit.

[0085] S22. Obtain the unit type of each structural unit; generate a structural tag according to the unit type; for each structural unit, identify key entity information of the text content, the key entity information including: person, place, time, event; generate a content tag according to the key entity information.

[0086] In this embodiment, content analysis is performed on each structural unit to extract key entity information, identify and mark entities such as characters, places, time, events, etc., analyze plot features such as emotional tendencies, conflict points, turning points, etc., and output structured text with content tags.

[0087] Specifically, the unit type of each structural unit is obtained. In the previous step, the target text has been divided into multiple different types of structural units. The structural units of different types are marked according to a preset format to obtain structural tags. The structural tags can be: bottom-level structural units, middle-level structural units and top-level structural units.

[0088] When identifying the key entity information of the text content for each structural unit, named entity recognition (NER) technology is used to extract entities from each structural unit through the BERT, SpaCy or Flair model to identify the key entity information therein, such as characters (roles): identify the names of characters appearing in the novel (such as "Zhang San"), places (such as "valley"), time (such as "May 2020"), and events (for example, major events are identified through keyword extraction: "battle", "duel", "farewell").

[0089] For entities that are not clearly labeled, cross-text entity matching technology can be used to infer entities based on context. Knowledge graphs (such as DBpedia) can be integrated to assist in identifying common places, times, and other information, improving recognition accuracy. Based on the identified key entity information, corresponding content tags are generated in a preset format. Tags can be stored in a JSON structure and associated with corresponding structural units. These tags can be used for subsequent plot analysis, sentiment analysis, structured retrieval, and other tasks. As metadata for structural units, they can help to perform multi-level retrieval and analysis more efficiently.

[0090] S23. Generate corresponding unit attribute information for each structural unit.

[0091] In this embodiment, unit attribute information includes summary information, character relationship information, plot development information, and emotional change information. Summary information is generated by generating bottom-level summaries for bottom-level structural units to obtain a bottom-level summary set; generating middle-level summaries for middle-level structural units to obtain a middle-level summary set; and generating top-level summaries for top-level structural units to obtain a top-level summary set. The bottom-level summary set, middle-level summary set, and top-level summary set are then used as summary information.

[0092] Specifically, a brief summary is generated for the smallest underlying structural unit (paragraph), using a combination of extractive and generative summarization methods to retain key characters, events, and plot developments, and output a collection of underlying summaries. For mid-level structural units (chapter, section), based on the underlying summaries, a mid-level summary is generated by integrating and eliminating redundant information, maintaining plot coherence, and outputting a collection of mid-level summaries. For top-level summaries (volume, entire book), a top-level summary is generated based on the mid-level summary to highlight the main characters, core plot lines, and themes, constructing a global summary of the novel, and outputting a collection of top-level summaries.

[0093] Character relationship information is generated in the following ways:

[0094] First, a character relationship map is constructed to identify all character entities in the novel, analyze the relationship types between characters (such as relatives, friends, enemies, etc.), track the changes in character relationships as the plot develops, and construct a dynamic character relationship map. Character relationship information can be queried from the character relationship map.

[0095] Specifically, pre-trained named entity recognition (NER) models (such as BERT+CRF, Spacy, and Flair) are used to automatically extract person entities from text. The recognition process divides the text into sentences and words; the NER model is used to extract "person" entities (such as names) from each paragraph or sentence; cross-chapter or cross-segment recognition can also use the co-occurrence information of the person context to aggregate repeated entities. Using coreference resolution technology, the same person entity mentioned in different chapters (for example, "Zhang San" and "Zhang Daming") is aggregated into the same person. Knowledge bases (such as DBpedia and Wikidata) can be used to enhance recognition and assist in resolving disambiguation issues such as homonyms.

[0096] Use the Relation Extraction model to analyze the interactions between characters in the text. Using dependency parsing and semantic role labeling (SRL) techniques, extract the emotions and relationship types associated with character behaviors and interactions. Parse sentences to identify typical relational verbs (such as "love," "hate," and "help") and their objects, and identify relationship types: kinship (such as parents, siblings, and spouse); friendship (such as close friends and partners); and adversarial (such as enemies and opposing factions). Each pair of identified connected characters is labeled with a relationship type (such as "father and son," "friends," and "enemy") and the strength of the relationship (such as deep, general, or hostile).

[0097] Tracking changes in character relationships as the plot progresses. As the plot progresses, relationships between characters will shift, for example, from "friends" to "enemies" or "lovers." By tracking events mentioned in the text and their contextual information, we can identify changes in character relationships. Based on event extraction and plot analysis, through timeline annotation and sentiment analysis, we track the evolution of character relationships at different plot points. For each change in a character relationship, we annotate the specific plot paragraph and event where it occurred. For example, the relationship between "Zhang San" and "Li Si" takes a turn in Chapter 5, from "friends" to "enemies"; "Wang Wu" and "Li Si" reconcile in Chapter 8, transitioning from "enemies" to "friends."

[0098] Use graph databases (such as Neo4j) or graph data structures (such as adjacency matrix, adjacency list) to build a dynamic character relationship map. Each node represents a character entity, and each edge represents the relationship between two characters. The attributes of the edge include the relationship type (such as "friend", "enemy"), strength, and change time (occurring after a certain chapter or event). Dynamically update the character relationship map according to changes in the text plot to ensure that the character nodes and relationship nodes in the map are adjusted as the plot develops. Support query relationship changes: such as "what changes have occurred in the relationship between a certain character and other characters after a certain event." Build a visual interface to display the relationship map between characters. Users can click on a character to view its relationship with other characters and the change history. Provide a query interface that supports users to enter the character name to obtain the relationship development of the character throughout the story and the details of its interaction with other characters.

[0099] Plot development information is generated in the following ways:

[0100] Identify key events and turning points in the novel, analyze the causal and temporal relationships between events, construct main and secondary plot lines, and generate a plot development diagram from which plot development information can be retrieved.

[0101] Specifically, an event extraction model (such as a BERT-based event extraction model) is used to automatically identify key events from the novel text and extract the core information involved: event type: such as battle, decision-making, confession, character death, etc. Event theme: such as "Wang Wu decides to go to war" and "Li Si and Zhang San break up." Participants of the event: such as the characters involved ("Li Si" and "Wang Wu"). Time and place: such as the time of occurrence ("the morning of the tenth day") and the place ("Chang'an City"). These events are labeled and an event list is generated to assist in subsequent causal analysis.

[0102] Identify key plot turning points in a story—moments where the main plot undergoes significant changes, such as "a character discovers a significant secret." Use sentiment analysis (e.g., using sentiment classification models) to identify passages with dramatic emotional fluctuations, as these are often high-risk plot turning points. For complex plots, use syntactic dependency analysis (e.g., Stanford Parser) to identify connections between character actions and transitional sentences.

[0103] Dependency parsing and semantic role labeling are used to extract causal relationships between events. For example, in a sentence like "Because Li Si betrayed Wang Wu, Wang Wu decided to seek revenge," an event chain reasoning model is used to infer causal relationships from the sentence, indicating that "event A causes event B." The causal relationship between events is modeled as a directed graph, where each edge represents a causal relationship and each node represents an event.

[0104] Use time extraction techniques (such as time-annotated NER models) to automatically extract the temporal information of each event and construct a time-based event sequence. Sort events by timestamp to generate an event timeline, ensuring that events are arranged in the order in which they occurred. If events are not clearly timed, use context-based temporal inference methods to infer the relative timing of events based on the temporal context of the plot and the context.

[0105] Through event extraction and causal analysis, we extract the main plot. These plots are key events that drive the story, such as the protagonist's confrontation with the villain or the development of a romantic relationship. We use event importance weights (based on frequency, emotional fluctuations, character interactions, etc.) to filter out the main plot events and arrange them in chronological order.

[0106] Secondary plotlines typically revolve around peripheral characters and side stories. By identifying side events (e.g., "Adventures of Supporting Characters" or "Entanglements of Family Relationships"), these events are categorized as secondary plotlines based on their relationship to the main plot. Similarly, secondary plotlines are constructed based on chronological order and event importance.

[0107] Construct a plot diagram, displaying the main and secondary plot lines as nodes and edges. Nodes represent events, while edges represent the causal or temporal relationships between them. Each line in the diagram can represent a complete plot direction, facilitating subsequent analysis and adaptation.

[0108] Utilize the data structure of a graph database (such as Neo4j) or a directed acyclic graph (DAG) to construct a complete plot development diagram. Each node represents an event, and the edges between nodes represent causal or temporal relationships. Add additional information such as timestamps, emotional tags, and characters to each event node to enhance the queryability and analyzability of the graph. Support dynamic updates of the diagram as the plot progresses. Add, delete, and modify nodes in the diagram to reflect changes in character relationships and plots. Provide a user interface that supports querying plot development based on dimensions such as events, characters, emotions, and time. For example, a user can query "Changes in the relationship between Li Si and Zhang San," and the system will return all interaction events and relationship change history between Li Si and Zhang San.

[0109] Emotion change information is generated in the following ways:

[0110] Identify the main themes and emotional tone of the novel, analyze how the themes and emotions change as the plot develops, mark the emotional highs and lows, and generate a thematic-emotional change curve.

[0111] Specifically, topic modeling methods (such as LDA or BERT+LDA) are used to automatically extract topic keywords from the text. For example, in a novel, "love," "revenge," "family," and "adventure" may be the main themes. Thematic analysis is performed based on the frequency of keywords, contextual relationships, and plot structure in the text to ensure that the core themes that run throughout the book are identified. Different chapters and paragraphs are thematically categorized, and each structural unit (such as chapter, section, paragraph) is given a topic label based on the core themes it contains. Sentiment analysis models (such as RoBERTa and BERT pre-trained models) are used to analyze the sentiment polarity of each chapter or paragraph to determine whether it is positive, negative, or neutral. Sentiment analysis is combined with the results of topic identification to ensure that the emotional tone of each plot is consistent with the theme. For example, when describing the theme of "revenge," the emotion may be negative or angry, while in the theme of "love," the emotion may be positive or warm. The emotional tone of each structural unit is output and a sentiment label is generated.

[0112] Construct a plot timeline based on the temporal relationships between each structural unit (chapter and paragraph). Assign a time label to each event or plot segment and place it on the timeline. As the plot progresses, the emotional tone and theme will change. For example, within the theme of "love," as the conflict unfolds, the emotion may shift from "sweet" to "sad." Use sentiment analysis techniques (such as those based on sentiment models) to generate a sentiment curve, analyzing the emotional fluctuations within the plot in real time. Score the emotional tone of each structural unit to form a sentiment intensity curve that depicts the emotional direction of the entire text. Perform a similar analysis on themes to identify "thematically rising" or "thematically declining" trends within the plot and mark key moments of emotional fluctuation, such as "emotional climaxes" and "emotional troughs." Associate themes with emotional changes to generate a thematic sentiment fluctuation graph. For example, the sentiment curve for the theme of "love" may show an initial rise followed by a decline, while the sentiment curve for the theme of "adventure" may show a climax followed by a rapid decline. Use smooth curve fitting algorithms (such as Spline Interpolation) to model emotional changes and ensure smooth transitions. In the emotion intensity curve, emotional climaxes (i.e., maximum emotional intensity) and emotional troughs (i.e., minimum emotional intensity) are marked. These points represent the moments with the greatest emotional tension in the plot, usually plot twists, conflict resolutions, or tragic climaxes. Marking emotional climaxes and troughs not only provides an intuitive sense of emotional intensity, but also provides guidance for subsequent plot analysis and film and television adaptations. Peak detection algorithms (such as PeakDetection, a signal processing-based algorithm) are used to automatically identify peaks and troughs in the emotion curve and give emotional labels for time nodes and related plots. Based on the rate of emotional change, periods of drastic emotional change are marked as auxiliary indicators of turning points.

[0113] Combining the emotional intensity curve with the theme intensity curve creates a comprehensive theme-emotion change curve. This curve illustrates the shifts in emotion and theme throughout the novel as the plot progresses. This curve not only displays the emotional fluctuations within each chapter or section, but also reveals the emotional trends within a particular theme, such as the climax of a love theme. A visualization interface is designed for this change curve, allowing users to view the relationship between emotional fluctuations and thematic changes. Interactive functionality is provided, allowing users to click on a plot node to access detailed emotional and thematic descriptions of that node, further understanding the emotional ups and downs of the storyline.

[0114] S24. Acquire the application platform where the target text is located; when the application platform contains video information corresponding to the target text, optimize the unit attribute information according to the video information.

[0115] In this embodiment, the application platform can be a video playback platform, the target text is usually a novel, film or television script, etc., and the video information corresponding to the target text can be a film or television drama in the video playback platform, that is, a film or television drama shot and generated based on the target text. The summary information, character relationship information, plot development information, and emotional change information of the film or television drama in the video information can be obtained, and based on the above information, the summary information, character relationship information, plot development information, and emotional change information of each structural unit of the target text are optimized and updated. Therefore, when a user searches for the target text through the video playback platform, the search results obtained are generated based on the film or television drama in the video playback platform and the target text, which better meets the user's search requirements.

[0116] S25. Construct a tree index structure corresponding to the target text according to the structure tag, content tag and unit attribute information.

[0117] In this embodiment, when constructing a tree index structure, a multi-level tree index is constructed based on the inclusion relationship between multiple structural units, parent-child and sibling relationships are established between nodes, bidirectional links between nodes are realized, context associations are supported, and a complete tree index structure is constructed.

[0118] The tree index structure generation method includes:

[0119] Design an index node structure. Each node can contain, but is not limited to, fields such as ID, level, summary, and tag. The top-level node stores global information such as the title, author, summary of the entire book, and main characters, as well as unit attribute information corresponding to the top-level structural units. The middle nodes store chapter summaries, appearing characters, key events, and other unit attribute information corresponding to the middle-level structural units. The leaf nodes store the original content, detailed annotations, and attribute information corresponding to the bottom-level structural units.

[0120] Specifically, according to the structure mark, the top-level structure unit is used as the top node of the tree index structure, the middle-level structure unit is used as the middle node of the tree index structure, and the bottom-level structure unit is used as the leaf node of the tree index structure to construct the tree index structure;

[0121] The top-level summary set, content tags corresponding to the top-level structural units, character relationship information, plot development information and emotional change information, as well as the text attribute information of the target text are stored in the top-level node, where the text attribute information may include the name of the target text (the title of the novel), text type (novel, film and television script, etc.), author, main characters, etc.

[0122] The middle-level summary set, the content labels corresponding to the middle-level structural units, the character relationship information, the plot development information and the emotional change information are stored in the middle node;

[0123] The bottom-level summary set, content labels corresponding to the middle-level structural units, character relationship information, plot development information, emotional change information and original text are stored in the leaf nodes.

[0124] In one possible implementation, the initially constructed tree index structure is optimized, the semantic similarity between nodes is calculated, cross-references are established, weight tags are added to important nodes, the retrieval priority is improved, and an inverted index and vector index are constructed for structured information and each node to support rapid positioning of keywords and semantics, and the optimized tree index structure is output.

[0125] Specifically, a semantic representation is performed on each node in the tree-like index structure. A language model is used to convert the text content of each node into a high-dimensional vector representation. The semantic similarity between nodes is calculated using cosine similarity, Euclidean distance, etc. For example, when two paragraphs describe similar plots or the same topic, the model will output a higher similarity score. For each node, its similarity with other nodes is calculated, and the strength of the relationship between the nodes is determined based on the similarity score. Nodes with high similarity can be connected in the tree structure by establishing bidirectional edges. Based on semantic similarity, a cross-reference relationship is established. High similarity between nodes may indicate that they belong to the same plot line or related plot segments, facilitating subsequent retrieval and analysis. For example: If the nodes between the event "Wang Wu decides to take revenge" and "Li Si is misunderstood" as an enemy have similar semantics, a cross-reference can be established in the tree structure to indicate the logical connection between the two.

[0126] In a tree structure, cross-references are automatically established based on the semantic similarity of nodes. Cross-references are primarily used to indicate potential connections between nodes, especially when dealing with plot twists, character interactions, and thematic interweaving. They can help the retrieval system associate related information across chapters or paragraphs. Cross-level cross-references can connect nodes at different levels (e.g., from chapter to section, from section to paragraph). For example, "Zhang San's Revenge Plan" may involve multiple chapters and sections, which are linked together through cross-references.

[0127] Cross-reference relationships can be established using a directed graph structure, where each node represents a structural unit and edges represent similarities and correlations between different nodes. Based on these cross-references, users can quickly locate relevant nodes across different levels of the tree-like index structure when performing queries.

[0128] Each node in the tree index is assigned a weight based on its importance (e.g., plot linch, frequently occurring keywords, emotional fluctuations, etc.). Nodes are prioritized based on their weights, prioritizing search results by returning nodes with higher weights, ensuring that results closely reflect the main plot and key events. Node weights can be adjusted dynamically, for example, based on user feedback, changes in novel adaptation content, or new plot developments.

[0129] Keyword inverted index: By scanning the text content in the tree structure, an inverted index is created for each keyword, recording the node location (such as chapter, section, paragraph) where the keyword appears. Inverted index structure: A list is created for each keyword, listing the location where it appears, so that users can quickly locate it when searching by keyword. For example, the keyword "revenge" may appear in multiple nodes such as "Chapter 5" and "Chapter 10", and can be quickly located using the inverted index.

[0130] Vector embedding techniques (such as Sentence-BERT or Doc2Vec) are used to embed the content of each node, generating a high-dimensional vector. All node vectors are indexed, and efficient vector search engines such as Faiss and Elasticsearch are used to support fast queries based on semantic similarity. Based on an inverted index, when a user enters a keyword, the system can quickly locate all nodes containing that keyword. Semantic retrieval: Based on a vector index, when a user enters a relevant plot description, the system can return semantically similar nodes.

[0131] Combining inverted index, vector index and weight tag, the final optimized tree index structure is output. The optimized index structure can support efficient keyword search and semantic search, and provides cross-reference and weight priority functions to ensure high accuracy and efficiency of search results.

[0132] As an example, Figure 5As shown, it is a schematic diagram of the tree index structure in a text retrieval method provided by an embodiment of the present invention. The top-level node is generated from the top-level structural unit at the whole book level, and is used to store global information such as the book title, author, book summary, main characters, and the like, as well as the unit attribute information corresponding to the top-level structural unit. Multiple layers of intermediate nodes can be set according to the specific levels of the structural unit. The intermediate nodes of this embodiment may include a first-level intermediate node, which is generated from the middle-level structural unit at the volume level, and is used to store the abstracts of each volume, appearing characters, key events, etc., and the unit attribute information corresponding to the middle-level structural unit. The intermediate nodes may include a second-level intermediate node, which is generated from the middle-level structural unit at the chapter level, and is used to store the abstracts of each chapter, appearing characters, key events, etc., and the unit attribute information corresponding to the middle-level structural unit. The leaf node is generated from the bottom-level structural unit at the paragraph level, and is used to store the original text of the paragraph level, detailed annotations, and the attribute information corresponding to the bottom-level structural unit.

[0133] S26. Analyze the query intent of the query request through the target model; determine the query entity and constraint conditions corresponding to the query intent; determine the retrieval strategy corresponding to the query request based on the query entity and constraint conditions; determine the query level and query scope of the structural unit corresponding to the tree index structure based on the retrieval strategy; perform retrieval within the query level and query scope based on the retrieval strategy to obtain retrieval results.

[0134] In this embodiment, the target model can be a large language model. The large language model is used to analyze the semantic structure of the user query request, identify the query intent type (such as character query, plot query, topic query, etc.), extract the key query entities and constraints in the query, output the structured query intent, rewrite the query statement, select the appropriate retrieval strategy based on the query intent, determine the starting query level and query scope of the retrieval, use the rewritten query statement, perform keyword retrieval and vector retrieval within the query level and query scope, search for nodes and structured information, expand the search of related nodes based on the association relationship between nodes, obtain retrieval results, and sort the retrieval results by relevance.

[0135] Furthermore, the system collects multi-level search results, eliminates redundant information, merges similar content, and establishes logical connections between results to generate a structured search result set. Based on the search results and query intent, it generates the answer content. Using large model technology, it ensures the coherence and completeness of the answer, adds necessary contextual information to enhance comprehension, and generates the final answer text corresponding to the query request. Simultaneously, it evaluates the relevance and completeness of the answer, conducts a secondary search when necessary, supplements missing information, optimizes the expression and structure of the answer, and outputs the final optimized answer.

[0136] As an example, Figure 6As shown, it is a flow chart of another text retrieval method provided by an embodiment of the present invention, which performs intent recognition after receiving a user query request, selects a retrieval strategy based on the recognized intent, performs retrieval in a tree index structure based on the retrieval strategy, sorts the retrieval results by relevance, integrates the retrieval results and generates a final answer for output.

[0137] The text retrieval method provided by the present invention structures the text at the chapter level and employs a bottom-up, multi-level summary generation approach. This solves the challenge of balancing global and local information in long text summaries, improves summary quality and information retention, and makes retrieval results more comprehensive and accurate. A tree-like index is designed based on the text hierarchy, with nodes at each level storing information of varying granularity. This supports multi-dimensional retrieval and enables multi-granularity retrieval from coarse to fine, significantly improving retrieval efficiency and reducing computing resource consumption while ensuring the contextual coherence of retrieval results. A dynamic character relationship graph and plot development diagram are constructed to capture the changes in structured information as the plot progresses, enhancing the system's semantic understanding of novel content, supporting complex relationship queries, and providing intuitive references for character relationships and plot development in film and television adaptations. A specialized intent recognition module is designed to dynamically select retrieval strategies and scopes based on query intent, improving retrieval accuracy, reducing irrelevant results, and enabling the system to provide customized retrieval services for different query types. Large model technology is used to integrate multi-level retrieval results to generate coherent answers that align with user intent, addressing the fragmented answers found in traditional retrieval systems and providing a more natural and coherent answer experience.

[0138] like Figure 7 The figure shows a schematic diagram of the structure of a text retrieval system provided by an embodiment of the present invention, comprising: a content processing layer, an indexing layer, a retrieval layer, and an output layer. The content processing layer comprises: 1. a novel hierarchical parsing module for text preprocessing, hierarchical structure identification and extraction, and content tag extraction; 2. a multi-level summary generation module for bottom-level summary generation, mid-level summary integration, and top-level summary generation; 3. a structured information extraction module for generating unit attribute information, which may include: character relationship map construction, plot development clue analysis, and theme and sentiment analysis. The indexing layer comprises: a tree index construction module for node design, tree index structure construction, and index optimization of the tree index structure. The retrieval layer comprises: 1. an intent recognition and retrieval module for query intent recognition and retrieval strategy selection for query requests; 2. a retrieval execution module for executing retrieval operations according to the retrieval strategy. The output layer comprises: a result integration and generation module for retrieval result integration, answer generation, and result evaluation and optimization. The answer is ultimately output to the user interface.

[0139] Figure 3 A structural diagram of a text retrieval device provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the device specifically includes:

[0140] A division module 31 is used to divide the target text into multiple structural units according to the text content;

[0141] A generating module 32, configured to generate a structure tag and a content tag for each of the structural units;

[0142] The generating module is further configured to generate corresponding unit attribute information for each structural unit, wherein the unit attribute information includes summary information, character relationship information, plot development information, and emotional change information;

[0143] A construction module 33 is configured to construct a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information;

[0144] The retrieval module 34 is configured to retrieve a retrieval result corresponding to a query request for the target text from the tree index structure when a query request for the target text is received.

[0145] In a possible implementation, the segmentation module is specifically configured to identify a hierarchical structure of paragraphs in the target text according to the text content of the target text;

[0146] The target text is divided into multiple structural units according to the hierarchical structure, and the structural units include: bottom-level structural units, middle-level structural units and top-level structural units. The bottom-level structural units represent paragraphs of the target text, the middle-level structural units contain at least one bottom-level structural unit, and the top-level structural units contain at least one middle-level structural unit.

[0147] In a possible implementation, the generating module is specifically configured to obtain a unit type of each of the structural units;

[0148] generating the structure tag according to the unit type;

[0149] For each of the structural units, identifying key entity information of the text content, the key entity information including: person, place, time, and event;

[0150] The content tag is generated according to the key entity information.

[0151] In a possible implementation, the generating module is specifically configured to generate a bottom-level summary for the bottom-level structural unit to obtain a bottom-level summary set;

[0152] Generating a mid-level summary for the mid-level structural unit to obtain a mid-level summary set;

[0153] Generating a top-level summary for the top-level structural unit to obtain a top-level summary set;

[0154] The bottom-level summary set, the middle-level summary set, and the top-level summary set are used as the summary information.

[0155] In a possible implementation, the construction module is specifically configured to construct the tree index structure by using the top-level structural unit as the top-level node of the tree index structure, the middle-level structural unit as the middle node of the tree index structure, and the bottom-level structural unit as the leaf node of the tree index structure according to the structural tag;

[0156] Storing the top-level summary set, content tags, character relationship information, plot development information, and emotional change information corresponding to the top-level structural units, and text attribute information of the target text in the top-level node;

[0157] Storing the middle-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, and emotional change information in the middle node;

[0158] The bottom-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, emotional change information and original text are stored in the leaf nodes.

[0159] In a possible implementation, the retrieval module is specifically configured to analyze the query intent of the query request through a target model;

[0160] Determine the query entity and constraint conditions corresponding to the query intent;

[0161] Determining a search strategy corresponding to the query request according to the query entity and the constraint condition;

[0162] Determine the query level and query scope of the structural unit corresponding to the tree index structure according to the retrieval strategy;

[0163] The search is performed within the query level and query scope according to the search strategy to obtain the search result.

[0164] In one possible implementation, the optimization module 35 is configured to obtain an application platform where the target text is located;

[0165] When the application platform includes video information corresponding to the target text, the unit attribute information is optimized according to the video information.

[0166] The text search device provided in this embodiment can be as follows Figure 3The device shown in , can perform the following Figure 1-2 All steps of the Chinese text retrieval method, and then achieve Figure 1-2 For details on the technical effects of the text retrieval method shown, please refer to Figure 1-2 For the sake of brevity, the relevant description will not be repeated here.

[0167] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is provided. Figure 4 The computer device 400 shown includes: at least one processor 401, memory 402, at least one network interface 404 and other user interfaces 403. The various components in the computer device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 405 is not described in detail. Figure 4 Various buses are labeled as bus system 405 .

[0168] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touchpad, or a touch screen).

[0169] It is understood that the memory 402 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0170] In some embodiments, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and application programs 4022 .

[0171] The operating system 4021 includes various system programs, such as a framework layer, a core library layer, and a driver layer, for implementing various basic services and handling hardware-based tasks. Application programs 4022 include various application programs, such as a media player and a browser, for implementing various application services. Programs implementing the methods of the embodiments of the present invention may be included in application programs 4022.

[0172] In an embodiment of the present invention, by calling a program or instruction stored in the memory 402, specifically, a program or instruction stored in the application 4022, the processor 401 is configured to execute the method steps provided in each method embodiment, for example, including:

[0173] Divide the target text into multiple structural units according to the text content;

[0174] generating a structure tag and a content tag for each of the structural units;

[0175] Generating corresponding unit attribute information for each of the structural units, the unit attribute information including: summary information, character relationship information, plot development information, and emotional change information;

[0176] Constructing a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information;

[0177] When a query request for the target text is received, a search result corresponding to the query request is retrieved from the tree index structure.

[0178] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in processor 401 or by software instructions. The above processor 401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software units in the decoding processor. The software units can be located in storage media well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 402 , and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware.

[0179] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSP devices, DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.

[0180] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0181] The computer device provided in this embodiment may be Figure 4 The device shown in , can perform Figure 1-2 All steps of the Chinese text retrieval method, and then achieve Figure 1-2 For details on the technical effects of the text retrieval method shown, please refer to Figure 1-2 For the sake of brevity, the relevant description will not be repeated here.

[0182] An embodiment of the present invention further provides a storage medium (computer-readable storage medium). The storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and the memory may also include a combination of the aforementioned types of memory.

[0183] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned text retrieval method executed on the device side is implemented.

[0184] The processor is configured to execute a text retrieval program stored in the memory to implement the following steps of a text retrieval method executed on the device side:

[0185] Divide the target text into multiple structural units according to the text content;

[0186] generating a structure tag and a content tag for each of the structural units;

[0187] Generating corresponding unit attribute information for each of the structural units, the unit attribute information including: summary information, character relationship information, plot development information, and emotional change information;

[0188] Constructing a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information;

[0189] When a query request for the target text is received, a search result corresponding to the query request is retrieved from the tree index structure.

[0190] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0191] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0192] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A text retrieval method, characterized in that: include: Divide the target text into multiple structural units according to the text content; generating a structure tag and a content tag for each of the structural units; Generating corresponding unit attribute information for each of the structural units, the unit attribute information including: summary information, character relationship information, plot development information, and emotional change information; Constructing a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information; When a query request for the target text is received, a search result corresponding to the query request is retrieved from the tree index structure.

2. The method according to claim 1, characterized in that The target text is divided into a plurality of structural units according to the text content, including: Identifying a hierarchical structure of paragraphs in the target text based on the text content of the target text; The target text is divided into multiple structural units according to the hierarchical structure, and the structural units include: bottom-level structural units, middle-level structural units and top-level structural units. The bottom-level structural units represent paragraphs of the target text, the middle-level structural units contain at least one bottom-level structural unit, and the top-level structural units contain at least one middle-level structural unit.

3. The method according to claim 1, characterized in that Generating a structure tag and a content tag for each of the structural units includes: Obtaining the unit type of each of the structural units; generating the structure tag according to the unit type; For each of the structural units, identifying key entity information of the text content, the key entity information including: person, place, time, and event; The content tag is generated according to the key entity information.

4. The method according to claim 2, characterized in that The summary information is generated in the following way: Generating a bottom-level summary for the bottom-level structural unit to obtain a bottom-level summary set; Generating a mid-level summary for the mid-level structural unit to obtain a mid-level summary set; Generating a top-level summary for the top-level structural unit to obtain a top-level summary set; The bottom-level summary set, the middle-level summary set, and the top-level summary set are used as the summary information.

5. The method according to claim 4, characterized in that The step of constructing a tree index structure corresponding to the target text according to the structure tag, the content tag, and the unit attribute information includes: According to the structure mark, the top-level structure unit is used as the top-level node of the tree index structure, the middle-level structure unit is used as the intermediate node of the tree index structure, and the bottom-level structure unit is used as the leaf node of the tree index structure to construct the tree index structure; Storing the top-level summary set, content tags, character relationship information, plot development information, and emotional change information corresponding to the top-level structural units, and text attribute information of the target text in the top-level node; Storing the middle-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, and emotional change information in the middle node; The bottom-level summary set, content tags corresponding to the middle-level structural units, character relationship information, plot development information, emotional change information and original text are stored in the leaf nodes.

6. The method according to claim 1, characterized in that The retrieving the search result corresponding to the query request from the tree index structure includes: Analyzing the query intent of the query request through a target model; Determine the query entity and constraint conditions corresponding to the query intent; Determining a search strategy corresponding to the query request according to the query entity and the constraint condition; Determine the query level and query scope of the structural unit corresponding to the tree index structure according to the retrieval strategy; The search is performed within the query level and query scope according to the search strategy to obtain the search result.

7. The method according to claim 1, characterized in that After generating corresponding unit attribute information for each structural unit, the method further includes: Obtain the application platform where the target text is located; When the application platform includes video information corresponding to the target text, the unit attribute information is optimized according to the video information.

8. A text retrieval device, characterized in that: include: A division module is used to divide the target text into multiple structural units according to the text content; A generating module, configured to generate a structure tag and a content tag for each of the structural units; The generating module is further configured to generate corresponding unit attribute information for each structural unit, wherein the unit attribute information includes summary information, character relationship information, plot development information, and emotional change information; A construction module, configured to construct a tree index structure corresponding to the target text according to the structure tag, the content tag and the unit attribute information; The retrieval module is configured to retrieve a retrieval result corresponding to a query request for the target text from the tree index structure when a query request for the target text is received.

9. A computer device, characterized in that: include: A processor and a memory, wherein the processor is configured to execute a text retrieval program stored in the memory to implement the text retrieval method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the text retrieval method according to any one of claims 1 to 7.