Text processing method, device, equipment and medium

By preprocessing long text data and generating prompt words, and training the text recognition model in combination with knowledge base search, the problem that large language models cannot effectively consider multiple influencing factors when processing internal documents in the industry, achieving more accurate and efficient text processing effects.

CN119761507APending Publication Date: 2025-04-04CHINA CONSTR BANK CORP (HUNAN BRANCH)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411824166.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When processing internal documents in the industry, the large language model cannot effectively consider multiple influencing factors in the document content, resulting in large differences in output results and long hardware processing time.

Method used

By preprocessing long text data, a text vector sample set is generated, and a prompt word is generated using these vector sample sets and pre-filing requirements information, matching knowledge base statements are retrieved from the pre-constructed knowledge base, text recognition model is trained, and the model is guided to output text information that meets the filing requirements.

Benefits of technology

It improves the performance and reliability of the model, enhances the generation ability, makes the output more accurate, reduces the demand for computing resources, reduces the cost and complexity of knowledge updates, improves hardware processing speed, and saves labor costs and workloads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761507A_ABST
    Figure CN119761507A_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data processing, and discloses a text processing method, device, equipment and medium, the method comprising: pre-processing long text data to obtain a text vector sample set; inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word; retrieving a knowledge base sentence matching the prompt word from a pre-built knowledge base; training a text recognition model using the prompt word and the knowledge base sentence to guide the text recognition model to output text information that meets the preset filing requirements; using the trained text recognition model to perform corresponding processing on the document to be processed to obtain the corresponding target text information. This improves the performance and reliability of the model, can make the result output by the text recognition model more accurate, realizes the filing processing of key information of the document, reduces the hardware processing time and the demand for computing resources, and further improves the hardware processing speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a text processing method, device, equipment and medium. Background Art

[0002] With the development of the Internet, the amount of text data generated in different industries is increasing. In particular, the banking industry, as a data-intensive industry, has accumulated a large amount of customer transaction data, behavioral data, and market data. These rich data resources provide a solid foundation for the training and application of large language models. However, the application scenarios of large language models are mostly for reshaping external business scenarios, and they cannot be well applied to daily work within the industry. A large number of documents within the industry need to be filed for key information. Large language models usually do not take into account multiple influencing factors in the document content, resulting in large differences in output results and a long hardware processing time. Summary of the invention

[0003] The purpose of the present invention is to provide a text processing method, device, equipment and medium, which can use a text recognition model to realize the filing processing of key information of a document, reduce the hardware processing time and the demand for computing resources, and further improve the hardware processing speed.

[0004] In order to solve the above technical problems, the present invention provides a text processing method, which comprises:

[0005] Preprocess the long text data to obtain a text vector sample set;

[0006] Inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word;

[0007] Retrieving a knowledge base sentence matching the prompt word from a pre-built knowledge base;

[0008] Using the prompt words and the knowledge base sentences to train a text recognition model, guiding the text recognition model to output text information that meets preset filing requirements;

[0009] The trained text recognition model is used to process the document to be processed accordingly to obtain the corresponding target text information.

[0010] In the first aspect, in the above-mentioned text processing method provided by the present invention, long text data is preprocessed to obtain a text vector sample set, including:

[0011] Segmenting the long text data to obtain text segment data; the long text data includes text data having at least one length;

[0012] Among them, during the segmentation process, parameters including the amount of overlap between segments, the segmentation size and the segmentation identifier are set or adjusted;

[0013] The text segment data is summarized into long texts to obtain a text vector sample set.

[0014] On the other hand, in the above-mentioned text processing method provided by the present invention, the text vector sample set and the preset filing requirement information are input into the prompt word template to generate the prompt word, including:

[0015] Receiving an instruction carrying a target task; the target task includes preset filing requirement information;

[0016] In response to the instruction, analyzing the target task to obtain the task attributes of the target task and the preset filing requirement information;

[0017] Inputting the text vector sample set, the task attributes of the target task and the preset filing requirement information into a prompt word template;

[0018] The prompt word is determined according to the text vector sample set, the preset filing requirement information and the position of the task attribute of the target task in the prompt word template.

[0019] On the other hand, in the above-mentioned text processing method provided by the present invention, retrieving a knowledge base sentence matching the prompt word from a pre-built knowledge base includes:

[0020] Collect historical text vector data and upload the historical text vectors to a vector knowledge base document;

[0021] Storing the vector knowledge base document in a vector database to construct a knowledge base;

[0022] A knowledge search operation is performed in the knowledge base according to the prompt word to obtain a knowledge base sentence matching the prompt word.

[0023] On the other hand, in the above-mentioned text processing method provided by the present invention, training the text recognition model includes:

[0024] The temperature value of the text recognition model, the number of clusters obtained by sampling and the average number of occurrences of random events per unit time are adjusted respectively.

[0025] On the other hand, in the above-mentioned text processing method provided by the present invention, guiding the text recognition model to output text information that meets the preset filing requirements includes:

[0026] The text recognition model is guided to output a conclusion including whether the filing requirements are met, whether filing or approval is required, and key content of the text that meets the preset filing requirements.

[0027] On the other hand, in the above-mentioned text processing method provided by the present invention, before preprocessing the text data, it also includes:

[0028] Collect long text data of at least one file type;

[0029] Categorize and process long text data according to different business demand types, different filing types and different business fields;

[0030] Label the long text data after classification.

[0031] In order to solve the above technical problems, the present invention further provides a text processing device, the device comprising:

[0032] The text preprocessing module is used to preprocess long text data to obtain a text vector sample set;

[0033] A prompt word generation module, used for inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word;

[0034] A knowledge base retrieval module, used to retrieve knowledge base sentences matching the prompt word from a pre-built knowledge base;

[0035] A model training module, used to train a text recognition model using the prompt words and the knowledge base sentences, and guide the text recognition model to output text information that meets the preset filing requirements;

[0036] The model inference module is used to use the trained text recognition model to perform corresponding processing on the document to be processed to obtain the corresponding target text information.

[0037] In order to solve the above technical problems, the present invention further provides a text processing device, the device comprising:

[0038] Memory for storing computer programs;

[0039] A processor is used to implement the steps of the above-mentioned text processing method when executing the computer program.

[0040] In order to solve the above technical problem, the present invention 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 steps of the above text processing method are implemented.

[0041] It can be seen from the above technical scheme that the present invention provides a text processing method, which includes: preprocessing long text data to obtain a text vector sample set; inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word; retrieving knowledge base sentences matching the prompt word from a pre-built knowledge base; training a text recognition model using the prompt word and the knowledge base sentence to guide the text recognition model to output text information that meets the preset filing requirements; and using the trained text recognition model to perform corresponding processing on the document to be processed to obtain the corresponding target text information.

[0042] The beneficial effect of the present invention lies in that the above-mentioned text processing method provided by the present invention takes into account the influencing factors in the document content, first pre-processes the long text data to obtain a text vector sample set, thereby optimizing the data transmission volume and reducing the hardware processing time, and then uses the text vector sample set and preset filing requirement information to generate prompt words, retrieves knowledge base sentences matching the prompt words from a pre-built knowledge base, and uses the prompt words and knowledge base sentences to train the text recognition model, wherein the prompt words and knowledge base sentences can guide the model to generate outputs that are more in line with the preset filing requirements, and realize the filing processing of key information of the document, which not only improves the performance and reliability of the model, but also enhances the generation capability of the model, making the output generated by it more accurate, and can ensure that there will be no large differences in the results output by the text recognition model, and reduces the cost and complexity of knowledge updating, reduces the demand for computing resources, and further improves the hardware processing speed, thereby saving labor costs and reducing workload.

[0043] In addition, the present invention also provides a corresponding text processing device, a text processing equipment and a computer-readable storage medium for the text processing method, which have the same or corresponding technical features as the above-mentioned text processing method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

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

[0046] Figure 2 A schematic diagram of the structure of a text processing device provided by an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the structure of a text processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 A flowchart of a text processing method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0050] S101. Preprocess the long text data to obtain a text vector sample set.

[0051] In practice, long text data is relative to short text, and generally includes more characters, words or sentences, is longer in length, may have more complex content, may contain multiple topics or sub-topics, and may involve multiple influencing factors such as text, pictures, and tables.

[0052] When the present invention performs step S101, in order to improve the data processing speed, the long text data is preprocessed to obtain multiple text vectors to construct a text vector sample set. A text vector refers to a way of representing text in the form of a mathematical vector. That is, the text content is converted into a mathematical vector that can be understood and processed by a computer through a specific method.

[0053] S102: Input the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word.

[0054] In implementation, after executing step S101 to obtain the text vector sample set, step S102 is started. Specifically, the text vector sample set and preset filing requirement information can be input into the prompt word template to generate the corresponding prompt word.

[0055] It should be noted that the preset filing requirement information refers to the relevant information corresponding to the preset filing requirements. The filing requirements are formulated by the relevant management department. For example, when a labor contract needs to be filed, the filing requirement is to record the main terms of the contract, the signing date, etc. The filing requirements can be found in the filing scope list. When submitting a document to the management department, it is necessary to confirm whether it needs to be filed. If so, it is necessary to further confirm the relevant information that meets the filing requirements.

[0056] Step S102 of the present invention applies prompt engineering technology, which is an important technology in model application. It guides the model to generate output that is more in line with expectations by carefully designing and optimizing the prompts input to the model. Prompt engineering can not only improve the performance of the model, but also make the performance of the model on specific tasks more stable and reliable. Prompts are texts input to the model to guide the model to generate specific outputs. In the present invention, the model can be gradually guided by clarifying task instructions, providing contextual information, using structured prompts, controlling output length and format, and using examples and templates. By carefully designing and optimizing prompts, the performance and reliability of the model can be significantly improved, and the model can also be better applied in specific business fields.

[0057] S103: Retrieve a knowledge base sentence matching the prompt word from a pre-built knowledge base.

[0058] It should be noted that step S103 of the present invention can be achieved by retrieving knowledge base statements that match the prompt words from a pre-built knowledge base. The pre-built knowledge base can be understood as an external knowledge base. Retrieving relevant knowledge base statements that match the prompt words from the external knowledge base can ensure that the output of the model is based on facts and reduce the illusion phenomenon caused by the lack of the latest or specific domain knowledge in the model. Compared with frequently fine-tuning the model to incorporate new knowledge, the present invention improves the performance of the model by retrieving the external knowledge base without increasing the model parameters, reduces the cost and complexity of knowledge updating, reduces the demand for computing resources, and improves the efficiency of the system.

[0059] S104: Use prompt words and knowledge base sentences to train the text recognition model, and guide the text recognition model to output text information that meets preset filing requirements.

[0060] It should be noted that the above text recognition model can be a large language model or other models, which are not limited here. The large language model refers to a machine learning model with large-scale parameters and complex computing structure, which obtains powerful natural language processing, image recognition and other capabilities by performing unsupervised learning on massive data.

[0061] When executing step S104, the prompt words generated in step S102 and the knowledge base sentences retrieved in step S103 can be used to train the text recognition model. The prompt words generated in step S102 and the knowledge base sentences retrieved in step S103 can guide the text recognition model to output text information that meets the preset filing requirements.

[0062] S105: Use the trained text recognition model to process the document to be processed accordingly to obtain corresponding target text information.

[0063] It should be added that, before executing step S105, the present invention may further include: fine-tuning the text recognition model. During the fine-tuning process, the text recognition model may be further trained on a dataset of a specific task so that the model can better adapt to a specific task or field.

[0064] In the above-mentioned text processing method provided by the embodiment of the present invention, the long text data is first preprocessed to obtain a text vector sample set, so that the data transmission volume is optimized and the hardware processing time can be reduced. Then, the text vector sample set and the preset filing requirement information are used to generate prompt words, and knowledge base sentences matching the prompt words are retrieved from the pre-built knowledge base. The text recognition model is trained using the prompt words and the knowledge base sentences, wherein the prompt words and the knowledge base sentences can guide the model to generate outputs that are more in line with the preset filing requirements, and realize the filing processing of key information of the document, which not only improves the performance and reliability of the model, but also enhances the generation ability of the model, making the output generated by it more accurate, and can ensure that there will be no large differences in the results output by the text recognition model, and reduces the cost and complexity of knowledge updating, reduces the demand for computing resources, and further improves the hardware processing speed, thereby saving labor costs and reducing workload.

[0065] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, before executing step S101 to pre-process the text data, it may also include: collecting long text data of at least one file type; classifying the long text data according to different business demand types, different filing types and different business fields; and labeling the classified long text data.

[0066] In implementation, there can be many types of long text data, such as: PDF, Word, Txt, Excel, CSV, text box, dialogue interaction documents, etc. Among them, plain text Txt text has a greater advantage. The present invention can first collect long text data of at least one file type; then classify and process the long text data according to different business demand types, different filing types and different business fields. Business demand types may include data application, channel release, product promotion, technical side upgrade and transformation, business extension, etc. Filing types may include technical solution filing, end-to-end filing, etc. The filing mode may include relevant information such as name, competent department, model description, filing prerequisite, review conditions, etc. The business field is searched in the known business field division table. The present invention labels the long text data after classification, which is helpful for the subsequent effective classification of text and accurate division of business fields.

[0067] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, step S101 pre-processes the long text data to obtain a text vector sample set, which may specifically include: segmenting the long text data to obtain text fragment data; the long text data includes text data having at least one length; wherein, during the segmentation process, parameters including the amount of overlap between segments, the segmentation size and the segmentation identifier are set or adjusted; and the text fragment data is summarized as a long text to obtain a text vector sample set.

[0068] In practice, since the contents of different documents vary in length and the input characters are one of the key factors affecting the model's running effect, the present invention performs segmentation processing on the input long text data to obtain text segment data. When segmenting long text, at least one document of the same length can be segmented into long texts by adjusting and modifying parameters such as the overlap between segments, the segmentation size, and the segmentation identifier. Then, the segmented multiple text segments are summarized into long texts to guide the model to refine and summarize the texts to improve the subsequent running speed and implementation effect of the model.

[0069] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, step S102 inputs the text vector sample set and the preset filing requirement information into a prompt word template to generate a prompt word, which may specifically include: receiving an instruction carrying a target task; the target task includes preset filing requirement information; in response to the instruction, analyzing the target task to obtain the task attributes of the target task, and the preset filing requirement information; inputting the text vector sample set, the task attributes of the target task and the preset filing requirement information into the prompt word template; determining the prompt word according to the position of the text vector sample set, the preset filing requirement information and the task attributes of the target task in the prompt word template.

[0070] In implementation, the present invention may receive an instruction carrying a target task, which is a task for generating a prompt word. After analyzing the target task in response to the instruction, the task attributes of the target task and preset filing requirement information may be obtained. Based on the text vector sample set, the task attributes of the target task and the preset filing requirement information may generate a prompt word.

[0071] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, step S103 retrieves knowledge base sentences matching the prompt word from a pre-constructed knowledge base, which may specifically include: collecting historical text vector data, and uploading the historical text vector to a vector knowledge base document; storing the vector knowledge base document in a vector database to construct a knowledge base; performing a knowledge retrieval operation in the knowledge base according to the prompt word to obtain a knowledge base sentence matching the prompt word.

[0072] In practice, the present invention can utilize the storage of vector knowledge base documents to construct the required knowledge base, and the knowledge in the knowledge base can be continuously updated. According to the prompt word generated in step S102, a knowledge base sentence matching the prompt word can be obtained by performing a knowledge search operation in the knowledge base.

[0073] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, step S104 trains the text recognition model, which may specifically include: adjusting the temperature value of the text recognition model, the number of clusters obtained by sampling (i.e., the K value), and the average number of occurrences of random events per unit time (i.e., the P value), respectively, to control the dependency conditions of the large model to generate characters, and guiding through the prompt words generated in step S102 and the knowledge base sentences retrieved in step S103, limiting the output results of the model, and obtaining output results that allow users to understand the desired target.

[0074] In practice, the present invention can train the text recognition model by adjusting the temperature value of the model, the number of clusters obtained by sampling and the average number of occurrences of random events per unit time.

[0075] Furthermore, in a specific implementation, in the above-mentioned text processing method provided in an embodiment of the present invention, step S104 guides the text recognition model to output text information that meets the preset filing requirements, which may specifically include: guiding the text recognition model to output a conclusion including whether the filing requirements are met, whether filing or approval is required, and key text content that meets the preset filing requirements.

[0076] In practice, the text recognition model of the present invention can output results in the form of point-by-point answers, and its output can specifically include a classification conclusion about the document, which can be one or a combination of meeting the filing requirements, not meeting the filing requirements, needing filing, not needing filing, needing approval, not needing approval, and can also include key text information that meets the preset filing requirements on the basis of needing filing. In this way, intelligent classification of documents can be achieved, and the business areas involved in the documents can be accurately divided into corresponding business departments.

[0077] It should be pointed out that the text recognition model of the present invention completes document reading and document processing, which not only improves the accuracy of the output results and provides a reference for business functions, but also continuously optimizes the time. The average processing time does not exceed 30s, which greatly improves work efficiency.

[0078] In the above embodiments, the text processing method is described in detail, and the present invention also provides corresponding embodiments of the text processing device and the text processing equipment. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.

[0079] Figure 2 This is a schematic diagram of the structure of a text processing device provided by an embodiment of the present invention. This embodiment is based on the perspective of functional modules, such as Figure 2 As shown, the device comprises:

[0080] The text preprocessing module 10 is used to preprocess the long text data to obtain a text vector sample set;

[0081] A prompt word generation module 11 is used to input the text vector sample set and the preset filing requirement information into the prompt word template to generate a prompt word;

[0082] A knowledge base retrieval module 12 is used to retrieve a knowledge base sentence matching the prompt word from a pre-built knowledge base;

[0083] The model training module 13 is used to train the text recognition model using prompt words and knowledge base sentences, and guide the text recognition model to output text information that meets the preset filing requirements;

[0084] The model inference module 14 is used to use the trained text recognition model to process the document to be processed accordingly to obtain the corresponding target text information.

[0085] In the above-mentioned text processing device provided by the embodiment of the present invention, through the interaction of the above-mentioned four modules,

[0086] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part refer to the description of the embodiments of the method part, which will not be described here. And it has the same beneficial effects as the above-mentioned text processing method.

[0087] Figure 3 This is a schematic diagram of the structure of a text processing device provided by an embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 3 As shown, the text processing device includes:

[0088] A memory 20, used for storing computer programs;

[0089] The processor 21 is used to implement the steps of the text processing method mentioned in the above embodiment when executing the computer program.

[0090] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0091] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the text processing method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the above-mentioned text processing method, etc.

[0092] In some embodiments, the text processing device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26. Those skilled in the art will appreciate that Figure 3 The structure shown in the figure does not constitute a limitation on the text processing device, and may include more or fewer components than shown in the figure. The text processing device provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the text processing method mentioned above, and the effect is the same as above.

[0093] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0094] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code. The computer-readable storage medium provided by the present invention can implement the above-mentioned text processing method, and the effect is the same as above.

[0095] Finally, the present invention also provides an embodiment corresponding to a computer program product. The computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps described in the above text processing method embodiment are implemented. The computer program product provided by the present invention can implement the above-mentioned text processing method, and the effect is the same as above.

[0096] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0097] The above is a detailed introduction to the text processing method, device, equipment and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A text processing method, characterized in that: The method comprises: Preprocess the long text data to obtain a text vector sample set; Inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word; Retrieving a knowledge base sentence matching the prompt word from a pre-built knowledge base; Using the prompt words and the knowledge base sentences to train a text recognition model, guiding the text recognition model to output text information that meets preset filing requirements; The trained text recognition model is used to process the document to be processed accordingly to obtain the corresponding target text information.

2. The text processing method according to claim 1, characterized in that: Preprocess the long text data to obtain a text vector sample set, including: Segmenting the long text data to obtain text segment data; the long text data includes text data having at least one length; Among them, during the segmentation process, parameters including the amount of overlap between segments, the segmentation size and the segmentation identifier are set or adjusted; The text segment data is summarized into long texts to obtain a text vector sample set.

3. The text processing method according to claim 1, characterized in that: Input the text vector sample set and the preset filing requirement information into the prompt word template to generate prompt words, including: Receiving an instruction carrying a target task; the target task includes preset filing requirement information; In response to the instruction, analyzing the target task to obtain the task attributes of the target task and the preset filing requirement information; Inputting the text vector sample set, the task attributes of the target task and the preset filing requirement information into a prompt word template; The prompt word is determined according to the text vector sample set, the preset filing requirement information and the position of the task attribute of the target task in the prompt word template.

4. The text processing method according to claim 1, characterized in that: Retrieving a knowledge base sentence matching the prompt word from a pre-built knowledge base, including: Collect historical text vector data and upload the historical text vectors to a vector knowledge base document; Storing the vector knowledge base document in a vector database to construct a knowledge base; A knowledge search operation is performed in the knowledge base according to the prompt word to obtain a knowledge base sentence matching the prompt word.

5. The text processing method according to claim 1, characterized in that: Train the text recognition model, including: The temperature value of the text recognition model, the number of clusters obtained by sampling and the average number of occurrences of random events per unit time are adjusted respectively.

6. The text processing method according to claim 1, characterized in that: Directing the text recognition model to output text information that meets preset filing requirements, including: The text recognition model is guided to output a conclusion including whether the filing requirements are met, whether filing or approval is required, and key content of the text that meets the preset filing requirements.

7. The text processing method according to claim 1, characterized in that: Before preprocessing the text data, it also includes: Collect long text data of at least one file type; Categorize and process long text data according to different business demand types, different filing types and different business fields; Label the long text data after classification.

8. A text processing device, characterized in that: The device comprises: The text preprocessing module is used to preprocess long text data to obtain a text vector sample set; A prompt word generation module, used for inputting the text vector sample set and preset filing requirement information into a prompt word template to generate a prompt word; A knowledge base retrieval module, used to retrieve knowledge base sentences matching the prompt word from a pre-built knowledge base; A model training module, used to train a text recognition model using the prompt words and the knowledge base sentences, and guide the text recognition model to output text information that meets the preset filing requirements; The model inference module is used to use the trained text recognition model to perform corresponding processing on the document to be processed to obtain the corresponding target text information.

9. A text processing device, characterized in that: The device comprises: Memory for storing computer programs; A processor, configured to implement the steps of the text processing method according to any one of claims 1 to 7 when executing the computer program.

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