A Humor Feature Extraction Method Based on Quantum Entropy

Through the quantum entropy feature extraction method, combined with the mathematical framework of humor dissonance theory and quantum theory, the problem of interpretability of humor feature extraction is solved, and the accuracy of humor recognition is improved, especially effective application on Chinese and English data sets.

CN115796186BActive Publication Date: 2025-07-04TIANJIN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211375762.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-07-04
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

The existing humor feature extraction technology lacks interpretability and it is difficult to effectively identify the mechanism of humor generation.

Method used

Using a humor feature extraction method based on quantum entropy, using the mathematical framework of humor dissonance theory and quantum theory, three humor features, uncertainty, implicitness and conditional uncertainty, are proposed for humor recognition through text representation of density matrix and quantum entropy feature extraction.

Benefits of technology

It improves the interpretability and recognition accuracy of humor characteristics, and improves the effect of humor recognition, especially the classification performance on Chinese and English datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115796186B_ABST
    Figure CN115796186B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of computational language models and quantum information theory, and specifically relates to a method for extracting humorous features based on quantum entropy, including the text representation of density matrices to model semantic uncertainty; the extraction of quantum entropy features based on density matrices, using quantum entropy as features for humorous recognition. The present invention models text representation through the mathematical framework of the humorous incongruity theory and quantum theory, and uses quantum entropy as a humorous feature to solve the problem of extracting interpretable humorous features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computational language models and quantum information theory, and particularly relates to a method for extracting humorous features based on quantum entropy. Background Art

[0002] Humor is a unique communication art of human beings and plays an important role in interpersonal communication. Humor can defuse the embarrassing atmosphere in a chat and eliminate obstacles in communication. Humor is the most complex cognitive attribute that humans possess. Even a simple joke uses language skills, theory of mind, abstract thinking, and social perception at the same time. Some studies have found that the appropriate use of humor can also effectively attract the attention of the audience, strengthen the memory of learning content, enhance the attraction between people, enhance friendship, and improve the trust between peers and business partners.

[0003] With the development of artificial intelligence, more and more human-computer interaction systems have entered people's lives. For example, Xiaoice of Microsoft, Blender of Facebook, and Meena of Google, etc. Most of them use multimedia information such as text, images, and voices as carriers, and text is the most core carrier of the interaction system. Identifying the emotions and connotations of text is particularly important for the interaction system. In the past, researchers spent a lot of energy studying the ways and principles of computers to understand emotions. Humor is essentially a hidden emotion that makes people laugh during human communication. Although humor is prevalent in interpersonal communication, due to its being a complex cognitive process, it may vary due to different personal cognitive levels. The generation mechanism and understanding mechanism of humor are more complex than ordinary emotions.

[0004] The existing research methods for humor recognition are generally divided into two categories: feature engineering-based methods and deep learning-based methods. Feature engineering-based methods use speech features, semantic distance, and emotional association as features for humor recognition. Deep learning-based methods use the powerful ability of neural networks to train humorous texts with neural network classification models. At present, there are few research methods based on humor theory, but due to its good interpretability, it can guide researchers on how to improve the model. Designing computational features based on humor theory helps to discover potential design problems of the model. To identify humor through computational means, first, the generation logic of humor needs to be understood. Currently, there are three generally recognized humor theories in the academic community, namely the Relief Theory based on psychological explanations, the Superiority Theory based on philosophical viewpoints, and the Incongruity Theory widely recognized in both the fields of psychology and philosophy [9].

[0005] In recent years, with the cross-disciplinary construction of Quantum Information Theory and Quantum Theory with artificial intelligence, researchers have begun to use the mathematical framework of quantum theory to solve problems in fields such as information retrieval, language models, and quantum cognition, and have tried to explain the quantum phenomena existing in natural language processing. Quantum theory has gradually become an interpretable framework for machine learning and even deep learning.

[0006] The quantum language model is a text modeling method that aims to model text information into a Hilbert space and use quantum theory to explain the neural network framework. As early as the 1930s, Dirac gave a unified mathematical formulation of quantum mechanics. Subsequently, von Neumann axiomatized quantum theory by exploring the mathematical structure of quantum mechanics and used rigorous mathematics to explain quantum theory. In quantum theory, the density matrix is an operator used to describe the physical properties of a mixed-state quantum system, and its mathematical form was given by von Neumann.

[0007] Quantum theory was first applied to the information retrieval model by Van Rijsbergen, representing the basic elements of information retrieval geometrically in a Hilbert space. Inspired by this work, a large number of quantum-inspired language models have been proposed. The most well-known work among them is the Quantum Language Model (QLM) proposed by Sordoni et al., which designed a new method for modeling term dependency relationships using the probability model of quantum theory. Both individual terms and composite dependent terms are modeled as projections in a vector space, that is, basic events in a probability space. In particular, composite dependent terms are represented as a superposition event, and documents and queries are represented as projection sequences encapsulated in a density matrix. Then, the negative VN divergence between density matrices is used to represent the correlation score between the query and the document. The advantage of this representation of dependencies is that there is no need for manual expansion of the term space when the number of terms increases. Sordoni and Nie used the mathematical framework of quantum theory to conduct a joint analysis of the vector space model and language model of information retrieval and clarified that the density matrix is a general representation tool. In the vector space model and language model, both documents and queries can be represented by density matrices. Subsequently, Sordoni et al. considered semantic commonalities and their complex syntactic relationships in discourse and defined the retrieval score of the potential concept space of a document relative to a query using quantum relative entropy. Zhang et al. represented questions and answers as density matrices respectively in a question-answering task, constructed a joint representation using the product of density matrices, and used the diagonal elements of the joint matrix as matching features.

[0008] In quantum information theory, von Neumann extended the classical Shannon entropy to the quantum case and defined the von Neumann entropy. The von Neumann entropy also characterizes the entropy of entanglement in the form of quantum conditional entropy and quantum relative entropy within the framework of quantum information theory. In addition, Sagawa et al. introduced the quantum relative entropy and proved its non-negativity. Brandsen et al. characterized the conditional quantum entropy using information theory principles in an axiomatic approach.

[0009] However, the existing humor feature extraction techniques have the problem of insufficient interpretability. Summary of the Invention

[0010] The object of the present invention is to provide a humor feature extraction method based on quantum entropy in view of the deficiencies of the prior art. By modeling the text representation through the mathematical frameworks of the humor incongruity theory and quantum theory, and using quantum entropy as the humor feature, the problem of extracting interpretable humor features is solved.

[0011] To achieve the above object, the present invention adopts the following technical solutions:

[0012] A humor feature extraction method based on quantum entropy includes the text representation of the density matrix to model the semantic uncertainty; and the quantum entropy feature extraction based on the density matrix, using the quantum entropy as the feature for humor recognition.

[0013] Preferably, the humor features include uncertainty, implicature, and conditional uncertainty. The uncertainty is used to describe the degree of semantic uncertainty of the "setup" sentence and the "punchline" sentence. The implicature is used to describe the degree of semantic implication between the "setup" sentence and the "punchline" sentence. The conditional uncertainty is used to describe the conditional relationship between the semantics of the "setup" sentence and the "punchline" sentence.

[0014] Preferably, the text representation of the density matrix includes:

[0015] Dividing the text into two parts: the "setup" sentence and the "punchline" sentence for representation;

[0016] Representing the "setup" sentence and the "punchline" sentence as density matrices in a Hilbert space.

[0017] It should be noted that the text representation of the density matrix, which divides the text into two parts: the "setup" sentence and the "punchline" sentence for text representation, is the basis for subsequent feature calculation. A reasonable text representation can ensure the effectiveness of subsequent features. According to the incongruity theory, it is necessary to examine the semantic differences between the "setup" sentence and the "punchline" sentence, so it is necessary to embed the "setup" sentence and the "punchline" sentence separately. The present invention embeds the "setup" sentence and the "punchline" sentence into the Hilbert space using the same representation method, and uses the Hilbert space of the real number field instead of the Hilbert space of the complex number field. Using the Dirac notation, a unit vector and its transpose are respectively represented as |u> and <u|. For each word is normalized in the following way:

[0018]

[0019] where ‖·‖ represents the L2 norm. The normalized word vectors are regarded as superposition states in the Hilbert space, and then the words are represented as quantum elementary events |w i ><w i | in the Hilbert space. The dependence relationship between words in a sentence s (a "setup" sentence or a "punchline" sentence) is modeled using a density matrix, and the elementary events corresponding to the words are combined with probabilities. Each sentence is represented as an n-by-n density matrix ρ:

[0020]

[0021] where p i represents the superposition probability, and here average superposition is adopted according to the sentence length l s , that is, p i = 1 / l s . The values on the diagonal of the density matrix ρ s represent the superposition semantics of the sentence, and the off-diagonal values encode the dependence relationship between the semantics in a quantum way.

[0022] Preferably, the Hilbert space is a Hilbert space over the real number field.

[0023] Preferably, the uncertainty respectively obtains evidence for judging humor from the "setup" sentence or the "punchline" sentence.

[0024] The uncertainties of the "setup" sentence and the "punchline" sentence are defined as follows:

[0025] U m = -tr(ρ mln ρ m )

[0026] where m ∈ {setup, punchline}, and ρ m is the density matrix of the "setup" sentence or the "punchline" sentence. The uncertainty U m reflects the degree of uncertainty and the amount of information of the text semantics. A higher uncertainty means containing more semantic information.

[0027] Preferably, the entailment defines the entailment of the "setup" sentence or the "punchline" sentence as follows:

[0028] E m||n = tr(ρ m lnρ m)-tr(ρ m lnρ n )

[0029] where \(m\in\{setup, punchline\}\), and \(\rho\) m is the density matrix of the "setup" sentence or the "punchline" sentence. The implicature reflects to a certain extent the distance of the semantic distribution.

[0030] Preferably, the conditional uncertainty defines the conditional uncertainty of the "setup" sentence or the "punchline" sentence as follows:

[0031] C m|n =U mn -U n =-tr(\(\rho\) m \(\rho\) n ln\(\rho\) m \(\rho\) n ) + tr(\(\rho\) n ln\(\rho\) n )

[0032] where \(m\in\{setup, punchline\}\), and \(\rho\) m is the density matrix of the "setup" sentence or the "punchline" sentence, and the symbol \(U\) represents uncertainty.

[0033] The beneficial effects of the present invention are as follows. The present invention will model the text representation with the mathematical frameworks of the humor incongruity theory and the quantum theory, and use quantum entropy as the humor feature. The humor feature extraction method includes the text representation of the density matrix and the extraction of the quantum entropy feature based on the density matrix. Among them, the text representation of the density matrix is used to model the semantic uncertainty, and the quantum entropy is used as the feature for humor recognition. The present invention proposes a total of three humor features: uncertainty, implicature, and conditional uncertainty. Among them, uncertainty is used to describe the degree of semantic uncertainty of the "setup" sentence and the "punchline" sentence. Implicature is used to describe the degree of implication between the semantics of the "setup" sentence and the "punchline" sentence. Conditional uncertainty is used to describe the conditional relationship between the semantics of the "setup" sentence and the "punchline" sentence, that is, to describe the degree of uncertainty of another text given the condition of the semantics of a piece of text. The present invention uses the density matrix to represent the semantic uncertainty of the "setup" sentence and the "punchline" sentence respectively, uses quantum entropy to quantify its semantic uncertainty, and uses quantum relative entropy and conditional quantum entropy to quantify the semantic relationship existing between texts. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Next, the features, advantages, and technical effects of the exemplary embodiments of the present invention will be described with reference to the drawings.

[0035] Figure 1 is the architecture diagram of the humor feature calculation based on quantum entropy of the present invention.

[0036] Figure 2 It is the implicative comparison diagram under different distributions of the present invention.

[0037] Figure 3 It is the conditional uncertainty comparison diagram under different distributions of the present invention.

[0038] Figure 4 It is the histogram of the feature ratio distribution of the SemEval 2021 Task 7 dataset of the present invention.

[0039] Figure 5 It is the histogram of the feature ratio distribution of the CDHR dataset of the present invention. Detailed implementation manners

[0040] The following will further elaborate on the present invention in conjunction with the attached Figures 1 to 5 drawings, but it shall not be construed as a limitation to the present invention.

[0041] To solve the problem of extracting interpretable humor features, the present invention will model the text representation by means of the mathematical frameworks of the humor incongruity theory and the quantum theory, and use quantum entropy as the humor feature. The humor feature extraction method includes the text representation of the density matrix and the quantum entropy feature extraction based on the density matrix. Among them, the text representation of the density matrix is used to model the semantic uncertainty, and the quantum entropy is used as the feature for humor recognition. The present invention proposes a total of three humor features: uncertainty, implicativeness, and conditional uncertainty. Among them, uncertainty is used to describe the semantic uncertainty degree of the "setup" sentence and the "punchline" sentence. Implicativeness is used to describe the implicative degree between the semantics of the "setup" sentence and the "punchline" sentence. Conditional uncertainty is used to describe the conditional relationship between the semantics of the "setup" sentence and the "punchline" sentence, that is, to describe the uncertainty degree of another text under the condition that the semantics of a piece of text is given.

[0042] The incongruity theory believes that humor is generated due to the violation of expectations. Usually, the "setup" sentence carries more than two semantics, intentionally leading the reader to one of the semantics, while the "punchline" sentence leads the reader to other semantics of the "setup" sentence, thus violating the reader's expectations and generating humor. To implement the idea of the incongruity theory, it is required that the text modeling needs to express multiple uncertain semantics, and the relationship between texts is quantifiable. Based on this fact, the present invention uses the density matrix to represent the semantic uncertainty of the "setup" sentence and the "punchline" sentence respectively, uses quantum entropy to quantify its semantic uncertainty, and uses quantum relative entropy and conditional quantum entropy to quantify the semantic relationship existing between texts. The overall architecture of the present invention is as Figure 1 shown, which can be mainly divided into two parts: text representation (density matrix) and humor feature calculation.

[0043] The text representation method of the present invention is as follows:

[0044] Based on the incongruity theory, the present invention divides the text into two parts: the "setup" sentence and the "punchline" sentence. The text representation is the basis for subsequent feature calculation, and a reasonable text representation can ensure the effectiveness of subsequent features. According to the incongruity theory, it is necessary to examine the semantic differences between the "setup" sentence and the "punchline" sentence, so it is necessary to embed the "setup" sentence and the "punchline" sentence separately. The present invention embeds the "setup" sentence and the "punchline" sentence into the Hilbert space using the same representation method, and uses the Hilbert space of the real number field instead of the Hilbert space of the complex number field. Using Dirac notation, a unit vector and its transpose are represented as |u> and <u| respectively. For each word it is unitized in the following way:

[0045]

[0046] where ‖·‖ represents the L2 norm. The unitized word vector is regarded as a superposition state in the Hilbert space, and then the word is represented as a quantum elementary event |w i ><w i | in the Hilbert space.

[0047] The dependence relationship between words in a sentence s (a "setup" sentence or a "punchline" sentence) is modeled using a density matrix, and the elementary events corresponding to the words are combined with probabilities. Each sentence is represented as an n×n density matrix ρ:

[0048]

[0049] where p i represents the superposition probability. Here, average superposition is adopted according to the sentence length l s , that is, p i = 1 / l s . The values on the diagonal of the density matrix ρ s represent the superposition semantics of the sentence, and the off-diagonal values encode the dependence relationship between the semantics in a quantum way.

[0050] The three humor features based on quantum entropy proposed by the present invention are as follows:

[0051] 1) Uncertainty

[0052] The present invention obtains evidence for discriminating humor from the "setup" sentence or the "punchline" sentence respectively. The uncertainty of the "setup" sentence and the "punchline" sentence is defined as follows:

[0053] U m = -tr(ρ mln ρ m )

[0054] where \(m\in\{setup, punchline\}\), \(\rho\) m is the density matrix of the "setup" sentence or the "punchline" sentence. The uncertainty \(U\) m reflects the degree of semantic uncertainty and the amount of information in the text. A higher uncertainty means more semantic information is included. Intuitively, for humorous texts, the "setup" sentence needs to have a higher uncertainty. In contrast, the uncertainty of the "punchline" sentence is less important.

[0055] 2) Implicativity

[0056] The quantum relative entropy can represent semantic implication, and the implicativity of the "setup" sentence or the "punchline" sentence is defined as follows:

[0057] \(E\) m||n \(=\text{tr}(\rho\) m \ln\rho\) m ) - \(\text{tr}(\rho\) m \ln\rho\) n )

[0058] where \(m\in\{setup, punchline\}\), \(\rho\) m is the density matrix of the "setup" sentence or the "punchline" sentence. The implicativity reflects the distance of the semantic distribution to a certain extent. As Figure 2 (a) shows, for two distributions, the wider the sample points of the distribution, the more likely it is to contain the sample points of other distributions (just as the value of \(E\) s||p1 is larger than the value of \(E\) p1||s , and the value of \(E\) s||p2 is larger than the value of \(E\) p2||s ).

[0059] Comparing Figure 2 (a) and Figure 2 (b), the farther the distance between the two semantic distributions, the larger the implication value (just as the value of \(E\) s||p2 is larger than the value of \(E\) s||p1 , and the value of \(E\) s||p1 is larger than the value of \(E\) s||p2 ). A larger implication value means that the "punchline" sentence is more likely to break the semantic expectation of the "setup" sentence, thus generating humor.

[0060] 3) Conditional uncertainty

[0061] The conditional quantum entropy describes the probability of another distribution given a distribution. The conditional uncertainty of the "setup" sentence or the "punchline" sentence is defined as follows:

[0062] \(C\) m|n \(=U\) mn - \(U\) n \(=-\text{tr}(\rho\) m \rho\) n \ln\rho\) mρ n ) + tr(ρ n lnρ n )

[0063] where m ∈ {setup, punchline}, and ρ m is the density matrix of the "setup" sentence or the "punchline" sentence, and the symbol U represents uncertainty. As Figure 3 shown, the farther the distance between the two distributions, the greater the value of conditional uncertainty, and the more likely it is to generate humor. The present invention also believes that conditional uncertainty expresses the degree of distortion of known semantics to unknown semantics. According to the incongruity theory, the "punchline" sentence of a humorous text should have a higher semantic distortion to the "setup" sentence. Therefore, a humorous text should have a higher conditional uncertainty.

[0064] The method for extracting humorous features based on quantum entropy of the present invention includes:

[0065] Text representation of the density matrix to model semantic uncertainty; extraction of quantum entropy features based on the density matrix, using quantum entropy as features for humor recognition.

[0066] In the method for extracting humorous features based on quantum entropy according to the present invention, the humorous features include uncertainty, implicature, and conditional uncertainty. Uncertainty is used to describe the degree of semantic uncertainty of the "setup" sentence and the "punchline" sentence, implicature is used to describe the implicature degree between the semantics of the "setup" sentence and the "punchline" sentence, and conditional uncertainty is used to describe the conditional relationship between the semantics of the "setup" sentence and the "punchline" sentence.

[0067] In the method for extracting humorous features based on quantum entropy according to the present invention, the text representation of the density matrix includes:

[0068] Dividing the text into two parts, namely the "setup" sentence and the "punchline" sentence for representation;

[0069] Representing the "setup" sentence and the "punchline" sentence as density matrices in a Hilbert space.

[0070] In the method for extracting humorous features based on quantum entropy according to the present invention, the Hilbert space is a Hilbert space over the real number field.

[0071] In the method for extracting humorous features based on quantum entropy according to the present invention, uncertainty obtains evidence for judging humor from the "setup" sentence or the "punchline" sentence respectively.

[0072] In the method for extracting humorous features based on quantum entropy according to the present invention, implicature defines the implicature of the "setup" sentence or the "punchline" sentence.

[0073] In the method for extracting humorous features based on quantum entropy according to the present invention, conditional uncertainty defines the conditional uncertainty of a "setup" sentence or a "punchline" sentence.

[0074] The present invention mainly includes the following contents:

[0075] 1. Experimental setup

[0076] Due to the problem of the curse of dimensionality in one-hot encoding, the present invention chooses to use the GloVe pre-trained word vectors proposed by Pennington et al. as English word embeddings, and the Chinese word pre-trained word vectors (CWV) publicly disclosed by Li et al. as Chinese word embeddings. The word vectors remain fixed during the feature calculation process. The present invention uniformly uses a support vector machine classifier to classify the features for humor. The regularization parameter C of the classifier is 1.0, and the radial basis function kernel (RBF) with a kernel coefficient of γ = 1 / n features is used. The SemEval 2021 Task7 dataset and the CDHR dataset are used as experimental datasets for feature evaluation. Among them, there are 1526 positive samples and 1526 negative samples in the SemEval 2021 Task7 dataset, and 3208 positive samples and 3208 negative samples in the CDHR dataset. Each sample in the two datasets is split into two parts: a "setup" sentence and a "punchline" sentence. Precision, Recall, F1-score, and Accuracy are used as evaluation indicators. The experiment is carried out in the way of 10-fold cross-validation, and the results are the average values of multiple experiments.

[0077] 2. Independent feature prediction

[0078] Table 2 shows the experimental results of independent feature prediction. The features U s (uncertainty of the "setup") and C p|s (uncertainty of the "punchline" given the "setup") proposed by the present invention outperform all baseline features. This is in line with expectations. The uncertainty of the "setup" sentence is more important for humor recognition than the uncertainty of the "punchline" sentence.

[0079] The semantic similarity measure based on WordNet performs better on the Chinese dataset than on the English dataset. The performance of Uncertainty and Surprisal is better than that of the semantic similarity-based measure. In particular, in the Chinese dataset, alliteration performs better because there is no epenthesis phenomenon in Chinese pronunciation, while the epenthesis phenomenon is common in English pronunciation. This results in a more complete syllable pronunciation being retained in Chinese pronunciation, making it easier to form alliteration chains. On the contrary, English will have fewer alliteration chains due to the epenthesis phenomenon in pronunciation.

[0080] In the SemEval 2021 Task7 dataset, E p||s (The implicative relationship between "setup" and "punchline") has the lowest F1 value, which can be explained by Figure 2 E p||s usually has a smaller variance than E s||p Since datasets with smaller variances are less likely to be correctly distinguished by classifiers, the performance of E s||p is usually better than that of E p||s However, this is not always the case on Chinese datasets. A possible reason is that the semantic expressions in Chinese are less clear than those in English, which leads to an expansion of the semantic distribution and makes it difficult to distinguish the subtle differences between the two implicative features.

[0081] Conditional uncertainty C p|s is the best-performing feature on both datasets. This is not surprising because the meaning expressed by feature C p|s exactly matches the process of humor generation described in the incongruity theory. Given the semantics of the "setup" sentence, the semantic uncertainty contained in the "punchline" sentence is a good feature for judging humor.

[0082] 3. Improving the content-based classifier

[0083] To prove that the features proposed in this invention have a boosting effect on content-based classifiers, this invention conducts splicing experiments on the features and content-based classifiers. The experiments are carried out on English and Chinese datasets respectively. For the English dataset, 50-dimensional GloVe word embeddings are used as the representation of text content, and for the Chinese dataset, 300-dimensional CWV word embeddings are used as the representation of text content. The specific method is to obtain the vector representation of each word in the "setup" and "punchline" sentences using word embeddings, and then calculate the average of the word vectors of the "setup" and "punchline" sentences according to the sentence length. For each sample in the English dataset, two 50-dimensional vectors (for the "setup" and "punchline" sentences) are obtained. For each sample in the Chinese dataset, two 300-dimensional vectors are obtained. The two obtained vectors are spliced into one vector as the content representation of the sample. Then, the samples in the English dataset obtain 100-dimensional vector representations, and the samples in the Chinese dataset obtain 600-dimensional vector representations. To verify the effectiveness of the humor features of this invention, the vector representations of the two datasets are spliced with the features respectively, obtaining 101-dimensional and 601-dimensional vectors, and a support vector machine classifier is used for classification as the classification result after being boosted by the humor features.

[0084] The experimental results are shown in Table 3. Compared with the baseline features, the features proposed in this invention have a significant improvement on content-based classifiers in both English and Chinese datasets. Among them, feature U sIt has the largest improvement on both datasets, which once again shows that the uncertainty of the "setup" sentence is more important for humor recognition than that of the "punchline" sentence. When predicting with individual features, C p|s performs the best, but its combined prediction with the content-based classifier is not the best. This is because in addition to semantic content, the content-based embedding also contains certain semantic logical relationships, and C p|s does not provide additional evidence for judging humor. The experimental results in both datasets show that E p||s has better performance than E s||p , which indicates that the content-based embedding does not contain the entailment of the "punchline" by the "setup", but is very likely to contain the entailment of the "setup" by the "punchline". This results in the connection E p||s being able to obtain more effective evidence for judging humor than the connection E s||p .

[0085] 4. Feature Visualization

[0086] Figure 4 and Figure 5 are the histograms of the feature distributions of the humor features proposed by the present invention on two datasets. The horizontal axis represents the values of the features, and the vertical axis represents the ratio of the number of features with a certain value to the total number of samples. In the figure, orange represents the quantity distribution of humorous samples, and blue represents the quantity distribution of non-humorous samples. The calculation method is as follows:

[0087]

[0088] where l represents the class label, taking values of humorous or non-humorous. |l i | represents the number of samples with the label l taking the value i, and |D| represents the total number of samples in the dataset.

[0089] Figure 4 is the statistical result of the feature distribution of the SemEval 2021 Task 7 dataset, Figure 5 is the statistical result of the feature distribution of the CDHR dataset. It can be seen from the figure that for the English dataset, the distributions of features U s and C p|s are the farthest apart, and the experimental results in Table 2 also show that U s and C p|s are the best-performing features. Through the feature distribution histogram, it can be found that in the English dataset, uncertainty (U s and U p ), entailment (E s||p and E p||s ) and conditional uncertainty (C s|p and C p|s)All show opposite trends, while this opposite trend is not presented in the Chinese dataset. A possible explanation is that the semantic expression in English is clearer than that in Chinese, and the logical relationship between the previous and the following texts is stronger, resulting in the features obtained by swapping the positions of the previous and the following texts showing opposite trends.

[0090] Table 1 Statistical Information of SemEval and CDHR Humor Recognition Datasets

[0091]

[0092] Table 2 Experimental Results on SemEval and CDHR Datasets

[0093]

[0094] Table 3 Experimental Results of Feature-Enhanced Content-Based Classifiers

[0095]

[0096]

[0097] Based on the disclosure and teachings of the above specification, those skilled in the art to which the present invention pertains are also able to make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the above specific embodiments, and any obvious improvements, substitutions, or variations made by those skilled in the art based on the present invention fall within the protection scope of the present invention. In addition, although some specific terms are used in this specification, these terms are only for convenience of description and do not constitute any limitation to the present invention.

Claims

1. A method for extracting humorous features based on quantum entropy, characterized in that, Including: The textual representation of the density matrix for expressing the uncertainty of modeling semantics; Quantum entropy feature extraction based on the density matrix, using quantum entropy as a feature for humor recognition; Among them, the humor features include uncertainty, implicature, and conditional uncertainty. The uncertainty is used to describe the semantic uncertainty degree of the "setup" sentence and the "punchline" sentence. The implicature is used to describe the implicature degree between the semantics of the "setup" sentence and the "punchline" sentence. The conditional uncertainty is used to describe the conditional relationship between the semantics of the "setup" sentence and the "punchline" sentence; The textual representation of the density matrix includes: Dividing the text into two parts, namely the "setup" sentence and the "punchline" sentence for representation; Representing the "setup" sentence and the "punchline" sentence as density matrices in a Hilbert space; The formula for uncertainty is as follows: U m = -tr(ρ mln ρ m ) where \(m\in\{setup,punchline\}\), \(\rho\) m is the density matrix of the "setup" sentence or the "punchline" sentence, and the uncertainty \(U\) m reflects the degree of uncertainty and the amount of information of the text semantics; The formula for implicature is as follows: E m||n = tr(ρ m lnρ m ) - tr(ρ m lnρ n ) where m ∈ {setup, punchline}, ρ m is the density matrix of the "setup" sentence or the "punchline" sentence, and the implicitness reflects the distance of the semantic distribution; The formula for conditional uncertainty is as follows: C m|n = U mn - U n = -tr(ρ m ρ n lnρ m ρ n ) + tr(ρ n lnρ n )。 2. The method for extracting humorous features based on quantum entropy according to claim 1, wherein: The Hilbert space is the Hilbert space of the real number field.

3. The method for extracting humorous features based on quantum entropy according to claim 1, wherein: The uncertainty obtains evidence for judging humor from the "setup" sentence or the "punchline" sentence respectively.

4. The method for extracting humorous features based on quantum entropy according to claim 1, wherein: The implicature defines the implicature of the "setup" sentence or the "punchline" sentence.

5. The method for extracting humorous features based on quantum entropy according to claim 1, wherein: The conditional uncertainty defines the conditional uncertainty of the "setup" sentence or the "punchline" sentence.

Citation Information

Patent Citations

  • Unsupervised text sentiment analysis method based on quantum theory

    CN112905736A

  • Voice dialogue system using humor utterance and method thereof

    KR101410601B1