Document description information generation method, electronic device, chip system, and storage medium
By performing text duplication detection on document description information and adjusting model parameters, the problem of duplicate text in summary generation was solved, achieving natural and efficient generation of document description information and improving semantic retrieval performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-11-04
- Publication Date
- 2026-04-28
AI Technical Summary
Existing summary generation methods are prone to duplicate text, resulting in unnatural or verbose text content that affects semantic retrieval performance.
By performing text duplication detection on the document description information and adjusting the parameters of the text extraction model when duplication is detected, the document description information is regenerated to reduce or avoid duplicate text.
It improves the generation of document description information, ensuring that the generated text is natural and efficient, and enhances the accuracy of semantic retrieval.
Smart Images

Figure CN119721033B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for generating document description information, an electronic device, a chip system, and a storage medium. Background Technology
[0002] Summary generation is crucial in the information age, helping readers quickly grasp the core content of documents and providing support for search engine optimization. Currently, summary generation methods are prone to duplicate text issues during the generation process; that is, the model may generate repeated phrases or sentences in the summary. This results in unnatural or verbose text, ultimately degrading semantic retrieval and preview performance. Therefore, reducing duplicate text in document summaries and effectively improving summary generation quality is a vital task. Summary of the Invention
[0003] This application provides a document description information generation method, electronic device, chip system, and storage medium, which can perform text duplication detection on the document description information and regenerate the document description information when duplication occurs, so as to reduce or avoid duplicate text in the document description information and thus improve the generation effect of document description information.
[0004] In a first aspect, embodiments of this application provide a method for generating document description information, which can be applied to electronic devices. The method includes: inputting a document to be processed into a text extraction model for processing to obtain first document description information of the document to be processed; performing text duplication detection on the first document description information; adjusting the model parameters of the text extraction model in response to detecting duplicate text in the first document description information and the number of retries being less than or equal to a threshold value; wherein the number of retries refers to the number of times the text extraction model is used to re-obtain the document description information of the document to be processed, and the adjusted model parameters of the text extraction model are related to the probability of generating duplicate text; inputting the document to be processed into the adjusted text extraction model for processing to obtain second document description information of the document to be processed; and determining the target document description information of the document to be processed based on the second document description information. Therefore, in this technical solution, the electronic device can perform text duplication detection on each generated document description information and adjust the parameters of the text generation model in the case of duplication to reduce or avoid duplicate text in the document description information, thereby improving the generation effect of the document description information.
[0005] In conjunction with the first aspect, in one possible approach, the above method further includes: displaying the document content of an initial document on a document display interface, the initial document being contained in a document database; in response to a detected editing operation, editing the document content to obtain a document to be processed; and in response to a trigger for generating document description information for the document to be processed, performing the step of inputting the document to be processed into a text extraction model for processing to obtain first document description information for the document to be processed. It is evident that for documents already existing in the document database, but whose content has changed after being edited by the user in a subsequent process, this application can regenerate the document description information of the changed document content to improve the generation effect of the document description information.
[0006] In conjunction with the first aspect, in one possible approach, the above method further includes: in response to a new document being added to the document database, performing a step of inputting the document to be processed into a text extraction model for processing to obtain first document description information of the document to be processed; wherein the document to be processed is a newly added document in the document database. It is evident that for newly added documents in the document database, this application can detect and generate corresponding document description information, avoiding document omissions, making the document data in the document database more complete, and improving the user search experience.
[0007] In conjunction with the first aspect, in one possible approach, the aforementioned text duplication detection of the first document description information includes: using each of multiple detection windows to perform text duplication detection on the first document description information, wherein the multiple detection windows have different window sizes. It is evident that, in this embodiment, using detection windows of different sizes to perform text duplication detection on the document description information achieves higher accuracy.
[0008] In conjunction with the first aspect, in one possible approach, the above-mentioned method utilizes each of the multiple detection windows to perform text duplication detection on the first document description information, including: adding the detected text to the text set in response to the text not being included in the text set; the detected text being any text located under the target detection window during the sliding detection of the first document description information using the target detection window; and determining that duplicate text exists in the first document description information in response to the detected text being included in the text set, wherein the duplicate text includes the detected text. It is evident that text duplication detection is performed text-by-text, which improves the accuracy of duplication detection.
[0009] In conjunction with the first aspect, one possible approach to adjusting the model parameters of the text extraction model includes: adjusting the model parameters based on the number of repetitions of repeated text, where the number of repetitions is obtained during text duplication detection of the first document description information. Therefore, determining the number of repetitions of repeated text is crucial for adjusting the model parameters.
[0010] In conjunction with the first aspect, in one possible approach, adjusting the model parameters of the text extraction model based on the repetition frequency of repeated text includes: determining adjustment data for repeated text based on the repetition frequency and constraint functions; and adjusting the original parameters of the text extraction model based on the repeated text adjustment data, whereby the adjusted data is used to reduce the generation probability of repeated text. It is evident that model parameters can be determined through constraint functions and the repetition frequency of repeated text. For repeated text with a high repetition frequency, the generation probability can be reduced through constraint functions, thereby decreasing repeated text in document description information.
[0011] In conjunction with the first aspect, in one possible approach, the method further includes: generating a prompt message in response to detecting duplicate text in the first document description information and the number of retries exceeding a threshold; displaying the prompt message on the document display interface, the prompt message indicating that the first document description information generated by the text extraction model does not meet the document description information conditions. Therefore, when the generated document description information does not meet the document description information conditions, a prompt message will be displayed on the interface to allow the user to use other methods to generate the document description information for that document, thus avoiding document omissions.
[0012] In conjunction with the first aspect, in one possible approach, the above method further includes: performing a compliance check on the target document description information of the document to be processed; generating a vector representation of the target document description information in response to the compliance check passing; and storing the target document description information and its vector representation in a document database. It is evident that storing the document description information and its corresponding vector representation in a document database allows users to quickly retrieve matching content during searches.
[0013] In conjunction with the first aspect, in one possible approach, the method further includes: displaying a search interface showing search information; in response to detecting a search trigger operation, determining a vector representation from a document database that matches the vector representation of the search information; searching for document description information corresponding to the vector representation that matches the vector representation of the search information, and displaying the corresponding document description information on the search interface. In this technical solution, matching document description information can be quickly determined from a document database based on the semantic information of the search information, improving the user experience.
[0014] Secondly, this application provides an electronic device comprising: one or more processors, a display screen, and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, the one or more processors calling the computer instructions to cause the electronic device to perform: inputting a document to be processed into a text extraction model for processing to obtain first document description information of the document to be processed; performing text duplication detection on the first document description information; in response to detecting duplicate text in the first document description information and the number of retries being less than or equal to a threshold, adjusting the model parameters of the text extraction model; wherein the number of retries refers to the number of times the document description information of the document to be processed is re-obtained using the text extraction model, and the adjusted model parameters of the text extraction model are associated with the probability of generating duplicate text; inputting the document to be processed into the text extraction model after the model parameters have been adjusted for processing to obtain second document description information of the document to be processed; and determining target document description information of the document to be processed based on the second document description information.
[0015] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: displaying the document content of an initial document on a document display interface, the initial document being contained in a document database; in response to a detected editing operation, editing the document content to obtain a document to be processed; and in response to a triggering of document description information generation for the document to be processed, performing the step of inputting the document to be processed into a text extraction model for processing to obtain first document description information for the document to be processed.
[0016] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to a new document being added to the document database, perform the step of inputting the document to be processed into a text extraction model for processing to obtain first document description information of the document to be processed; wherein the document to be processed is the new document added to the document database.
[0017] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform text duplication detection on the first document description information, including: performing text duplication detection on the first document description information using each of a plurality of detection windows of different sizes.
[0018] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform text duplication detection on the first document description information using each of a plurality of detection windows, including: adding the detected text to the text set in response to the detected text not being included in the text set; the detected text being any text located under the target window during the sliding detection of the first document description information using the target detection window; and determining that duplicate text exists in the first document description information, including the detected text, in response to the detected text being included in the text set.
[0019] In conjunction with the second aspect, in one possible manner, the one or more processors invoke computer instructions to cause the electronic device to perform adjustments to the model parameters of a text extraction model, including: adjusting the model parameters of the text extraction model based on the number of repetitions of repeated text, the number of repetitions of repeated text being obtained during text duplication detection of the first document description information.
[0020] In conjunction with the second aspect, in one possible manner, the one or more processors invoke computer instructions to cause the electronic device to perform adjustments to the model parameters of a text extraction model based on the number of times the repeated text is repeated, including: determining adjustment data for the repeated text based on the number of times the repeated text is repeated and a constraint function; and adjusting the original parameters of the repeated text in the text extraction model based on the repeated text adjustment data, wherein the repeated text adjustment data is used to reduce the generation probability of the repeated text.
[0021] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: generating a prompt message in response to detecting duplicate text in the first document description information and the number of retries exceeding a threshold; displaying the prompt message on the document display interface, the prompt message indicating that the first document description information generated by the text extraction model does not meet the document description information conditions.
[0022] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: a compliance check on the target document description information of the document to be processed; in response to the compliance check of the target document description information passing, generating a vector representation of the target document description information; and storing the target document description information and the vector representation of the target document description information into a document database.
[0023] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: displaying a search interface showing search information; in response to detecting a search trigger operation, determining a vector representation from a document database that matches the vector representation of the search information; searching for document description information corresponding to the vector representation that matches the vector representation of the search information, and displaying the corresponding document description information on the search interface.
[0024] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect above.
[0025] Fourthly, this application provides a chip system including one or more processors, a memory, and an interface circuit. The memory, the interface circuit, and the one or more processors are interconnected via lines. The memory stores program instructions, and when the program instructions are executed by the processor, the chip system performs the method described in the first aspect above.
[0026] Fifthly, this application provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to perform the method described in the first aspect. Attached Figure Description
[0027] Figures 1A-1D A schematic diagram of a document editing interface provided for an embodiment of this application;
[0028] Figure 2A and Figure 2B A schematic diagram of a direct document addition interface provided in an embodiment of this application;
[0029] Figure 3A and Figure 3B A schematic diagram of a document search interface provided in an embodiment of this application;
[0030] Figure 4 A flowchart illustrating a document description information generation method provided in an embodiment of this application;
[0031] Figure 5A and Figure 5B This is a schematic diagram of a prompt information display interface provided in an embodiment of this application;
[0032] Figure 6 A flowchart illustrating another method for generating document description information provided in an embodiment of this application;
[0033] Figure 7 A flowchart illustrating the document description information generation method based on software modules provided in this application embodiment;
[0034] Figure 8 This application provides a schematic diagram of the interaction between software modules.
[0035] Figure 9 A schematic diagram of a software layered architecture provided in an embodiment of this application;
[0036] Figure 10 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0037] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0039] The terms "first," "second," "third," etc., used in the embodiments of this application are to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, it may include a series of steps or units, or optionally, steps or units not listed, or other steps or units inherent to these processes, methods, products, or devices. The terms "one embodiment" or "some embodiments," etc., mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of the embodiments of this application, do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0040] In the embodiments of this application, the words "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.
[0041] Furthermore, "at least one" refers to one or more, while "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0042] Before introducing the document description information generation method provided in this application, the relevant terms involved in this embodiment will be introduced:
[0043] Large Language Models (LLMs) are deep learning-based artificial intelligence models designed to understand and generate human language. These models, trained on massive amounts of text data, can perform various natural language processing tasks, such as text classification, question answering, dialogue system construction, and machine translation. LLMs typically employ a Transformer architecture and are trained through pre-training and fine-tuning. During pre-training, the model learns the syntax, semantics, and contextual information of language on vast amounts of unlabeled text data; the fine-tuning stage optimizes the model for specific tasks to improve its performance in downstream tasks. These models often have billions or even hundreds of billions of parameters, such as GPT-3 and GPT-4. LLMs have a wide range of applications, including but not limited to natural language generation, dialogue systems, machine translation, sentiment analysis, knowledge extraction, and reasoning. Furthermore, they are applied to emerging fields such as speech recognition, computer vision, and multimodal learning. LLMs are a crucial pathway to artificial intelligence, demonstrating powerful natural language understanding and generation capabilities, and providing initial possibilities for achieving general artificial intelligence.
[0044] Artificial Intelligence (AI) is a science and technology field that studies how to enable computers to simulate and perform human intelligent tasks. It aims to develop systems capable of intelligent behaviors such as perception, understanding, learning, and reasoning, and attempts to understand the essence of intelligence in order to produce intelligent machines that can react in a manner similar to human intelligence.
[0045] Vector representation (Embedding): For example, in deep learning and natural language processing, "embedding" refers to the process of converting data (such as text, images, etc.) into low-dimensional dense vectors that can capture the semantic information of the data. In these fields, embedding is often understood as a technique of "vectorization" or "vector representation".
[0046] Embedding models are widely used techniques in machine learning and natural language processing (NLP) that map high-dimensional data (such as text, images, and audio) to a low-dimensional continuous vector space. This technique captures the underlying relationships and semantic information of the data, thereby improving model performance and efficiency. The core idea of embedding is to transform discrete, non-continuous data into continuous vector representations, enabling computers to process and analyze data more effectively. In NLP, embedding techniques are typically used to convert words or sentences into vectors to facilitate model training and inference. For example, in text processing, embedding can map each word to a point in a high-dimensional space, where the distance between these points reflects the semantic similarity between words. In this embodiment, after obtaining the document description information of the document to be processed, the vector representation model can be used to determine the vector representation of the document description information, thus enabling semantic search during the search process.
[0047] In the information age, establishing a mapping relationship between search information and a document can help users quickly find the articles they need from a vast database, improving the user experience. To accurately determine the document description information of a document and thus establish the mapping relationship between the document and the search information, this application provides a method for generating document description information and an electronic device. After deploying a text extraction model for document description information (usually a fine-tuned large language model) in a text-based product on the terminal, when a document to be processed is detected locally or in the cloud, the document to be processed is input into the text extraction model for processing to obtain the document description information, which includes the document's summary information and keywords. The generated document description information undergoes text duplication detection. If the document description information contains duplicate text (specifically, duplicate words), and the number of times the document description information of the document to be processed is retrieved again using the text extraction model does not exceed a set threshold, the model parameters of the text extraction model are adjusted according to the number of times the duplicate text in the document description information is repeated. The document to be processed is then input into the adjusted text extraction model for processing to obtain new document description information. The text duplication detection process is repeated. If the generated document description information does not contain duplicate text, or if duplicate text exists but the number of times the text extraction model re-obtains the document description information exceeds a threshold, the generated document description information is output. This output indicates either accurate document description information or that the document description information generated by the text extraction model does not meet the requirements. Using this method, electronic devices (such as mobile phones, tablets, and computers) can automatically detect the existence of new or modified documents and perform text duplication detection during the generation of document description information. If duplicates are found, the document description information is regenerated to reduce duplicate text and improve the quality of the generated document description information.
[0048] The document description information generation method provided in this application can be applied to electronic devices. The electronic device can be an electronic device with display screen hardware and corresponding software support.
[0049] For example, electronic devices can be mobile phones, tablets, wearable devices, in-vehicle devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), home appliances, etc. This application does not impose any restrictions on the specific type of electronic device.
[0050] The document description information generation method of this application is applicable to documents in electronic document format. The document format can be portable document format (PDF), presentation (PowerPoint, PPT), editable text file (Word), or long image, etc. The corresponding document may have the same or different format as this document.
[0051] For ease of explanation, this application uses the display of electronic documents on a display device as an example. The display device can be any electronic device with display screen hardware and corresponding software support. For example, the display device can be a projector, television, mobile phone, tablet computer, laptop computer, netbook, etc.
[0052] The document description information generation method according to the embodiments of this application is applicable to the following scenarios, such as generating document description information of the edited document after editing a document contained in document data.
[0053] like Figure 1A As shown, the electronic device can display a main screen interface, which includes a document display interface. The document display interface displays the document content 101 of the initial document. The initial document is contained in a document database. Users can perform editing operations on the document content in 101. Editing operations include adding, modifying, and deleting the document content of the initial document.
[0054] like Figure 1B As shown, content 102 is added to the document content 101 of the initial document. If the user clicks to save and store it in the document database, the document content of the initial document stored in the document database will change. In response to the detected editing operation (addition operation), the electronic device will add content to the document to obtain the document to be processed. If the user clicks the control used to generate document description information, such as the "summary generation" control, the electronic device can input the document to be processed into the text extraction model to regenerate the document description information and replace the original document description information of the initial document with the new document description information.
[0055] like Figure 1CAs shown, content 103 is modified in the initial document's content 101. If the user clicks to save and store it in the document database, the initial document's content in the database changes. The electronic device, responding to the detected editing operation (modification operation), modifies the document content to obtain the document to be processed. If the user clicks a control used to generate document description information, such as the "summary generation" control, the electronic device can regenerate the document description information from the text extraction model and replace the original document description information with the new one.
[0056] like Figure 1D As shown, content 104 is modified in the initial document's content 101. If the user clicks "save" and stores it in the document database, the initial document's content in the database changes. The electronic device, responding to the detected editing operation (deletion operation), deletes the document content, resulting in the document to be processed. If the user clicks a control used to generate document description information, such as the "summary generation" control, the electronic device can input the document to be processed into a text extraction model to regenerate the document description information and replace the original document description information with the new information. Alternatively, deletion can also delete the entire document. In this case, the already generated document description information needs to be located and deleted from the document database to reduce memory usage.
[0057] One thing to note is that Figures 1A-1D This is an exemplary document display interface. Optionally, in this embodiment, it may include multiple electronic devices, such as editing the initial document on one electronic device and generating document description information on another electronic device.
[0058] The method for generating document description information according to the embodiments of this application is also applicable to the following scenarios, such as when the document to be processed is a new document that does not exist in the document database of the electronic device, and the electronic device generates document description information for the new document after receiving the new document.
[0059] like Figure 2A As shown in the image, the document display interface of the user's opened electronic device is displayed. At this time, the document display interface has no document content, as shown in 201, it is blank.
[0060] like Figure 2BAs shown, when a user imports a new document, the electronic device retrieves the new document and displays the new document content 202 on the document display interface. For the document content in 202, the electronic device can input the document content into a text extraction model for processing to obtain document description information, and store the document description information and the document in the document database for subsequent searching.
[0061] After generating document description information for each document and storing it in the database, it can be applied to document search scenarios. The following uses a document search scenario as an example to exemplify the application scenarios of this application.
[0062] like Figure 3A As shown, the electronic device can display a main screen interface, which includes a search page. The search page includes a search box and a results display box. If the user enters the search keyword "artificial intelligence" in the search box 301, the computer uses "artificial intelligence" to search the database for the vector representation corresponding to "artificial intelligence" and determines the document description information of the matching document. Figure 3A The results display box 302 shows the document names of documents that match "artificial intelligence," while the corresponding area 303 includes the document names of multiple documents. Optionally, these document names can be sorted according to relevance, with the most relevant ones listed first.
[0063] like Figure 3B As shown, the electronic device can also display a main screen interface, which includes a search page. The search page includes a search box and a results display box. The results display box can further include a directory display box and a summary information display box. The directory display box 304 displays... Figure 3A The document name that matches "artificial intelligence" in the table of contents. When the user selects any document in the table of contents display box 304, such as "Document 1", the summary information corresponding to "Document 1" can be displayed in the summary information display box 305 to achieve a preview effect.
[0064] Based on the scenarios described above, the following section explains how document description information and vector representations are generated. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a flowchart illustrating a document description information generation method provided in an embodiment of this application. The method may include, but is not limited to, the following steps:
[0065] S401, the document to be processed is input into the text extraction model for processing to obtain the first document description information of the document to be processed. In some embodiments, before the electronic device inputs the document to be processed into the text extraction model to generate document description information, it needs to first determine the document to be processed. The document to be processed includes two types: one is a document already existing in the document database; the other is a document added by the user that is not in the document database.
[0066] In the first scenario: the document display interface shows the content of an initial document, which is contained in a document database. This action can be triggered by the user, meaning the user actively opens the initial document in the document database on the electronic device's document display interface and then edits its content. After editing, the user triggers controls on the interface used to generate document description information, such as a "summary generation" control. The electronic device then responds to the detected editing operation, edits the document content, and obtains the document to be processed. This document is then input into a text extraction model for processing to obtain the first document description information. The editing processes here include adding, deleting, and modifying documents, specifically as follows... Figures 1A-1D As shown, I will not repeat the details here.
[0067] In the second scenario, a new document is added to the document database, meaning the electronic device detects a new document either locally or in the cloud. In this case, the newly added document can be treated as a document to be processed. The electronic device responds to the new document in the document database by treating it as a document to be processed and inputting it into a text extraction model for processing, thus obtaining the first document description information of the document to be processed.
[0068] For the document to be processed in the first scenario, the electronic device inputs the document into the text extraction model for processing to obtain the first document description information. This first document description information is used to update the original document description information of the document to be processed, because in scenario 1, the document content has changed, and therefore the corresponding document description information will also change. For the document to be processed in the second scenario, since the document is newly added, the first document description information is also generated for the first time. It should be noted that before inputting the document into the text extraction model, a compliance check can be performed on the document to be processed to detect whether there are illegal words. If so, it will not be processed, and the process can directly proceed to step S406.
[0069] In this embodiment of the application, the first document description information includes the summary information of the document to be processed and the keywords of the document to be processed. The keywords are the central words that summarize the document to be processed. For example, for a document about artificial intelligence, the keywords may include artificial intelligence, model, etc. The summary information is the central idea of the document to be processed, which summarizes the document in a concise way so that readers can understand the general content of a document.
[0070] In some embodiments, the text extraction model is a large language model that has been trained and fine-tuned. For any document, the text extraction model can extract document description information, and the output format of this document description information is consistent after training.
[0071] S402, Perform text duplication detection on the first document description information.
[0072] In some embodiments, the electronic device can perform text duplication detection on the first document description information using a sliding window string matching method. To achieve accurate duplication detection, each of multiple detection windows can be used to perform text duplication detection on the first document description information separately. The window sizes of the multiple detection windows are different. The number of detection windows is related to the window size of the first document description information. Let min_window_size be the minimum window size of the first document description information, and max_window_size be the maximum window size. Then, the size of the detection window is from min_window_size to max_window_size.
[0073] The first document description information includes N words, where N is a positive integer. Taking a target detection window in multiple detection windows as an example, the process of detecting N words using the target detection window is explained. In this process, a text set is first defined to record the text of the window being detected during the detection process. If the text to be detected is not included in the text set, it is added to the text set. The text to be detected is any text located within the target detection window during the sliding detection of the N words included in the first document description information using the target detection window. If the text to be detected is included in the text set, it is determined that there is duplicate text in the first document description information, including the text to be detected. In simpler terms, it involves first determining a detection window, then using this detection window to perform sliding detection on the first description document, dividing the first description document into multiple detection windows, comparing the text in each detection window sequentially with the text in the text set, and then determining whether duplicates exist.
[0074] Based on the text duplication detection results, if there is duplicate text in the first document description information, then proceed to step S403; if there is no duplicate text in the first document description information, then proceed to step S404.
[0075] The following example illustrates the process of text duplication detection. Assume the document description is T, and W is the sequence of words in the text, where W = {w1, w2, ..., w...} n} where n is the total number of words. Define min_window_size as the minimum window size of W and max_window_size as the maximum window size of W. Define a detection window s, where s∈[min_window_size,max_window_size], and define a text set S to store the detected words. For each starting index i, where i∈[0,ns], define a window W. i =(w i ,w i+1 ,…w i+s-1 If W i If ∈S, then duplicate text is considered to exist; otherwise, W is used. i The words in the text are added to the text collection S, and the loop continues until the end of the traversal.
[0076] Taking an example, let the document description information T be "a kind of artificial intelligence method", then W = {a kind of artificial intelligence method}. Let the size of the detection window s be 2. Starting with the first "a kind", the detection is performed 11 times: the first time "a kind" does not exist in the text set, it is added to the text set; the second time "a kind of artificial intelligence method" does not exist in the text set, it is added to the text set; this process continues until the last time "method" does not exist in the text set, then "method" is added to the text set. In this process, it can be concluded that "a kind of artificial intelligence method" is repeated, "a kind of artificial intelligence method" is repeated, and "artificial intelligence method" is repeated. Then, following the detection logic, the window is expanded sequentially. When the size of the detection window s is 3, "a kind of artificial intelligence method" and "a kind of artificial intelligence method" are repeated. Based on this method, it is possible to determine whether there is duplicate text in the document description information. Simultaneously, the number of times the duplicate text is repeated can be determined during the detection process, usually by recording the number of times the duplicate text is repeated using a counter.
[0077] S403, determine whether the number of times the document description information of the document to be processed is obtained again using the text extraction model is less than or equal to the number threshold.
[0078] In some embodiments, when duplicate text exists in the first document description information, it is necessary to determine the number of times the text extraction model re-acquires the document description information of the document to be processed, and set this as the retry count. In this embodiment, the number of times the text extraction model re-acquires the document description information of the document to be processed is set as the retry count. The retry count is determined during the continuous processing of the text extraction model. The text extraction model records each processing operation, so the retry count can be directly determined. First, determine the number of times the text extraction model processes the document description information. The retry count is the number of processing operations minus 1. If the number of times the text extraction model processes the document description information is 1, then the retry count is 0.
[0079] During this process, it is determined whether the number of retries is less than or equal to a threshold. If the number of retries is less than or equal to the threshold, step S405 is executed. If the number of retries is greater than the threshold, step S406 is executed. The threshold can be customized; however, the value should not be too large, as this will affect efficiency, nor should it be too small, as this may result in unsatisfactory document descriptions. Therefore, a compromise value can be set based on past experience.
[0080] S404, the first document description information is determined as the target document description information of the document to be processed, and compliance detection is performed on the target document description information of the document to be processed.
[0081] In some embodiments, after determining the target document description information of the document to be processed, the target document description information needs to be stored so that users can find the corresponding document based on search keywords. Before storing, the target document description information of the document to be processed needs to be checked for compliance. The purpose of this check is to detect whether there are any abnormal words or abnormal formats in the target document description information.
[0082] In response to the detection of compliance in the target document description information, a vector representation of the target document description information is generated, and the target document description information and its vector representation are stored in the database. The vector representation of the target document description information is obtained by processing the target document description information in a vector representation model. In response to the detection of non-compliance in the target document description information, the target document description information of the document to be processed is deleted, and the process proceeds to step S406.
[0083] S405, Adjust the model parameters of the text extraction model.
[0084] The model parameters are related to the probability of generating duplicate text. In this embodiment, the main purpose is to reduce the probability of generating duplicate text by using the model parameters, thereby reducing duplicate text in the document description information.
[0085] In some embodiments, the model parameters of the text extraction model are determined based on the number of times the text is repeated. The repeated text specifically refers to the repeated words in the document description information. The number of times each word is repeated can be determined when performing text duplication detection on the document description information. When a duplication is detected, the number of times the corresponding word is repeated is incremented by 1. After the document description information detection is completed, the number of times each repeated word is repeated can be determined.
[0086] Furthermore, when adjusting the model parameters of the text extraction model based on the repetition frequency of repeated text, the adjustment data for repeated text is first determined based on the repetition frequency and the constraint function. The constraint function can be either logarithmic or constant form. Then, based on the adjusted data, the original parameters of the text extraction model for repeated text are adjusted. The adjusted data is used to reduce the probability of generating repeated text. In practical applications, the original parameters of the text extraction model for repeated text can be directly replaced with the adjusted data. The constraint function, also known as the penalty function, is used to penalize repeated text, thereby reducing the probability of generating repeated text.
[0087] The following describes two methods for determining the adjusted data for duplicate text:
[0088] Method 1: The constraint function is in logarithmic form, determining the adjustment data for repeated text in logarithmic form. The constraint function is set as r(w i ,k),r(w i The value of ,k) is the adjustment data for repeated text, and the specific adjustment data for repeated text can be shown in formula (1):
[0089] r(w i ,k)=1+αlog (k+1) (1)
[0090] Among them, w i For repeated words, k represents repeated words w. i The number of repetitions, α is a parameter controlling the growth rate. When k = 0, r(w) i When k) = 1, no penalty is imposed. When k > 0, r(w) i The penalty increases as k increases, meaning that the more frequently a word appears, the greater the penalty, in order to reduce the probability of that word appearing.
[0091] Method 2: The constraint function is in constant form, meaning the adjustment data for repeated text is determined using constant values. The constraint function is set to r(w) i ,k),r(w i The value of k) is the adjustment data for repeated text, and the specific adjustment data for repeated text can be shown in formula (2):
[0092]
[0093] Where m is the number of times a word is repeated; the more times it is repeated, the higher r(w) becomes. i The larger the value of k), the better.
[0094] Based on the adjusted data of duplicate text obtained above, the generation probability of the adjusted duplicate text can be determined. Due to the increase in model parameters, the generation probability of the duplicate analysis is reduced.
[0095] In some feasible implementations, the predicted generation probability of repeating text can be determined based on the adjusted data of repeating text and the current generation probability of repeating text. The general process is as follows:
[0096] ① For each generated word, determine the original generation probability P of each word. t After the document to be processed is input into the text extraction model, the document description information and the generation probability of each word in the document description information can be obtained. Since the output of the text extraction model has been defined during the training process, the document description information and the generation probability of each word in the document description information can be directly output.
[0097] ② For each word w that has been generated i If the word is repeated, we will generate it with probability P. t (w i Adjustments will be made to the word w. i If no words are repeated, no adjustment is needed. The adjustment is specifically based on the data for repeated text (i.e., repeated words), and the adjusted w... i The probability calculation process can be found in formula (3):
[0098] P′ t (w i ) = P t (w i ) / r(w i ,k) (3)
[0099] ③ Finally, P′t is renormalized to ensure that the sum of the probabilities of all words is 1. The distribution of the renormalized probability distribution P″t can be calculated by the following formula (4):
[0100]
[0101] S406, Generate a prompt message and display the prompt message on the user interface. The prompt message is used to indicate that the first document description information generated by the text extraction model does not meet the document description information conditions.
[0102] In some feasible embodiments, as described above, when the first document description contains duplicate text and the number of retries exceeds a threshold, the electronic device can generate a prompt message and display it on the document display interface. Typically, this prompt message is displayed on the administrator's document display interface to inform the administrator that the first document description generated by the text extraction model does not meet the document description conditions (e.g., too much duplicate text or the presence of sensitive words), so that the administrator can use other text extraction models to generate the document description for the document to be processed. Without intervention, the document description for this document cannot be successfully stored in the database, making it impossible for the user to find the document, thus impacting the user experience.
[0103] Additionally, in some possible embodiments, during compliance checks, if non-compliant target document description information is detected, the electronic device can generate a prompt message to alert the administrator that the document description information of the document to be processed is non-compliant. Alternatively, upon detecting non-compliance, the non-compliant words can be identified and replaced or deleted. Furthermore, after performing compliance checks on the target document description information, the electronic device also checks the entire document to be processed. If the document to be processed is also non-compliant, then the document to be processed can be prohibited from being added to the database.
[0104] like Figure 5A As shown, a document display interface is displayed on the electronic device. If the first document description information generated by the text extraction model does not meet the document description information conditions, a prompt box 501 will be displayed on the document display interface, which may display the message "The document description information of document 2 does not meet the document description information conditions". If the administrator clicks the "Confirm" control, they can jump to the document description information display interface to manually modify the document description information; if the administrator clicks the "Cancel" control, it means that the administrator will not process the document description information and there is no need to add the document description information to the database for the time being.
[0105] like Figure 5B As shown, a document display interface is displayed on the electronic device. If the generated document description information is found to be non-compliant, a prompt box 502 will be displayed on the document display interface, which may display the message "The document description information of document 3 is non-compliant, please confirm." If the administrator clicks the "Confirm" control, they can jump to the document description information display interface, so that the administrator can manually modify the non-compliant parts of the document description information; if the administrator clicks the "Cancel" control, it means that the administrator will not process the document description information, and there is no need to add the document description information to the database for the time being.
[0106] S407, The text extraction model with adjusted input model parameters is used to process the document to be processed to obtain the second document description information of the document to be processed.
[0107] In some feasible embodiments, after the text extraction model's parameters are adjusted, the document to be processed is input into the adjusted text extraction model for processing, resulting in a second document description. The second document description differs from the first document description. Based on the above description, it can be determined that the second document description contains fewer repeated text compared to the first document description.
[0108] Furthermore, in order to generate more accurate document description information, text duplication detection can be performed on the second document description information, specifically by repeatedly executing steps S402-S406.
[0109] S408, Determine the target document description information of the document to be processed based on the second document description information.
[0110] In some feasible embodiments, if the second document description information does not contain duplicate text, it is directly used as the target document description information. If the second document description information still contains duplicate text, the model parameters are adjusted, and the text extraction model is used to generate the third document description information. This process continues with text duplication detection and retrieval count determination. Based on this logic, document description information can be generated multiple times until no duplicate text exists or the number of retries exceeds a threshold. This approach reduces duplicate text in the document description information and improves the generation effect.
[0111] Based on the above explanation, it is clear that document databases store a large amount of document description information and vector representations; therefore, users can perform document searches. The specific process may include: displaying a search interface, which shows search information; such as... Figure 3A As shown, the search information can be "artificial intelligence". In response to detecting a search trigger operation, the electronic device determines a vector representation from the document database that matches the vector representation of the search information; it then searches the document database for the document description information corresponding to the vector representation that matches the vector representation of the search information, and finally displays the corresponding document description information on the search interface. For example... Figure 3A As shown, the document name can be displayed in the search interface; for example... Figure 3B As shown, a document summary can be displayed in the search interface.
[0112] In this embodiment, the document description information is generated by repeated detection, multiple retries, and continuous adjustment of model parameters. This ensures the diversity of the generated description information, while also guaranteeing automated handling of repeated generation anomalies and improving the quality of the generated document description information.
[0113] To more clearly illustrate the document description information generation method of this application's embodiments, please refer to... Figure 6 This section uses a single document as an example to outline the entire process of describing information within the document, including the following steps:
[0114] (1) Perform document preprocessing.
[0115] (2) Use a text extraction model to process the document and obtain the document description information.
[0116] (3) Perform duplicate detection on the document description information.
[0117] (4) Determine if there is duplicate text in the document description information.
[0118] (5) If the document description information contains duplicate text, determine whether the number of retries is less than or equal to the number of retries threshold.
[0119] (6) If the number of retries is less than or equal to the threshold, adjust the parameters of the text extraction model. At the same time, use the model with adjusted parameters to reprocess the document to obtain the document description information, and repeat (3)-(6). If the number of retries is greater than the threshold, end the process.
[0120] (7) If there is no duplicate text in the document description information, then input the document description information into the risk control module.
[0121] (8) Determine whether the document description information is safe.
[0122] (9) If the document description information is secure, then store the document description information in the document database.
[0123] (10) Generate a vector representation of the document description information.
[0124] (11) If the document description information is not secure, the process ends.
[0125] In step (11), if the document description information is detected to be insecure, you can choose not to display the prompt information directly or not to store it in the database. Alternatively, you can replace the insecure areas in the document description information, such as sensitive words, with appropriate words.
[0126] pass Figure 6 It allows you to clearly understand the entire process of generating document description information.
[0127] The following section describes the process by which an electronic device generates document description information, taking into account the specific scenarios corresponding to the document status of the document to be processed and the internal module interactions of the electronic device. For example... Figure 7 As shown, the steps may include, but are not limited to, the following:
[0128] S701, the system's AI search service module detects documents to be processed.
[0129] The document status of the document to be processed indicates whether it is a newly added document or a modification of an existing document. In this step, the document path and document status of the document to be processed can be determined. The document path indicates where the document to be processed originated, and the document status indicates whether the document is newly added or a modification of an existing document.
[0130] S702, the system's AI search service module sends the document path and document status of the document to be processed to the summary generation plugin module.
[0131] S703, the abstract generation plugin module forwards the document path and document status of the document to be processed to the abstract generation service process.
[0132] The summary generation plugin module connects the system's AI search service module and the summary generation service process. Its purpose is to facilitate the summary generation service process, primarily providing a communication module. Both the summary generation plugin module and the summary generation service process are related to the generation of document description information; the use of "summary" as an example name does not limit the scope of document description information.
[0133] S704, The summary generation service process obtains the content of the document to be processed based on the document path and performs detection on the content of the document to be processed.
[0134] The detection of document content includes parsing, cleaning, and risk control management.
[0135] S705, the summary generation service process sends the document to be processed to the model inference engine module, requesting the generation of document description information and corresponding vector representation.
[0136] The model inference engine module contains a text extraction model and a vector representation model. Therefore, when the summary generation service process initiates a request, the model inference engine module can generate document description information and, when the document description information meets the generation conditions, use the vector representation model to generate the corresponding vector representation.
[0137] During the process of generating document description information for the document to be processed by the text extraction model, it is necessary to perform the above-mentioned duplicate text detection, retrieval number determination, and compliance detection to ensure the reliability of the generated document description information.
[0138] S706, the model inference engine module returns the document description information and the corresponding vector representation to the summary generation service process.
[0139] S707, The abstract generation service process saves document description information and corresponding vector representations.
[0140] This allows document descriptions and corresponding vector representations to be stored in a document database, ensuring that users can quickly find the relevant content during subsequent searches.
[0141] S708, The summary generation service process returns the document description information generation result of the document to be processed to the summary generation plugin module.
[0142] S709, The summary generation plugin module returns the document description information of the document to be processed to the system AI search service module.
[0143] The document description information generation result of the document to be processed includes successful generation and failure generation. Optionally, in the case of failure generation, the system's AI search service module can also input prompt information to the user to indicate the reason for the failure, so that the user can take measures to deal with it.
[0144] Furthermore, Figure 7 The specific processing steps between the various modules shown can be found in [reference needed]. Figure 8 ,from Figure 8 As can be seen, the specific processes executed by each module are as follows. Among them, the system AI search service module also includes a communication module and a document detection module. The document detection module mainly detects the document status, including document addition, document modification, and document deletion. The document to be processed is sent to the communication module in the summary generation service process through the communication module.
[0145] The abstract generation service process obtains documents to be processed through the communication module, enqueues each document in the form of a queue, parses the content of each document, performs risk control and data cleaning, and then requests the document description information of each document from the model inference engine module. After obtaining the document description information of each document, it performs risk control management on the document description information and requests the vector representation of each document description information from the model inference engine module. Finally, the document description information and vector representation are stored in the database for subsequent user searches.
[0146] The model inference engine module mainly deploys the text extraction model and the vector representation model through deployment tools. After receiving a document description information generation request initiated by the summary generation service process, it uses the text extraction model to determine the document description information and returns it; after receiving a vector representation generation request for the document description information initiated by the summary generation service process, it uses the vector representation model to determine the vector representation of the document description information and returns it.
[0147] The following is combined Figure 9 The provided software system architecture summarizes the generation and application processes of the information described in the aforementioned documents. For example... Figure 9 As shown, the layered architecture of an electronic device can be divided into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In this embodiment, the Android system, from top to bottom, consists of the application layer, service layer, model layer, and inference / deployment layer.
[0148] The applications provided by the application layer can include search applications and document applications. The search application mainly provides a search interface for users to conduct searches; the document application is mainly used for document display. After the user completes the search, the search results are displayed in the document interface.
[0149] The service layer primarily provides services to the various applications in the application layer. An intelligent middleware service is deployed within the service layer, which intelligently provides services to these applications. Specifically, for search and document processing within this application layer, the intelligent middleware service in the server layer provides search services for the search application and document services for the document application.
[0150] The model layer is mainly for deploying models to support the services of the service layer. In this embodiment, a large language model that can extract document description information is deployed in the model layer, specifically a text extraction model. At the same time, a vector representation model is also deployed in the model layer, which mainly performs vector representation processing on the document description information to obtain the vector representation corresponding to each document description information.
[0151] The inference deployment layer primarily deploys large model deployment accelerators, with the aim of accelerating the processing speed of models deployed in the model layer.
[0152] One thing to note is that Figure 9 The implementation logic of each layer is from bottom to top, with the lower layer providing technical support to the upper layer so that users can perform document searches and display the searched documents on the document display interface.
[0153] like Figure 10As shown, the layered architecture of an electronic device can divide the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system, from top to bottom, consists of the application layer, the application framework layer, and the kernel layer, etc.
[0154] The application layer may include a series of application packages, such as applications for camera, gallery, video playback, live streaming, maps, calendar, music, and calling. In this embodiment, the application layer may further include a display module. The display module can be used to control the user interface to output prompts related to document description information, such as prompting the user that the generated document description information does not meet the document description information conditions, or prompting the user that the document description information is unsafe.
[0155] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0156] The application framework layer can include a window manager. The window manager is used to manage window applications. The window manager can obtain the screen size, determine if a status bar is present, lock the screen, capture the screen, etc.
[0157] The application framework layer may also include a view system, a notification manager, and so on.
[0158] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0159] The notification manager allows applications to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. In this embodiment, the notification manager can output prompts to the user, such as indicating that the generated document description information does not meet the document description information conditions, or indicating that the document description information is unsafe.
[0160] In this embodiment, the application framework layer may further include a system AI search service module, a summary generation plugin module, a summary generation service process, and a model inference engine module. The system AI search service module can detect the document to be processed and determine whether to trigger the generation of document description information. The summary generation plugin module is mainly used for communication, responsible for sending relevant information about the document to be processed to the summary generation service process. The summary generation service process is mainly used for detecting the document to be processed and requesting the model inference engine module to generate document description information and vector representations. The model inference engine module is mainly used for deploying a text extraction model and a vector representation model to generate document description information and vector representations.
[0161] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, and processor drivers.
[0162] It should be noted that the functional modules included in the above software structure are merely exemplary and do not constitute a specific limitation on the mobile phone software architecture of this application. In other embodiments, the functional modules included in the above software structure may be more or fewer, and this application does not impose any limitations on this. Although the embodiments of this application use the Android system as an example for illustration, its basic principles are equally applicable to electronic devices based on operating systems such as iOS or Windows.
[0163] It should be understood that, in the embodiments of this application, the electronic device may be a mobile phone, tablet computer, laptop computer, handheld computer, mobile internet device (MID), wearable device, virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, personal digital assistant (PDA), etc., and the embodiments of this application are not limited thereto.
[0164] For example, the hardware structure of the electronic device in the embodiments of this application will be described below.
[0165] like Figure 11 As shown, the electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0166] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0167] An NPU (Neural Processing Unit) is a neural network computing processor that, by drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding. In this embodiment, an NPU can be used to extract text from a document to determine its descriptive information.
[0168] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0169] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0170] The wireless communication function of electronic devices can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0171] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0172] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0173] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0174] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0175] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1. In this embodiment, the display screen 194 can be used to display... Figures 1A-1D The document display interface shown Figure 2A and Figure 2B The document display interface shown Figure 3A and Figure 3BThe search interface shown Figure 5A and Figure 5B The document display interface shown.
[0176] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of the electronic device, in a different position than display screen 194.
[0177] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0178] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
[0179] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0180] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0181] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0182] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.
[0183] The above-disclosed embodiments are merely one preferred embodiment of this application and only a part of the embodiments of this application. They should not be construed as limiting the scope of the claims of this application.
Claims
1. A method for generating document description information, characterized in that, The method includes: The document to be processed is input into a text extraction model for processing to obtain the first document description information of the document to be processed. Perform text duplication detection on the first document description information; In response to the detection of duplicate text in the first document description information, and the number of retries being less than or equal to a threshold, adjustment data for the duplicate text is determined based on the number of repetitions of the duplicate text and a constraint function. The number of retries refers to the number of times the document description information of the document to be processed is re-acquired using the text extraction model, and the adjusted model parameters of the text extraction model are related to the generation probability of the duplicate text. The number of repetitions of the duplicate text is obtained during the text duplication detection process on the first document description information. The constraint function includes either a logarithmic form or a constant form. If the constraint function is in logarithmic form, the adjustment data is determined based on the logarithmic result of the number of repetitions and a parameter controlling the growth rate; or, if the constraint function is in constant form, the adjustment data is determined based on the number of repetitions and the correspondence between the number of repetitions and a constant. Based on the adjustment data of the repeated text, the original parameters of the repeated text in the text extraction model are adjusted, and the adjustment data of the repeated text is used to reduce the generation probability of the repeated text. The document to be processed is processed by the text extraction model after the model parameters are adjusted to obtain the second document description information of the document to be processed. The target document description information of the document to be processed is determined based on the second document description information.
2. The method as described in claim 1, characterized in that, The method further includes: The document content of the initial document is displayed on the document display interface, and the initial document is contained in the document database; In response to the detected editing operation, the document content is edited to obtain the document to be processed; In response to the generation of document description information for the document to be processed, the step of inputting the document to be processed into a text extraction model for processing to obtain the first document description information of the document to be processed is executed.
3. The method as described in claim 1, characterized in that, The method further includes: In response to the addition of a document to the document database, the step of inputting the document to be processed into the text extraction model for processing to obtain the first document description information of the document to be processed is performed. The document to be processed is a newly added document in the document database.
4. The method according to any one of claims 1-3, characterized in that, The step of performing text duplication detection on the first document description information includes: The first document description information is subjected to text duplication detection using each of the multiple detection windows; the multiple detection windows have different window sizes.
5. The method as described in claim 4, characterized in that, The step of performing text duplication detection on the first document description information using each of the multiple detection windows includes: In response to the detection text not being included in the text set, the detection text is added to the text set; the detection text is any text located under the target detection window during the sliding detection of the first document description information using the target detection window. In response to the fact that the detected text is included in the text set, it is determined that there is duplicate text in the first document description information, and the duplicate text includes the detected text.
6. The method as described in claim 1, characterized in that, The method further includes: In response to the detection of duplicate text in the first document description information and the number of retries being greater than the threshold number, a prompt message is generated; The prompt information is displayed on the document display interface. The prompt information is used to indicate that the first document description information generated by the text extraction model does not meet the document description information conditions.
7. The method as described in claim 1, characterized in that, The method further includes: Perform compliance checks on the target document description information of the document to be processed; In response to the passing of the compliance check of the target document description information, a vector representation of the target document description information is generated; The target document description information and its vector representation are stored in the document database.
8. The method as described in claim 7, characterized in that, The method further includes: A search interface is displayed, showing search information. In response to detecting a search-triggered operation, a vector representation matching the vector representation of the search information is determined from the document database; Search for document description information corresponding to the vector representation that matches the vector representation of the search information, and display the corresponding document description information on the search interface.
9. An electronic device, characterized in that, The electronic device includes: one or more processors, a memory, and a touch screen; the memory is used to store program code; the processor is used to run the program code, causing the electronic device to implement the method as described in any one of claims 1-8.
10. A chip system, characterized in that, The chip system includes one or more processors, a memory, and an interface circuit. The memory, the interface circuit, and the one or more processors are interconnected via circuits. The memory stores program instructions. When the program instructions are executed by the processor, the chip system implements the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Method for generating guided text abstract based on Transformer
CN111897949A