Document processing method and device, electronic equipment and storage medium

By obtaining the document identification, name and storage path of the knowledge document, combining it with the pre-built tag table and tag dictionary, using the processing model to automatically determine the tag name list, and writing the association between the knowledge document and the tag into the database, the problems of low efficiency and easy labeling errors when uploading knowledge documents in batches are solved, and automatic labeling is achieved and document processing efficiency is improved.

CN120705120APending Publication Date: 2025-09-26INSPUR ENTERPRISE CLOUD TECHNOLOGY (SHANDONG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510875021.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

The existing technology has the problem of low efficiency and easy labeling errors when uploading knowledge documents in batches.

Method used

By obtaining the document identification, name and storage path of the knowledge document, combined with the pre-built tag table and tag dictionary, the processing model is used to automatically determine the tag name list, and the association relationship between the knowledge document and the tag is written into the database.

Benefits of technology

It realizes the automatic tagging of knowledge documents, improves the efficiency of document processing and reduces tagging errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705120A_ABST
    Figure CN120705120A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method and device, electronic equipment and a storage medium, and the method comprises the steps: for each uploaded knowledge document, splicing a tag name list, a knowledge document name, a processing instruction and matters needing attention to obtain spliced data; calling a pre-constructed processing model to process the spliced data to obtain a corresponding related tag name list, processing based on the related tag name list and a tag dictionary, and determining an association relationship between the knowledge document and the tag; and calling a database to execute an addition statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database, and storing the association relationship. The method comprises the following steps: calling a processing model to select one or more tags according to a knowledge document name and a given tag name list; and then the labels selected by the model are associated with the knowledge documents in the database, so that accurate labeling of the knowledge documents is realized, and the document processing efficiency is improved.
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 document processing method, device, electronic device and storage medium. Background Art

[0002] In a knowledge question-answering system, users' knowledge documents are uploaded to the knowledge base in batches in advance so that the knowledge base can be used as context in the subsequent question-answering process. To facilitate querying and management of knowledge documents, knowledge documents are usually tagged.

[0003] Traditional labeling is generally done manually, which leads to low efficiency and error-prone labeling when uploading knowledge documents in batches. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a document processing method, apparatus, electronic device, and storage medium to solve the problems of low efficiency and prone labeling errors in the prior art.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention provides a document processing method, the method comprising:

[0007] For each uploaded knowledge document, obtain the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name and storage path of the knowledge document;

[0008] Determine a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database;

[0009] Splicing the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data;

[0010] Inputting the spliced ​​data into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, wherein the pre-built processing model is pre-built based on historical data;

[0011] Determine the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary;

[0012] The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0013] Optionally, determining a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database includes:

[0014] Query all tag data from the tag table pre-stored in the database and store it in the tag list;

[0015] The tag names in the tag list are written into a tag name list, and the tag names and tag IDs in the tag list are written into a tag dictionary.

[0016] Optionally, the spliced ​​data is input into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, including:

[0017] Invoking a pre-built processing model to identify processing instructions and precautions in the spliced ​​data;

[0018] Calling a pre-built processing model to process the tag name list and knowledge document name in the spliced ​​data based on the processing instructions and precautions, and determining relevant tags corresponding to the knowledge document name;

[0019] The relevant tags corresponding to the knowledge document names fed back by the processing model are obtained and saved in a relevant tag name list.

[0020] Optionally, determining the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary includes:

[0021] Determine whether there is a value corresponding to each relevant tag in the relevant tag name list in the tag dictionary;

[0022] If so, obtain the value corresponding to the relevant tag from the tag dictionary and write it into the tag ID list;

[0023] If it is determined that the length of the tag ID list is not the preset length, it is determined that the tag corresponding to the tag ID list is associated with the knowledge document.

[0024] Optionally, calling a database to execute an add statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database, includes:

[0025] For each tag ID in the tag ID list, create an associated ID corresponding to each tag ID;

[0026] Concatenate the association ID, the tag ID, and the document identifier corresponding to the knowledge document to obtain a concatenated string;

[0027] Adding the concatenated character string to a preset association relationship insertion statement to obtain an addition statement corresponding to the association relationship between the knowledge document and the tag;

[0028] The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0029] Optionally, after determining the tag name list and tag dictionary corresponding to the knowledge document based on the tag table pre-built in the database, the method further includes:

[0030] Processing based on the knowledge document to determine splicing keywords;

[0031] Inputting the splicing keyword, the tag name list, the processing instructions, and the precautions into a pre-built recognition model, so that the pre-built recognition model determines an associated tag corresponding to the splicing keyword from the tag name list based on the processing instructions and the precautions, wherein the pre-built recognition model is built based on corresponding historical data;

[0032] Writing the associated tags corresponding to the splicing keywords into the corresponding related tag name list;

[0033] Determine the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary;

[0034] The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0035] Optionally, processing is performed based on the knowledge document to determine the splicing keywords, including:

[0036] Processing the knowledge document to determine keywords corresponding to the subject type of the knowledge document;

[0037] The keywords are spliced ​​together to obtain spliced ​​keywords.

[0038] A second aspect of an embodiment of the present invention provides a document processing device, comprising:

[0039] An acquisition unit, configured to acquire, for each uploaded knowledge document, the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name, and storage path of the knowledge document;

[0040] a determining unit, configured to determine a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database;

[0041] a splicing unit, configured to splice the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data;

[0042] a processing unit, configured to input the spliced ​​data into a pre-built processing model, so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, wherein the pre-built processing model is pre-built based on historical data;

[0043] An execution unit is used to process based on the relevant tag name list and tag dictionary to determine the association relationship between the knowledge document and the tag; call the database to execute the addition statement corresponding to the association relationship between the knowledge document and the tag to write the association relationship between the knowledge document and the tag into the database and save it.

[0044] The third aspect of an embodiment of the present invention shows an electronic device, which includes a processor and a memory, the memory is used to store program code and data generated by data, and the processor is used to call the program instructions in the memory to execute the document processing method as described in the first aspect of the embodiment of the present invention.

[0045] A fourth aspect of an embodiment of the present invention shows a storage medium, which includes a stored program, wherein when the program runs, the device where the storage medium is located is controlled to execute the document processing method as described in the first aspect of the embodiment of the present invention.

[0046] Based on the above-mentioned embodiments of the present invention, a document processing method, device, electronic device and storage medium are provided, and the method includes: for each uploaded knowledge document, obtaining the currently uploaded knowledge document and the corresponding processing instructions and precautions, and recording the document identification, knowledge document name and storage path of the knowledge document; determining the label name list and label dictionary corresponding to the knowledge document based on a label table pre-constructed in a database; splicing the label name list, knowledge document name, the processing instructions and precautions to obtain spliced ​​data; inputting the spliced ​​data into a pre-constructed processing model so that the pre-constructed processing model processes the spliced ​​data to obtain a corresponding list of relevant label names, and the pre-constructed processing model is pre-constructed based on historical data; processing based on the relevant label name list and label dictionary to determine the association relationship between the knowledge document and the label; calling the database to execute the addition statement corresponding to the association relationship between the knowledge document and the label, so as to write the association relationship between the knowledge document and the label into the database and save it. In an embodiment of the present invention, a tag name list and a tag dictionary corresponding to the knowledge document are determined based on a tag table pre-constructed in a database; the tag name list, the knowledge document name, the processing instructions and precautions are spliced ​​to obtain spliced ​​data; the spliced ​​data is input into a pre-constructed processing model, and a large model interface is called so that the processing model selects one or more tags based on the knowledge document name and the given tag name list; then the tags selected by the model are associated with the knowledge document in the database, thereby achieving accurate tagging of the knowledge document and improving document processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0048] Figure 1 A schematic diagram of the server and client architecture shown in an embodiment of the present invention;

[0049] Figure 2 A schematic flow chart of a document processing method according to an embodiment of the present invention;

[0050] Figure 3 A schematic flow chart of another document processing method according to an embodiment of the present invention;

[0051] Figure 4 The figure is a schematic structural diagram of a document processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0053] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0054] It should be noted that the descriptions of "first", "second", etc. in the present invention are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0055] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0056] See also Figure 1 , is a schematic diagram of the architecture of the server and client shown in an embodiment of the present invention.

[0057] The server 10 is connected to the client 20 .

[0058] When the client 20 receives a knowledge document uploaded by the user through a form, byte stream, etc., the client 20 initiates a corresponding interface request for each document, and multiple knowledge documents are sent to the server 10 by initiating requests in a concurrent manner.

[0059] It should be noted that upload methods include but are not limited to form, byte stream, etc.

[0060] The server 10 specifically implements the process of document processing as follows Figure 2 FIG. 1 is a flow chart of a document processing method according to an embodiment of the present invention, wherein the method includes:

[0061] Step S201: for each uploaded knowledge document, obtain the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name and storage path of the knowledge document;

[0062] It should be noted that the specific implementation of step S201 includes the following steps.

[0063] Step S11: storing the currently uploaded knowledge document according to a preset storage method, and obtaining a storage path for the stored knowledge document;

[0064] In the specific implementation of step S11, for each uploaded knowledge document, the client saves the uploaded knowledge document to the server, the server stores it according to the corresponding storage method, obtains the storage path of the knowledge document after storage, and adds the variable field document path {document_path} corresponding to the knowledge document.

[0065] The formats of knowledge documents include but are not limited to common txt, docx, pdf, etc.

[0066] The storage method after saving to the server, including but not limited to file system, object storage, etc.;

[0067] Step S12: Create an identifier for the knowledge document and obtain a corresponding document name from the knowledge document.

[0068] In the specific implementation of step S12, the function UUID is used to generate the unique identifier of the knowledge document, that is, the document identifier, and saved to the variable knowledge document table primary key {document_ID}; then, the knowledge document name is obtained from the knowledge document and saved to the variable knowledge document name {document_name}.

[0069] Step S13: storing the document identifier, knowledge document name and storage path of the knowledge document;

[0070] In the specific implementation of step S13, the preset knowledge document table documents insert statement is called to write the document identifier, knowledge document name and storage path of the above-mentioned knowledge document into the knowledge document table documents, that is, the corresponding knowledge document table documents table insert statement is INSERT INTOdocuments VALUES({document_ID},{document_name}, {document_path}).

[0071] It should be noted that the knowledge document table, "documents," is pre-created in the database. It contains the following fields: ID, name, and save_path. ID is the primary key of the knowledge document table, name is the name of the knowledge document, and save_path is the storage path for the knowledge document. All three fields are string types.

[0072] Optionally, when executing the process from step S11 to step S13, processing instructions and precautions uploaded by the user based on the client are obtained at the same time.

[0073] Step S202: determining a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database;

[0074] It should be noted that the specific implementation of step S22 includes the following steps.

[0075] Step S21: all tag data are searched from the tag table pre-stored in the database, and stored in the tag list.

[0076] It should be noted that the tag table tags is created in advance. The specific creation process is: calling the corresponding SQL statement to write the tag ID and noun.

[0077] The tags table contains the fields ID and name. ID is the primary key of the tags table, and name is the tag name, both of which are string types.

[0078] For example: INSERT INTO tags VALUES (tag_ID1, tag_name1), (tag_ID2, tag_name2); tag_ID1 and tag_name1 represent the ID and name of the first tag to be created, and tag_ID2 and tag_name2 represent the ID and name of the second tag to be created. If there are multiple data items, the same writing method can be used.

[0079] Among them, the tag IDs are all generated using the UUID function.

[0080] In the specific implementation of step S21 , the tag data such as tag ID and tag name of all tags are queried in the tag table tag table and saved in the variable tag list {tag_list}.

[0081] Step S22: writing the tag names in the tag list into the tag name list, and writing the tag names and tag IDs in the tag list into the tag dictionary.

[0082] In the specific implementation of step S22, first, create an empty tag name list {tag_name_list} and an empty tag dictionary {tag_dict}; then, traverse the tag list {tag_list} obtained in the above step S21, and for each tag in it, take out the tag name and add it to the tag name list {tag_name_list}; then, take out the tag ID and add it to the tag dictionary {tag_dict} with the tag name as the key and the tag ID as the value.

[0083] Step S203: splicing the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data.

[0084] In the specific implementation of step S203, first, the processing instructions and precautions related to the knowledge document input by the user based on the client are obtained; and the tag name list, knowledge document name, processing instructions and precautions are spliced ​​to obtain spliced ​​data {prompt_str}.

[0085] It should be noted that the spliced ​​data is in the form of a character string.

[0086] For example, if the processing instruction is "Your task is to filter out the tags related to the file name based on the file name and the given list of tags"; the note is "Please return strictly in list form without outputting the thinking process; if there are no tags related to the file name in the given list of tags, return an empty list: []"; concatenating it with the list of tag names and the knowledge document name, the concatenated data is <Instruction>Your task is to filter out the tags related to the file name based on the file name and the given list of tags.< / Instruction><Note>Please return strictly in list form without outputting the thinking process. If there are no tags related to the file name in the given list of tags, return an empty list: []< / Note><Tag List>{tag_name_list}< / Tag List><File Name>{document_name}< / File Name>.

[0087] Step S204: Input the concatenated data into a pre-constructed processing model so that the pre-constructed processing model processes the concatenated data to obtain a corresponding list of relevant tag names.

[0088] Among them, the pre-constructed processing model is pre-constructed based on historical data;

[0089] It should be noted that there are different implementation methods in the specific process of implementing Step S204.

[0090] In one implementation, it includes the following steps.

[0091] Step S31: Call the pre-constructed processing model to identify the processing instruction and note in the concatenated data;

[0092] Step S32: Call the pre-constructed processing model to process the list of tag names and the knowledge document name in the concatenated data based on the processing instruction and note to determine the relevant tags corresponding to the knowledge document name;

[0093] Step S33: Obtain the relevant tags corresponding to the knowledge document name fed back by the processing model and save them to the list of relevant tag names.

[0094] In the process of specifically implementing steps S31 to S33, the spliced ​​data {prompt_str} is used as the prompt content for calling the large model interface; in order to construct a completed processing model, the corresponding processing instructions and precautions are first identified; then the spliced ​​data is processed based on the processing instructions and precautions to determine the tags related to the processing instructions, i.e., the related tags, from the tag name list; the related tags returned by the processing model are obtained and stored in the completion parameter {completion}; then, {completion} is used as an input parameter to call the json.loads function to save all related tags to the related tag name list {related_tag_name_list}.

[0095] Optionally, if the database throws an exception when calling the json.loads function, directly assign the empty list [] to the related tag name list {related_tag_name_list}.

[0096] The related tag name list {related_tag_name_list} is used to store tag names corresponding to tags related to the processing instruction.

[0097] It should be noted that the training process of the pre-built processing model includes: pre-acquiring the splicing data, processing instructions, precautions and corresponding related label name lists of different historical knowledge documents as training data, and training the training data based on the processing instructions and precautions in the training data to build the corresponding large model; then, using the splicing data of the historical knowledge documents to test the trained large model until the output related label name list is the same as the related label name list in the training data, and determining that the trained processing model is obtained.

[0098] It should be noted that the large model can be a basic model built by a neural network, machine learning or deep learning algorithm.

[0099] Step S205: performing processing based on the relevant tag name list and the tag dictionary to determine the association relationship between the knowledge document and the tag.

[0100] It should be noted that the specific implementation of step S205 includes the following steps.

[0101] Step S41: determine whether the value corresponding to each relevant tag in the relevant tag name list exists in the tag dictionary. If so, execute step S42; if not, return to execute step S41.

[0102] In the specific implementation of step S41, the related tag name list {related_tag_name_list} is traversed, and for each element in the table, that is, the tag name, it is determined whether there is a corresponding value in the tag dictionary {tag_dict}. If not, this traversal is skipped and the next element is judged until every element in the related tag name list {related_tag_name_list} is judged; otherwise, step S42 is executed.

[0103] Step S42: Obtain the value corresponding to the relevant tag from the tag dictionary and write it into the tag ID list;

[0104] In the specific implementation of step S42 , the value corresponding to the relevant tag is taken out from the tag dictionary and added to the tag ID list {tag_ID_list}.

[0105] Step S43: Determine whether the length of the tag ID list is a preset length. If so, determine that there is no tag corresponding to the knowledge document; if not, execute step S44.

[0106] It should be noted that the preset length is set by technicians based on multiple experiments and can generally be set to 0.

[0107] In the specific implementation of step S43, after judging each element in the related tag name list {related_tag_name_list}, it is judged whether the length of the tag ID list is the preset length. If so, it is determined that there is no tag corresponding to the knowledge document; if not, step S44 is executed.

[0108] Step S44: Determine whether the tag corresponding to the tag ID list is associated with the knowledge document.

[0109] In the specific implementation of step S44 , it is determined that the tag corresponding to the tag ID in the tag ID list has an association relationship with the knowledge document.

[0110] Step S206: calling the database to execute the adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0111] It should be noted that the specific implementation of step S206 includes the following steps.

[0112] Step S51: for each tag ID in the tag ID list, create an associated ID corresponding to each tag ID;

[0113] In the specific implementation of step S51, the tag ID list {tag_ID_list} is traversed, and for each element therein, that is, the tag ID is assigned to the temporary variable list ID {tag_ID}, and the UUID function is used to generate the associated ID {join_ID} corresponding to each tag ID.

[0114] Step S52: concatenate the association ID, the tag ID, and the document identifier corresponding to the knowledge document to obtain a concatenated string;

[0115] In the specific implementation of step S52, the association ID {join_ID}, the tag ID {tag_ID} and the document identifier {document_ID} corresponding to the knowledge document are concatenated to obtain a concatenated string, namely, the string "({join_ID}, {document_ID}, {tag_ID})".

[0116] Step S53: Adding the concatenated character string to the preset association relationship insert statement to obtain an addition statement corresponding to the association relationship between the knowledge document and the tag.

[0117] In the process of implementing step S53, first, a general SQL statement for the association relationship between knowledge documents and tags is pre-inserted in batches, that is, a preset association relationship insertion statement is assigned to the insert statement {insert_sql}, and initialized to: "INSERT INTO document_tag_joins VALUES"; then, the concatenated string is appended to the end of {insert_sql} to obtain the addition statement corresponding to the association relationship between the knowledge document and the tag.

[0118] Step S54: calling the database to execute the adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0119] In the specific implementation of step S54, the database is called to execute an add statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the association table of knowledge documents and tags in the database.

[0120] It's important to note that the association table between knowledge documents and tags is pre-created and stored in the database. It's named document_tag_joins. It contains the following fields: ID, document_ID, and tag_ID. ID is the primary key of the association table; document_ID is the knowledge document ID, which is associated with the ID field in the document table; and tag_ID is the tag ID, which is associated with the ID field in the tag table.

[0121] In an embodiment of the present invention, a tag name list and a tag dictionary corresponding to the knowledge document are determined based on a tag table pre-constructed in a database; the tag name list, the knowledge document name, the processing instructions and precautions are spliced ​​to obtain spliced ​​data; the spliced ​​data is input into a pre-constructed processing model, and a large model interface is called so that the processing model selects one or more tags based on the knowledge document name and the given tag name list; the tags selected by the model are then associated with the knowledge document in the database, thereby realizing an automated process of accurately labeling knowledge documents, thereby improving document processing efficiency.

[0122] Based on the document processing method shown in the above embodiment of the present invention, the embodiment of the present invention accordingly shows a flow chart of another document processing method, such as Figure 3 As shown, the method includes:

[0123] Step S301: for each uploaded knowledge document, obtain the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name and storage path of the knowledge document;

[0124] Step S302: determining a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database;

[0125] It should be noted that the specific implementation process of step S301 and step S302 is the same as the specific implementation process of step S201 and step S202 described above, and they can refer to each other.

[0126] Step S303: Processing is performed based on the knowledge document to determine splicing keywords.

[0127] It should be noted that the specific implementation of step S303 includes the following steps.

[0128] Step S61: Processing the knowledge document to determine keywords corresponding to the subject type of the knowledge document;

[0129] In the specific implementation process of step S61, first, the correspondence between the name and the type is searched according to the name of the knowledge document to determine the subject type of the knowledge document; then, the knowledge document and its corresponding subject type are input into the keyword extraction model to extract keywords corresponding to the subject type of the knowledge document.

[0130] It should be noted that the keyword extraction model is trained on the initial model based on historical knowledge documents, the corresponding theme types of historical knowledge documents, and pre-calibrated keywords, and the trained initial model is used as the keyword extraction model.

[0131] Step S62: Concatenate the keywords to obtain a concatenated keyword.

[0132] In the specific process of implementing step S62: Concatenate the keywords corresponding to the theme type of the knowledge document in the extraction order to obtain a concatenated keyword.

[0133] For example: The keywords corresponding to the theme type of the knowledge document include AA, BB, and CC. Concatenate the keywords corresponding to the theme type of the knowledge document in the extraction order to obtain <keyword1>AA< / keyword1><keyword2>BB< / keyword2><keyword3>CC< / keyword3>.

[0134] Step S304: Input the concatenated keyword, the list of tag names, the processing instruction, and the precautions into a pre-constructed recognition model, so that the pre-constructed recognition model determines the associated tag corresponding to the concatenated keyword from the list of tag names based on the processing instruction and the precautions.

[0135] Among them, the pre-constructed recognition model is constructed based on the corresponding historical data;

[0136] It should be noted that in the specific process of implementing step S304, the following steps are included.

[0137] Step 71: Call the pre-constructed recognition model to determine the initial tag corresponding to the concatenated keyword from the list of tag names based on the processing instruction.

[0138] It should be noted that the training process of the pre-constructed recognition model includes: pre-obtaining historical data such as the concatenated keywords of different historical knowledge documents, the processing instruction, and the initial tags; and using them as a sample set; training the initial model based on the sample set to construct a recognition model that can identify the initial tag corresponding to the concatenated keyword from the list of tag names based on the processing instruction.

[0139] Step S72: Call the pre-constructed recognition model to screen out the associated tag corresponding to the concatenated keyword from the initial tags based on the precautions.

[0140] In the specific process of implementing step S72, call the pre-constructed recognition model to remove the initial tags that are not relevant to the precautions to obtain the associated tag corresponding to the concatenated keyword.

[0141] It should be noted that the pre-built recognition model is also used to filter labels related to the precautions.

[0142] Step S305: writing the associated tag corresponding to the spliced ​​keyword into the corresponding related tag name list.

[0143] Step S306: performing processing based on the relevant tag name list and the tag dictionary to determine the association relationship between the knowledge document and the tag;

[0144] Step S307: calling the database to execute the adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0145] It should be noted that the specific implementation process of step S306 and step S307 is the same as the specific implementation process of step S205 and step S206 described above, and they can be referenced to each other.

[0146] In an embodiment of the present invention, processing is performed based on the knowledge document to determine a splicing keyword; the splicing keyword, the tag name list, the processing instructions, and precautions are input into a pre-built recognition model, so that the pre-built recognition model determines an associated tag corresponding to the splicing keyword from the tag name list based on the processing instructions and precautions, and the pre-built recognition model is constructed based on corresponding historical data; the associated tag corresponding to the splicing keyword is written into a corresponding related tag name list; processing is performed based on the related tag name list and a tag dictionary to determine an association relationship between the knowledge document and the tag; and a database is called to execute an addition statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it. This achieves an automated process for accurately tagging knowledge documents, thereby improving document processing efficiency.

[0147] Based on the document processing method shown in the above embodiment of the present invention, the embodiment of the present invention also shows a structural diagram of a document processing device, as shown in FIG. Figure 4 Said device comprises:

[0148] The acquisition unit 401 is used to acquire the currently uploaded knowledge document and the corresponding processing instructions and precautions for each uploaded knowledge document, and record the document identifier, knowledge document name and storage path of the knowledge document;

[0149] A determining unit 402 is configured to determine a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database;

[0150] A splicing unit 403 is used to splice the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data;

[0151] The processing unit 404 is configured to input the spliced ​​data into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, wherein the pre-built processing model is pre-built based on historical data;

[0152] Execution unit 405 is used to process based on the relevant tag name list and tag dictionary to determine the association relationship between the knowledge document and the tag; call the database to execute the addition statement corresponding to the association relationship between the knowledge document and the tag to write the association relationship between the knowledge document and the tag into the database and save it.

[0153] The specific principles and execution processes of each unit in the document processing device disclosed in the above embodiment of the present invention are the same as the corresponding contents in the document processing method provided in the above embodiment of the present invention. Please refer to the corresponding parts of the document processing method disclosed in the above embodiment of the present invention, and no further details will be given here.

[0154] In an embodiment of the present invention, a tag name list and a tag dictionary corresponding to the knowledge document are determined based on a tag table pre-constructed in a database; the tag name list, the knowledge document name, the processing instructions and precautions are spliced ​​to obtain spliced ​​data; the spliced ​​data is input into a pre-constructed processing model, and a large model interface is called so that the processing model selects one or more tags based on the knowledge document name and the given tag name list; the tags selected by the model are then associated with the knowledge document in the database, thereby realizing an automated process of accurately labeling knowledge documents, thereby improving document processing efficiency.

[0155] Optionally, based on the document processing device shown in the above embodiment of the present invention, the determining unit 402 is specifically configured to:

[0156] Query all tag data from the tag table pre-stored in the database and store it in the tag list;

[0157] The tag names in the tag list are written into a tag name list, and the tag names and tag IDs in the tag list are written into a tag dictionary.

[0158] Optionally, based on the document processing apparatus shown in the embodiment of the present invention described above, the processing unit 404 inputs the spliced ​​data into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, specifically for:

[0159] Invoking a pre-built processing model to identify processing instructions and precautions in the spliced ​​data;

[0160] Calling a pre-built processing model to process the tag name list and knowledge document name in the spliced ​​data based on the processing instructions and precautions, and determining relevant tags corresponding to the knowledge document name;

[0161] The relevant tags corresponding to the knowledge document names fed back by the processing model are obtained and saved in a relevant tag name list.

[0162] Optionally, based on the document processing apparatus shown in the embodiment of the present invention, the execution unit 405 that processes the relevant tag name list and the tag dictionary to determine the association relationship between the knowledge document and the tag is specifically configured to:

[0163] Determine whether there is a value corresponding to each relevant tag in the relevant tag name list in the tag dictionary;

[0164] If so, obtain the value corresponding to the relevant tag from the tag dictionary and write it into the tag ID list;

[0165] If it is determined that the length of the tag ID list is not the preset length, it is determined that the tag corresponding to the tag ID list is associated with the knowledge document.

[0166] Optionally, based on the document processing apparatus shown in the embodiment of the present invention described above, the execution unit 405 calls the database to execute an addition statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database, specifically for:

[0167] For each tag ID in the tag ID list, create an associated ID corresponding to each tag ID;

[0168] Concatenate the association ID, the tag ID, and the document identifier corresponding to the knowledge document to obtain a concatenated string;

[0169] Adding the concatenated character string to a preset association relationship insertion statement to obtain an addition statement corresponding to the association relationship between the knowledge document and the tag;

[0170] The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

[0171] Optionally, based on the document processing device shown in the embodiment of the present invention, the splicing unit 403 is further configured to process the knowledge document to determine splicing keywords;

[0172] Accordingly, the processing unit 404 is further configured to:

[0173] Inputting the splicing keyword, the tag name list, the processing instructions, and the precautions into a pre-built recognition model, so that the pre-built recognition model determines an associated tag corresponding to the splicing keyword from the tag name list based on the processing instructions and the precautions, wherein the pre-built recognition model is built based on corresponding historical data;

[0174] Writing the associated tags corresponding to the splicing keywords into the corresponding related tag name list;

[0175] Optionally, based on the document processing device shown in the embodiment of the present invention, the splicing unit 403 for determining the splicing keywords is specifically configured to:

[0176] Processing the knowledge document to determine keywords corresponding to the subject type of the knowledge document;

[0177] The keywords are spliced ​​together to obtain spliced ​​keywords.

[0178] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store document processing program code and data, and the processor is used to call program instructions in the memory to execute the steps shown in the document processing method in the above embodiment.

[0179] An embodiment of the present invention provides a storage medium, which includes the electronic device provided by the above-mentioned embodiment of the present application, and the electronic device is used to execute the document processing method disclosed in the embodiment of the present application.

[0180] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

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

[0182] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A document processing method, characterized in that: The method comprises: For each uploaded knowledge document, obtain the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name and storage path of the knowledge document; Determine a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database; Splicing the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data; Inputting the spliced ​​data into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, wherein the pre-built processing model is pre-built based on historical data; Determine the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary; The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

2. The method according to claim 1, characterized in that Determining a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database includes: Query all tag data from the tag table pre-stored in the database and store it in the tag list; The tag names in the tag list are written into a tag name list, and the tag names and tag IDs in the tag list are written into a tag dictionary.

3. The method according to claim 1, characterized in that The spliced ​​data is input into a pre-built processing model so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, including: Invoking a pre-built processing model to identify processing instructions and precautions in the spliced ​​data; Calling a pre-built processing model to process the tag name list and knowledge document name in the spliced ​​data based on the processing instructions and precautions, and determining relevant tags corresponding to the knowledge document name; The relevant tags corresponding to the knowledge document names fed back by the pre-built processing model are obtained and saved in a relevant tag name list.

4. The method according to claim 1, wherein Determining the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary includes: Determine whether there is a value corresponding to each relevant tag in the relevant tag name list in the tag dictionary; If so, obtain the value corresponding to the relevant tag from the tag dictionary and write it into the tag ID list; If it is determined that the length of the tag ID list is not the preset length, it is determined that the tag corresponding to the tag ID list is associated with the knowledge document.

5. The method according to claim 4, characterized in that Calling a database to execute an add statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database, includes: For each tag ID in the tag ID list, create an associated ID corresponding to each tag ID; Concatenate the association ID, the tag ID, and the document identifier corresponding to the knowledge document to obtain a concatenated string; Adding the concatenated character string to a preset association relationship insertion statement to obtain an addition statement corresponding to the association relationship between the knowledge document and the tag; The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

6. The method according to claim 1, characterized in that After determining the tag name list and tag dictionary corresponding to the knowledge document based on the tag table pre-built in the database, the method further includes: Processing based on the knowledge document to determine splicing keywords; Inputting the splicing keyword, the tag name list, the processing instructions, and the precautions into a pre-built recognition model, so that the pre-built recognition model determines an associated tag corresponding to the splicing keyword from the tag name list based on the processing instructions and the precautions, wherein the pre-built recognition model is built based on corresponding historical data; Writing the associated tags corresponding to the splicing keywords into the corresponding related tag name list; Determine the association relationship between the knowledge document and the tag based on the relevant tag name list and the tag dictionary; The database is called to execute an adding statement corresponding to the association relationship between the knowledge document and the tag, so as to write the association relationship between the knowledge document and the tag into the database and save it.

7. The method according to claim 6, characterized in that Processing is performed based on the knowledge document to determine splicing keywords, including: Processing the knowledge document to determine keywords corresponding to the subject type of the knowledge document; The keywords are spliced ​​together to obtain spliced ​​keywords.

8. A document processing device, characterized in that: The device comprises: An acquisition unit, configured to acquire, for each uploaded knowledge document, the currently uploaded knowledge document and the corresponding processing instructions and precautions, and record the document identifier, knowledge document name, and storage path of the knowledge document; a determining unit, configured to determine a tag name list and a tag dictionary corresponding to the knowledge document based on a tag table pre-built in a database; a splicing unit, configured to splice the tag name list, the knowledge document name, the processing instructions and the precautions to obtain spliced ​​data; a processing unit, configured to input the spliced ​​data into a pre-built processing model, so that the pre-built processing model processes the spliced ​​data to obtain a corresponding list of related tag names, wherein the pre-built processing model is pre-built based on historical data; An execution unit is used to process based on the relevant tag name list and tag dictionary to determine the association relationship between the knowledge document and the tag; call the database to execute the addition statement corresponding to the association relationship between the knowledge document and the tag to write the association relationship between the knowledge document and the tag into the database and save it.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store program code and data generated by data, and the processor is used to call program instructions in the memory to execute the document processing method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the document processing method according to any one of claims 1 to 7.