Small sample tobacco entity identification method and system in voice scene

By reducing text data and replacing homophones and synonyms in the tobacco entity recognition model, a small sample data set is formed, which solves the problems of data set size and recognition errors in the tobacco field, and improves the training efficiency and recognition accuracy of the model.

CN118690746APending Publication Date: 2024-09-24CHINA TOBACCO SHANDONG IND
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the tobacco field, the training of tobacco entity recognition models requires large-scale data sets and manual annotation, resulting in high costs. Homophones and synonyms lead to recognition errors, affecting model accuracy and marketing efficiency.

Method used

By obtaining tobacco text corpus data, converting it into text data and deleting unnecessary words, incorporating homophone and synonym replacement, a small sample data set is formed, which is used to train named entity recognition models, improving model training efficiency and recognition accuracy.

Benefits of technology

It effectively reduces the size of the data set, improves the efficiency and accuracy of model recognition, solves the problems of insufficient corpus and recognition error transmission, and improves the overall performance of tobacco entity recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690746A
    Figure CN118690746A
Patent Text Reader

Abstract

The invention belongs to the technical field of information processing, and provides a small sample tobacco entity recognition method and system in a voice scene, after tobacco text corpus data is obtained and converted into text data, characters are deleted according to the principle that the contribution to the expression effect of the text data is ranked later, and the character recognition result is obtained. The number of characters in a single piece of text data is smaller than or equal to a set threshold value, the problem that the recognized text data is too large is avoided on the basis of ensuring recognition precision, and model recognition and marketing efficiency is improved; meanwhile, during model training, performing homophone entity replacement data enhancement and synonym replacement data enhancement on the tagged tobacco text corpus data training set; entity replacement and synonym replacement of homophones are fused in data set corpora of tobacco, and the problems of corpora insufficiency during training of an entity recognition model and error transmission in recognition are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information processing technology, and in particular relates to a small sample tobacco entity recognition method and system in a voice scenario. Background Art

[0002] Using entity recognition models to identify tobacco entities can provide data support for downstream intelligent big data processing and algorithms, thereby improving the intelligent marketing of tobacco products, especially the effectiveness of intelligent marketing in offline retail store scenarios.

[0003] The inventors found that in the tobacco field scenario, the training of the tobacco entity recognition model requires large-scale data sets to support it and requires manual annotation, which consumes a lot of costs; in addition, tobacco entity names usually contain typos, especially homophones and synonyms, which will affect the accuracy of the tobacco entity recognition model and other indicators, resulting in recognition errors; at the same time, in the intelligent marketing process, when the tobacco text corpus data obtained is recognized by the tobacco entity recognition model, the recognition process will be longer due to the large amount of corpus data, affecting the model recognition and marketing efficiency. Summary of the invention

[0004] In order to solve the above problems, the present invention proposes a small sample tobacco entity recognition method and system in a voice scenario. After obtaining tobacco text corpus data and converting it into text data, the present invention deletes characters so that the number of characters in a single text data is less than or equal to a set threshold, thereby ensuring model identification and marketing efficiency; at the same time, entity replacement and synonym replacement of homophones are integrated into the tobacco data set corpus, which solves the problems of insufficient corpus during entity recognition model training and error propagation in recognition.

[0005] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0006] In a first aspect, the present invention provides a small sample tobacco entity recognition method in a voice scenario, comprising:

[0007] Get tobacco voice data;

[0008] Convert the speech data into text data, filter out sentences whose number of characters in a single text data is greater than a set threshold, and delete the characters in the sentences according to the principle of ranking the lower contribution to the expression of the text data, until the number of characters in a single text data is less than or equal to the set threshold;

[0009] According to the text data and the preset tobacco entity recognition model, a tobacco entity recognition model result is obtained;

[0010] Among them, the tobacco entity recognition model is a named entity recognition model; when training the model, the labeled text data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement.

[0011] Furthermore, for each tobacco entity text, the first word uses the start tag, and the remaining words use internal tags; for words that do not belong to any tobacco entity, external tags are used.

[0012] Furthermore, when ranking the contribution of the words in the sentence to the expression of text data, from front to back, they are words expressing the name of the tobacco entity, words expressing the characteristics of tobacco, words expressing the price, words expressing the quantity, and other words.

[0013] Furthermore, when performing homophone replacement, the pinyin of a word in the tobacco entity is randomly selected and replaced with a homophone whose frequency of occurrence in Chinese is higher than a preset value; while performing homophone replacement, the tobacco entity consisting of the adjective representing the tobacco name plus the product name is replaced as a whole with the name of other tobacco product entities to perform similar entity replacement.

[0014] Furthermore, the relative positions of the tobacco entity names in the annotated corpus in the sentences are recorded; the remaining parts of the sentences are segmented into Chinese words, and Chinese part-of-speech tags and screening are performed, and only the segmentation results of verbs, adverbs and adjectives are retained to generate a candidate set for synonym replacement;

[0015] Randomly select words from the candidate set and replace them using a synonym dictionary;

[0016] Combine the replaced words, unreplaced words, and tobacco entity names in the order of the original sentences to obtain a new corpus.

[0017] Furthermore, the corpus generated by entity replacement of homophones, the corpus generated by synonym replacement, and the annotated original corpus are denoised and merged to obtain a data set for model training.

[0018] In a second aspect, the present invention further provides a small sample tobacco entity recognition system in a voice scenario, comprising:

[0019] The data acquisition module is configured to: obtain tobacco voice data;

[0020] The data processing module is configured to: convert the voice data into text data, filter out sentences whose number of characters in a single text data is greater than a set threshold, and delete the characters in the sentences according to the principle of ranking the lower contribution to the expression of the text data, until the number of characters in the single text data is less than or equal to the set threshold;

[0021] The tobacco entity recognition module is configured to: obtain a tobacco entity recognition model result according to the text data and a preset tobacco entity recognition model;

[0022] Among them, the tobacco entity recognition model is a named entity recognition model; when training the model, the labeled text data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement.

[0023] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the small sample tobacco entity recognition method in a voice scenario described in the first aspect.

[0024] In a fourth aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the program, the steps of the small sample tobacco entity recognition method in the voice scenario described in the first aspect are implemented.

[0025] In a fifth aspect, the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the small sample tobacco entity recognition method in the voice scenario described in the first aspect are implemented.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] In the present invention, after obtaining tobacco text corpus data and converting it into text data, the characters are deleted according to the principle of ranking the characters with the lowest contribution to the expression of the text data, so that the number of characters in a single text data is less than or equal to a set threshold value, and the problem of too large text data is avoided on the basis of ensuring the recognition accuracy, thereby improving the model recognition and marketing efficiency; at the same time, according to the tobacco text corpus data and the preset tobacco entity recognition model, the tobacco entity recognition model result is obtained; wherein, during model training, the annotated tobacco text corpus data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement; the entity replacement of homophones and synonym replacement are integrated into the tobacco data set corpus, thereby solving the problem of insufficient corpus during entity recognition model training and error transmission during recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings in the specification that constitute a part of this embodiment are used to provide a further understanding of this embodiment. The schematic embodiments of this embodiment and their descriptions are used to explain this embodiment and do not constitute improper limitations on this embodiment.

[0029] Figure 1 This is a flow chart of a data set data enhancement method according to Embodiment 1 of the present invention;

[0030] Figure 2 The flowchart of the entity replacement method incorporating homophones according to the first embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0032] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0033] Embodiment 1:

[0034] In the tobacco field, the training of tobacco entity recognition models requires large-scale data sets to support and manual annotation, which costs a lot of money. In addition, tobacco entity names usually contain typos, especially homophones, which will affect the accuracy of the tobacco entity recognition model and lead to recognition errors.

[0035] For example, currently, commonly used named entity recognition models such as BERT-BiLSTM-CRF usually require large-scale data sets to support their training. However, since manual annotation is required, building large-scale data sets requires a lot of costs; in addition, although the current speech recognition model performs well in general scenarios, in specific scenarios such as tobacco, entity names often have typos, especially homophones, which will affect the accuracy of tobacco entity recognition models and other indicators; therefore, it is necessary to design data enhancement methods to improve the overall performance of small-scale tobacco named entity recognition tasks in speech scenarios.

[0036] With the promotion of intelligent marketing, the intelligent marketing of tobacco products has also been developed. For example, the corpus data of the demander is obtained through the intelligent marketing robot, and then the specific tobacco products that the demander wants to buy are identified and determined based on the expected data, and the purchase process is given. After the demander scans the code to pay, the intelligent marketing robot gives the corresponding tobacco product; when the intelligent marketing robot identifies the corpus data of the demander, it is necessary to quickly and accurately determine the specific tobacco products. However, in actual operation, due to the demander's inaccurate pronunciation or insufficient understanding of tobacco products, there are usually typos in the tobacco entity names in the identified corpus data, especially homophones and synonyms, which will affect the accuracy of the tobacco entity recognition model and other indicators, resulting in recognition errors, thereby affecting the overall efficiency of intelligent marketing; at the same time, in the process of intelligent marketing, when the tobacco text corpus data obtained is recognized by the tobacco entity recognition model, the recognition process will be longer due to the large corpus data, affecting the model recognition and marketing efficiency.

[0037] In response to the above problems, Figure 1 As shown, this embodiment provides a small sample tobacco entity recognition method in a voice scenario, including:

[0038] Get tobacco voice data;

[0039] Convert the speech data into text data, filter out sentences whose number of characters in a single text data is greater than a set threshold, and delete the characters in the sentences according to the principle of ranking the lower contribution to the expression of the text data, until the number of characters in a single text data is less than or equal to the set threshold;

[0040] According to the text data and the preset tobacco entity recognition model, a tobacco entity recognition model result is obtained;

[0041] Among them, the tobacco entity recognition model is a named entity recognition model; when training the model, the labeled text data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement.

[0042] Specifically, in order to avoid the problem that the text data sentences are too long, thus affecting the model training and recognition accuracy, speed and generalization ability, the text recognition results are appropriately deleted. For sentences with a text volume greater than a certain threshold, the parts that have little effect on the overall semantic expression of the text are deleted, thereby controlling the total amount of text in a single text data. On the basis of ensuring recognition accuracy, the problem of too large text data is avoided, and the model identification and marketing efficiency are improved; at the same time, through comprehensive data enhancement, the entity replacement of homophones and synonym replacement are incorporated. Among them, by incorporating the entity replacement of homophones, the data characteristics of tobacco voice scenes are taken into account, and the problem of error propagation in tobacco voice recognition is solved; through synonym replacement, the diversity of the data set corpus can be increased. The two parts of entity replacement and synonym replacement of comprehensive homophones solve the problems of insufficient training corpus and error propagation faced by the tobacco named entity recognition model in the voice scene and the tobacco named entity recognition task.

[0043] Optionally, in this embodiment, the method includes the processes of raw data annotation, entity replacement with homophones, synonym replacement, and data merging. Among them, raw data annotation is to perform BIO annotation on the original tobacco text corpus through the BIO annotation method; entity replacement with homophones is achieved by introducing homophone replacement into the same entity replacement method, and using this method to perform data enhancement on the data set; synonym replacement is to enhance the data set through synonym replacement data enhancement to improve the diversity of the corpus; data merging is to perform data denoising and merging on the data set after data enhancement by the above method with the annotated original corpus set, so as to obtain a comprehensive data set after data enhancement. The steps may include:

[0044] S1. Obtain tobacco text corpus data.

[0045] Optionally, web data crawling technology is used to crawl texts such as website comments, and Chinese speech recognition is performed in offline retail scenarios to obtain tobacco text corpus; for example, the text corpus crawled from the tobacco website is "Hard XX is my favorite flue-cured tobacco, with a soft flavor. I don't like cigarettes that are too strong", and the text corpus recorded in an offline retail scenario and obtained by performing Chinese speech recognition is "Do you have red XX? Give me one."

[0046] S2. Delete and annotate the original tobacco text corpus.

[0047] S2.1, Deletion Processing:

[0048] Optionally, when ranking the contribution of words in a sentence to the expression of text data, from front to back are words expressing the name of tobacco entity, words such as "big", "small", "red" and "hard" expressing characteristics of tobacco, words such as "thirteen", "eighteen" or "twenty" expressing price, words such as "one box", "two boxes", "one box" and "two boxes" expressing quantity, and other words such as "want", "buy" and "do you have" etc.

[0049] If the number of characters in a single piece of text data is greater than the set threshold, first delete the words "want", "buy" and "have you", and then determine whether the number of characters in the single piece of text data is less than or equal to the set threshold; if the number of characters in a single piece of text data is still greater than the set threshold, delete the price words "thirteen", "eighteen" or "twenty", the words "big", "small", "red" and "hard" and the words of the tobacco entity name in that order until the number of characters in the single piece of text data is less than or equal to the set threshold, and then stop deleting.

[0050] S2.1, marking:

[0051] Optionally, for each tobacco entity text, the first word uses the start tag, and the remaining words use the internal tag; for words that do not belong to any tobacco entity, use the external tag; the classified use of tags improves the recognition efficiency while ensuring the recognition accuracy. Specifically, the BIO annotation method uses three tags, B, I, and O, representing the start, internal, and external respectively; for each tobacco entity text, the first word uses the B tag to indicate the start of the tobacco entity; the remaining words in the entity text use the "I-TOBACCO" tag to indicate the inside of the entity; if a word is not part of any tobacco entity, use the O tag.

[0052] S3. For the corpus data set annotated in step S2, data enhancement is performed by incorporating entity replacement data of homophones.

[0053] like Figure 2 As shown, this step can be implemented by two methods: entity replacement of homophones and entity replacement of the same type. The overall method flow of this step is described as follows:

[0054] S3.1. In order to replace entities containing homophones, it is necessary to first convert the original tobacco named entity phrase into Chinese pinyin, and then search for homophones based on the pinyin.

[0055] S3.2, when performing homophone replacement, give priority to common characters with the same pinyin as the original entity. When replacing, randomly select the pinyin of a character in the original tobacco entity and replace it with a homophone that appears frequently in Chinese, such as a value that appears more frequently than a preset frequency in historical data.

[0056] S3.3, in order to avoid the overfitting problem, which may lead to a decrease in the accuracy of the named entity recognition model, when performing homophone replacement according to step S3.2, usually at most one new corpus is generated. This can effectively increase the diversity of the data while avoiding adverse effects on the performance of the named entity recognition model.

[0057] S3.4. While performing entity replacement for homophones, similar entities are replaced on the annotated tobacco text corpus to improve entity diversity.

[0058] When expressing the names of spoken tobacco entities, adjectives such as "red XX" and "hard YY" plus product names are more common; when performing similar entity replacement, the tobacco entity expressions of such adjectives plus product names are regarded as a whole and replaced with the names of other tobacco product entities. Similarly, when performing similar entity replacement, at most one new corpus is usually generated, which can further increase the diversity of the data while ensuring that the replacement does not have a negative impact on the performance of the model.

[0059] S4: Perform synonym replacement data enhancement on the corpus data set annotated in step S2. The specific method flow of this step is described as follows:

[0060] S4.1. Protect the names of tobacco entities in the annotated corpus and record their relative positions in the sentences.

[0061] S4.2. Perform Chinese word segmentation on the remaining part of the sentence, and perform Chinese part-of-speech tagging and screening, retaining only the word segmentation results of verbs, adverbs and adjectives, and generate a candidate set for synonym replacement.

[0062] S4.3. Randomly select words from the candidate set and use a synonym dictionary to replace the words.

[0063] S4.4. Combine the replaced words, unreplaced words and tobacco entity names in the order of the original sentence to obtain a new corpus.

[0064] S5. De-noise and merge the corpus generated in step S3 and step S4 with the annotated original corpus to obtain a comprehensive tobacco entity recognition data set after comprehensive data enhancement.

[0065] Among them, the main contents of data denoising are as follows:

[0066] For the corpus generated in steps S3 and S4, some words in the entity names are replaced with stop words. Stop words are words that are used as auxiliary words in a sentence and lack practical meaning, such as the word "de" in a phrase, and modal particles like "ba" and "ma". For example, in step S3, the word "Xiong Ba" is used to replace the word "Xiong Ba", thus destroying the normal structure of the sentence. Therefore, in the data denoising operation, this piece of corpus will be deleted from the generated corpus set.

[0067] The merging method is to integrate the original corpus and the generated corpus into a new corpus set dataset that contains both the original corpus and the generated corpus, in order to perform subsequent model training tasks.

[0068] In this embodiment, through two parts of content: entity replacement data augmentation by incorporating homophonic characters and synonym replacement data augmentation for the tobacco text corpus, comprehensive data augmentation is performed, which can solve the error propagation problem brought by the speech recognition model in the speech scenario, improve entity diversity and corpus diversity, and further enhance the performance of the named entity recognition model on the small-sample tobacco entity recognition dataset in the speech scenario.

[0069] Embodiment 2:

[0070] This embodiment provides a small-sample tobacco entity recognition system in a speech scenario, including:

[0071] A data acquisition module, configured to: obtain tobacco speech data;

[0072] A data processing module, configured to: convert the speech data into text data, filter out the sentences in a single piece of text data whose number of characters is greater than a set threshold, and delete the characters in the sentence according to the principle of ranking the least contributing to the expression of the text data until the number of characters in a single piece of text data is less than or equal to the set threshold;

[0073] A tobacco entity recognition module, configured to: obtain the tobacco entity recognition model result according to the text data and a preset tobacco entity recognition model;

[0074] Among them, the tobacco entity recognition model is a named entity recognition model; during model training, entity replacement data augmentation by incorporating homophonic characters and synonym replacement data augmentation are performed on the labeled text data training set.

[0075] The working method of the system is the same as that of the small-sample tobacco entity recognition method in Embodiment 1, and will not be elaborated here.

[0076] Embodiment 3:

[0077] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the small sample tobacco entity recognition method in the voice scenario described in Example 1 are implemented.

[0078] Embodiment 4:

[0079] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, the steps of the small sample tobacco entity recognition method in the voice scenario described in Example 1 are implemented.

[0080] Embodiment 5:

[0081] This embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the small sample tobacco entity recognition method in the voice scenario described in Example 1 are implemented.

[0082] The above description is only a preferred embodiment of the present embodiment and is not intended to limit the present embodiment. For those skilled in the art, the present embodiment may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present embodiment shall be included in the protection scope of the present embodiment.

Claims

1. A small sample tobacco entity recognition method in a voice scenario, characterized in that: include: Get tobacco voice data; Convert the speech data into text data, filter out sentences whose number of characters in a single text data is greater than a set threshold, and delete the characters in the sentences according to the principle of ranking the lower contribution to the expression of the text data, until the number of characters in a single text data is less than or equal to the set threshold; According to the text data and the preset tobacco entity recognition model, a tobacco entity recognition model result is obtained; Among them, the tobacco entity recognition model is a named entity recognition model; when training the model, the labeled text data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement.

2. The small sample tobacco entity recognition method in the voice scene according to claim 1, characterized in that: For each tobacco entity text, the first word uses the start tag, and the remaining words use internal tags; for words that do not belong to any tobacco entity, external tags are used.

3. The small sample tobacco entity recognition method in the voice scene according to claim 1, characterized in that: When ranking the contribution of words in a sentence to the expression of text data, from front to back, they are words expressing the name of tobacco entity, words expressing tobacco characteristics, words expressing price, words expressing quantity, and other words.

4. The small sample tobacco entity recognition method in the voice scene according to claim 1, characterized in that: When replacing homophones, randomly select the pinyin of a word in the tobacco entity and replace it with a homophone whose frequency of appearance in Chinese is higher than a preset value; while replacing homophones, replace the tobacco entity consisting of the adjective representing the tobacco name plus the product name as a whole with the name of other tobacco product entities to replace similar entities.

5. The small sample tobacco entity recognition method in the voice scene according to claim 1, characterized in that: Record the relative position of the tobacco entity name in the sentence in the annotated corpus; perform Chinese word segmentation on the remaining part of the sentence, and perform Chinese part-of-speech tagging and screening, retaining only the word segmentation results of verbs, adverbs, and adjectives, and generate a candidate set for synonym replacement; Randomly select words from the candidate set and replace them using a synonym dictionary; Combine the replaced words, unreplaced words, and tobacco entity names in the order of the original sentences to obtain a new corpus.

6. The small sample tobacco entity recognition method in a voice scenario according to claim 1, characterized in that: The corpus generated by entity replacement of homophones, the corpus generated by synonym replacement, and the annotated original corpus are denoised and merged to obtain a data set for model training.

7. A small sample tobacco entity recognition system in a voice scenario, characterized in that: include: The data acquisition module is configured to: obtain tobacco voice data; The data processing module is configured to: convert the voice data into text data, filter out sentences whose number of characters in a single text data is greater than a set threshold, and delete the characters in the sentences according to the principle of ranking the lower contribution to the expression of the text data, until the number of characters in the single text data is less than or equal to the set threshold; The tobacco entity recognition module is configured to: obtain a tobacco entity recognition model result according to the text data and a preset tobacco entity recognition model; Among them, the tobacco entity recognition model is a named entity recognition model; when training the model, the labeled text data training set is subjected to entity replacement data enhancement of homophones and synonym replacement data enhancement.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the small sample tobacco entity recognition method in a voice scenario as described in any one of claims 1 to 6 are implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the program, the steps of the small sample tobacco entity recognition method in a voice scenario according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the small sample tobacco entity recognition method in a voice scenario according to any one of claims 1 to 6 are implemented.