Document processing method and device, electronic equipment, storage medium and program product

By using segmentation prompt words in large language models for semantic recognition, the problem of difficult text segmentation without punctuation is solved and the reliability and accuracy of text segmentation are improved.

CN118798206APending Publication Date: 2024-10-18CHINA MOBILE GROUP SHANDONG +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410270514.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

It is difficult for the existing technology to handle the situation of no punctuation or irregular use of punctuation during the text segmentation process, resulting in low reliability and accuracy of text segmentation.

Method used

By obtaining the document to be processed, converting it into text to be processed, determining the segmentation prompt words, and inputting the segmentation prompt words and the text to be processed into the large language model for semantic recognition, text segmentation is performed based on the recognition results, and unreasonable line breaks are automatically deleted. punctuation and effectively segment unpunctuated text.

Benefits of technology

It improves the reliability and accuracy of text segmentation and ensures effective processing and segmentation of non-punctuation text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798206A_ABST
    Figure CN118798206A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a document processing method and device, electronic equipment and a storage medium, and the document processing method comprises the steps: obtaining a to-be-processed document, and converting the to-be-processed document into a to-be-processed text; determining segmentation prompt words for segmenting the to-be-processed text; and inputting the segmentation prompt word and the to-be-processed text into a large language model, performing semantic recognition on the to-be-processed text by utilizing the large language model, segmenting the to-be-processed text according to the segmentation prompt word and a semantic recognition result, and outputting a first text segmentation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a document processing method, device, electronic device, storage medium and program product. Background Art

[0002] With the continuous development of artificial intelligence, the combination of large language models and vector databases has become the mainstream trend in application scenarios such as question-answering systems, retrieval systems, and audit systems. It has broad application prospects in finance, communications, law, education, etc. In the process of updating knowledge in vector databases, the segmentation and vectorization of document content is a key link that affects the knowledge retrieval effect of large language models.

[0003] In some scenarios, text segmentation is often performed based on punctuation rules. However, this method is difficult to handle situations without punctuation, such as text titles or text sections with irregular punctuation. As a result, the reliability and accuracy of text segmentation are relatively low. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a document processing method, device, electronic device and storage medium, which can improve the reliability and accuracy of document processing.

[0005] In order to solve the above technical problems, the embodiments of the present application are implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a document processing method, which includes: obtaining a document to be processed, converting the document to be processed into a text to be processed; determining segmentation prompt words for segmenting the text to be processed; inputting the segmentation prompt words and the text to be processed into a large language model, using the large language model to perform semantic recognition on the text to be processed, and segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, and outputting a first text segmentation result.

[0007] In a second aspect, an embodiment of the present application provides a document processing device, which includes: an acquisition module, used to acquire a document to be processed and convert the document to be processed into a text to be processed; a determination module, used to determine a segmentation prompt word for segmenting the text to be processed; a segmentation module, used to input the segmentation prompt word and the text to be processed into a large language model, use the large language model to perform semantic recognition on the text to be processed, and segment the text to be processed according to the segmentation prompt word and the semantic recognition result, and output a first text segmentation result.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the document processing method steps mentioned in the first aspect.

[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the document processing method steps mentioned in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the document processing method mentioned in the first aspect.

[0011] It can be seen from the technical solution provided by the above embodiment of the present application that by obtaining the document to be processed, converting the document to be processed into the text to be processed, determining the segmentation prompt words for segmenting the text to be processed, and then inputting the segmentation prompt words and the text to be processed into the large language model, using the large language model to perform semantic recognition on the text to be processed, and segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, and outputting the first text segmentation result. In this way, by using the large language model to perform semantic recognition on the text to be processed, and then segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, the unreasonable line breaks can be automatically deleted and the punctuation-free text can be effectively segmented, thereby improving the reliability and accuracy of text segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] Figure 1 A flowchart of a document processing method provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram of a module composition of a document processing device provided in an embodiment of the present application;

[0015] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The purpose of the embodiments of the present application is to provide a document processing method, device, electronic device and storage medium, which improve the reliability and accuracy of document processing.

[0017] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0018] For example, Figure 1 As shown, the embodiment of the present application provides a document processing method, the execution subject of the method may be a server, and the document processing method may specifically include the following steps:

[0019] In step S101, a document to be processed is obtained, and the document to be processed is converted into a text to be processed.

[0020] Specifically, the document to be processed can be a document to be segmented, and the format of the document to be processed includes but is not limited to text type, picture type, etc. Text type documents include but are not limited to doc, txt, json, excel, etc., and picture type documents include but are not limited to jpg, png, pdf; for text type documents, text can be directly extracted from the document, and for picture type documents, optical character recognition technology (Optical Character Recognition, OCR) recognition technology can be used to convert the picture document into text, thereby facilitating subsequent text processing and the input of large language models.

[0021] Among them, OCR is a technology that uses computer software to recognize and parse text in images. In practical applications, OCR can be used to convert text in images into editable and searchable text formats, such as converting scanned documents into word documents or plain text.

[0022] In step S103, segmentation prompt words for segmenting the text to be processed are determined.

[0023] Specifically, segmenting the text to be processed means dividing the text into different segments (paragraphs) according to certain rules for subsequent processing. We need to input the preprocessed text into the large language model and perform text segmentation operations in combination with segmentation prompt words.

[0024] When determining the segmentation prompt words, segmentation prompt words can be extracted based on prompt engineering (PE). Prompt engineering refers to the use of specific prompt words or tags to mark and indicate text. It can prompt and mark the semantics of the text to help the large language model better understand the text and generate corresponding outputs. Therefore, appropriate prompt words or tags can be designed according to actual needs, and they can be input into the large language model together with the preprocessed text for training and prediction. For example, the segmentation prompt words can be "Please segment the above text according to semantics, and require a line break at the end of the title and a line break at the end of sentences with the same semantics."

[0025] In step S105, the segmentation prompt words and the text to be processed are input into the large language model, the large language model is used to perform semantic recognition on the text to be processed, and the text to be processed is segmented according to the segmentation prompt words and the semantic recognition results, and a first text segmentation result is output.

[0026] Specifically, Large Language Model (LLM) is a cutting-edge technology in the field of artificial intelligence, which aims to understand and generate human language. These models are based on deep learning architectures and are usually pre-trained by large enterprises and scientific research institutions through massive corpus information. Due to its huge number of parameters, it has more powerful language processing capabilities than traditional neuro-linguistic programming (NLP) models. The development of LLM has achieved remarkable achievements both at home and abroad. Enterprises, institutions and academia in various countries and regions are actively investing resources and efforts to promote the development of LLM technology. The large language model mentioned in the embodiment of the present application can be implemented using Chatglm2-6b open source large language model, and can also be implemented using open source large language models such as baichuan, xverse, and lamma.

[0027] The text to be processed and the segmentation prompt word are input into the large language model, and the large language model is used to perform semantic recognition on the text to be processed, and the text to be processed is segmented according to the segmentation prompt word and the semantic recognition result. Assuming that the text to be processed is x and the segmentation prompt word is p, the segmentation results {w1,w2,w3...} of the large language model have the following relationship:

[0028] {w1,w2,w3...}=LLM(x,p)

[0029] Among them, w1, w2, w3, etc. represent the segmented texts obtained by cutting based on the text to be processed x.

[0030] For example, the text to be processed is as follows:

[0031] Asset Appraisal Report

[0032] Summary of asset appraisal report

[0033] The purpose of this asset appraisal is to provide the client with a detailed investigation and verification of the asset value.

[0034] A reference for the appraisal value of assets such as buildings, structures and their auxiliary facilities, machinery and equipment.

[0035] The scope of the appraisal is single asset appraisal, and the types of assets entrusted for appraisal are three categories: fixed assets: buildings, structures and other auxiliary facilities, machinery and equipment.

[0036] in:

[0037] A. Fixed assets: Buildings and structures, totaling 48 items, are divided into two categories:

[0038] 1. There are 28 buildings with a total construction area of ​​about 7,414.23 square meters, which are basically brick-concrete, simple, colored steel tile, and steel frame shed structures. They are mainly power distribution rooms, tool rooms, staff dormitories, old offices, old canteens, algae halls, weighing rooms, roadside duty rooms, roadside repair rooms, newly built mobile cabins, duty rooms in the production plant area, material warehouses next to lime kilns, staff dormitories of mills, duty rooms of mills, sunshades of mills, mills, repair workshops, and finished product warehouses of mills, etc., located in Citang Village, Fumin County.

[0039] 2. There are 20 structures and other auxiliary facilities, mainly including: grinding mill retaining wall, grinding mill foundation, power distribution room foundation, lime kiln, lime kiln anti-slip retaining wall, new prefabricated house floor, flower bed, etc.

[0040] It can be seen that the above text to be processed includes many line breaks, and some semantically complete text segments are split, which makes it difficult to retrieve the vector of the large language model.

[0041] For the above-mentioned text to be processed and the manually created segmentation prompt words, the text segmentation results can be obtained. The segmentation prompt words can be "Please segment the above-mentioned text according to semantics, requiring a line break at the end of the title and a line break at the end of sentences with the same semantics". The obtained results are as follows:

[0042] Asset Appraisal Report

[0043] summary

[0044] The purpose of this asset appraisal is to provide a reference for the client's asset value verification involving fixed assets, including buildings, structures and their auxiliary facilities, machinery and equipment.

[0045] The scope of the appraisal is single asset appraisal, and the types of assets entrusted for appraisal are three categories: fixed assets: buildings, structures and other auxiliary facilities, machinery and equipment.

[0046] A. Fixed assets: Buildings and structures, totaling 48 items, are divided into two categories:

[0047] 1. There are 28 buildings with a total construction area of ​​about 7,414.23 square meters, which are basically brick-concrete, simple, colored steel tile, and steel frame shed structures. They are mainly power distribution rooms, tool rooms, staff dormitories, old offices, old canteens, algae halls, weighing rooms, roadside duty rooms, roadside repair rooms, newly built mobile cabins, duty rooms in the production plant area, material warehouses next to lime kilns, staff dormitories of mills, duty rooms of mills, sunshades of mills, mills, repair workshops, and finished product warehouses of mills, etc., located in Citang Village, Fumin County.

[0048] 2. There are 20 structures and other auxiliary facilities, mainly including: grinding mill retaining wall, grinding mill foundation, power distribution room foundation, lime kiln, lime kiln anti-slip retaining wall, new prefabricated house floor, flower bed, etc.

[0049] By processing the large language model, the line breaks in the original text are automatically deleted by the large language model. At the same time, texts with the same semantics are integrated to achieve semantic-based segmentation of document content.

[0050] Through the technical solution disclosed in the embodiment of the present application, by obtaining a document to be processed, converting the document to be processed into a text to be processed, determining segmentation prompt words for segmenting the text to be processed, and then inputting the segmentation prompt words and the text to be processed into a large language model, using the large language model to perform semantic recognition on the text to be processed, and segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, and outputting a first text segmentation result. In this way, by using the large language model to perform semantic recognition on the text to be processed, and then segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, the unreasonable line breaks can be automatically deleted and the punctuation-free text can be effectively segmented, thereby improving the reliability and accuracy of text segmentation.

[0051] Furthermore, in order to further improve the accuracy of segmentation of the text to be processed, in a possible implementation method, after the segmentation prompt words and the text to be processed are input into a large language model, the large language model is used to perform semantic recognition on the text to be processed, and the text to be processed is segmented according to the segmentation prompt words and the semantic recognition results, and the first text segmentation result is output, the method also includes: obtaining key information of each paragraph in the first text segmentation result; performing a second segmentation on the text to be processed according to the key information of each paragraph to obtain a second text segmentation result.

[0052] Specifically, after the first segmentation of the processed text by the large language model, the processed text is segmented into multiple text segments. However, when the large language model segments the processed text, there may be confusion in words and sentences, resulting in partial changes in the content of the segmented text segments. Therefore, the processed text can be segmented for a second time based on the key information in the first text segmentation result, thereby further improving the reliability and accuracy of the text segmentation. Among them, the key information in each text segment includes but is not limited to the keyword string at the end of each text segment, the character length of each text segment, and the position of the keyword string at the end of each text segment in the processed text. The key information of each text segment is used to perform a second segmentation on the initial processed text, thereby ensuring that the content of the original document to be processed does not change and that the text segmentation can be performed efficiently.

[0053] Through the technical solution disclosed in the embodiment of the present application, by obtaining a document to be processed, converting the document to be processed into a text to be processed, determining segmentation prompt words for segmenting the text to be processed, and then inputting the segmentation prompt words and the text to be processed into a large language model, using the large language model to perform semantic recognition on the text to be processed, and segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, and outputting a first text segmentation result. In this way, by using the large language model to perform semantic recognition on the text to be processed, and then segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, the unreasonable line breaks can be automatically deleted and the punctuation-free text can be effectively segmented, thereby improving the reliability and accuracy of text segmentation.

[0054] In one possible implementation, obtaining key information for each paragraph in the first text segmentation result includes: obtaining the keyword string at the end of each paragraph in the first text segmentation result, and the character length of each paragraph; performing a secondary segmentation on the text to be processed according to the key information of each paragraph to obtain the second text segmentation result includes: performing a secondary segmentation on the text to be processed according to the keyword string of each paragraph and the character length of each paragraph to obtain the second text segmentation result.

[0055] Specifically, the keyword string at the end of each paragraph in the first text segmentation result can indicate the end of each paragraph, and the character length of each paragraph can be the length of the total number of words in each paragraph. The original text to be processed is divided into multiple paragraphs according to the total length of each paragraph and the end mark indicating the end of each paragraph. In this way, the text to be processed is divided twice according to the character length of each paragraph and the keyword string at the end of each paragraph to obtain a second text segmentation result, which further improves the accuracy of text segmentation.

[0056] For example, the second text segmentation result obtained after the original to-be-processed text mentioned in the above embodiment is segmented twice is as follows:

[0057] Asset Appraisal Report

[0058] Summary of asset appraisal report

[0059] The purpose of this asset appraisal is to provide a reference for the client's asset value verification involving fixed assets, including buildings, structures and their auxiliary facilities, machinery and equipment.

[0060] The scope of the appraisal is single asset appraisal, and the types of assets entrusted for appraisal are three categories: fixed assets: buildings, structures and other auxiliary facilities, machinery and equipment.

[0061] A. Fixed assets: Buildings and structures, totaling 48 items, are divided into two categories:

[0062] 1. There are 28 buildings with a total construction area of ​​about 7,414.23 square meters, which are basically brick-concrete, simple, colored steel tile, and steel frame shed structures. They are mainly power distribution rooms, tool rooms, staff dormitories, old offices, old canteens, algae halls, weighing rooms, roadside duty rooms, roadside repair rooms, newly built mobile cabins, duty rooms in the production plant area, material warehouses next to lime kilns, staff dormitories of mills, duty rooms of mills, sunshades of mills, mills, repair workshops, and finished product warehouses of mills, etc., located in Citang Village, Fumin County.

[0063] 2. There are 20 structures and other auxiliary facilities, mainly including: grinding mill retaining wall, grinding mill foundation, power distribution room foundation, lime kiln, lime kiln anti-slip retaining wall, new prefabricated house floor, flower bed, etc.

[0064] In a possible implementation, after performing secondary segmentation on the text to be processed according to the key information of each of the text segments to obtain a second text segmentation result, the method further includes: converting the text segments in the second text segmentation result into vectors; and storing the vectors in a vector database.

[0065] Specifically, the second text segmentation result after the second segmentation is vectorized. Specifically, the text2vec technology can be used to vectorize the second segmentation processing result and insert it into the vector database for retrieval and query by the large language model. Among them, the vector database can be the domestic milvus vector database, among which text2vec is a technology for converting text into vectors. It can convert language units such as words and phrases in the text into high-dimensional vectors. These vectors can reflect the semantic and grammatical relationships between these units. In the text2vec technology, pre-trained word vector models such as Word2Vec, GloVe, BERT, etc. can be used to convert words in the text into vectors.

[0066] The obtained vector representation is stored in a vector database for retrieval and query by a large language model. A vector database is a technology for storing and retrieving vectors. It can efficiently store and retrieve a large amount of vector data. Assuming that the text vectors are represented as X' and X, the cosine similarity between the two vectors can be calculated using the following formula: cos(X,X'):

[0067]

[0068] Cosine similarity can be used to compare the similarity between two vectors or texts. The closer the value is to 1, the more similar the two vectors or texts are. It can be used in applications such as large language model recommendation systems, information retrieval, and similarity matching.

[0069] Corresponding to the document processing method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a document processing device, Figure 2 A schematic diagram of the module composition of a document processing device provided in an embodiment of the present application, wherein the document processing device is used to execute Figure 1 Describes the document processing methods, such as Figure 2 As shown, the document processing device 200 includes: an acquisition module 201, used to acquire a document to be processed and convert the document to be processed into a text to be processed; a determination module 202, used to determine a segmentation prompt word for segmenting the text to be processed; a segmentation module 203, used to input the segmentation prompt word and the text to be processed into a large language model, use the large language model to perform semantic recognition on the text to be processed, and segment the text to be processed according to the segmentation prompt word and the semantic recognition result, and output a first text segmentation result.

[0070] It can be seen from the technical solution provided by the above embodiment of the present application that by obtaining the document to be processed, converting the document to be processed into the text to be processed, determining the segmentation prompt words for segmenting the text to be processed, and then inputting the segmentation prompt words and the text to be processed into the large language model, using the large language model to perform semantic recognition on the text to be processed, and segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, and outputting the first text segmentation result. In this way, by using the large language model to perform semantic recognition on the text to be processed, and then segmenting the text to be processed according to the segmentation prompt words and the semantic recognition results, the unreasonable line breaks can be automatically deleted and the punctuation-free text can be effectively segmented, thereby improving the reliability and accuracy of text segmentation.

[0071] In a possible implementation, the acquisition module 201 is further used to acquire key information of each text segment in the first text segmentation result; and perform secondary segmentation on the text to be processed according to the key information of each text segment to obtain a second text segmentation result.

[0072] In one possible implementation, the acquisition module 201 is also used to obtain the keyword string at the end of each paragraph in the first text segmentation result, and the character length of each paragraph; the segmentation module 203 is also used to perform a secondary segmentation on the text to be processed according to the keyword string of each paragraph and the character length of each paragraph to obtain a second text segmentation result.

[0073] In a possible implementation, the acquisition module 201 is also used to obtain the keyword string at the end of each paragraph in the first text segmentation result, and the position of each keyword string in the text to be processed; the segmentation module 203 is also used to perform a secondary segmentation on the text to be processed according to the keyword string of each paragraph and the position of each keyword string in the text to be processed to obtain a second text segmentation result.

[0074] In a possible implementation, the method further includes: a conversion module, configured to convert text segments in the second text segmentation result into vectors; and a storage module, configured to store the vectors in a vector database.

[0075] The document processing device provided in the embodiment of the present application can implement each process in the embodiment corresponding to the above-mentioned document processing method, and has the same or similar beneficial effects. To avoid repetition, it will not be described here.

[0076] It should be noted that the document processing device provided in the embodiment of the present application and the document processing method provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned document processing method, and has the same or similar beneficial effects, and the repeated parts will not be repeated.

[0077] Corresponding to the document processing method provided in the above embodiment, based on the same technical concept, the embodiment of the present application further provides an electronic device, which is used to execute the above document processing method. Figure 3 A schematic diagram of the structure of an electronic device for implementing each embodiment of the present application is shown in FIG. Figure 3 As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and the memory 302 may store one or more storage applications or data. Among them, the memory 302 may be a temporary storage or a permanent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device.

[0078] Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the electronic device. The electronic device can also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input and output interfaces 305, and one or more keyboards 306.

[0079] Specifically in this embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to achieve the above Figure 1 The various steps in the method embodiment are similar to those in the method embodiment, and have the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.

[0080] This embodiment also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above Figure 1 Each step in the method embodiment has the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.

[0081] The present application provides a computer program product, wherein the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the above Figure 1 Each step in the method embodiment has the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.

[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0083] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0086] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0087] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0088] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0090] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0091] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A document processing method, It is characterized in that The document processing method comprises: Obtaining a document to be processed, and converting the document to be processed into a text to be processed; Determining segmentation prompt words for segmenting the text to be processed; The segmentation prompt words and the text to be processed are input into a large language model, the large language model is used to perform semantic recognition on the text to be processed, and the text to be processed is segmented according to the segmentation prompt words and the semantic recognition results, and a first text segmentation result is output.

2. The document processing method according to claim 1, It is characterized in that After inputting the segmentation prompt words and the text to be processed into a large language model, performing semantic recognition on the text to be processed using the large language model, segmenting the text to be processed according to the segmentation prompt words and the semantic recognition result, and outputting a first text segmentation result, the method further includes: Obtaining key information of each text segment in the first text segmentation result; The text to be processed is segmented twice according to the key information of each text segment to obtain a second text segmentation result.

3. The document processing method according to claim 2, It is characterized in that The step of obtaining key information of each text segment in the first text segmentation result includes: Obtaining the keyword string at the end of each text segment in the first text segmentation result, and the character length of each text segment; The second segmentation of the text to be processed is performed according to the key information of each text segment to obtain a second text segmentation result, which includes: The text to be processed is segmented twice according to the keyword character string of each of the text segments and the character length of each of the text segments to obtain a second text segmentation result.

4. The document processing method according to claim 2, It is characterized in that The step of obtaining key information of each text segment in the first text segmentation result includes: Obtaining the keyword string at the end of each text segment in the first text segmentation result, and the position of each keyword string in the text to be processed; The second segmentation of the text to be processed is performed according to the key information of each text segment to obtain a second text segmentation result, which includes: The text to be processed is segmented twice according to the keyword character string of each of the text segments and the position of each of the keyword character string in the text to be processed to obtain a second text segmentation result.

5. The document processing method according to any one of claims 2 to 4, It is characterized in that After performing secondary segmentation on the text to be processed according to the key information of each text segment to obtain a second text segmentation result, the method further includes: Converting the text segments in the second text segmentation result into vectors; The vector is stored in a vector database.

6. A document processing device, It is characterized in that include: An acquisition module, used for acquiring a document to be processed and converting the document to be processed into a text to be processed; A determination module, used for determining segmentation prompt words for segmenting the text to be processed; The segmentation module is used to input the segmentation prompt words and the text to be processed into a large language model, use the large language model to perform semantic recognition on the text to be processed, and segment the text to be processed according to the segmentation prompt words and the semantic recognition results, and output a first text segmentation result.

7. The document processing device according to claim 6, It is characterized in that The acquisition module is further used to acquire key information of each text segment in the first text segmentation result; The segmentation module is further used to perform secondary segmentation on the text to be processed according to the key information of each text segment to obtain a second text segmentation result.

8. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the document processing method steps as described in any one of claims 1-5.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the document processing method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer is caused to execute the steps of the document processing method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Excel data intelligent segmentation method and system based on AI desktop cloud customer service assistant

    CN121051198A