Text labeling method and device based on AIGC, computer equipment and storage medium

By combining the AIGC large model and rule matching methods, the problems of low document annotation efficiency and insufficient flexibility are solved, and efficient and accurate text annotation is achieved, adapting to text requirements of different types and formats.

CN118607486APending Publication Date: 2024-09-06CHINA SOUTHERN ASSET MANAGEMENT CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410653815.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The existing technology is inefficient in document content analysis and annotation, cannot effectively identify important information in documents, and lacks flexibility in processing documents of different types or formats.

Method used

Using a method that combines large models based on AIGC and rule matching, the original text is obtained and annotation prompt words are set, converted into embedding vectors, similarity is calculated, and preset phrase templates are used for rule matching, and the results are combined for annotation display.

Benefits of technology

It improves the accuracy and efficiency of text annotation, its scope of application, can meet the needs of text annotation in different scenarios and types, reduces user reading time, reduces the risk of annotation errors and information omission, and is adaptable to documents of various formats and styles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607486A
    Figure CN118607486A
Patent Text Reader

Abstract

The invention discloses a text labeling method and device based on AIGC, computer equipment and a storage medium, and the method comprises the steps: obtaining a to-be-labeled original text, and setting prompt words for the original text; inputting the original text with the cue word into the AIGC large model, and outputting a key text with a label by the AIGC large model; converting the original text into an original embedding vector, and converting the key text into a key embedding vector; calculating the similarity between the original embedding vector and the key embedding vector, and mapping the key text into the original text according to a similarity calculation result to obtain a first labeling result about the original text; performing rule matching on the original text by utilizing the phrase template to obtain a second labeling result about the original text; and in combination with the first labeling result and the second labeling result, obtaining a target labeling object for the original text, and performing labeling display on the original text according to the target labeling object. According to the method, the efficiency, precision and application range of text labeling can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software technology, and in particular to a text annotation method, device, computer equipment and storage medium based on AIGC. Background Art

[0002] In modern corporate management and administrative processes, documents are often used extensively to record and convey information. These documents often contain complex information and detailed process descriptions. However, since these documents are often lengthy and complex, it usually takes a long time for staff to read a long text, which may result in the omission of key content and affect work efficiency.

[0003] Currently, the analysis and annotation of document content mainly relies on manual methods, that is, people read documents and manually mark important content, which is obviously inefficient. Although there are some rule-based search automation tools in the prior art, these tools usually lack a deep understanding of the overall content and context of the document and cannot effectively identify the truly important information in the document. In addition, rule-based automation systems often require complex configurations and lack flexibility when processing documents of different types or formats. Summary of the invention

[0004] The embodiments of the present invention provide a text annotation method, apparatus, computer equipment and storage medium based on AIGC, aiming to improve the efficiency, accuracy and scope of application of text annotation.

[0005] In a first aspect, an embodiment of the present invention provides a text annotation method based on AIGC, comprising:

[0006] Obtaining an original text to be annotated, and setting annotation prompt words for the original text;

[0007] The original text with the marked prompt words is input into the AIGC large model, and the AIGC large model outputs the marked key text;

[0008] Converting the original text into an original embedding vector, and converting the key text into a key embedding vector;

[0009] Calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text;

[0010] Using a preset phrase template to perform rule matching on the original text, and obtaining a second annotation result on the original text;

[0011] The first annotation result and the second annotation result are combined to obtain a target annotation object for the original text, and the original text is annotated and displayed according to the target annotation object.

[0012] In a second aspect, an embodiment of the present invention provides a text annotation device based on AIGC, including:

[0013] A text acquisition unit, used to acquire the original text to be annotated, and set an annotation prompt word for the original text;

[0014] The model processing unit is used to input the original text with the annotation prompt words into the AIGC large model, and the AIGC large model outputs the key text with annotations;

[0015] A vector output unit, used to input the original text and the key text into the text2vec model respectively, and the text2vec model outputs the original embedding vector and the key embedding vector accordingly;

[0016] A similarity mapping unit, used to calculate the similarity between the original embedding vector and the key embedding vector, and map the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text;

[0017] A rule matching unit, used to perform rule matching on the original text using a preset phrase template, and obtain a second annotation result on the original text;

[0018] The annotation display unit is used to combine the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotate and display the original text according to the target annotation object.

[0019] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the AIGC-based text annotation method as described in the first aspect is implemented.

[0020] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the AIGC-based text annotation method as described in the first aspect is implemented.

[0021] The embodiment of the present invention provides a text annotation method, device, computer equipment and storage medium based on AIGC, the method comprising: obtaining an original text to be annotated, and setting an annotation prompt word for the original text; inputting the original text with the annotation prompt word into the AIGC large model, and the AIGC large model outputs the annotated key text; converting the original text into an original embedding vector, and converting the key text into a key embedding vector; calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result, to obtain a first annotation result about the original text; using a preset phrase template to match the original text with rules, and obtain a second annotation result about the original text; combining the first annotation result and the second annotation result, obtaining a target annotation object for the original text, and annotating and displaying the original text according to the target annotation object. The embodiment of the present invention can effectively improve the accuracy and efficiency of text annotation by combining the AIGC large model and rule matching to annotate the text, and at the same time, the rule matching can be adjusted accordingly according to the actual situation, so as to improve the scope of application of text annotation, so that it can meet the text annotation requirements of different scenarios and different types. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0023] Figure 1 A flowchart of a text annotation method based on AIGC provided in an embodiment of the present invention;

[0024] Figure 2 A schematic diagram of the principle of a text annotation method based on AIGC provided in an embodiment of the present invention;

[0025] Figure 3 A schematic block diagram of an AIGC-based text annotation device provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0027] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0028] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0029] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0030] See below Figure 1 , Figure 1 A flowchart of a text annotation method based on AIGC provided by an embodiment of the present invention specifically includes: steps S101 to S106.

[0031] S101, obtaining an original text to be annotated, and setting annotation prompt words for the original text;

[0032] S102, inputting the original text with the marked prompt words into the AIGC large model, and the AIGC large model outputs the marked key text;

[0033] S103, converting the original text into an original embedding vector, and converting the key text into a key embedding vector;

[0034] S104, calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result, to obtain a first annotation result about the original text;

[0035] S105, using a preset phrase template to perform rule matching on the original text, and obtaining a second annotation result on the original text;

[0036] S106: Combine the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotate and display the original text according to the target annotation object.

[0037] In this embodiment, combined with Figure 2First, the process text, i.e., the original text to be annotated, is obtained from the terminal interface. For the original text, on the one hand, annotation prompt words are set for it and input into the AIGC large model, and then the AIGC large model outputs the corresponding key text point by point; on the other hand, it is vectorized, i.e., it is converted from the original text to the corresponding original embedding vector; on the other hand, it is rule matched using a preset phrase template. For the key text output by the AIGC large model, it is converted into a key embedding vector, and the similarity is calculated with the original embedding vector, so that the key text is accurately mapped to the original text, and the first annotation result is obtained accordingly. At the same time, the second annotation result will be obtained after the rule matching, so the two annotation results are combined to obtain the final annotation result, i.e., the target annotation object, and then the target annotation object is annotated and displayed on the terminal interface.

[0038] This embodiment combines the AIGC large model and rule matching to annotate text, which can effectively improve the accuracy and efficiency of text annotation. At the same time, the rule matching can be adjusted accordingly according to the actual situation, so the scope of application of text annotation is also improved, so that it can meet the needs of text annotation in different scenarios and different types. Specifically, this embodiment can improve the efficiency of information processing by setting prompt words to automatically annotate key information, significantly reducing the time required for users to read and understand long process documents, which is particularly important for quick decision-making and improving work efficiency; by highlighting the key content in the document, the readability and ease of use of the document are enhanced, making the document more readable and helping users quickly capture the most important information, especially for new users who are not familiar with the specific process. In addition, the existing manual annotation is not only time-consuming, but also prone to errors due to negligence or misunderstanding. This embodiment reduces manual errors and omissions through automated annotation, reducing the risk of annotation errors and information omissions. In addition, this embodiment can adapt to documents of various formats and styles, whether it is a structured report or an unstructured instruction manual, and can effectively extract and annotate key information, thereby improving the adaptability and flexibility of text annotation. Furthermore, this embodiment can reduce the reliance on professional document managers by automatically identifying and marking important content, thereby reducing labor costs and time costs.

[0039] It should also be noted that when setting the annotation prompt words in this embodiment, they can be set based on scenario requirements, such as text purpose, text results, summary statements, words with large amounts of information, important time nodes, important amounts, important quantifiers, important personnel or departments, sensitive words, and risk disclosure words, etc.

[0040] In one embodiment, the inputting of the original text with the marked prompt words into the AIGC big model, and the outputting of the marked key text by the AIGC big model, includes:

[0041] Collecting a text training set and adding annotation prompt words to the text training set;

[0042] Configure the fine-tuning parameters of the AIGC large model; wherein the fine-tuning parameters include batch size, training rounds, and learning rate;

[0043] Fine-tune the AIGC large model using the text training set, and compare the output result of the AIGC large model with the true label of the text training set to obtain a difference value;

[0044] Based on the difference value, a loss function is calculated using a softmax function, and the loss function is used to optimize and update the AIGC large model;

[0045] The optimized and updated AIGC large model is used to predict the annotations of the input original text and obtain the annotated key text.

[0046] Before using the AIGC large model to process the input original text, this embodiment first pre-trains the AIGC large model to improve the output accuracy of the AIGC large model. During pre-training, important text words are first collected and organized into a data set. After adding prompt words, the data set is organized into a dialogue form that is convenient for model training, for example:

[0047] "Role: user, content: Please list the important text in the following text point by point: TEXT";

[0048] "Role: assistant, content: 1.T1.\n 2.T2.\n 3.T3";

[0049] Among them, TEXT represents the text to be annotated, and T1, T2, and T3 all represent the annotated parts.

[0050] Next, configure the fine-tuning parameters, which usually include batchsize, training rounds, learning rate, etc., and then fine-tune the large model. The model mainly calculates the output corresponding to the input on the data set, and then calculates the difference between the model output and the correct result, and then uses the softmax function to calculate the loss function, and then adjusts part of the model parameters according to the gradient feedback. This part of the parameters can be the parameters of the last few layers of the model, or the parameters of the model about the annotation prompt word part, or the parameters of several newly added layers. After the training is completed, you can continue to test the model effect so that you can continue to modify the parameters and retrain the model when the model effect is not ideal. After determining the available model parameters, deploy the model, and then perform annotation prediction on the input original text. In actual use, the original text cannot be directly used as input to the model, but needs to be concatenated with the prompt word to obtain the model input text. For example, if the original text is TEXT, then the model input text is:

[0051] "Please list point by point the important text in the following text: TEXT".

[0052] Furthermore, the optimized and updated AIGC large model is used to predict the annotations of the input original text, and the annotated key text is obtained, including:

[0053] The input raw text is preprocessed and then converted into Token ID through the Tokenize operation. The text preprocessing includes the removal of stop words and the detection of missing values.

[0054] Load the pre-trained language model and input the Token ID into the language model, which then encodes and infers the Token ID.

[0055] When the reasoning of the language model reaches the termination condition, the current reasoning result is obtained and output as the annotated key text.

[0056] In this embodiment, the input original text is processed by the AIGC large model to obtain the key text of the point-by-point reply. Specifically, text preprocessing is first performed, such as text segmentation, sentence segmentation, and removal of stop words. Then the input text list is converted into a Token ID through the Tokenize operation. Next, a pre-trained large language model is loaded, and language models such as GPT-3, Baichuan, or ChatGLM can be used. Then the Token ID is input into the model, and the model will automatically map it into a one hot encoding, thereby converting the sparse text vector into a dense embedding vector. The embedding vector is then input into the large model in parallel, and after model reasoning (generally several layers of transformer structure), the continuation or answer of each token's embedding is obtained. Specifically, model reasoning mainly includes the following steps:

[0057] (1) Initialization: When reasoning starts, initialization is performed first. This can include setting a start marker (for example, " <start>") as the first input for the generated text, as well as to initialize the model's internal states such as hidden states or attention weights.

[0058] (2) Generate words or tokens: The model starts from the initialization state and generates each word or token of the text in sequence. The process of generating each word usually includes the following steps:

[0059] Compute contextual information: Based on previously generated words and the input text, compute the contextual information for the current time step. This may involve using an attention mechanism to focus on relevant parts of the input text.

[0060] Select the next word: Using the current state of the model and contextual information, select the next word or token to generate. Typically, the model will use a softmax operation to assign a probability distribution to each possible word, and then select the most likely word from them.

[0061] Update state: After a word is generated, the model updates its internal state so that it can generate the next word. This may include updating hidden states, memory cells, or other model parameters.

[0062] The above inference generation process will continue until the termination condition is met. The termination condition is usually the generation of a specified number of words or the generation of a specific termination marker (for example, " <end>"), or other conditions required by the task. Once the termination condition is met, the text generation process ends.

[0063] In one embodiment, converting the original text into the original embedding vector, and converting the key text into the key embedding vector, comprises:

[0064] The original text and the key text are respectively input into the text2vec model, and the text2vec model outputs the original embedding vector and the key embedding vector accordingly.

[0065] This embodiment uses the text2vec model to convert the original text into the original embedding vector, and converts the key text into the key embedding vector. Specifically, the original text is first divided into sentences according to punctuation marks such as commas or periods, and then each sentence of the original text after the sentence division is input into the text2vec model to obtain the original embedding vector of each sentence. At the same time, since the key text is a point-by-point reply text, it can be input into the text2vec model point by point, thereby obtaining the key embedding vector of each key text.

[0066] Text2vec is a text vectorization method that converts text data into high-dimensional dense vectors so that computers can better understand and process text data. Text2vec is usually based on deep learning technologies such as Word2Vec, GloVe, BERT, etc., which represents text in vector space by learning the semantic and grammatical information of text data. The significance of text vectorization is to convert text data into a form that can be processed by computers, so as to realize various application scenarios of text data, such as text classification, sentiment analysis, machine translation, etc. Through text vectorization, computers can better understand the meaning and structure of text data, thereby realizing more intelligent NLP applications.

[0067] In one embodiment, the calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text includes:

[0068] The cosine distance is used to calculate the similarity between the original embedding vector and the key embedding vector.

[0069] In this embodiment, the similarity is calculated by Cosine distance, so that the most similar key embedding vector is queried in each original embedding vector of the original text, so that each result of the key text can be mapped to each sentence in the original text, thereby eliminating the situation where the key text output by the model is not completely consistent with the sentence in the original text, thereby improving the accuracy of text annotation. Of course, in other embodiments, other similarity algorithms can also be used, such as Euclidean distance, etc.

[0070] In one embodiment, the using of a preset phrase template to perform rule matching on the original text and obtaining a second annotation result on the original text includes:

[0071] Set time phrase templates and quantity and amount phrase templates for the original text by regular matching;

[0072] The time phrase template is used to perform rule matching on the time phrases in the original text, and the quantity and amount phrase template is used to perform rule matching on the quantity and amount phrases in the original text.

[0073] This embodiment uses regular matching to design some time phrase templates to match time phrases, and uses regular matching to design some quantity and amount phrase templates to match quantity and amount phrases. It can be understood that since different application scenarios have corresponding proprietary words, this embodiment can set corresponding professional vocabulary modules for rule matching according to specific scenarios. Proprietary words are matched mainly by collecting a set of proprietary words and then matching characters. For example, special personnel and departments need to be labeled within the company, and some sensitive words also need to be labeled, etc., so as to achieve the effect of supporting customized scenarios. This embodiment uses rule matching to be more accurate in granularity than the sentences output by the model, and can also prevent the problem of some key phrases not being accurately recognized.

[0074] In a specific embodiment, when setting the time phrase template, the template specifically includes: xx:xx, xx o'clock in the morning / evening / am / pm, xx day of xx month of xxxx year, x year, x days later, x months later, week x, week x, x month, etc.

[0075] The regular matching template is designed as follows:

[0076] "((week|week)([Mon Tue Wed Thu Fri Sat end of day]+))|((morning|morning|noon|afternoon|evening|early morning)*(\d{1,2} o'clock))|(before*([\dMon Tue Wed Thu Fri Sat]{1,2})((week(within|mid|after)?)|(o'clock(before)?)|(day(within|mid|after)?)|((number)?working days(within|mid|>after)?)|(year(within|mid|after)?)|((number)?(month)+(month)?)|((number)?hours(within|mid|after)?)|(day(within|mid|after)?)))|((morning|morning|noon|afternoon|evening|early morning)+\d{1,2}(:|:)\d{1,2})|(\d{4}year)".

[0077] When setting the quantity and amount phrase template, the template specifically includes: xx%, xx.xx, xx billion yuan, xx million yuan, xx pieces, etc.

[0078] The regular matching template is designed as follows:

[0079] "(\d|[a-zA-Z]+)+(\.(\d|[a-zA-Z])+)?(thousands|tens|hundreds|millions|millions)*(individual|name|accounts|only)+)|(?!.*(\.|:|:))((\d+(~|-|\.)\d+)(?!.*(\.|:|:))".

[0080] In one embodiment, the combining the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotating and displaying the original text according to the target annotation object includes:

[0081] Accumulate the first annotation result and the second annotation result to obtain an accumulated result, and determine whether there is a duplicate result in the accumulated result;

[0082] When it is determined that there are duplicate results, the result deduplication operation is performed according to the principle of giving priority to retaining the second annotation result;

[0083] The accumulated result after deduplication is set as the target annotation object; or, when it is determined that there is no duplicate result, the accumulated result is directly set as the target annotation object.

[0084] This embodiment accumulates the results of rule matching and the results of model calculation and then uses them as target annotation objects. However, considering that there may be overlaps between the results of rule matching and the results of model calculation, duplicate results are deduplicated and the target annotation is then displayed on the interface of the terminal device to improve annotation efficiency.

[0085] Figure 3 A schematic block diagram of an AIGC-based text annotation device 300 provided in an embodiment of the present invention, the device 300 includes:

[0086] The text acquisition unit 301 is used to acquire the original text to be annotated and set annotation prompt words for the original text;

[0087] The model processing unit 302 is used to input the original text with the marked prompt words into the AIGC large model, and the AIGC large model outputs the marked key text;

[0088] A vector conversion unit 303, used to convert the original text into an original embedding vector, and convert the key text into a key embedding vector;

[0089] A similarity mapping unit 304 is used to calculate the similarity between the original embedding vector and the key embedding vector, and map the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text;

[0090] A rule matching unit 305 is used to perform rule matching on the original text using a preset phrase template and obtain a second annotation result on the original text;

[0091] The annotation display unit 306 is used to combine the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotate and display the original text according to the target annotation object.

[0092] In one embodiment, the model processing unit 302 includes:

[0093] A training collection unit, used for collecting a text training set and adding annotation prompt words to the text training set;

[0094] A parameter configuration unit, used to configure fine-tuning parameters of the AIGC large model; wherein the fine-tuning parameters include batch size, training rounds, and learning rate;

[0095] A fine-tuning training unit, used to perform fine-tuning training on the AIGC large model using the text training set, and compare the output result of the AIGC large model with the true label of the text training set to obtain a difference value;

[0096] An optimization and updating unit, configured to calculate a loss function using a softmax function based on the difference value, and optimize and update the AIGC large model using the loss function;

[0097] The annotation prediction unit is used to use the optimized and updated AIGC large model to perform annotation prediction on the input original text and obtain the annotated key text.

[0098] In one embodiment, the annotation prediction unit includes:

[0099] The text preprocessing unit is used to perform text preprocessing on the input original text, and then convert the original text into a Token ID through a Tokenize operation; the text preprocessing includes removing stop words and detecting missing values;

[0100] An encoding and reasoning unit, used to load a pre-trained language model and input the Token ID into the language model, and then the language model encodes and infers the Token ID;

[0101] The reasoning output unit is used to obtain the current reasoning result when the reasoning of the language model reaches the termination condition, and output the current reasoning result as annotated key text.

[0102] In one embodiment, the vector conversion unit 303 includes:

[0103] The vector output unit is used to input the original text and the key text into the text2vec model respectively, and the text2vec model outputs the original embedding vector and the key embedding vector accordingly.

[0104] In one embodiment, the similarity mapping unit 304 includes:

[0105] The similarity calculation unit is used to calculate the similarity between the original embedding vector and the key embedding vector by using the cosine distance.

[0106] In one embodiment, the rule matching unit 305 includes:

[0107] A phrase setting unit, used for setting a time phrase template and a quantity and amount phrase template for the original text by means of regular matching;

[0108] The phrase matching unit is used to perform rule matching on the time phrases in the original text using the time phrase template, and to perform rule matching on the quantity and amount phrases in the original text using the quantity and amount phrase template.

[0109] In one embodiment, the annotation display unit 306 includes:

[0110] A result accumulation unit, used for accumulating the first annotation result and the second annotation result to obtain an accumulation result, and determining whether there is a duplicate result in the accumulation result;

[0111] A result deduplication unit is used to perform a result deduplication operation according to the principle of giving priority to retaining the second marked result when it is determined that there are duplicate results;

[0112] The object setting unit is used to set the accumulated result after deduplication as the target annotation object; or, when it is determined that there is no duplicate result, directly set the accumulated result as the target annotation object.

[0113] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0114] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0115] The embodiment of the present invention also provides a computer device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the computer device may also include various network interfaces, power supplies and other components.

[0116] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

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

Claims

1. A text annotation method based on AIGC, characterized in that: include: Obtaining an original text to be annotated, and setting annotation prompt words for the original text; The original text with the marked prompt words is input into the AIGC large model, and the AIGC large model outputs the marked key text; Converting the original text into an original embedding vector, and converting the key text into a key embedding vector; Calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text; Using a preset phrase template to perform rule matching on the original text, and obtaining a second annotation result on the original text; The first annotation result and the second annotation result are combined to obtain a target annotation object for the original text, and the original text is annotated and displayed according to the target annotation object.

2. The AIGC-based text annotation method according to claim 1, characterized in that: The original text with the marked prompt words is input into the AIGC big model, and the AIGC big model outputs the marked key text, including: Collecting a text training set and adding annotation prompt words to the text training set; Configure the fine-tuning parameters of the AIGC large model; wherein the fine-tuning parameters include batch size, training rounds, and learning rate; Fine-tune the AIGC large model using the text training set, and compare the output result of the AIGC large model with the true label of the text training set to obtain a difference value; Based on the difference value, a loss function is calculated using a softmax function, and the loss function is used to optimize and update the AIGC large model; The optimized and updated AIGC large model is used to predict the annotations of the input original text and obtain the annotated key text.

3. The AIGC-based text annotation method according to claim 1, characterized in that: The optimized and updated AIGC large model is used to predict the annotations of the input original text and obtain the annotated key text, including: The input raw text is preprocessed and then converted into Token ID through the Tokenize operation. The text preprocessing includes the removal of stop words and the detection of missing values. Load the pre-trained language model and input the Token ID into the language model, which then encodes and infers the Token ID. When the reasoning of the language model reaches the termination condition, the current reasoning result is obtained and output as the annotated key text.

4. The AIGC-based text annotation method according to claim 1, characterized in that: The converting the original text into the original embedding vector, and converting the key text into the key embedding vector, comprises: The original text and the key text are respectively input into the text2vec model, and the text2vec model outputs the original embedding vector and the key embedding vector accordingly.

5. The AIGC-based text annotation method according to claim 1, characterized in that: The calculating the similarity between the original embedding vector and the key embedding vector, and mapping the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text, includes: The cosine distance is used to calculate the similarity between the original embedding vector and the key embedding vector.

6. The AIGC-based text annotation method according to claim 1, characterized in that: The using a preset phrase template to perform rule matching on the original text and obtaining a second annotation result on the original text includes: Set time phrase templates and quantity and amount phrase templates for the original text by regular matching; The time phrase template is used to perform rule matching on the time phrases in the original text, and the quantity and amount phrase template is used to perform rule matching on the quantity and amount phrases in the original text.

7. The AIGC-based text annotation method according to claim 1, characterized in that: The step of combining the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotating and displaying the original text according to the target annotation object includes: Accumulate the first annotation result and the second annotation result to obtain an accumulated result, and determine whether there is a duplicate result in the accumulated result; When it is determined that there are duplicate results, the result deduplication operation is performed according to the principle of giving priority to retaining the second annotated result; The accumulated result after deduplication is set as the target annotation object; or, when it is determined that there is no duplicate result, the accumulated result is directly set as the target annotation object.

8. A text annotation device based on AIGC, characterized in that: include: A text acquisition unit, used to acquire the original text to be annotated, and set an annotation prompt word for the original text; The model processing unit is used to input the original text with the annotation prompt words into the AIGC large model, and the AIGC large model outputs the key text with annotations; A vector conversion unit, used to convert the original text into an original embedding vector, and convert the key text into a key embedding vector; A similarity mapping unit, used to calculate the similarity between the original embedding vector and the key embedding vector, and map the annotated key text to the original text according to the similarity calculation result to obtain a first annotation result about the original text; A rule matching unit, used to perform rule matching on the original text using a preset phrase template, and obtain a second annotation result on the original text; The annotation display unit is used to combine the first annotation result and the second annotation result to obtain a target annotation object for the original text, and annotate and display the original text according to the target annotation object.

9. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the AIGC-based text annotation method according to any one of claims 1 to 7 when executing the computer program.

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

Citation Information

Cited By

  • Data platform metadata annotation completion method, system and equipment

    CN120780785A