WO2021134177A1 - 说话内容的情感标注方法、装置、设备及存储介质 - Google Patents

说话内容的情感标注方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021134177A1
WO2021134177A1 PCT/CN2019/129836 CN2019129836W WO2021134177A1 WO 2021134177 A1 WO2021134177 A1 WO 2021134177A1 CN 2019129836 W CN2019129836 W CN 2019129836W WO 2021134177 A1 WO2021134177 A1 WO 2021134177A1
Authority
WO
WIPO (PCT)
Prior art keywords
emotion
content
label
emotional
preset
Prior art date
Application number
PCT/CN2019/129836
Other languages
English (en)
French (fr)
Inventor
冯中发
黄东延
熊友军
Original Assignee
深圳市优必选科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市优必选科技股份有限公司 filed Critical 深圳市优必选科技股份有限公司
Priority to CN201980003300.6A priority Critical patent/CN111164589A/zh
Priority to PCT/CN2019/129836 priority patent/WO2021134177A1/zh
Publication of WO2021134177A1 publication Critical patent/WO2021134177A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/353Clustering; Classification into predefined classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification

Definitions

  • This application relates to the field of sentiment analysis, and in particular to a method, device, equipment and storage medium for emotional labeling of speech content.
  • Existing emotion labeling methods extract various speech content from the dialogue texts of massive novels, and extract emotional words from the description of the corresponding speaker as the emotional tendency label of the spoken content. This can be achieved through existing emotion labeling methods. Automatic labeling of large-scale emotional text data.
  • an embodiment of the present application provides a method for emotional labeling of spoken content, and the method includes:
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker description;
  • an accurate emotion tag corresponding to the content of the speech is determined.
  • the preset sentiment classifier is trained through the following steps:
  • the training sample set includes multiple training samples, each training sample includes: training speech content and training emotion category labels corresponding to the training speech content;
  • the training speech content is used as the input of the preset emotion classifier
  • the training emotion category label is used as the expected output of the preset emotion classifier
  • the preset emotion classifier is trained to obtain the trained preset emotion classifier.
  • obtaining a training sample set includes:
  • the training utterance content contains an emotion word in the preset emotion dictionary, marking the emotion category of the training utterance content as the emotion category corresponding to the recognized emotion word;
  • the emotion category is marked on the training speech content according to the labeling instruction.
  • determining the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label includes:
  • the method further includes:
  • the precise emotion label corresponding to the spoken content is determined, including:
  • the precise emotion tag corresponding to the content of the speech is determined.
  • the method further includes:
  • the content of the speech is determined to have no emotional label.
  • an embodiment of the present application provides an emotional tagging device for speaking content, the device including:
  • the first acquisition module is used to acquire the original corpus.
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker description;
  • the first emotion label determination module is used to recognize the emotion words of the speaker description according to the preset emotion dictionary, and obtain the first emotion label corresponding to the corresponding speech content;
  • the second emotion label determination module inputs the content of the speech into the preset emotion classifier, and obtains the second emotion label output by the preset emotion classifier;
  • the precise emotion label determination module is used to determine the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label.
  • the precise emotion label determination module is also used to:
  • an embodiment of the present application provides an emotional tagging device for speaking content, including a memory and a processor, and a computer program is stored in the memory.
  • the processor executes the following steps:
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker description;
  • an accurate emotion tag corresponding to the content of the speech is determined.
  • an embodiment of the present application provides a storage medium storing a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker description;
  • an accurate emotion tag corresponding to the content of the speech is determined.
  • the original corpus is collected, labeled, filtered and noise-reduced, so that the final speech content is all with accurate emotional tags, which improves the emotional content of the spoken content.
  • the automatic output through the preset sentiment classifier improves the efficiency of sentiment labeling.
  • FIG. 1 is a flowchart of a method for emotional labeling of spoken content in an embodiment of the application
  • FIG. 2 is a flowchart of a training process of a preset emotion classifier in an embodiment of the application
  • FIG. 3 is a flowchart of obtaining training samples in an embodiment of the application
  • FIG. 4 is a flowchart of obtaining accurate emotion tags in an embodiment of this application.
  • Fig. 5 is a flowchart of a method for emotional labeling of spoken content in another embodiment of the application.
  • FIG. 6 is a schematic structural diagram of an emotional tagging device for speaking content in an embodiment of the application.
  • FIG. 7 is a schematic diagram of the internal structure of an emotion labeling device for speaking content in an embodiment of the application.
  • a method for emotional labeling of spoken content includes:
  • Step 102 Obtain an original corpus.
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker descriptions.
  • the original corpus refers to a corpus that needs to be emotionally annotated.
  • the corpus contains different novel dialogues with corresponding business fields and related needs.
  • Each novel dialogue includes two parts: speech content and speaker description.
  • the speaker description specifically refers to an emotional description combined with the speaking situation when the speaker expresses the corresponding content of the speech, such as "He said honestly:'Tomorrow's holiday'", where'happy' is right' He'expressed an emotional description of the speech content of'tomorrow's holiday'.
  • Step 104 Perform emotional word recognition on the speaker description according to the preset emotional dictionary, and obtain the first emotional tag corresponding to the corresponding utterance content.
  • the preset emotional dictionary is a pre-built professional emotional dictionary, which contains different emotional vocabulary, including adjectives, adverbs, verbs, and so on. Each emotional word has a corresponding emotional tendency.
  • the speaker’s description of emotional words is recognized through the preset emotional dictionary. Since the speaker’s description in each novel dialogue will have emotional word descriptions, the first emotional label corresponding to the corresponding speech content can be obtained based on this, for example, by "He said honestly:'Tomorrow's holiday'" to identify, you can get the'happy' emotional tag corresponding to'tomorrow's holiday'.
  • Step 106 Input the speech content into the preset emotion classifier, and obtain the second emotion label output by the preset emotion classifier.
  • the preset emotion classifier is a virtual module for emotion recognition and classification based on machine learning.
  • the second emotion label corresponding to the corresponding speech content can be obtained.
  • the second emotion label is obtained based on the emotion word recognition processing on the content of the speech.
  • Step 108 Determine an accurate emotion tag corresponding to the content of the speech according to the first emotion tag and the second emotion tag.
  • the first emotion label and the second emotion label are combined to judge the difference between the two, and finally the accurate emotion label is determined.
  • the final speech content obtained is all with accurate emotion labels, which improves the accuracy of the emotion annotation of the speech content.
  • the preset emotion classifier is used to automatically The output improves the efficiency of emotion annotation.
  • the preset sentiment classifier is trained through the following steps:
  • Step 202 Obtain a training sample set.
  • the training sample set includes a plurality of training samples, and each training sample includes: training speech content and training emotion category labels corresponding to the training speech content.
  • the training sample set is a part of the novel dialogue in the original corpus, and the preset emotion classifier is trained through a part of the novel dialogue.
  • the preset emotion classifier is based on BERT (Bidirectional Encoder Representation from Transformers) classification model.
  • BERT is a two-way transformer that is used to pre-train a large amount of unlabeled text data to learn a language representation, which can be used to fine-tune specific and learning tasks.
  • step 204 the training speech content is used as the input of the preset emotion classifier, the training emotion category label is used as the expected output of the preset emotion classifier, and the preset emotion classifier is trained to obtain the trained preset emotion classifier.
  • the speech content in the training sample is used as the input of the preset emotion classifier
  • the emotion label corresponding to the determined corresponding speech content is used as the expected output
  • the preset emotion classifier is continuously trained through the input and expected output.
  • the difference between the actual output and the expected output is used to adjust the weight parameters of the preset emotion classifier, and finally the training is completed when the preset conditions are met, and the trained preset emotion classifier is obtained.
  • obtaining a training sample set includes:
  • Step 302 Obtain the content of the speech.
  • the spoken content refers to the spoken content used in the training sample set.
  • Step 304 Perform emotional word recognition on the training speech content according to the preset emotional dictionary.
  • the content of the speech is the most direct place to reflect the emotional tendency, so the emotional word recognition of the content of the speech is carried out through the preset emotional dictionary.
  • Step 306 When it is recognized that the training speech content contains the emotional word in the preset emotion dictionary, the emotion category of the training speech content is marked as the emotion category corresponding to the recognized emotion word.
  • the emotion label corresponding to the emotion word is used as the expected output of the speech content sample.
  • Step 308 When it is not recognized that the training speech content contains the emotional words in the preset emotion dictionary, mark the training speech content with the emotion category according to the labeling instruction.
  • the preset sentiment classifier is continuously trained to achieve the actual output close to the expected output, so that the result of sentiment labeling is more accurate.
  • determining the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label includes:
  • Step 402 When the emotion categories of the first emotion label and the second emotion label corresponding to the spoken content are the same, the data corresponding to the spoken content is retained.
  • the consistency of the first emotion label and the second emotion label is further judged. If they are the same, the piece of data will be retained, and the data will actually be determined The emotional label of the content of the speech is accurate.
  • Step 404 When the emotion categories of the first emotion label and the second emotion label corresponding to the utterance content are inconsistent, delete the data corresponding to the utterance content.
  • the second emotion label may also be retained and determined as an accurate emotion label.
  • Step 406 Determine an accurate emotional label corresponding to the content of the utterance according to the emotional label corresponding to the retained content of the utterance.
  • the remaining spoken content is determined to be an accurate emotion label after further judgment.
  • the method further includes: according to the corresponding emotional category the first emotional label Perform basic emotion classification, and obtain the third emotion label corresponding to the corresponding speech content;
  • Determining the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label includes: determining the precise emotion label corresponding to the spoken content according to the third emotion label and the second emotion label.
  • the basic emotion category refers to the commonly used emotion categories, generally several types, such as happiness, anger, sadness, shock, fear, etc.
  • the first emotion label is the corresponding specific emotion, such as happy, comfortable, angry, dissatisfied Etc.
  • the above-mentioned happiness and comfort can be determined as happiness
  • anger and dissatisfaction can be determined as anger
  • other specific emotion categories can also be classified.
  • the second emotion label corresponds to the basic emotion category
  • the second emotion label corresponds to the specific emotion category
  • the obtained emotion labels are more applicable.
  • the method further includes: calculating each speech content and all other first emotion labels. The similarity of the speech content corresponding to the emotion label; if any calculated similarity is greater than the preset threshold, the speech content is determined to have no emotion label.
  • the speech content is a non-emotional tendency category; in another embodiment, it is also possible to speak to words greater than the preset threshold.
  • the amount of content is further restricted.
  • the emotional annotation is made more accurate, and the data can be retained to the maximum to avoid being excluded.
  • the present application provides a method for emotional labeling of spoken content, and the method includes:
  • Step 502 Obtain an original corpus.
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker descriptions.
  • Step 504 Perform emotional word recognition on the speaker description according to the preset emotional dictionary, and obtain the first emotional tag corresponding to the corresponding utterance content.
  • Step 506 Combine the first emotion tag into multiple basic emotion categories according to the corresponding emotion category to obtain a third emotion tag corresponding to the corresponding utterance content.
  • Step 508 Calculate the similarity between each piece of speech content and all other speech content corresponding to the first emotion tags.
  • step 510 if any calculated similarity is greater than a preset threshold, the content of the speech is determined as having no emotional label.
  • Step 512 Input the speech content into the preset emotion classifier, and obtain the second emotion label output by the preset emotion classifier.
  • Step 514 Determine an accurate emotion tag corresponding to the content of the speech according to the third emotion tag and the second emotion tag.
  • the second emotion label and the third emotion label are both the basic emotion category, and the category mentioned in the similarity comparison is also the basic category.
  • the present application provides an emotional tagging device for speaking content, which includes:
  • the first acquisition module 602 is used to acquire an original corpus.
  • the original corpus contains different novel dialogues.
  • the novel dialogues include: speaking content and speaker description;
  • the first emotion label determination module 604 is configured to perform emotion word recognition on the speaker description according to the preset emotion dictionary, and obtain the first emotion label corresponding to the corresponding speech content;
  • the second emotion label determination module 606 inputs the content of the speech into the preset emotion classifier, and obtains the second emotion label output by the preset emotion classifier;
  • the precise emotion label determination module 608 is configured to determine the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label.
  • the second emotion label determination module is also used to obtain a training sample set, the training sample set includes a plurality of training samples, and each training sample includes: training speech content and training emotion category labels corresponding to the training speech content;
  • the training speech content is used as the input of the preset emotion classifier, the training emotion category label is used as the expected output of the preset emotion classifier, and the preset emotion classifier is trained to obtain the trained preset emotion classifier.
  • the second emotion label determination module is also used to obtain the content of the speech; perform emotion word recognition on the training speech content according to the preset emotion dictionary; when it is recognized that the training speech content contains the When presetting the emotion words in the emotion dictionary, mark the emotion category of the training speech content as the emotion category corresponding to the recognized emotion word; when it is not recognized that the training speech content includes the preset emotion dictionary In the case of emotional words of, the emotional category of the training speech content is labeled according to the labeling instruction.
  • the precise emotion label determination module is also used to retain the data corresponding to the speech content when the emotion categories of the first emotion label and the second emotion label corresponding to the spoken content are the same; when the first emotion corresponding to the spoken content When the emotion categories of the tag and the second emotion tag are inconsistent, the data corresponding to the speech content is deleted; the accurate emotion tag corresponding to the speech content is determined according to the emotion tag corresponding to the retained speech content.
  • the device for annotating the emotion of speech content further includes:
  • the third emotion label determination module is used to classify the first emotion label according to the corresponding emotion category into basic emotions to obtain the third emotion label corresponding to the corresponding utterance content.
  • the precise emotion label determination module is also used to determine the precise emotion label corresponding to the content of the speech according to the third emotion label and the second emotion label.
  • the device for annotating the emotion of speech content further includes:
  • the non-emotional label determination module is used to calculate the similarity between each piece of speech content and the speech content corresponding to all other first emotional tags; if any of the calculated similarities is greater than the preset threshold, the speech content is determined to be non-emotional label .
  • the present application provides an emotional labeling device for speaking content, and the internal structure diagram of the emotional labeling device for speaking content is shown in FIG. 7.
  • the emotional annotation device for speaking content includes a processor, a memory, and a network interface connected through a system bus.
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the device for emotional labeling of speech content stores an operating system and may also store a computer program.
  • the processor can enable the processor to implement the emotional labeling method of the spoken content.
  • a computer program can also be stored in the internal memory, and when the computer program is executed by the processor, the processor can execute an emotional annotation method of speech content.
  • FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the emotional tagging device of the speech content to which the solution of the present application is applied.
  • the emotional tagging device for speaking content may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
  • the provided method for emotional labeling of spoken content can be implemented in the form of a computer program, and the computer program can be run on the emotional labeling device of spoken content as shown in FIG. 7.
  • the memory of the device for emotional labeling of spoken content can store various program modules that constitute a device for emotional labeling of spoken content. For example, the first acquisition module 602, the first emotion label determination module 604, the second emotion label determination module 606, and the precise emotion label determination module 608.
  • An emotional tagging device for speaking content including a processor and a memory.
  • a computer program is stored in the memory.
  • the processor executes the following steps: acquiring an original corpus, which contains different novel dialogues,
  • the novel dialogue includes: speaking content and speaker description; performing emotional word recognition on the speaker description according to the preset emotion dictionary, and obtaining the first emotion label corresponding to the corresponding speaking content; inputting the speaking content into the preset emotion classifier, Obtain the second emotion label output by the preset emotion classifier; determine the precise emotion label corresponding to the spoken content according to the first emotion label and the second emotion label.
  • the preset emotion classifier is trained through the following steps: obtaining a training sample set, the training sample set includes a plurality of training samples, each training sample includes: training speech content and training emotion category corresponding to the training speech content Labeling: The training speech content is used as the input of the preset emotion classifier, and the training emotion category label is used as the expected output of the preset emotion classifier, and the preset emotion classifier is trained to obtain the trained preset emotion classifier.
  • obtaining a training sample set includes: obtaining speech content; performing emotional word recognition on the training speech content according to the preset emotion dictionary; when it is recognized that the training speech content contains the preset When emotion words in the emotion dictionary are used, the emotion category of the training speech content is marked as the emotion category corresponding to the recognized emotion word; when it is not recognized that the training speech content contains the emotion in the preset emotion dictionary When words are being used, the emotional category is marked on the training speech content according to the marking instruction.
  • determining the precise emotion label corresponding to the spoken content according to the first emotion tag and the second emotion tag includes: when the emotion category of the first emotion tag and the second emotion tag corresponding to the spoken content are the same, then retain Data corresponding to the content of the utterance; when the emotion category of the first emotion label and the second emotion label corresponding to the utterance content are inconsistent, delete the data corresponding to the utterance content; determine the accuracy corresponding to the utterance content according to the emotion label corresponding to the retained utterance content Emotional label.
  • the processor when the step of performing emotional word recognition on the speaker’s description according to the preset emotional dictionary to obtain the first emotional tag corresponding to the corresponding speech content, when the computer program is executed by the processor, the processor also executes The following steps: perform basic emotion classification of the first emotion label according to the corresponding emotion category to obtain the third emotion label corresponding to the corresponding speech content; determine the precise emotion corresponding to the speech content according to the first emotion label and the second emotion label The label includes: determining the precise emotional label corresponding to the spoken content according to the third emotional label and the second emotional label.
  • the processor after the step of performing emotional word recognition on the speaker’s description according to the preset emotional dictionary to obtain the first emotional tag corresponding to the corresponding speech content, when the computer program is executed by the processor, the processor also executes The following steps: Calculate the similarity between each piece of speech content and all other speech content corresponding to the first emotion tag; if any calculated similarity is greater than a preset threshold, the speech content is determined to have no emotion tag.
  • the present application provides a storage medium storing a computer program.
  • the processor executes the following steps: Obtain an original corpus, which contains different novel dialogues, and the novel dialogues include : Speaking content and speaker description; perform emotional word recognition on the speaker description according to the preset emotion dictionary to obtain the first emotion label corresponding to the corresponding utterance content; input the utterance content into the preset emotion classifier to obtain the preset The second sentiment label output by the sentiment classifier; the precise sentiment label corresponding to the content of the speech is determined according to the first sentiment label and the second sentiment label.
  • the preset emotion classifier is trained through the following steps: obtaining a training sample set, the training sample set includes a plurality of training samples, each training sample includes: training speech content and training emotion category corresponding to the training speech content Labeling: The training speech content is used as the input of the preset emotion classifier, and the training emotion category label is used as the expected output of the preset emotion classifier, and the preset emotion classifier is trained to obtain the trained preset emotion classifier.
  • obtaining a training sample set includes: obtaining speech content; performing emotional word recognition on the training speech content according to the preset emotion dictionary; when it is recognized that the training speech content contains the preset When emotion words in the emotion dictionary are used, the emotion category of the training speech content is marked as the emotion category corresponding to the recognized emotion word; when it is not recognized that the training speech content contains the emotion in the preset emotion dictionary When words are being used, the emotional category is marked on the training speech content according to the marking instruction.
  • determining the precise emotion label corresponding to the spoken content according to the first emotion tag and the second emotion tag includes: when the emotion category of the first emotion tag and the second emotion tag corresponding to the spoken content are the same, then retain Data corresponding to the content of the utterance; when the emotion category of the first emotion label and the second emotion label corresponding to the utterance content are inconsistent, delete the data corresponding to the utterance content; determine the accuracy corresponding to the utterance content according to the emotion label corresponding to the retained utterance content Emotional label.
  • the processor when the step of performing emotional word recognition on the speaker’s description according to the preset emotional dictionary to obtain the first emotional tag corresponding to the corresponding speech content, when the computer program is executed by the processor, the processor also executes The following steps: perform basic emotion classification of the first emotion label according to the corresponding emotion category to obtain the third emotion label corresponding to the corresponding speech content; determine the precise emotion corresponding to the speech content according to the first emotion label and the second emotion label The label includes: determining the precise emotional label corresponding to the spoken content according to the third emotional label and the second emotional label.
  • the processor after the step of performing emotional word recognition on the speaker description according to the preset emotional dictionary to obtain the first emotional tag corresponding to the corresponding speech content, when the computer program is executed by the processor, the processor also executes The following steps are as follows: Calculate the similarity between each piece of speech content and all other speech content corresponding to the first emotion label; if any calculated similarity is greater than a preset threshold, the speech content is determined to have no emotion label.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Channel
  • memory bus Radbus direct RAM
  • RDRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

一种说话内容的情感标注方法、说话内容的情感标注装置、设备及存储介质,该方法包括:获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述(102);根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签(104);将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签(106);根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签(108)。该方法通过对原始语料库进行收集、标注、筛选降噪,使得最终获得的说话内容都是带有精确情感标签的,提高了说话内容的情感标注的精准度,此外,通过预设情感分类器进行自动输出,提高了情感标注的效率。

Description

说话内容的情感标注方法、装置、设备及存储介质 技术领域
本申请涉及情感分析领域,尤其涉及一种说话内容的情感标注方法、装置、设备及存储介质。
背景技术
现有的情感标注方法从海量小说的对话文本中抽取各式各样的说话内容,从对应的说话人的描述中抽取情感词作为说话内容的情感倾向标签,通过现有的情感标注方法可以实现大规模情感文本数据的自动标注。
技术问题
但是现有这种对小说对话内容中的说话内容进行自动标注的方法,得到的情感标注是不精确的。
技术解决方案
基于此,有必要针对上述问题,提供一种说话内容的情感标注方法、装置、设备及存储介质。
第一方面,本申请实施例提供一种说话内容的情感标注方法,该方法包括:
获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;
根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;
将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;
根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,预设情感分类器通过以下步骤进行训练:
获取训练样本集,训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与训练说话内容对应的训练情感类别标注;
将训练说话内容作为预设情感分类器的输入,将训练情感类别标注作为预设情感分类器期望的输出,对预设情感分类器进行训练,得到训练好的预设情感分类器。
在一个实施例中,获取训练样本集,包括:
获取说话内容;
根据所述预设情感词典对所述训练说话内容进行情感词识别;
当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别;
当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
在一个实施例中,根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:
当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据;
当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据;
根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,还包括:
将第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的说话内容对应的第三情感标签;
根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:
根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,还包括:
计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度;
若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
第二方面,本申请实施例提供一种说话内容的情感标注装置,该装置包括:
第一获取模块,用于获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;
第一情感标签确定模块,用于根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;
第二情感标签确定模块,将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;
精确情感标签确定模块,用于根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,精确情感标签确定模块还用于:
当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据;
当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据;
根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
第三方面,本申请实施例提供一种说话内容的情感标注设备,包括存储器和处理器,存储器中储存有计算机程序,计算机程序被处理器执行时,使得处理器执行如下步骤:
获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;
根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;
将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;
根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
第四方面,本申请实施例提供一种存储介质,储存有计算机程序,计算机程序被处理器执行时,使得处理器执行如下步骤:
获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;
根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;
将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;
根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
有益效果
实施本申请实施例,将具有如下有益效果:
通过上述说话内容的情感标注方法、装置、设备及存储介质,对原始语料库进行收集、标注、筛选降噪,使得最终获得的说话内容的都是带有精确情感标签的,提高了说话内容的情感标注的精准度,此外,通过预设情感分类器进行自动输出,提高了情感标注的效率。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
其中:
图1为本申请一个实施例中说话内容的情感标注方法的流程图;
图2为本申请一个实施例中预设情感分类器训练过程的流程图;
图3为本申请一个实施例中获取训练样本的流程图;
图4为本申请一个实施例中得到精确情感标签的流程图;
图5为本申请另一个实施例中说话内容的情感标注方法的流程图;
图6为本申请一个实施例中说话内容的情感标注装置的结构示意图;
图7为本申请一个实施例中说话内容的情感标注设备的内部结构示意图。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
如图1所示,在一个实施例中,提出一种说话内容的情感标注方法,该方法包括:
步骤102,获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述。
其中,原始语料库是指需要进行情感标注的语料库,在该语料库中包含有相应业务领域及相关需求的不同的小说对话,每一条小说对话都包含说话内容和说话人描述两个部分。其中说话人描述具体的是指对说话人表达出对应说话内容时的一个结合说话情境的带有情感的描述,例如“他高兴的说:‘明天放假’”,其中‘高兴’即是对‘他’表达出‘明天放假’这个段说话内容的一个情感描述。
步骤104,根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签。
其中,预设情感词典是预先构建的专业情感词典,该词典中包含有不同的情感词汇,包括形容词、副词、动词等。每一种情感词都有与之对应的情感倾向。通过预设情感词典对说话人描述进行情感词识别,由于每一条小说对话中的说话人描述都会有情感词描述,因此据此可以得到与相应的说话内容对应的第一情感标签,例如通过对“他高兴的说:‘明天放假’”进行识别,就可以得到‘明天放假’对应的‘高兴’情感标签。
步骤106,将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签。
其中,预设情感分类器是基于机器学习的一个用于情感识别分类的虚拟模块,通过将说话内容输入到该预设情感分类器中,可得到与相应说话内容对应的第二情感标签,该第二情感标签是基于对说话内容进行情感词识别处理得到。
步骤108,根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
其中,结合第一情感标签和第二情感标签,判断两者的差异情况,最终确定精确的情感标签。
通过对原始语料库进行收集、标注、筛选降噪,使得最终获得的说话内容的都是带有精确情感标签的,提高了说话内容的情感标注的精准度,此外,通过预设情感分类器进行自动输出,提高了情感标注的效率。
如图2所示,在一个实施例中,预设情感分类器通过以下步骤进行训练:
步骤202,获取训练样本集,训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与训练说话内容对应的训练情感类别标注。
其中,训练样本集也就是原始语料库中的一部分小说对话,通过一部分小说对话来训练预设情感分类器,预设情感分类器是基于BERT(Bidirectional Encoder Representation from Transformers)的分类模型。BERT是一个双向的transformer,用于对大量未标记的文本数据进行预训练,以学习一种语言表示形式,这种语言表示形式可用于对特定及其学习任务进行微调。
步骤204,将训练说话内容作为预设情感分类器的输入,将训练情感类别标注作为预设情感分类器期望的输出,对预设情感分类器进行训练,得到训练好的预设情感分类器。
其中,将训练样本中的说话内容分别都作为预设情感分类器的输入,将确定了的相应说话内容对应的情感标注作为期望输出,通过输入和期望输出不断的训练预设情感分类器,根据实际输出和期望输出的差值来调整预设情感分类器的权重参数,最终在满足预设条件时完成训练,得到训练好的预设情感分类器。
通过不断的使用样本训练预设情感分类器,从而得到一个较为优越的情感分类器,使得最终输出的结果更加精准,提高了整个情感标注结果的精确度。
如图3所示,在一个实施例中,获取训练样本集,包括:
步骤302,获取说话内容。
其中,说话内容即指用于训练样本集中的说话内容。
步骤304,根据预设情感词典对训练说话内容进行情感词识别。
其中,说话内容是体现情感倾向最直接的地方,因此通过预设情感词典对说话内容进行情感词识别。
步骤306,当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别。
其中,通过预设情感词典进行识别时,若说话内容中包含有情感词,则将该情感词对应的情感标注作为该条说话内容样本的期望输出。
步骤308,当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
其中,同理的,通过预设情感词典进行识别时,若说话内容中没有包含有情感词,则进行人工判定,接受人工判定的情感标注作为期望输出。具体的根据说话内容中隐含的情感倾向进行判定,例如‘这个桌子上太多灰了’,可以推测出该句话隐含的是偏向低落情感的,因此将低落作为‘这个桌子上太多灰了’的情感标签,并在训练时作为期望输出。
通过建立精确的样本输入和样本期望输出,不断的训练预设情感分类器达到实际输出接近期望输出的目的,使得情感标注的结果更加精准。
如图4所示,在一个实施例中,根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:
步骤402,当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据。
其中,在得到同一说话内容的第一情感标签和第二情感标签后,进一步判断第一情感标签和第二情感标签的一致性,若一致,则将保留该条数据,实际上也就确定该条说话内容的情感标签是精确的。
步骤404,当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据。
其中,当判断结果为不一致时,说明该条说话内容的情感标签存在精度问题,因此将该条数据进行删除。在另一个实施例中,也可以保留并将第二情感标签确定为精确的情感标签。
步骤406,根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
其中,遍历所有说话内容后,保留下来的说话内容皆为经过进一步判断后确定为精确情感标签。
通过进一步判断第一情感标签和第二情感标签的一致性,最终确定出精确的情感标签,使得得到的情感标注精度较高。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,还包括:将第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的说话内容对应的第三情感标签;
根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
其中,基础情感类别是指常用的情感大类别,一般为几种,比如喜、怒、悲、惊、恐等,而第一情感标签则是对应的具体情感,比如开心、舒畅、愤怒、不满等,通过基础情感类别则可以将上述开心和舒畅确定为喜,对应的将愤怒和不满确定为怒,同理的还可以将其他具体情感类别进行分类。
其中,在本实施中,第二情感标签对应的为基础情感类别,而在上述实施例中,第二情感标签则对应的为具体情感类别。
通过将具体的情感类别进行归并分类,使得得到的情感标注更具有适用性。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,还包括:计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度;若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
其中,由于小说对话中对说话人的描述是基于特定场景的,有些话语本身是不含有情感倾向的,但在特定场景中说话人的情感状态使得对应的话具有的情感标签。因此通过进一步判断不同情感标签中说话内容之间的相似度,若相似度大于了预设阈值,说明该说话内容是不含有情感倾向的,不应带有情感标签,则将其确定为无情感标签。例如‘今天是6月20日’该句话本身不含有情感,但在小说对话场景中,若‘6月20日’是说话人的生日或者其他值得开心的日子,则说话人描述会是‘开心’之类的,对应的情感标签也会是‘开心’;然而在另一个场景中‘6月20日’是说话人十分悲伤的一天,因此在该场景下,说话人描述会是‘悲伤’,因此将此类说话内容确定为无情感倾向类别。具体的,若检测到存在与某条说话内容相似度大于预设阈值的其他说话内容时,就判定该说话内容为无情感倾向类别;在另一个实施例中也可以对大于预设阈值的说话内容的数量进行进一步限制。
通过提取出无情感倾向的说话内容,使得情感标注更加精准,也使得数据能够最大化的保留,避免被排除。
如图5所示,在一个实施例中,本申请提供一种说话内容的情感标注方法,该方法包括:
步骤502,获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述。
步骤504,根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签。
步骤506,将第一情感标签根据对应的情感类别归并多个基础情感类别,得到与相应的说话内容对应的第三情感标签。
步骤508,计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度。
步骤510,若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
步骤512,将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签。
步骤514,根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
其中,第二情感标签和第三情感标签都为基础情感类别,并且相似度比较时提到的类别也为基础类别。
通过对说话内容的搜集、初步情感标注、归类、排除无情感类别、进一步情感标注、筛选出精确的情感标签,整个过程结合了小说对话中说话内容的特性,一步步的降噪,使得得到的情感标注是十分精确的。
如图6所示,在一个实施例中,本申请提供一种说话内容的情感标注装置,该装置包括:
第一获取模块602,用于获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;
第一情感标签确定模块604,用于根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;
第二情感标签确定模块606,将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;
精确情感标签确定模块608,用于根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,第二情感标签确定模块还用于获取训练样本集,训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与训练说话内容对应的训练情感类别标注;将训练说话内容作为预设情感分类器的输入,将训练情感类别标注作为预设情感分类器期望的输出,对预设情感分类器进行训练,得到训练好的预设情感分类器。
在一个实施例中,第二情感标签确定模块还用于获取说话内容;根据所述预设情感词典对所述训练说话内容进行情感词识别;当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别;当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
在一个实施例中,精确情感标签确定模块还用于当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据;当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据;根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,上述说话内容的情感标注装置还包括:
第三情感标签确定模块,用于将第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的说话内容对应的第三情感标签。
精确情感标签确定模块还用于根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,上述说话内容的情感标注装置还包括:
无情感标签确定模块,用于计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度;若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
在一个实施例中,本申请提供一种说话内容的情感标注设备,该说话内容的情感标注设备的内部结构图如图7所示。该说话内容的情感标注设备包括通过系统总线连接的处理器、存储器和网络接口。其中,存储器包括非易失性存储介质和内存储器。该说话内容的情感标注设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现说话内容的情感标注方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行说话内容的情感标注方法。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的说话内容的情感标注设备的限定,具体的说话内容的情感标注设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供的一种说话内容的情感标注方法可以实现为一种计算机程序的形式,计算机程序可在如图7所示的说话内容的情感标注设备上运行。说话内容的情感标注设备的存储器中可存储组成一种说话内容的情感标注装置的各个程序模块。比如,第一获取模块602、第一情感标签确定模块604、第二情感标签确定模块606、精确情感标签确定模块608。
一种说话内容的情感标注设备,包括处理器和存储器,存储器中储存有计算机程序,计算机程序被处理器执行时,使得处理器执行如下步骤:获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,预设情感分类器通过以下步骤进行训练:获取训练样本集,训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与训练说话内容对应的训练情感类别标注;将训练说话内容作为预设情感分类器的输入,将训练情感类别标注作为预设情感分类器期望的输出,对预设情感分类器进行训练,得到训练好的预设情感分类器。
在一个实施例中,获取训练样本集,包括:获取说话内容;根据所述预设情感词典对所述训练说话内容进行情感词识别;当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别;当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
在一个实施例中,根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据;当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据;根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,计算机程序被处理器执行时,使得处理器还执行如下步骤:将第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的说话内容对应的第三情感标签;根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,计算机程序被处理器执行时,使得处理器还执行如下步骤:计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度;若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
在一个实施例中,本申请提供一种存储介质,储存有计算机程序,计算机程序被处理器执行时,使得处理器执行如下步骤:获取原始语料库,原始语料库中包含不同的小说对话,小说对话包括:说话内容和说话人描述;根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签;将说话内容输入到预设情感分类器中,获取预设情感分类器输出的第二情感标签;根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,预设情感分类器通过以下步骤进行训练:获取训练样本集,训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与训练说话内容对应的训练情感类别标注;将训练说话内容作为预设情感分类器的输入,将训练情感类别标注作为预设情感分类器期望的输出,对预设情感分类器进行训练,得到训练好的预设情感分类器。
在一个实施例中,获取训练样本集,包括:获取说话内容;根据所述预设情感词典对所述训练说话内容进行情感词识别;当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别;当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
在一个实施例中,根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:当说话内容对应的第一情感标签和第二情感标签的情感类别一致时,则保留说话内容对应的数据;当说话内容对应的第一情感标签和第二情感标签的情感类别不一致时,则删除说话内容对应的数据;根据保留的说话内容对应的情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,计算机程序被处理器执行时,使得处理器还执行如下步骤:将第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的说话内容对应的第三情感标签;根据第一情感标签和第二情感标签确定与说话内容对应的精确情感标签,包括:根据第三情感标签和第二情感标签确定与说话内容对应的精确情感标签。
在一个实施例中,在根据预设情感词典对说话人描述进行情感词识别,得到与相应的说话内容对应的第一情感标签的步骤之后,计算机程序被处理器执行时,使得处理器还执行如下步骤:计算每条说话内容与其他所有第一情感标签对应的说话内容的相似度;若计算得到的任一相似度大于预设阈值,则将说话内容确定为无情感标签。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。请输入具体实施内容部分。

Claims (10)

  1. 一种说话内容的情感标注方法,其特征在于,所述方法包括:
    获取原始语料库,所述原始语料库中包含不同的小说对话,所述小说对话包括:说话内容和说话人描述;
    根据预设情感词典对所述说话人描述进行情感词识别,得到与相应的所述说话内容对应的第一情感标签;
    将所述说话内容输入到预设情感分类器中,获取所述预设情感分类器输出的第二情感标签;
    根据所述第一情感标签和所述第二情感标签确定与所述说话内容对应的精确情感标签。
  2. 根据权利要求1所述的方法,其特征在于,所述预设情感分类器通过以下步骤进行训练:
    获取训练样本集,所述训练样本集中包括多个训练样本,每个训练样本包括:训练说话内容和与所述训练说话内容对应的训练情感类别标注;
    将所述训练说话内容作为所述预设情感分类器的输入,将所述训练情感类别标注作为所述预设情感分类器期望的输出,对所述预设情感分类器进行训练,得到训练好的所述预设情感分类器。
  3. 根据权利要求2所述的方法,其特征在于,所述获取训练样本集,包括:
    获取说话内容;
    根据所述预设情感词典对所述训练说话内容进行情感词识别;
    当识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,将所述训练说话内容的情感类别标注为识别到的情感词对应的情感类别;
    当没有识别到所述训练说话内容中包含有所述预设情感词典中的情感词时,根据标注指令对所述训练说话内容标注情感类别。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述第一情感标签和所述第二情感标签确定与所述说话内容对应的精确情感标签,包括:
    当所述说话内容对应的所述第一情感标签和所述第二情感标签的情感类别一致时,则保留所述说话内容对应的数据;
    当所述说话内容对应的所述第一情感标签和所述第二情感标签的情感类别不一致时,则删除所述说话内容对应的数据;
    根据保留的说话内容对应的情感标签确定与所述说话内容对应的精确情感标签。
  5. 根据权利要求1所述的方法,其特征在于,在所述根据预设情感词典对所述说话人描述进行情感词识别,得到与相应的所述说话内容对应的第一情感标签的步骤之后,还包括:
    将所述第一情感标签根据对应的情感类别进行基础情感归类,得到与相应的所述说话内容对应的第三情感标签;
    所述根据所述第一情感标签和所述第二情感标签确定与所述说话内容对应的精确情感标签,包括:
    根据所述第三情感标签和所述第二情感标签确定与所述说话内容对应的精确情感标签。
  6. 根据权利要求1所述的方法,其特征在于,在所述根据预设情感词典对所述说话人描述进行情感词识别,得到与相应的所述说话内容对应的第一情感标签的步骤之后,还包括:
    计算每条所述说话内容与其他所有所述第一情感标签对应的说话内容的相似度;
    若计算得到的任一相似度大于预设阈值,则将所述说话内容确定为无情感标签。
  7. 一种说话内容的情感标注装置,其特征在于,所述装置包括:
    第一获取模块,用于获取原始语料库,所述原始语料库中包含不同的小说对话,所述小说对话包括:说话内容和说话人描述;
    第一情感标签确定模块,用于根据预设情感词典对所述说话人描述进行情感词识别,得到与相应的所述说话内容对应的第一情感标签;
    第二情感标签确定模块,将所述说话内容输入到预设情感分类器中,获取所述预设情感分类器输出的第二情感标签;
    精确情感标签确定模块,用于根据所述第一情感标签和所述第二情感标签确定与所述说话内容对应的精确情感标签。
  8. 根据权利要求7所述的装置,其特征在于,所述精确情感标签确定模块还用于:
    当所述说话内容对应的所述第一情感标签和所述第二情感标签的情感类别一致时,则保留所述说话内容对应的数据;
    当所述说话内容对应的所述第一情感标签和所述第二情感标签的情感类别不一致时,则删除所述说话内容对应的数据;
    根据保留的说话内容对应的情感标签确定与所述说话内容对应的精确情感标签。
  9. 一种说话内容的情感标注设备,包括存储器和处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1-6所述任一种方法的步骤。
  10. 一种存储介质,储存有计算机程序,其特征在于,所述计算机程序被处理器执行时,使得所述处理器执行如权利要求1-6所述任一种方法的步骤。
PCT/CN2019/129836 2019-12-30 2019-12-30 说话内容的情感标注方法、装置、设备及存储介质 WO2021134177A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980003300.6A CN111164589A (zh) 2019-12-30 2019-12-30 说话内容的情感标注方法、装置、设备及存储介质
PCT/CN2019/129836 WO2021134177A1 (zh) 2019-12-30 2019-12-30 说话内容的情感标注方法、装置、设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/129836 WO2021134177A1 (zh) 2019-12-30 2019-12-30 说话内容的情感标注方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021134177A1 true WO2021134177A1 (zh) 2021-07-08

Family

ID=70562370

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129836 WO2021134177A1 (zh) 2019-12-30 2019-12-30 说话内容的情感标注方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN111164589A (zh)
WO (1) WO2021134177A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112270168B (zh) * 2020-10-14 2023-11-24 北京百度网讯科技有限公司 对白情感风格预测方法、装置、电子设备及存储介质

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063399A (zh) * 2013-03-22 2014-09-24 杭州金弩信息技术有限公司 一种自动识别文本所承载的情感概率的方法及系统
US20160239573A1 (en) * 2015-02-18 2016-08-18 Xerox Corporation Methods and systems for predicting psychological types
US20160307114A1 (en) * 2011-10-24 2016-10-20 Hewlett Packard Enterprise Development Lp Performing sentiment analysis
US20170004439A1 (en) * 2015-06-30 2017-01-05 International Business Machines Corporation Sentiment analysis and inventory based event planning
CN106547740A (zh) * 2016-11-24 2017-03-29 四川无声信息技术有限公司 文本信息处理方法及装置
CN107301171A (zh) * 2017-08-18 2017-10-27 武汉红茶数据技术有限公司 一种基于情感词典学习的文本情感分析方法和系统
CN108563688A (zh) * 2018-03-15 2018-09-21 西安影视数据评估中心有限公司 一种影视剧本人物情绪识别方法
WO2018182501A1 (en) * 2017-03-30 2018-10-04 Agency For Science, Technology And Research Method and system of intelligent semtiment and emotion sensing with adaptive learning
CN109858026A (zh) * 2019-01-17 2019-06-07 深圳壹账通智能科技有限公司 文本情感分析方法、装置、计算机设备及存储介质
CN110399494A (zh) * 2018-04-16 2019-11-01 北京京东尚科信息技术有限公司 用于生成信息的方法和装置
CN110556129A (zh) * 2019-09-09 2019-12-10 北京大学深圳研究生院 双模态情感识别模型训练方法及双模态情感识别方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108108468A (zh) * 2017-12-29 2018-06-01 华中科技大学鄂州工业技术研究院 一种基于概念和文本情感的短文本情感分析方法和装置

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160307114A1 (en) * 2011-10-24 2016-10-20 Hewlett Packard Enterprise Development Lp Performing sentiment analysis
CN104063399A (zh) * 2013-03-22 2014-09-24 杭州金弩信息技术有限公司 一种自动识别文本所承载的情感概率的方法及系统
US20160239573A1 (en) * 2015-02-18 2016-08-18 Xerox Corporation Methods and systems for predicting psychological types
US20170004439A1 (en) * 2015-06-30 2017-01-05 International Business Machines Corporation Sentiment analysis and inventory based event planning
CN106547740A (zh) * 2016-11-24 2017-03-29 四川无声信息技术有限公司 文本信息处理方法及装置
WO2018182501A1 (en) * 2017-03-30 2018-10-04 Agency For Science, Technology And Research Method and system of intelligent semtiment and emotion sensing with adaptive learning
CN107301171A (zh) * 2017-08-18 2017-10-27 武汉红茶数据技术有限公司 一种基于情感词典学习的文本情感分析方法和系统
CN108563688A (zh) * 2018-03-15 2018-09-21 西安影视数据评估中心有限公司 一种影视剧本人物情绪识别方法
CN110399494A (zh) * 2018-04-16 2019-11-01 北京京东尚科信息技术有限公司 用于生成信息的方法和装置
CN109858026A (zh) * 2019-01-17 2019-06-07 深圳壹账通智能科技有限公司 文本情感分析方法、装置、计算机设备及存储介质
CN110556129A (zh) * 2019-09-09 2019-12-10 北京大学深圳研究生院 双模态情感识别模型训练方法及双模态情感识别方法

Also Published As

Publication number Publication date
CN111164589A (zh) 2020-05-15

Similar Documents

Publication Publication Date Title
WO2021104099A1 (zh) 一种基于情景感知的多模态抑郁症检测方法和系统
US9014363B2 (en) System and method for automatically generating adaptive interaction logs from customer interaction text
US7707027B2 (en) Identification and rejection of meaningless input during natural language classification
CN108090047B (zh) 一种文本相似度的确定方法及设备
CN105957531B (zh) 基于云平台的演讲内容提取方法及装置
DE102018126041B4 (de) Vorrichtung, verfahren und system zum verstehen gesprochener sprache unter nutzung eines dynamischen vokabulars
US20230177835A1 (en) Relationship modeling and key feature detection based on video data
Holliday Variation in question intonation in the corpus of regional African American language
CN113506574A (zh) 自定义命令词的识别方法、装置和计算机设备
CN110851601A (zh) 基于分层注意力机制的跨领域情感分类系统及方法
US10283142B1 (en) Processor-implemented systems and methods for determining sound quality
CN111180025A (zh) 表示病历文本向量的方法、装置及问诊系统
Alqarafi et al. Toward’s Arabic multi-modal sentiment analysis
Meng et al. Synthesizing English emphatic speech for multimodal corrective feedback in computer-aided pronunciation training
WO2021134177A1 (zh) 说话内容的情感标注方法、装置、设备及存储介质
Szekrényes Prosotool, a method for automatic annotation of fundamental frequency
CN116524962A (zh) 一种基于Conformer结构与多任务学习框架的语音情感识别方法
CN115527551A (zh) 语音标注质量评价方法、装置、电子设备和存储介质
CN115063155A (zh) 一种数据标注方法、装置、计算机设备及存储介质
CN114741512A (zh) 一种文本自动分类方法及系统
CN112951237A (zh) 一种基于人工智能的自动语音识别方法及系统
CN112052690A (zh) 一种基于融合位置特征的Bert-CNN-BLSTM-CRF的短文本情感分析方法
CN116320621B (zh) 一种基于nlp的流媒体内容分析方法及系统
Jeyasheeli et al. Deep learning methods for suicide prediction using audio classification
CN110858268A (zh) 一种检测语音翻译系统中不流畅现象的方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19958186

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19958186

Country of ref document: EP

Kind code of ref document: A1