Apparatus and method for text classification
By using a text classifier with a multi-head attention module and a knowledge base, combined with a reason classifier and a knowledge base, the problem of accuracy and transparency in comment classification on social media platforms is solved, achieving more efficient automated comment judgment and user understanding.
Patent Information
- Application Number
- CN202080098622.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-05
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2040-05-05
AI Technical Summary
Existing social media platforms rely on human arbitration in comment categorization, which is inefficient for handling large volumes of comments. Furthermore, traditional computer-based text classifiers are inadequate in identifying acceptable and unacceptable comments, particularly lacking accuracy in legal and cultural understanding.
A text classifier based on a multi-head attention module and a knowledge base is employed. By identifying the context relevant to the prediction result, and combining a reason classifier and a knowledge base, the classifier predicts and provides reasons for the classification result. The most relevant input words are selected using an interpretable multi-head attention module, and the context is expanded by the knowledge base. The confidence value is calculated to determine whether human arbitration is needed.
It improves the accuracy and transparency of comment categorization, reduces human intervention, and enhances the understanding of categorization results, especially providing better judgment in terms of legal and cultural understanding.
Smart Images

Figure CN115552414B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present invention relates generally to the field of electronic devices capable of executing computer programs. More specifically, the present invention relates to an apparatus and method for text classification. BACKGROUND
[0002] Modern computers and devices with computing capabilities, such as mobile phones, cars and home appliances, are generally capable of executing third-party computer applications. Among these computer applications, there are many applications that enable different people using social media applications to interact. For example, a first person can take images of a holiday trip and then post these images using a social media platform or other similar services. The poster can also add comments to the posted images.
[0003] Typically, other users of the social media platform can also comment on the posted images and possibly the comments posted earlier. These comments are usually analyzed so that unwanted comments can be prevented from being posted. For example, the original post can include comments that contain illegal content, or the comments by other users can be impolite, offensive or violate rules set by the platform operator.
[0004] Early social media platforms relied on the use of human moderators to approve or disapprove the comments before or after they were posted. The number of these comments has increased significantly and computer-based methods have been developed. In the computer-based methods, a text classifier using a machine learning apparatus is typically employed. The text classifier based on the machine learning apparatus is trained to be able to indicate, for example, whether the analyzed comments are acceptable or not.
[0005] The text classifier is usually trained in an unsupervised manner using a very large corpus. In the present invention, unsupervised learning is used to denote a machine learning algorithm that is used to make inferences from datasets consisting of input data that do not have pre-existing labels. Unsupervised learning can be called pre-training as it is usually complemented by supervised learning. For the task of identifying acceptable and unacceptable comments, supervised learning uses input data that has been labeled by trained humans. Conventional text classifiers are able to provide correct classification results in a way that trained humans understand why the comments are classified as acceptable or unacceptable.
[0006] With the increasing amount of social media content and the like, there is a need to improve text classification. SUMMARY
[0007] Apparatuses and methods are provided for classifying text content using a text classifier to determine a class to which the text content belongs. After classification, the text classifier provides the classification result and a context related to the classification result to an explanation system. The explanation system predicts one or more reasons behind the classification result according to the classification result and the context related to the classification result. With the reasons known, the classification result is easier to understand and users of social media services or similar services can better understand why their comments or other text content were rejected.
[0008] The above and other objects are achieved by the subject-matter claimed by the independent claims. Further implementations are evident from the dependent claims, the description and the drawings.
[0009] In a first aspect, a method for determining text classification reasons is disclosed. The method comprises receiving a text input to be classified; predicting a class of the text input using a text classifier; extracting a context related to the prediction result; determining one or more reasons for the prediction result according to the extracted context; providing the prediction result and the determined one or more reasons as a classification result.
[0010] Advantageously, the text classification reasons can be determined so that a user obtaining the classification result can understand why the classification was done. This can be achieved by identifying the context related to the decision from the received input and predicting the actual reasons for the classification according to the related context. This also improves the user experience as the user trusts the automatic decision. Furthermore, human arbiters are able to provide better informed decisions. The reasons facilitate culture-specific arbitration and can also better take into account legal issues related to arbitration of specific content.
[0011] In a first implementation of the first aspect, extracting the context related to the prediction result comprises identifying the context related to the prediction result, wherein the identifying comprises selecting the most relevant input words to the prediction using an interpretable multi-head attention module. Using a multi-head attention module is advantageous as the multi-head attention module can focus on multiple inputs and select the most relevant ones.
[0012] In a second implementation of the first aspect, determining the one or more reasons for the prediction result comprises determining the one or more reasons for the prediction result from the identified context using a machine learning apparatus and further predicting the classification reasons using a reason classifier and a knowledge base. Using a knowledge base is advantageous as it can be used to fine-tune the reasons, especially in case of uncertainty in determining the reasons. This improves the correctness of the reasoning and thus reduces the need for human intervention.
[0013] In a third implementation form of the first aspect, predicting the classification reason comprises extending the identified context using a knowledge base, wherein the knowledge base comprises semantic relations of words. Extending the identified context is advantageous in that the correct reason can be determined more easily from the extended identified context. When the determination is based on a larger group of words having semantic relations, this increases the correctness of the reason determination.
[0014] In a fourth implementation form of the first aspect, the method further comprises calculating a value representing a confidence of the predicted result and the determined one or more reasons. Calculating a value or coefficient representing a confidence of the prediction is advantageous. This facilitates determining whether the knowledge base or a human arbiter needs to be utilized. This increases the correctness of the decision and reduces the need for manual work.
[0015] In a fifth implementation form of the first aspect, the method further comprises comparing the calculated value with a threshold value, and forwarding the text input, the predicted result and the one or more reasons to a system operator when the calculated value is below the threshold value. Determining a threshold value for the calculated value representing a confidence is advantageous in that it enables easy determination of whether a fine-tuning or a review of the determined reasons is necessary.
[0016] In a sixth implementation form of the first aspect, the method further comprises generating an explanation from the one or more reasons. Providing an explanation to the user instead of one or more reasons is advantageous in that the aim is to improve the understanding of the classification result.
[0017] In a seventh implementation form of the first aspect, the text classifier is a language representation based neural network. Using a language representation based neural network is advantageous in that the neural network enables efficient text classification.
[0018] In a second aspect, a computer program comprising computer program code is disclosed, which when executed in a computing device, the computer program code is configured to perform the above method. Using a computer program to achieve the above advantages and technical effects is advantageous.
[0019] In a third aspect, an apparatus for determining a text classification reason is disclosed, the apparatus comprising processing circuitry configured to: receive a text input to be classified; predict a class of the text input using a text classifier; extract a context related to the predicted result; determine one or more reasons for the predicted result from the extracted context; provide the predicted result and the determined one or more reasons as a classification result.
[0020] Advantageously, the text classification reason can be determined such that a user obtaining the classification result can understand the reason for the classification being done. This can be achieved by identifying the context relevant to the decision from the received input and predicting the actual reason for the classification from the relevant context.
[0021] In a first implementation form of the third aspect, when extracting the context relevant to the prediction result, the processing circuitry is configured to identify the context relevant to the prediction result, wherein the identifying comprises selecting the most relevant input words to the prediction using an interpretable multi-head attention module. Using a multi-head attention module is advantageous because the multi-head attention module can focus on multiple inputs and select the most relevant inputs.
[0022] In a second implementation form of the third aspect, the processing circuitry is further configured to determine one or more reasons for the prediction result by determining one or more reasons for the prediction result from the identified context using a machine learning device and further predicting the classification reason using a reason classifier and a knowledge base. Using a knowledge base is advantageous because it can be used to fine-tune the reasons, especially in cases where the determination of the reason is unsure. This increases the correctness of the reasoning and thus reduces the need for human intervention.
[0023] In a third implementation form of the third aspect, the processing circuitry is further configured to expand the identified context using a knowledge base, wherein the knowledge base comprises semantic relationships of words. Expanding the identified context is advantageous because the correct reason can be more easily determined from the expanded identified context. This increases the correctness of the reason determination when the determination is based on a larger group of words having semantic relationships.
[0024] In a fourth implementation form of the third aspect, the processing circuitry is further configured to calculate a value representing a confidence of the prediction result and the determined one or more reasons. Calculating a value or coefficient representing a confidence of the prediction is advantageous. This helps to determine whether the knowledge base or a human arbiter needs to be utilized. This increases the correctness of the decision and reduces the need for manual work.
[0025] In a fifth implementation form of the third aspect, the processing circuitry is further configured to compare the calculated value with a threshold value and, when the calculated value is lower than the threshold value, forward the text input, the prediction result, and the one or more reasons to a system operator. Determining a threshold value for the calculated value representing a confidence is advantageous, which makes it easy to determine whether the determination of the reason has to be fine-tuned or reviewed.
[0026] In a sixth implementation form of the third aspect, the processing circuitry is further configured to generate an explanation based on the one or more reasons. Providing an explanation to the user instead of the one or more reasons is advantageous as the purpose is to improve the understanding of the classification result.
[0027] The principles discussed in this disclosure can be implemented in hardware and / or software. BRIEF DESCRIPTION OF DRAWINGS
[0028] Other exemplary embodiments will be described in conjunction with the following figures, in which:
[0029] Figure 1 An example of a block diagram of an apparatus for determining text classification reasons is shown;
[0030] Figure 2 An example of signaling of a neural network based classifier is shown;
[0031] Figure 3 A detailed example of a reason ontology is shown.
[0032] In the following drawings, like reference numerals will be used to refer to like or at least functionally equivalent features throughout the various drawings. DETAILED DESCRIPTION
[0033] The following detailed description illustrates by way of example certain aspects of the disclosure without attempting to limit the application to any one or more particular aspects described. The detailed description is intended for the purpose of illustration only and is not intended to limit the scope of the application. Other aspects, features, and advantages of the application will become apparent upon reading the detailed description.
[0034] It is to be understood that the disclosure in relation to the described methods also applies to devices or systems corresponding to the methods for performing the methods, and vice versa. For example, if a particular method step is described, a corresponding device can comprise a unit performing the described method step, even if such a unit is not explicitly described or shown in the drawings. Further, it is to be understood that features of the various exemplary aspects described herein can be combined with each other, unless explicitly stated otherwise.
[0035] In the following description, detailed and very specific examples are given. These examples should be understood as a description of one possible way of implementing text classification. In these examples, a machine learning based text data classifier is a model that takes text as input and predicts one or more classes as output. The model is learned by a machine by analyzing many examples of text belonging to different classes that we want to predict.
[0036] The classifier represents the text in a numerical way in order to process the text. There are different types of text representation. Below are two examples of text representation:
[0037] A) Bag-of-words representation: The text is represented by the frequency of the words it contains. In the model, only the words in a given dictionary are considered. For example, "this is a text" would be represented as [1, 1, 0], where each position counts the frequency of the words [this, text, cat], respectively, [this, text, cat] being the given dictionary.
[0038] B) Term frequency - inverse document frequency representation: The text is represented by the frequency of the words it contains, like in the bag-of-words model. However, the frequency of common words is penalized. For example, "this is a text" would be represented as [1, 0.01, 0] according to the dictionary [this, text, cat], "the" being a very common word and thus penalized. Other text representations can be used even if the two text representations are specifically mentioned.
[0039] Thus, there are different classifiers based on machine learning that can be used. Some examples are given below:
[0040] A) Neural network: The class is predicted by a network of interconnected neurons. A neuron is a unit that performs a mathematical operation. The neurons in a neural network are organized in a hierarchical manner. The numerical representation fed to the network is processed by the neurons to predict the class.
[0041] B) Decision tree: The class is predicted by iteratively answering questions about the input data according to a model that resembles a flowchart.
[0042] C) Decision forest: The predicted class is obtained by majority voting according to the predictions of multiple independent decision trees.
[0043] D) k-Nearest neighbors: The input text is classified according to the k most similar text examples. The underlying principle is that similar examples should belong to the same class.
[0044] E) Support vector machine: The class is predicted by identifying which part of a hyperdimensional space defined by the text representation the input text belongs to. A support vector machine is a mathematical method that partitions the hyperdimensional space for different classes.
[0045] F) Naive Bayes: These types of classifiers are probabilistic classifiers based on Bayes' rule. In the examples below, a neural network-based classifier is used for text classification and reason classification, however, any other classifier mentioned above or similar to them can be used.
[0046] Figure 1 Examples of apparatus for determining text classification reasons are disclosed. In Figure 1In the example of a social media platform, the client device 100 is used to provide a text input to be classified. A common example of providing a text input for classification is posting a comment on a social media platform; however, the text input can be classified for any other purpose. The analysis can be performed to verify whether the comment is suitable for posting; however, Figure 1 The example of a social media platform is not limited to social media. Figure 1 The example can be used for various classifications that require a classification justification. For example, the exemplary apparatus can be used to classify scientific texts into different classes or subclasses. The reasoning behind the classification can be useful, especially when the classes are similar to each other. In this case, it is advantageous to understand why a particular class was chosen.
[0047] In the example of a social media platform, the client device 100 is used to provide a text input to be classified. A common example of providing a text input for classification is posting a comment on a social media platform; however, the text input can be classified for any other purpose. The analysis can be performed to verify whether the comment is suitable for posting; however, Figure 1 The client device 100 used in the example of a social media platform can be a mobile device, such as a phone, a tablet or other portable device, or a normal computer comprising a processor, at least one memory and a network connection. A person providing a comment on a social media platform uses a device comprising a suitable application or provides another interface to the social media platform. The user of the client device can provide the input in the form of a written comment or using voice commands, so that the device generates a text input. The client device 100 is connected to the Internet using a local area network, a mobile network or any other suitable network connection that can be used to provide access to the social media platform.
[0048] The text input is received at a server 110 that provides text classification. The server 110 comprises circuitry capable of executing computer programs and storing related data. The circuitry can comprise one or more processors and one or more memories. The server 110 can be a part of the social media platform or a separate service that receives the text input from the social media platform. For the sake of clarity, the server 110 is described in the example of a social media platform. Figure 1 In the example of a social media platform, the text input is provided from the client device 100 to the server 110. The server can be a specialized server for the text classifier or a normal server shared with different functions. A logical server, a part of a server cluster or a cloud can be used instead of a physical server. In the example of a social media platform, the server is a part of the social media platform. Figure 1 In the example of a social media platform, the server comprises a neural network that has been trained using unsupervised training providing unlabelled data 120 and supervised training providing labelled data 130. The unsupervised training is typically performed using a large set containing words in order to learn a language representation. The unsupervised training can be performed only once or repeatedly. The supervised training is typically performed on a smaller set containing data that has been labelled by a professional human labeller. The process is typically modified continuously. Thus, when a professional human labeller reviews a comment, it can confirm the classification or make a correction. The confirmation and / or correction can be fed back to the neural network as feedback. Thus, the classification result is continuously improved.
[0049] InFigure 1 In the example, text classification is based on a deep language model. A deep language model is a stack of layers based on multi-head attention modules. This model can collectively focus on information from different inputs through multi-head attention. The multi-head attention module selects the input most relevant to the current task. Based on the input sentence, the model learns the inputs it needs to focus on, and thus, the multi-head attention module learns which words are relevant to the current task. The deep language model assigns each word H to a weight from the attention heads to the prediction. w The importance of multi-head attention is identified by a normalized set. H w It is a vector, where, according to the attention mechanism, each position represents the importance of each word.
[0050] exist Figure 1 In the example, server 110 employs an adversarial approach to filter important keywords. The server acts as the adversary, removing each word from the sentence and calculating the predicted probability p of the sentence when word w is removed. w Given the predicted probability p of the entire sentence s The server will send each word A w The significance of the confrontation is indicated by:
[0051] I w =p s -p w
[0052] A w =I w / ∑I j
[0053] Where j = 1 to n, that is, the total number of words in the sentence.
[0054] Finally, a gradient-based filter D for identifying important words is introduced. w D w Defined as the normalized gradient for each word used in the prediction:
[0055] d w =dL / dw
[0056] D w =d w / ∑d j
[0057] Where j = 1 to n, that is, the total number of words in the sentence.
[0058] Then, server 110 extracts the context of the text as the most predictive words, and these most predictive words form a total set: set (A w H w D w), denoted as Feature Extraction FE. This set is represented as a weighted average of the components: alpha A A w + alpha H H w + alpha D D w These words form the context C of the classification and are sent to the explanation system 140 to infer the classification reason. Thus, the context C is the context relevant to the classification result and is extracted after being identified as relevant to the classification result.
[0059] The explanation system 140 includes a reason classifier 160 and a knowledge base 150. The reason classifier 160 is a machine learning based classifier. In the example case, it is a multi-class classifier based on a deep neural network. The neural network is trained on labeled data of multiple reasons to predict the probability of classifying the text for each of the multiple reasons. The reason classifier 160 uses the context C of the classification instead of the entire text for reason identification. Traditionally, a text classifier predicts a target class: for example, appropriate / inappropriate class. In the example case, the text classifier 115 also identifies the context responsible for the prediction, which is then used by the reason classifier 160. Using the context for prediction has the advantage that it helps the reason classifier 160 to focus on the parts of the text that are relevant to the original classification. For texts longer than a few words, this brings the substantial advantage of reducing the need for large labeled data sources for training the reason classifier 160. Figure 1 Figure 1 The explanation system 140 can use the knowledge base 150 to expand the context C that is identified as relevant to the classification result. The expansion can include generating supplementary context using synonyms of the used words and the like. For example, if a review written by a user is “This text is dumb”, it can be classified as inappropriate. In this case, the relevant context C is likely to be the word “dumb”. Expanding it can provide synonyms or words of similar meaning “idiotic”, “stupid”, or “moronic”. By expanding the context, the reason can be determined from a larger set of words of similar meaning. The expansion does not necessarily include all possible synonyms, but can be limited to those that are most commonly used in ways that are considered inappropriate. For example, these ways include using offensive and insulting words, while more polite ways of expressing the same meaning can be considered appropriate.
[0060]
[0061] Figure 1 The example shown, the reason classifier 160, is trained using partially labeled data from a knowledge base 150. This data comprises a graph of words (nodes) linked together (edges) with NR reason tags, where NR is the number of possible reasons for the explanation. NR reason tags are only available for certain nodes. The graph of words is constructed using semantic relationships between words, such as synonyms, antonyms, hypernyms, and hyponyms from the comprehensive knowledge base 150. Each node in the graph is also associated with a word embedding that encodes additional information about each node.
[0062] The reason classifier 160 is then defined as a graph convolutional neural network (GCN), which learns to predict outcomes based on the input graph. Given a graph G, the reason classifier GCN takes the word embeddings of each node as input, summarized as an N x S matrix W, and the links in the graph structure as an N x N adjacency matrix A. N is the number of nodes in the graph, and S is the size of the embeddings. The output of the reason classifier 160 GCN is then represented as an N x NR matrix of reasons: O = GCN(W, A). Given a context C, the interpretation system E then identifies the key reasons used for prediction as R = E(C), where E(C) = predict.GCN(W, A, C).
[0063] Finally, given a new text X, the text classifier 115 predicts the text class y = M(X). Then, the method identifies the most important word used for classification as the context C = FE(M, X, y). The explanation system then uses the context to predict the reason R = E(C).
[0064] Another challenge faced by traditional methods is the availability of labeled training data for synthesizing ontology. The data is either insufficient or simply unavailable. Figure 1 The example overcomes this challenge by using Knowledge Base 150 for deeper context-driven classification. Knowledge Base 150 is constructed as a graph that predicts possible reasons through rich textual context. Figure 1 The exemplary device, by combining a knowledge base 150 and a reason classifier 160, can achieve a better understanding of the input text and identify the reasons R used for classification decisions.
[0065] Figure 1 The diagram shows the accumulated reasons from the explanation system and the predictions from the text classifier 115. If necessary, the classification and reasons are reviewed by a human arbitrator 170. Otherwise, an automatic arbitration decision is made. Feedback from the arbitrator is sent back to the text classifier 115 and the explanation system 140 to improve their prediction accuracy.
[0066] Figure 2 An example of signaling based on a neural network classifier is shown. This signaling can be applied to... Figure 1 In similar devices, however, they do not need to be exactly the same. The device is sufficient to determine the rationale for classification and to perform the classification. Figure 2 In the example, user 200 is communicating with social media service 210. For example, user 200 may send a comment related to an image posted by another user. Social media service 210 provides the received comments to text classifier 220, which works in conjunction with interpretation service 230 and arbitrator 240. The signaling in the example is illustrated below.
[0067] exist Figure 2 In the example, user 200 submits text content to a social media service. In alternative embodiments, the content could be speech or graphics in the form of audio. The principles described below can also be applied to different types of input, but classification is required, such as classifying between appropriate and inappropriate, and a rationale for the classification decision must be provided. Thus, speech can be recognized and converted into text, and image content can be recognized using appropriate algorithms.
[0068] exist Figure 2 In the example, social media service 210 provides text received from users to text classifier 220. Text classifier 220 is a machine learning-based entity that has been trained using both unsupervised and supervised learning (253). Unsupervised learning is typically used to train machine learning-based entities because it improves the quality of predictions. However, this is optional and is usually performed before text classifier 220 is used in production. Training also continues when text classifier 220 is used to classify text content provided by users (253). Training during production use is based on supervised training, where a person trained to evaluate text content determines whether text classifier 220 has made a correct classification decision.
[0069] When the text classifier receives text content, it first predicts whether the text content belongs to the appropriate or inappropriate class. The text classifier also determines the confidence coefficient α. The text classifier also identifies which part of the text content is relevant to making the judgment, extracts that part, and then provides the interpretation service 230 with the classification judgment and the relevant text content (i.e., context).
[0070] The text classifier 220 is accordingly used to train the explanation service 230 (254). The training can include supervised and unsupervised training, and when the text classifier 220 is used to classify text content from actual users, the training continues in a supervised manner. The explanation service predicts (258) the reasons for the classification result from the received context, and determines a confidence coefficient β. If β shows low confidence, the knowledge base can be used to fine-tune (259) the prediction result. The reasons and β are then sent to the automatic arbitration phase 260.
[0071] The confidence coefficients α and β determine whether the received text content can be automatically arbitrated. If the above coefficients show low values, the classification result and reasons are sent to the arbitration assistant phase 270. If the confidence coefficients α and β show high confidence, the classification result is returned (261) to the social media service 210 together with the determined reasons. There can be one or more reasons. If the text content is classified as inappropriate, the reasons are provided (263) to the user 200. If the text content is classified as appropriate, the text content is displayed (262) to all users of the social media service 210 according to the user's desired access rights. Thus, the visibility of the comment can be limited if the user has decided to show the comment to their contacts, e.g. friends or friends of friends.
[0072] If the confidence coefficients show low confidence, the classification result and reasons are sent (271) to the arbitrator 240. The arbitrator 240 evaluates (272) the classification and reasons sent back to the social media service 210. The decision made by the arbitrator 240 is sent as feedback (273, 274) to the explanation service 230 and the text classifier 220. The feedback can confirm whether the classification result is correct or incorrect. Thus, it is confirmed whether the reasons are correct or incorrect. The social media service 210 is then run as in the automatic arbitration mode, and either the appropriate content is displayed (275) or at least one reason is sent (276) to the user, explaining why the content was classified as inappropriate.
[0073] Figure 3 Examples of the reason ontology are shown. The requirements for the ontology vary according to the service and the country / region in which the ontology is used. In Figure 3 One example relating to private information is explained in more detail. The text content 300 is first classified into an appropriate class 301 or an inappropriate class 302. These reasons are typically limited only to the needs of inappropriate classification; however, in some applications, it can be advantageous to know why the text input was classified as appropriate input. In Figure 3In the example of inappropriate classes, the inappropriate classes are then divided into categories, such as private information 303. The justification classifier then determines whether the classification result is based on the presence of private information. For example, it can be inappropriate to use information such as a phone number, an email address, or even a name when it is assumed that these should not be published in a review. In some cases, the determination is not easy, as it is not easy to distinguish between private information and public information. In some countries / regions, it can be prohibited to disclose any information about minors. Thus, if the justification classifier determines that this information is considered private information, it can give a further explanation by choosing between such private (304) information and information relating to minors (305). Thus, similar classification and more detailed explanations can be given for illegal, offensive, advertising, violent, culturally conflicting, and fake text contexts. Figure 3 The examples shown in the above are not exhaustive, and there can be more categories and justifications, depending on geographical restrictions or simply because the social media service operator wants to have specific justifications available.
[0074] As mentioned above, the above-described apparatus using positioning can be implemented by hardware such as a mobile phone, a tablet computer, a computer, a telecommunication network base station, or any other network-connected device, or as a method. The method can be implemented as a computer program. The computer program is then executed in a computing device.
[0075] The apparatus, such as an apparatus for text classification, is configured to perform one of the above-described methods. The apparatus comprises the necessary hardware components. These can include at least one processor, at least one memory, at least one network connection, a bus, and the like. The memory or the processor can be shared with other components, for example, or accessed from a cloud service, a centralized computing unit, or other resources available via a network connection, instead of a dedicated hardware component.
[0076] The apparatus and the corresponding method for text classification have been described in connection with the embodiments disclosed herein. However, persons skilled in the art will readily recognize that other variations of the disclosed embodiments can be understood and effected by a skilled person, depending on the study of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the indefinite article "a" or "an" does not exclude a plurality. A single processor or other unit can fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. A computer program can be stored / distributed on a suitable medium, such as an optical storage medium or a solid-state storage medium supplied together with or as part of other hardware, but also distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems.
Claims
1. A method for determining a text classification rationale, characterized in that, The method comprises: receiving a text input to be classified; predicting a class of the text input using a text classifier, resulting in a prediction result, the prediction result indicating that the text input is appropriate or inappropriate; extracting a context related to the prediction result, the context comprising words in the text input; determining one or more reasons for the prediction result from the extracted context; providing the prediction result and the determined one or more reasons as a classification result; the extracting the context related to the prediction result comprises using the text classifier to identify the context related to the prediction result; the determining the one or more reasons for the prediction result comprises using a reason classifier to determine the one or more reasons for the prediction result from the identified context, the reason classifier using a graph training of NRreasons-labeled linked words, the graph of words being constructed using semantic relations of words, NRbeing used to indicate a number of reasons.
2. The method of claim 1, wherein, the identifying comprises using an interpretable multi-head attention module to select input words most relevant to the prediction.
3. The method of claim 2, wherein, the determining the one or more reasons for the prediction result from the identified context using a reason classifier comprises using a reason classifier and a knowledge base to predict the one or more reasons for the prediction result from the identified context.
4. The method of claim 3, wherein, the one or more reasons for the prediction result further comprise extending the identified context using a knowledge base, wherein the knowledge base comprises semantic relations of words.
5. The method according to any one of claims 1 to 4, characterized in that, further comprising: computing a value representing a confidence of the prediction result and the determined one or more reasons.
6. The method of claim 5, wherein, further comprising: comparing the computed value to a threshold value, and when the computed value is below the threshold value, forwarding the text input, the prediction result, and the one or more reasons to a system operator.
7. The method according to any one of claims 1 to 4, 6, characterized in that, further comprising: generating an explanation from the one or more reasons.
8. The method according to any one of claims 1 to 4, 6, characterized in that, the text classifier is a neural network based on a language representation.
9. A computer program product comprising computer program code, characterised in that, the computer program code, when executed in a computing device, is for performing the method according to any one of claims 1 to 8.
10. An apparatus for determining the rationale for text classification, characterized in that, the apparatus comprises processing circuitry for: receiving a text input to be classified; predicting a class of the text input using a text classifier, resulting in a prediction result, the prediction result indicating that the text input is appropriate or inappropriate; extracting a context related to the prediction result, the context comprising words in the text input; determining one or more reasons for the prediction result from the extracted context; providing the prediction result and the determined one or more reasons as a classification result; when extracting the context related to the prediction result, the processing circuitry is for using the text classifier to identify the context related to the prediction result; The processing circuitry is to determine one or more reasons for the prediction result by determining one or more reasons for the prediction result from the identified context using a reason classifier, the reason classifier using graph training of NRreasons-labeled linked-together words, the graph of words constructed using semantic relationships of words, NRbeing to indicate a number of reasons.
11. The apparatus of claim 10, wherein, The identifying includes using an interpretable multi-headed attention module to select input words most relevant to the prediction.
12. The apparatus of claim 11, wherein, The processing circuitry determining one or more reasons for the prediction result from the identified context using a reason classifier includes predicting one or more reasons for the prediction result from the identified context using a reason classifier and a knowledge base.
13. The apparatus of claim 11 or 12, wherein, The processing circuitry is further to expand the identified context using a knowledge base, wherein the knowledge base includes semantic relationships of words.
14. The apparatus of any one of claims 10-12, wherein, The processing circuitry is further to compute a value representing a confidence of the prediction result and the determined one or more reasons.
15. The apparatus of claim 14, wherein, At least one of the processing circuitries is further to compare the computed value to a threshold value, and when the computed value is below the threshold value, to forward the text input, the prediction result, and the one or more reasons to a system operator.
16. The apparatus of any one of claims 10-12, 15, wherein, The processing circuitry is further to generate an explanation from the one or more reasons.
Citation Information
Patent Citations
Methods, apparatus, and systems for transforming unstructured natural language information into structured computer- processable data
WO2019050968A1
Combined methods and systems for online media content
WO2019175571A1