Text content automatic insertion method and device, storage medium and electronic equipment

Through text analysis technology combined with LSTM and BERT models, automatically identifying and inserting cited literature and/or examples, the problem of low intelligence in existing tools is solved and writing efficiency and text quality is improved.

CN120337875APending Publication Date: 2025-07-18AIJI MICRO CONSULTING (XIAMEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510461562.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Existing text editing tools and online writing aids are less intelligent and automated in citing literature and/or illustration insertion, resulting in less writing efficiency.

Method used

The LSTM model is used to analyze the context, combine the BERT model for deep semantic analysis, automatically identify entities, keywords and contexts in the text, and use semantic matching algorithm to obtain cited literature and/or examples, obtain matching content through web crawlers and APIs, and automatically insert them into the pending text according to the best insertion position.

Benefits of technology

Automatic insertion of cited documents and/or illustrations is realized, reducing manual search and editing time, and improving writing efficiency and logical coherence and credibility of text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337875A_ABST
    Figure CN120337875A_ABST
Patent Text Reader

Abstract

The invention discloses a text content automatic insertion method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a to-be-processed text; performing text analysis on the to-be-processed text, and determining an entity, a keyword and a context of the to-be-processed text; obtaining reference literatures and / or examples according to the entities and the keywords; analyzing the context by using an LSTM model, and predicting an optimal insertion position of the reference literature and / or the example in the to-be-processed text; inserting the reference literature and / or the example into the to-be-processed text according to the optimal insertion position to generate a target text; and displaying the target text. According to the method and the device, automatic insertion of reference literatures and / or examples can be realized, and manual searching and editing time is shortened, so that the writing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of text processing, and particularly to a method, apparatus, storage medium, and electronic device for automatically inserting text content. Background Art

[0002] Existing text editing tools and reference management software (such as EndNote, Zotero) provide citation management and insertion functions. However, these tools mainly rely on users to manually input and select reference documents, with relatively low levels of intelligence and automation. In addition, some online writing assistance tools (such as Grammarly, Hemingway) can provide basic writing suggestions and grammar checks, but have limited functions in terms of inserting reference documents and / or examples.

[0003] Current text editing tools mainly rely on users to manually search for and edit reference documents and / or examples, with relatively low levels of intelligence and automation and low writing efficiency. Summary of the Invention

[0004] Embodiments of this application provide a method, apparatus, storage medium, and electronic device for automatically inserting text content, which can improve the writing efficiency of text.

[0005] In a first aspect, embodiments of this application provide a method for automatically inserting text content, including:

[0006] Obtain the text to be processed;

[0007] Perform text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed;

[0008] Obtain reference documents and / or examples based on the entities and the keywords;

[0009] Use an LSTM model to analyze the context and predict the best insertion positions of the reference documents and / or the examples in the text to be processed;

[0010] Insert the reference documents and / or the examples into the text to be processed according to the best insertion positions to generate a target text;

[0011] Display the target text.

[0012] In the method for automatically inserting text content provided by embodiments of this application, after obtaining the text to be processed and before performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed, it further includes:

[0013] Perform text preprocessing on the text to be processed.

[0014] In the method for automatically inserting text content provided in the embodiments of the present application, the text preprocessing of the text to be processed includes:

[0015] Performing word segmentation, removing stop words, lemmatization, and normalization on the text to be processed.

[0016] In the method for automatically inserting text content provided in the embodiments of the present application, the text analysis of the text to be processed to determine the entities, keywords, and context of the text to be processed includes:

[0017] Using a pre-trained BERT model to perform in-depth semantic analysis on the text to be processed after text preprocessing to identify the entities, keywords, and context in the text to be processed.

[0018] In the method for automatically inserting text content provided in the embodiments of the present application, the obtaining of reference documents and / or examples according to the entities and the keywords includes:

[0019] Using a semantic matching algorithm to determine whether there are reference documents and / or examples matching the keywords and the entities in the local database;

[0020] If not, using a web crawler and an API to perform Internet resource retrieval to obtain matching reference documents and / or examples.

[0021] In the method for automatically inserting text content provided in the embodiments of the present application, the examples include text-based examples. Before inserting the reference documents and / or the examples into the text to be processed according to the optimal insertion position to generate the target text, it further includes:

[0022] Formatting the reference documents according to a preset reference format;

[0023] Using a GPT-4 model to process the text-based examples.

[0024] In a second aspect, the embodiments of the present application provide a device for automatically inserting text content, including:

[0025] A text acquisition unit for acquiring the text to be processed;

[0026] A text analysis unit for performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed;

[0027] A content determination unit for obtaining reference documents and / or examples according to the entities and the keywords;

[0028] A location determination unit, configured to analyze the context using an LSTM model and predict the optimal insertion location of the cited document and / or the example in the text to be processed;

[0029] A content insertion unit, configured to insert the cited document and / or the example into the text to be processed according to the optimal insertion location to generate a target text;

[0030] A user interface, configured to display the target text.

[0031] In the text content automatic insertion device provided in the embodiment of the present application, it further includes:

[0032] A text preprocessing unit, configured to perform text preprocessing on the text to be processed.

[0033] In a third aspect, the present application provides a storage medium storing multiple instructions, and the instructions are suitable for being loaded by a processor to execute the method described in any one of the above.

[0034] In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in any one of the above is implemented.

[0035] In summary, the text content automatic insertion method provided in the embodiment of the present application includes: obtaining a text to be processed; performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed; obtaining cited documents and / or examples according to the entities and the keywords; analyzing the context using an LSTM model and predicting the optimal insertion location of the cited documents and / or the examples in the text to be processed; inserting the cited documents and / or the examples into the text to be processed according to the optimal insertion location to generate a target text; and displaying the target text. The embodiment of the present application can automatically obtain cited documents and / or examples, and use an LSTM model to predict the optimal insertion location of the cited documents and / or examples in the text to be processed, so as to realize the automatic insertion of the cited documents and / or examples. Therefore, the present application can realize the automatic insertion of the cited documents and / or examples, reduce the manual search and editing time, and thus improve the writing efficiency. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0037] Figure 1 It is a schematic flowchart of the method for automatically inserting text content provided by an embodiment of the present application.

[0038] Figure 2 It is a schematic structural diagram of the device for automatically inserting text content provided by an embodiment of the present application.

[0039] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0040] Here, exemplary embodiments will be described in detail, and examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0041] It should be noted that in this document, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including that element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanations in the specific embodiments or further in combination with the context of the specific embodiments.

[0042] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] In subsequent descriptions, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the convenience of explaining the present application, and they have no specific meaning in themselves. Therefore, "module", "component" or "unit" can be used interchangeably.

[0044] In the description of the present application, it should be noted that the orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application. In addition, terms such as "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0045] Current text editing tools mainly rely on users to manually search for and edit reference documents and / or examples, with low levels of intelligence and automation and low writing efficiency.

[0046] Based on this, embodiments of the present application provide a method, apparatus, storage medium, and electronic device for automatically inserting text content. Specifically, the text content automatic insertion apparatus can be integrated into an electronic device, which can be a server or a terminal device, etc.; among them, the terminal can include a mobile phone, a wearable intelligent device, a tablet computer, a laptop computer, and a personal computer (PC), etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0047] The following will specifically illustrate the technical solutions shown in the present application through specific embodiments. It should be noted that the description order of the following embodiments does not limit the priority order of the embodiments.

[0048] Please refer to Figure 1 , Figure 1 which is a schematic flow chart of the text content automatic insertion method provided by the embodiments of the present application. The specific process of the text content automatic insertion method can be as follows:

[0049] 101. Obtain the text to be processed.

[0050] Among them, the text to be processed can be any form of information carrier, such as an article, a sentence, a paragraph, etc. In addition, the text to be processed can be in any language, such as Chinese, English, French, etc.

[0051] In some embodiments, text preprocessing can also be performed on the text to be processed. Specifically, text preprocessing such as word segmentation, stop word removal, word form reduction, and normalization processing can be performed on the text to be processed.

[0052] Specifically, first, perform word segmentation. Word segmentation refers to splitting continuous text into individual lexical units, that is, splitting the text to be processed into individual lexical units. Then, perform the operation of removing stop words, that is, removing those words that frequently appear in the text to be processed but contribute little to the meaning of the text, such as "de", "shi", "zai", etc. Then, perform lemmatization, that is, restoring the words to their basic forms. For example, restore "running" to "run". Finally, perform normalization to ensure that the lexical forms in the text to be processed are unified. For example, convert all numbers or special symbols to standard forms. Through these preprocessing steps, the accuracy and efficiency of text processing can be effectively improved.

[0053] Among them, the "standard form" refers to the unified and standardized representation of the words, numbers, symbols, etc. in the text to be processed, so as to facilitate subsequent analysis and processing. Specifically, it can be as follows:

[0054] Normalization of numbers: Convert different forms of numbers into a unified format. For example, convert "10,000" to "10000", or unify the date "01 / 15 / 2025" to "2025-01-15".

[0055] Unification of letter cases: Convert all letters to lowercase or uppercase to eliminate the impact of case differences on text analysis. For example, unify "Apple" and "apple" to "apple".

[0056] Processing of special symbols: Remove, replace, or unify special symbols. For example, replace "$" with "USD", mark the "#" symbol as a tag form, or directly remove unnecessary symbols.

[0057] Spelling normalization: Correct spelling mistakes or variant forms. For example, unify "colour" and "color" into one form, and choose according to the language region specification.

[0058] Unification of abbreviations and full names: Restore abbreviations to full names (such as replacing "AI" with "Artificial Intelligence"), or vice versa, abbreviate full names.

[0059] Adjustment of text format: Perform unified and standardized processing on serial numbers, lists, or specific structures (such as HTML tags) to ensure consistent data formats.

[0060] 102. Perform text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed.

[0061] Specifically, a pre-trained BERT model can be used to perform in-depth semantic analysis on the text to be processed after text preprocessing, and identify entities, keywords, and context in the text to be processed.

[0062] Among them, the pre-training tasks of the BERT model include two core parts: the masked language model training task (Masked Language Model, MLM) and the next sentence prediction training (Next Sentence Prediction, NSP).

[0063] The masked language model training task refers to randomly selecting 15% of the words in the input text for masking (replaced with the special token [MASK]), and letting the model predict these masked words. This task enables the model to learn to infer missing vocabulary based on the context, thereby mastering deep semantic information.

[0064] The next sentence prediction training task refers to providing a pair of sentences and determining whether the second sentence is a logical continuation of the first sentence. This method enables the model to learn to understand the relationship between sentences and is applicable to tasks such as question answering and document classification.

[0065] Specifically, first, pre-training resources can be prepared by collecting a large amount of unlabeled text data, such as Wikipedia, BooksCorpus, etc., and then performing text preprocessing on these text data as in step 101. After that, the BERT model is trained through the masked language model training task and the next sentence prediction training to obtain a BERT model that can finally perform in-depth semantic analysis on the text to be processed.

[0066] In the specific implementation process, a specific fine-tuning model in the BERT model (such as the fine-tuned NER model) can be used for entity recognition. In addition, the BERT model does not directly provide the keyword extraction function, but keyword extraction can be performed using two methods: sentence embeddings and attention scores. Sentence embeddings refer to converting text fragments into vectors and calculating the relevance to the entire content of the text to be processed. Attention scores refer to analyzing the weights in the attention mechanism to extract important words. Context can be achieved through sentence pair classification or question answering tasks. Among them, sentence pair classification refers to identifying whether two sentences are logically related. The question answering task refers to extracting the fragment in the text to be processed that answers a specified question.

[0067] The BERT model is trained on a large corpus of text and has powerful language understanding capabilities. It can capture subtle semantic differences in the text to be processed. By performing in-depth semantic analysis on the text to be processed, it can not only extract the key information (i.e., entities, keywords, and context) in the text to be processed, but also understand the meaning of these key information in the specific context. This analysis method has a wide range of applications in the field of natural language processing, such as in information retrieval, sentiment analysis, question answering systems, etc. By using the BERT model, the accuracy and efficiency of text analysis can be significantly improved, thus better serving various language processing tasks.

[0068] 103. Obtain citation documents and / or examples based on entities and keywords.

[0069] Specifically, a semantic matching algorithm can be used to determine whether there are citation documents and / or examples in the local database that match the keywords and entities; if so, extract the matching citation documents and / or examples in the local database; if not, use web crawlers and APIs to retrieve Internet resources to obtain matching citation documents and / or examples.

[0070] Among them, determining whether there are citation documents and / or examples in the local database that match the keywords and entities refers to calculating the semantic similarity between the entities and keywords and the content in the citation documents and / or examples, and determining whether there are citation documents and / or examples in the local database that match the keywords and entities through a similarity threshold. It can be understood that when the semantic similarity is greater than or equal to the similarity threshold, it can be confirmed that there is a match. When the semantic similarity is less than the similarity threshold, it can be confirmed that there is no match.

[0071] In some embodiments, the citation documents can also be formatted according to a preset citation format, so that the inserted citation documents are in the same format as the text to be processed. Examples can include text-based examples, and the GPT-4 model can be used to process the text-based examples to generate high-quality example content.

[0072] 104. Use the LSTM model to analyze the context and predict the best insertion position of the citation documents and / or examples in the text to be processed.

[0073] The Long Short-Term Memory (LSTM) model, through its unique gating mechanism, can capture long-distance dependencies, thus better understanding the semantics and structure of the text. Through training on a large amount of labeled data, the LSTM model can learn the typical positions of different types of citation documents and / or examples in the text, so as to accurately predict the most suitable insertion point in a new text processing task.

[0074] In the specific implementation process, the LSTM model can be trained first, and then the trained LSTM model can be used to predict the best insertion positions of cited documents and / or examples in the text to be processed.

[0075] The training process of the LSTM model can be as follows:

[0076] (1) Collect training data:

[0077] First, paragraphs containing cited documents or examples can be extracted from academic articles, reports, or papers, and the insertion positions of the cited documents and / or examples can be marked. Then, mark its format as the insertion position label for each word or sentence. For example, given the text: "The research shows that this method is very effective [1]." Label: [0,0,0,0,0,1] (1 indicates the insertion position of the cited document). After that, the collected training data can be preprocessed as in step 101.

[0078] (2) Build an LSTM model, which can include:

[0079] Input embedding layer: The input text sequence is converted into word vectors of a fixed dimension through the input embedding layer.

[0080] LSTM layer: Use LSTM to capture the context information in the text sequence and identify potential insertion points.

[0081] Output layer: Use a fully connected layer and an activation function to calculate the probability of each position as an insertion point.

[0082] Result output layer: The model gives an insertion probability (0 - 1) for each text position, and the position with a higher probability is regarded as the best insertion point.

[0083] (3) Model training:

[0084] Input: Feed the training text and the labeled tags into the LSTM model.

[0085] Forward propagation: Calculate the insertion probability of each position.

[0086] Loss calculation: Compare the predicted value with the true label and calculate the loss function.

[0087] Backward propagation: Adjust the parameters of the LSTM model to reduce the loss function.

[0088] Repeat iteration: Improve the prediction accuracy of the LSTM model through multiple rounds of training.

[0089] Model verification: Verify the prediction accuracy of the LSTM model through the validation dataset.

[0090] 105. Insert the cited references and / or examples into the text to be processed according to the optimal insertion positions to generate the target text.

[0091] 106. Display the target text.

[0092] In actual application, the user can view the effects of the cited references and / or examples in real time through the user interface and make fine-tuning.

[0093] Among them, the effects can be the fluency of the text structure and logic. For example, the cited references or examples should be inserted into appropriate positions to enhance the coherence of the target text. For instance, the cited reference should be inserted after the elaboration of a certain view, or the example should be inserted into the blank in the argument to ensure clear logic. Again, the inserted reference or example should be logically matched with the surrounding sentences or paragraphs to ensure that the cited content is relevant to the current discussion and does not make the target text appear abrupt or unnatural.

[0094] For example, the original text: "The use of automation in modern industry has greatly improved production efficiency."

[0095] The effect after insertion: "The use of automation in modern industry has greatly improved production efficiency [1]."

[0096] In this case, the cited reference is properly inserted into the appropriate position, enhancing the credibility of the target text without affecting the fluency of the sentence.

[0097] In some embodiments, the effect can also be the timeliness of inserting the cited references and / or examples. The cited references and / or examples are inserted into appropriate positions to enhance the coherence of the text. For example, the cited reference should be inserted after the elaboration of a certain view, or the example should be inserted into the blank in the argument to ensure clear logic. The inserted cited references and / or examples are logically matched with the surrounding sentences or paragraphs to ensure that the cited content is relevant to the current discussion and does not make the text appear abrupt or unnatural.

[0098] For example, the original text: "In recent years, more and more studies have shown that the application of machine learning in multiple fields has remarkable effects."

[0099] The effect after insertion: "In recent years, more and more studies have shown that the application of machine learning in multiple fields has remarkable effects [2][3]. For example, Smith et al. (2021) showed in their study that the prediction accuracy of machine learning in the financial field has been greatly improved."

[0100] In this case, the insertion of the example enhances the credibility of the original sentence and makes the argument more persuasive.

[0101] The user interface can provide a simple and intuitive user interface, support text input, citation and / or example display, real-time preview and editing. Moreover, it supports exporting the finally confirmed text into multiple formats (such as Word, PDF, Markdown).

[0102] In summary, the method for automatically inserting text content provided by the embodiments of this application includes: obtaining the text to be processed; performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed; obtaining citations and / or examples according to the entities and keywords; using the LSTM model to analyze the context and predict the best insertion positions of the citations and / or examples in the text to be processed; inserting the citations and / or examples into the text to be processed according to the best insertion positions to generate the target text; and displaying the target text. The embodiments of this application can automatically obtain citations and / or examples and use the LSTM model to predict the best insertion positions of the citations and / or examples in the text to be processed, realizing the automatic insertion of citations and / or examples. Therefore, the embodiments of this application can achieve the automatic insertion of citations and / or examples, reduce the manual search and editing time, and thus improve the writing efficiency.

[0103] Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of the text content automatic insertion device provided by the embodiments of this application. The text content automatic insertion device may include a text acquisition unit 201, a text analysis unit 202, a content determination unit 203, a position determination unit 204, a content insertion unit 205, and a user interface 206.

[0104] Among them,

[0105] The text acquisition unit 201 is configured to obtain the text to be processed;

[0106] The text analysis unit 202 is configured to perform text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed;

[0107] The content determination unit 203 is configured to obtain citations and / or examples according to the entities and keywords;

[0108] The position determination unit 204 is configured to use the LSTM model to analyze the context and predict the best insertion positions of the citations and / or examples in the text to be processed;

[0109] The content insertion unit 205 is configured to insert the citations and / or examples into the text to be processed according to the best insertion positions to generate the target text;

[0110] The user interface 206 is configured to display the target text.

[0111] For the specific implementation manners of each of the above units, reference may be made to the embodiments of the above-mentioned method for automatically inserting text content, which will not be elaborated herein one by one.

[0112] In summary, the text content automatic insertion device provided in the embodiments of the present application can obtain the text to be processed through the text acquisition unit 201; the text analysis unit 202 performs text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed; the content determination unit 203 obtains reference documents and / or examples according to the entities and keywords; the position determination unit 204 uses the LSTM model to analyze the context and predict the best insertion position of the reference documents and / or examples in the text to be processed; the content insertion unit 205 inserts the reference documents and / or examples into the text to be processed according to the best insertion position to generate the target text; and the user interface 206 displays the target text. The embodiments of the present application can automatically obtain reference documents and / or examples, and use the LSTM model to predict the best insertion position of the reference documents and / or examples in the text to be processed, so as to realize the automatic insertion of reference documents and / or examples. Therefore, the embodiments of the present application can realize the automatic insertion of reference documents and / or examples, reduce the manual search and editing time, and thus improve the writing efficiency.

[0113] The embodiments of the present application also provide an electronic device, which may integrate the text content automatic insertion device of the embodiments of the present application. As Figure 3 shown, it shows a schematic structural diagram of the electronic device involved in the embodiments of the present application. The electronic device includes a memory 301, a processor 302, and a computer program stored on the memory 301 and executable on the processor 302. Among them, when the processor 302 executes the computer program, it implements the above-mentioned method for automatically inserting text content in the embodiments of the present application.

[0114] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the detailed description of the method for automatically inserting text content above, which will not be elaborated herein.

[0115] It should be noted that for the method for automatically inserting text content in the embodiments of the present application, those skilled in the art can understand that all or part of the processes for implementing the method for automatically inserting text content in the embodiments of the present application can be controlled by a computer program related hardware. The computer program can be stored in a computer-readable storage medium, such as stored in the memory of the terminal, and executed by at least one processor in the terminal. During the execution process, it may include the processes of the embodiments of the method for automatically inserting text content.

[0116] For the text content automatic insertion device according to the embodiments of the present application, its various functional modules can be integrated in a processing chip, or each module can exist physically separately, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0117] Therefore, the embodiments of the present application provide a storage medium, in which multiple instructions are stored, and these instructions can be loaded by a processor to execute the steps in any of the text content automatic insertion method and clearing method provided by the embodiments of the present application. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), etc.

[0118] The above has introduced in detail the text content automatic insertion method, device, storage medium and electronic device provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. An automatic text content insertion method, characterized in that, Including: Obtain the text to be processed; Perform text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed; Obtain reference documents and / or examples according to the entities and the keywords; Use the LSTM model to analyze the context and predict the best insertion positions of the reference documents and / or the examples in the text to be processed; Insert the reference documents and / or the examples into the text to be processed according to the best insertion positions to generate the target text; Display the target text.

2. The automatic text insertion method according to claim 1, characterized in that, After obtaining the text to be processed and before performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed, it further includes: Perform text preprocessing on the text to be processed.

3. The automatic text insertion method according to claim 2, wherein The performing text preprocessing on the text to be processed includes: Perform word segmentation, stop word removal, lemmatization, and normalization processing on the text to be processed.

4. The automatic text insertion method according to claim 3, characterized in that, The performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed includes: Use the pre-trained BERT model to perform in-depth semantic analysis on the text to be processed after text preprocessing to identify the entities, keywords, and context in the text to be processed.

5. The automatic text insertion method according to claim 1 or 4, characterized in that The obtaining reference documents and / or examples according to the entities and the keywords includes: Adopt a semantic matching algorithm to determine whether there are reference documents and / or examples matching the keywords and the entities in the local database; If not, use web crawlers and APIs to retrieve Internet resources to obtain matching reference documents and / or examples.

6. The automatic text insertion method according to claim 1, characterized in that, The examples include text-based examples. Before inserting the reference documents and / or the examples into the text to be processed according to the best insertion positions to generate the target text, the method further includes: Format the reference documents according to a preset reference format; Use the GPT-4 model to process the text-based examples.

7. An automatic text content insertion device, characterized in that, Including: A text acquisition unit for obtaining the text to be processed; A text analysis unit for performing text analysis on the text to be processed to determine the entities, keywords, and context of the text to be processed; A content determination unit for obtaining reference documents and / or examples according to the entities and the keywords; A position determination unit for using the LSTM model to analyze the context and predict the best insertion positions of the reference documents and / or the examples in the text to be processed; A content insertion unit for inserting the reference documents and / or the examples into the text to be processed according to the best insertion positions to generate the target text; A user interface for displaying the target text.

8. The automatic text content insertion device according to claim 7, characterized in that, It further includes: A text preprocessing unit for performing text preprocessing on the text to be processed.

9. A storage medium, characterized in that, The storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the method according to any one of claims 1-6.

10. An electronic device, characterized in that, Including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1-6 is implemented.