Document label generation method
Through the embedded calculation and clustering of the document of the knowledge management platform, the recommendation value of the document label is automatically generated, and the user needs to set the label by hand, and improves the user experience and efficiency uploaded by the document.
Patent Information
- Application Number
- CN202411187011.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-28
AI Technical Summary
In the knowledge management platform, users need to manually set document tags, resulting in poor user experience and increasing the workload of document uploads.
By embedding and calculation and clustering of existing platform documents, generate prototype vectors, combined with the embedded information of the user uploaded document, automatically generate the label recommendation value, and reduce the steps of the user's manual settings.
The automation generation document label has been realized, the user's workload is reduced, and the user experience uploaded by the document is enhanced.
Smart Images

Figure CN119377399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge management, and in particular to a method for generating document tags. Background Art
[0002] In recent years, large enterprises and institutions have gradually begun to deploy knowledge management platforms. With the launch of the platforms and the rapid growth of users, the platforms have accumulated a large number of knowledge documents, and the number of documents saved has increased rapidly.
[0003] In order to allow users to quickly retrieve content on the platform, knowledge management platforms usually ask document creators to set tags for documents when they upload them to the platform. In this way, when users search for content, they can quickly locate a certain type of document through the document tags, thereby narrowing the search scope and speeding up the search.
[0004] Usually, the knowledge management platform will pre-set the value range of the label. For example, each document can be labeled according to the industry involved in its content, and the value range may be fixed values such as education, medical care, industry, government affairs, and transportation. When uploading a document, the document creator needs to manually specify the label of the document. For example, when uploading the "5G Smart Education White Paper", the user needs to manually set its label to "education"; when uploading the "Industrial Internet Solution", the user needs to manually set its label to "industry", and the user experience of the platform is poor. Summary of the invention
[0005] The purpose of the present invention is to provide a method for generating document labels, which automatically generates labels for newly uploaded documents based on existing documents on a knowledge management platform and their corresponding label information. The generated labels are used as recommended values for uploading documents for user confirmation. If the user believes that the automatically generated labels are correct, the manual setting steps can be omitted, which saves the user's workload in uploading documents and improves the user experience of uploading documents, so as to solve the technical problems existing in the above-mentioned background technology.
[0006] To achieve the above object, the technical solution of the present invention is as follows:
[0007] A method for generating a document tag comprises the following steps:
[0008] Step 1: Perform embedding calculation on documents on the existing platform;
[0009] Step 2: Cluster the existing documents on the platform to obtain the prototype vector of each cluster;
[0010] Step 3: Perform embedding calculation on the document being uploaded by the user to obtain the corresponding embedding information;
[0011] Step 4: Compare the similarity of the embedded information and the degree of keyword repetition between the user-uploaded document and the prototype vector, find the most similar document, and take its label as the label of the user-uploaded document.
[0012] Furthermore, the step one includes: performing embedding calculation on the string and calculating the length of the document; the embedding calculation on the string uses the Embedding interface of the OpenAI large model, the Embedding interface improved by the FlagOpen large model or the Embedding interface improved by the BGE large model; the calculation of the length of the document only counts the number of characters contained in the document; if the document is a text file, the length of the document is the size of the text file; if the document content is a Word document, the Word document is decompressed as a zip file to obtain an xml file, and the xml tags and format description information are ignored to extract the entire text of the document, thereby obtaining the length of the document; if the document content is in the form of a picture, the text in the picture is extracted through an additional OCR operation to obtain the entire text of the document, thereby obtaining the length of the document.
[0013] Furthermore, the large model embedding interface has a length limit for the input string. If the text length of the document is less than the input limit of the large model embedding interface, the entire text string of the document is input into the large model embedding interface at one time to obtain the embedding information of the document; if the text length of the document exceeds the input limit of the large model embedding interface, the text of the document is sliced into a fixed size.
[0014] Furthermore, the method of slicing the text of the document according to a fixed size is: method 1 or method 2,
[0015] Method 1: Segment the text of the document into natural paragraphs. The natural paragraph is marked by the "carriage return line feed" character. Starting from the first character of the document, each time a "carriage return line feed" character is encountered, it is considered that the end of a natural paragraph is detected. Then, starting from the next character, the end of the next natural paragraph is detected. This process is repeated until all the natural paragraphs of the document are detected. If the length of a natural paragraph is less than 50 characters, it can be considered that the natural paragraph is title information and the content of the natural paragraph can be ignored. After the above processing, the text of each natural paragraph corresponds to a slice.
[0016] Method 2: According to the input limit of the large model embedding interface, all characters in the document are divided into multiple slices according to a fixed length, such as 128KB; the last slice may be smaller than the fixed length, which is normal, and the subsequent processing process is the same.
[0017] Furthermore, after determining the slice information of the document, the text strings corresponding to the slices are input into the embedding interface of the large model in turn to obtain the embedding information corresponding to each slice text; the sum of the embedding information of each slice is the embedding information of the entire document; the embedding vectors of each slice are directly summed and then the average is taken to obtain the embedding information of the entire document, that is, Where n represents the number of slices, e i Represents the embedding information of the i-th slice.
[0018] Furthermore, the step 2 is specifically as follows: given a sample set D, D = {(x1, y1), (x2, y2), (x3, y3), ... (x i ,y i )…,(x m ,y m )}; where m is the number of existing documents on the platform, x i is the embedding information of the document, i.e., the embedding vector; i is the label corresponding to the document; the preset number of clusters is n, and the value of n is the number of values of the existing labels; the clustering purpose is to cluster the sample set D to obtain a set of prototype vectors {p0, p1, ... p i ..., p n ,}, each prototype vector represents a cluster; p i The dimension of x i The dimension is the same as q, {p0, p1, ...p i ..., p n ,} is initialized as the embedding vector corresponding to the most popular document under each tag; the popularity of a document is calculated by weighted summation of the number of reads, collections, likes, downloads, and comments on the document, and the calculation formula is as follows: Popularityi=w1*C read +w3*C like +w4*C collect +w5*C download +w6*C share +w7*P comment , where C read is the number of documents read by the user, C like The number of times a user likes a document, C collect is the number of times the user has collected documents, C download The number of times a user downloads a document, C share The number of times a user shares a document, C comment is the number of times the user comments on the document, w1, w2, w3, w4, w5, w6, w7 are the corresponding weights; vector x i With vector p iThe distance is calculated using the Euclidean distance, and the calculation formula is: The prototype vector is calculated as follows: Initialize the prototype vector set {p0, p1, ...p i ..., p n ,}, set the learning rate η∈(0,1), set the maximum number of iterations, if the maximum number of iterations is not reached, use each element in the sample set to perform clustering calculations, traverse the sample set D, and calculate x i The distance from each prototype vector to x i The prototype vector p with the smallest distance j , compare yi and p j If the label categories are the same, p j To x i The direction is close, at this time p j =p i +η*(x i -p i ); if the label categories are different, p j Stay away from x i , at this time p j =p i -η*(x i -p i ), the number of iterations increases by 1; a set of prototype vectors of length n is obtained, in which each element is the central vector corresponding to all documents under a class of labels.
[0019] Furthermore, the step three uses the same calculation method as the step one to perform embedding calculation and generate an embedding vector d.
[0020] Furthermore, the step 4 is specifically as follows: the embedding vector d of the document being uploaded by the user is compared with the prototype vector generated in step 2 in turn for similarity, and the similarity of the embedding vector is calculated using the cosine similarity formula or the Euclidean distance formula; the cosine similarity is used to calculate the similarity of the two vectors A and B, and the calculation formula is as follows: Use the Euclidean distance to calculate the similarity between two vectors A and B. The calculation formula is as follows, where d(A, B) is the Euclidean distance between vectors A and B, and a i and b i They are the values of the elements in the corresponding dimensions of A and B respectively: The embedding vector d of the document being uploaded by the user is compared with each element in the prototype vector set generated in step 2 for similarity in turn; if there is a prototype vector whose similarity with the embedding vector of the document uploaded by the user is greater than a threshold value 1, the label of the document corresponding to the prototype vector with the largest similarity is taken as the recommended value of the label of the document uploaded by the user; otherwise, the top n prototype vectors with the highest similarity to the embedding information of the document uploaded by the user are taken as candidates, and the top m keywords with the highest TD-IDF values are obtained for the documents corresponding to the candidate prototype vectors and the documents uploaded by the user through the TD-IDF algorithm. If there is a document corresponding to a prototype vector whose keyword repetition rate with the keyword of the document uploaded by the user is greater than a threshold value 2, the label of the document corresponding to the prototype vector is taken as the recommended value of the label of the document uploaded by the user.
[0021] Furthermore, the specific method of obtaining the keywords of a document is as follows: Use a word segmentation tool to segment the document, filter out all stop words, various adverbs and adjectives, and only retain nouns and proper nouns; For each word in the document, perform the following calculation: word frequency (TF) = the number of times a word appears in the document; TF-IDF=TF*IDF; the corpus is the collection of all user-uploaded documents on the platform; the first n keywords with the highest TD-IDF value are taken as the keywords of the document; if there is no prototype vector with a similarity greater than a threshold 1 to the embedding vector of the user-uploaded document, and there is no document corresponding to a prototype vector with a keyword repetition rate greater than a threshold 2 to the document uploaded by the user, then the label of the document corresponding to the prototype vector with the greatest similarity is taken as the recommended value of the label of the user-uploaded document.
[0022] Furthermore, the content of the tag is automatically displayed in the selection box for the user to set the tag; if the user thinks the setting of the tag is reasonable, the process of manually setting the tag can be skipped; otherwise, the tag selection can be manually modified, and the platform will use the tag manually modified by the user as the tag of the content.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The platform utilizes the tag information of existing documents to automatically generate recommended values for the tags of documents that users are uploading, reducing the workload of users' manual settings and improving the platform's user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of the present invention;
[0026] Figure 2 is a schematic diagram of calculating embedded information after document slicing in the present invention;
[0027] Figure 3It is a logic judgment flow chart of label selection in the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.
[0029] See also Figures 1 to 3 As shown, a method for generating a document tag specifically includes the following steps:
[0030] Step 1: Perform embedding calculation on documents on the existing platform;
[0031] To perform string embedding calculations, you can use OpenAI's Embedding interface, or the Embedding interface improved by large models such as FlagOpen and BGE.
[0032] The length of the document is calculated by only counting the number of characters contained in the document. Information such as images, audio, and video in the document is ignored, because the semantic information corresponding to these information is usually highly correlated with the text part of the document. For example, a video is embedded in a Word document of the industrial Internet. The video content should be highly relevant to the industrial Internet. Therefore, ignoring the video content has little impact on the semantic information of the entire document. In addition, ignoring the processing of information such as video can greatly reduce the overhead of document embedding calculation. If the document is a text file, the length of the document is the size of the text file. If the document content is a Word document, because it is essentially an XML file, the Word document can be decompressed as a zip file to obtain the XML file. Ignoring the XML tags and format description information, the entire text of the document can be extracted to obtain the length of the document. If the document content is in the form of an image, for example, an embedded image in Word, or an image-type PDF file, the text in the image can be extracted through additional OCR operations to obtain the entire text of the document, thereby obtaining the length of the document.
[0033] The large model embedding interface usually has a length limit for the input string. Therefore, if the text length of the document is less than the input limit of the above embedding interface, the entire text string of the document is input into the large model embedding interface at one time to obtain the embedding information of the document.
[0034] If the length of the document text exceeds the input limit of the above embedding interface, the document text can be sliced according to a fixed size. For example, if the document length is 1MB and the input limit of the large model embedding interface is 128KB, there are two ways to slice. Method 1: Segment the text according to the natural paragraphs of the document text. The natural paragraph ends with the "carriage return line feed" character. Starting from the first character of the document, each time a "carriage return line feed" character is encountered, it is considered that the end of a natural paragraph is detected. Then, starting from the next character, the end of the next natural paragraph is detected. And so on, all the natural paragraphs of the document are detected. If the length of the natural paragraph is less than 50 characters, it can be considered that the natural paragraph is the title information, and the content of the natural paragraph can be ignored. After the above processing, the text of each natural paragraph corresponds to a slice. Method 2: According to the input limit of the large model embedding interface, all characters in the document are sliced into multiple slices according to a fixed length, such as 128KB. The last slice may be less than the fixed length, which is normal, and the subsequent processing process is the same.
[0035] After determining the slice information of the document, the text strings corresponding to the slices are input into the embedding interface of the large model in turn to obtain the embedding information corresponding to each slice text. The sum of the embedding information of each slice is the embedding information of the entire document. Therefore, the embedding vectors of each slice are directly summed and then averaged to obtain the embedding information of the entire document, that is, Where n represents the number of slices, e i Represents the embedded information of the i-th slice. The specific process is shown in the schematic diagram. Figure 2 .
[0036] Step 2: Cluster the existing documents on the platform to obtain the prototype vector of each cluster;
[0037] Given a sample set D, D = {(x1, y1), (X2, y2), (X3, y3), ... (x i ,y i )…,(x m ,y m )}; where m is the number of existing documents on the platform, x i is the embedding information of the document, i.e., the embedding vector; iis the label corresponding to the document; the number of preset clusters is n, and the value of n is the number of values of the existing labels. For example, if the platform currently labels documents by industry, n is the number corresponding to the industry information. If the platform currently limits the value of labels to one of "health, industry, emergency, education, government affairs, agriculture, and the Internet", the value of n is 7. For another example, if the platform currently labels documents by technology, n is the number corresponding to the technology information. If the platform currently limits the value of labels to one of "5G, cloud computing, Internet of Things, AI, and big data", the value of n is 5;
[0038] The purpose of clustering is to cluster the sample set D and obtain a set of prototype vectors {p0, p1, ...p i ..., p n ,}, each prototype vector represents a cluster; p i The dimension of x i The dimension is the same as q, {p0, p1, ...p i ..., p n ,} is initialized as the embedding vector corresponding to the most popular document under each tag; the popularity of a document is calculated by weighted summation of the number of reads, collections, likes, downloads, and comments on the document, and the calculation formula is as follows: Popularityi=w1*C read +w3*C like +w4*C collect +w5*C download +w6*C share +w7*P comment , where C read is the number of documents read by the user, C like The number of times a user likes a document, C collect is the number of times the user has collected documents, C download The number of times a user downloads a document, C share The number of times a user shares a document, C comment The number of times a user comments on a document, w1, w2, w3, w4, w 5, w6, w7 are the corresponding weights;
[0039] Vector x i With vector p i The distance is calculated using the Euclidean distance, and the calculation formula is:
[0040] The prototype vector is calculated as follows: Initialize the prototype vector set {p0, p1, ...p i ..., p n,}, set the learning rate η∈(0,1), set the maximum number of iterations, if the maximum number of iterations is not reached, use each element in the sample set to perform clustering calculations, traverse the sample set D, and calculate x i The distance from each prototype vector to x i The prototype vector p with the smallest distance j , compare y i With p j If the label categories are the same, p j To x i The direction is close, at this time p j =p i +η*(x i -p i ); if the label categories are different, p j Stay away from x i , at this time p j =p i -η*(x i -p i ), the number of iterations increases by 1; after the above data training, a set of prototype vectors with a length of n is obtained, in which each element is the central vector corresponding to all documents under a class of labels.
[0041] Step 3: Perform embedding calculation on the document being uploaded by the user, using the same method as step 1, and generate an embedding vector denoted as d;
[0042] Step 4: Compare the similarity of the embedded information and the degree of keyword repetition between the user-uploaded document and the prototype vector, find the most similar document, and take its label as the label of the user-uploaded document.
[0043] Specifically, the embedding vector d of the document being uploaded by the user is compared with the prototype vector generated in step 2 in turn for similarity. The similarity of the embedding vector is calculated using the cosine similarity formula or the Euclidean distance formula.
[0044] Use cosine similarity to calculate the similarity between two vectors A and B. The calculation formula is as follows:
[0045] Use the Euclidean distance to calculate the similarity between two vectors A and B. The calculation formula is as follows, where d(A, B) is the Euclidean distance between vectors A and B, and a i and b i They are the values of the elements in the corresponding dimensions of A and B respectively:
[0046] Compare the similarity of the embedding vector d of the document being uploaded by the user with each element in the prototype vector set generated in step 2;
[0047] If there is a prototype vector whose similarity with the embedding vector of the document uploaded by the user is greater than the threshold 1, the label of the document corresponding to the prototype vector with the largest similarity is taken as the recommended value of the label of the document uploaded by the user. For the specific process, see Figure 3 ;
[0048] Otherwise, the top n prototype vectors with the highest similarity to the embedded information of the document uploaded by the user are taken as candidates. For the documents corresponding to the candidate prototype vectors and the documents uploaded by the user, the top m keywords with the highest TD-IDF values are obtained through the TD-IDF algorithm. If there is a document corresponding to a certain prototype vector and the keywords of the document uploaded by the user with a repetition rate greater than the threshold 2, the label of the document corresponding to the prototype vector is taken as the recommended value of the label of the document uploaded by the user.
[0049] The specific method of obtaining the keywords of a document is as follows: Use a word segmentation tool to segment the document, filter out all stop words, adverbs and adjectives, and only keep nouns and proper nouns; perform the following calculations on each word in the document:
[0050] Term frequency (TF) = the number of times a word appears in a document;
[0051]
[0052] TF-IDF=TF*IDF;
[0053] The corpus is a collection of documents uploaded by all users on the platform; the first n keywords with the highest TD-IDF values are taken as the keywords of the document;
[0054] If there is no prototype vector whose similarity with the embedding vector of the user-uploaded document is greater than threshold 1, and there is no document corresponding to a prototype vector whose keyword repetition rate with the document uploaded by the user is greater than threshold 2, then the label of the document corresponding to the prototype vector with the greatest similarity is taken as the recommended value of the label of the user-uploaded document.
[0055] The content of the tag is automatically displayed in the selection box for the user to set the tag; if the user thinks the setting of the tag is reasonable, the process of manually setting the tag can be skipped; otherwise, the tag selection can be manually modified, and the platform will use the tag manually modified by the user as the tag of the content.
[0056] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the profession, without departing from the scope of the technical solution of the present invention, according to the technical essence of the present invention, any simple modification, equivalent replacement and improvement made to the above embodiment still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for generating a document tag, characterized in that: The specific steps include: Step 1: Perform embedding calculation on documents on the existing platform; Step 2: Cluster the existing documents on the platform to obtain the prototype vector of each cluster; Step 3: Perform embedding calculation on the document being uploaded by the user to obtain the corresponding embedding information; Step 4: Compare the similarity of the embedded information and the degree of keyword repetition between the user-uploaded document and the prototype vector, find the most similar document, and take its label as the label of the user-uploaded document.
2. The method for generating a document tag according to claim 1, characterized in that: The step one includes: performing embedding calculation on the character string and calculating the length of the document; the embedding calculation on the character string uses the Embedding interface of the OpenAI large model, the Embedding interface improved by the FlagOpen large model or the Embedding interface improved by the BGE large model; the calculation of the length of the document only counts the number of characters contained in the document; if the document is a text file, the length of the document is the size of the text file; if the document content is a Word document, the Word document is decompressed as a zip file to obtain an xml file, and the entire text of the document can be extracted by ignoring the xml tags and format description information, thereby obtaining the length of the document; if the document content is in the form of a picture, the text in the picture is extracted through an additional OCR operation to obtain the entire text of the document, thereby obtaining the length of the document.
3. The method for generating a document tag according to claim 2, characterized in that: The large model embedding interface has a length limit for the input string. If the text length of the document is less than the input limit of the large model embedding interface, the entire text string of the document is input into the large model embedding interface at one time to obtain the embedding information of the document; if the text length of the document exceeds the input limit of the large model embedding interface, the text of the document is sliced into fixed sizes.
4. The method for generating a document tag according to claim 3, characterized in that: The method of slicing the text of a document according to a fixed size is: method one or method two, Method 1: Split the text into natural paragraphs of the document. The natural paragraph ends with the "carriage return line feed" character. Starting from the first character of the document, each time a "carriage return line feed" character is encountered, it is considered that the end of a natural paragraph is detected. Then, starting from the next character, the end of the next natural paragraph is detected. This process is repeated until all the natural paragraphs of the document are detected. If the length of a natural paragraph is less than 50 characters, it can be considered that the natural paragraph is title information and the content of the natural paragraph can be ignored. After the above processing, the text of each natural paragraph corresponds to a slice. Method 2: According to the input limit of the large model embedding interface, all characters in the document are divided into multiple slices according to a fixed length, such as 128KB; the last slice may be smaller than the fixed length, which is normal, and the subsequent processing process is the same.
5. The method for generating a document tag according to claim 4, characterized in that: After determining the slice information of the document, the text strings corresponding to the slices are input into the embedding interface of the large model in turn to obtain the embedding information corresponding to each slice text; the sum of the embedding information of each slice is the embedding information of the entire document; By directly summing the embedding vectors of each slice and taking the average, we can get the embedding information of the entire document, that is, Where n represents the number of slices, e i Represents the embedding information of the i-th slice.
6. The method for generating a document tag according to claim 5, characterized in that: The specific step 2 is: given a sample set D, D = {(x1, y1), (x2, y2), (x3, y3), ... (x i ,y i )…,(x m ,y m )}; where m is the number of existing documents on the platform, x i is the embedding information of the document, i.e., the embedding vector; i is the label corresponding to the document; the preset number of clusters is n, and the value of n is the number of values of the existing labels; the clustering purpose is to cluster the sample set D to obtain a set of prototype vectors {p0, p1, ... p i …,p n ,}, each prototype vector represents a cluster; p i The dimension of x i The dimension of p0, p1, ... p is the same, let q, p0, p1, ... p i …,p n ,} is initialized as the embedding vector corresponding to the most popular document under each tag; the popularity of a document is calculated by weighted summation of the number of reads, collections, likes, downloads, and comments on the document, and the calculation formula is as follows: Popularityi=w1*C read +w3*C like +w4*C collect +w5*C download +w6*C share +w7*P comment , where C read is the number of documents read by the user, C like The number of times a user likes a document, C collect is the number of times the user has collected documents, C download The number of times a user downloads a document, C share The number of times a user shares a document, C comment is the number of times the user comments on the document, w1, w2, w3, w4, w5, w6, w7 are the corresponding weights; vector x i With vector p i The distance is calculated using the Euclidean distance, and the calculation formula is: The prototype vector is calculated as follows: Initialize the prototype vector set {p0, p1, ... p i …,p n ,}, set the learning rate η∈(0,1), set the maximum number of iterations, if the maximum number of iterations is not reached, use each element in the sample set to perform clustering calculations, traverse the sample set D, and calculate x i The distance from each prototype vector to x i The prototype vector p with the smallest distance j , compare y i With p j If the label categories are the same, p j To x i The direction is close, at this time p j =p i +η*(x i -p i ); if the label categories are different, p j Stay away from x i , at this time p j =p i -η*(x i -p i ), the number of iterations increases by 1; a set of prototype vectors of length n is obtained, in which each element is the central vector corresponding to all documents under a class of labels.
7. The method for generating a document tag according to claim 6, characterized in that: The step three uses the same calculation method as the step one to perform embedding calculation and generate an embedding vector d.
8. The method for generating a document tag according to claim 7, characterized in that: The step 4 is specifically as follows: the embedding vector d of the document being uploaded by the user is compared with the prototype vector generated in step 2 in turn for similarity, and the similarity of the embedding vector is calculated using the cosine similarity formula or the Euclidean distance formula; the cosine similarity is used to calculate the similarity of the two vectors A and B, and the calculation formula is as follows: Use the Euclidean distance to calculate the similarity between two vectors A and B. The calculation formula is as follows, where d(A,B) is the Euclidean distance between vectors A and B, and a i and b i They are the values of the elements in the corresponding dimensions of A and B respectively: The embedding vector d of the document being uploaded by the user is compared with each element in the prototype vector set generated in step 2 for similarity in turn; if there is a prototype vector whose similarity with the embedding vector of the document uploaded by the user is greater than a threshold value 1, the label of the document corresponding to the prototype vector with the largest similarity is taken as the recommended value of the label of the document uploaded by the user; otherwise, the top n prototype vectors with the highest similarity to the embedding information of the document uploaded by the user are taken as candidates, and the top m keywords with the highest TD-IDF values are obtained for the documents corresponding to the candidate prototype vectors and the documents uploaded by the user through the TD-IDF algorithm. If there is a document corresponding to a prototype vector whose keyword repetition rate with the keyword of the document uploaded by the user is greater than a threshold value 2, the label of the document corresponding to the prototype vector is taken as the recommended value of the label of the document uploaded by the user.
9. The method for generating a document tag according to claim 8, characterized in that: The specific method of obtaining the keywords of a document is as follows: Use a word segmentation tool to segment the document, filter out all stop words, adverbs and adjectives, and only keep nouns and proper nouns; For each word in the document, perform the following calculations: word frequency (TF) = the number of times a word appears in the document; TF-IDF=TF*IDF; the corpus is the collection of all user-uploaded documents on the platform; the first n keywords with the highest TD-IDF value are taken as the keywords of the document; if there is no prototype vector with a similarity greater than a threshold 1 to the embedding vector of the user-uploaded document, and there is no document corresponding to a prototype vector with a keyword repetition rate greater than a threshold 2 to the document uploaded by the user, then the label of the document corresponding to the prototype vector with the greatest similarity is taken as the recommended value of the label of the user-uploaded document.
10. The method for generating a document tag according to claim 9, characterized in that: The content of the tag is automatically displayed in the selection box for the user to set the tag; if the user thinks the setting of the tag is reasonable, the process of manually setting the tag can be skipped; otherwise, the tag selection can be manually modified, and the platform will use the tag manually modified by the user as the tag of the content.