MODEL-AGNOSTIC VISUALIZATIONS USING LINEAR PROGRAMMING APPROXIMATION
20210358478 · 2021-11-18
Inventors
- Abhinav Aggarwal (Albuquerque, NM, US)
- Ian Roy Beaver (Spokane, WA, US)
- Cynthia Freeman (Albuquerque, NM, US)
- Jonathan Patrick Merriman (Spokane, WA, US)
Cpc classification
G10L15/22
PHYSICS
G06N5/01
PHYSICS
G10L2015/0635
PHYSICS
International classification
G10L15/06
PHYSICS
Abstract
A method of determining influence of language elements in script to an overall classification of the script by perturbing the dataset representing a conversation. In some instances, for example, in the conversation, the language elements and turns within the conversation (e.g., in a chat bot) are analyzed for their influence in escalation or non-escalation of the conversation to a higher level of resolution, e.g., to a human representative or manager.
Claims
1. A method of visually presenting a representation of the effect of language elements on outcome of a conversation between a user and a virtual assistant, the method comprising: creating a set of perturbations to be applied to data representing a set of textual language elements in a conversation between a user and a virtual assistant; applying the set of perturbations to the data; formulating at least one linear programming approximation using results from the perturbations and solving the at least one linear programming approximations to generate a solution; creating and displaying a visual presentation based on the solutions, whereby visual aspects of the visual presentation represent relative possibility that one of the perturbations will change a classification of the conversation, the possibility based on the solutions.
2. The method of claim 1, further comprising: training a language model according to the perturbations.
3. The method of claim 1, wherein the conversation has a plurality of dialogue turns, the method further comprising: determining a significance of turns in the conversation according to a probability that any of the language elements in one of said turns will result in escalation of the conversation from the virtual assistant to a customer service agent based on the solutions.
4. The method of claim 3, further comprising: finding a weight value for each dialogue turn such that, for each perturbation, the LPA takes the weights into account to approximate the classification of the conversation.
5. The method of claim 1, wherein the visual representation comprises a visual scale indicative of the importance of the textual language elements to the classifier outcome, the visual scale comprising a color indicator, wherein color and intensity of the color indicator reflects relative importance of the classifier outcome for each of the textual language elements
6. The method of claim 1, wherein the visual representation takes into account relative weights of each perturbation.
7. One or more non-transitory computer-readable storage media storing computer-readable instructions that, when execute, instruct one or more processors to perform operations, comprising: creating a set of perturbations to be applied to data representing a set of textual language elements in a conversation between a user and a virtual assistant; applying the set of perturbations to the data; formulating at least one linear programming approximation using results from the perturbations and solving the at least one linear programming approximations to generate a solution; creating and displaying a visual presentation based on the solutions, whereby visual aspects of the visual presentation represent relative possibility that one of the perturbations will change a classification of the conversation, the possibility based on the solutions.
8. The one or more non-transitory computer-readable storage media of claim 7, the operations further comprising: training a language model according to the perturbations.
9. The one or more non-transitory computer-readable storage media of claim 7, wherein the conversation has a plurality of dialogue turns, the method further comprising: determining a significance of turns in the conversation according to a probability that any of the language elements in one of said turns will result in escalation of the conversation from the virtual assistant to a customer service agent based on the solutions.
10. The one or more non-transitory computer-readable storage media of claim 9, the operations further comprising: finding a weight value for each dialogue turn such that, for each perturbation, the LPA takes the weights into account to approximate the classification of the conversation.
11. The one or more non-transitory computer-readable storage media of claim 7, wherein the visual representation comprises a visual scale indicative of the importance of the textual language elements to the classifier outcome, the visual scale comprising a color indicator, wherein color and intensity of the color indicator reflects relative importance of the classifier outcome for each of the textual language elements
12. The one or more non-transitory computer-readable storage media of claim 7, wherein the visual representation takes into account relative weights of each perturbation.
13. A method of identifying effect of language elements on outcome of a conversation between a user and a virtual assistant, the method comprising, comprising: removing data representing a textual language element from a conversation dataset representing a conversation between a user and a virtual assistant to produce a perturbed dataset, the conversation having a plurality of dialogue turns and having a classification before removing the data; applying a classifier to the perturbed dataset; and upon determining that the perturbed dataset has a different classification than the conversation dataset, reporting that the textual language element represented by the removed data is important to outcome of applying the classifier.
14. The method of claim 13, the steps further comprising: training a language model for use in an interactive virtual assistant based on textual language elements reported to be important.
15. The method of claim 13, the steps further comprising: displaying on a graphical user interface a visual scale indicative of the importance of the textual language elements represented by the removed data to outcome of applying the classifier.
16. The method of claim 15, the steps further comprising the visual scale comprising a color indicator, wherein color and intensity of the color indicator reflects relative importance of the classifier outcome for each of the textual language elements.
17. A non-transitory computer-readable storage media having stored therein software executable to perform steps, comprising: removing data representing a textual language element from a conversation dataset representing a conversation between a user and a virtual assistant to produce a perturbed dataset, the conversation having a plurality of dialogue turns and having a classification before removing the data; applying a classifier to the perturbed dataset; and upon determining that the perturbed dataset has a different classification than the conversation dataset, reporting that the textual language element represented by the removed data is important to outcome of applying the classifier.
18. The non-transitory computer-readable storage media of claim 17, the steps further comprising: training a language model for use in an interactive virtual assistant based on textual language elements reported to be important.
19. The non-transitory computer-readable storage media of claim 17, the steps further comprising: displaying on a graphical user interface a visual scale indicative of the importance of the textual language elements represented by the removed data to outcome of applying the classifier.
20. The non-transitory computer-readable storage media of claim 19, the steps further comprising the visual scale comprising a color indicator, wherein color and intensity of the color indicator reflects relative importance of the classifier outcome for each of the textual language elements.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying figures, which are incorporated herein and form part of the specification, illustrate model-agnostic visualization using linear programming approximation. Together with the description, the figures further serve to explain the principles of the model-agnostic visualization using linear programming approximation described herein and thereby enable a person skilled in the pertinent art to make and use the model-agnostic visualization using linear programming approximation.
[0012]
[0013]
[0014]
DETAILED DESCRIPTION
[0015] Reference will now be made in detail to embodiments of the model-agnostic visualization using linear programming approximation.
[0016] Described herein is a new method to visualize the decisions of any classifier. Such visualizations can help build trust in the classifier and serve as a check on the biases of the data used. By carefully perturbing the input, classifier prediction probabilities are explained by creating multiple linear programming approximations (LPAs). The solutions of these LPAs determine the importance of textual elements (such as sentences in a document or turns in a conversation) pertaining to the classification task at hand. A metric that measures how faithful the visualization methodology is to the classifier is provided to illustrate how closely the visualization technique approximates the behavior of the classifier.
[0017] A method for visualizing a classifier's decisions using a linear programming approximation (LPA) approach is provided. Given a textual input, the classifier returns a prediction probability for the class. By perturbing the textual input, the importance of certain elements of the text can be determined by analyzing how much the prediction probabilities vary. For example, suppose a classifier is trained to determine if a movie review is positive or negative. The review can be perturbed (by removing one or more sentences) and seeing how probabilities for the classes of positive or negative review change. If a sentence such as “I hate this movie” is removed from the review, and the prediction probability for a negative review drastically drops, it can be determined that the influence of that particular sentence is great. The sentences 110 of the review 120 could then be highlighted by color intensity for their importances 130 in the classifier's decision, as illustrated in
[0018] Such sentiment analysis provides an illustration of which phrases, clauses or sentences lead to the outcome, e.g., positive or negative. Phrases, clauses or sentences, e.g., sentiment analysis, are not the only delineation.
[0019] As another example, suppose a classifier is trained to determine if and when a conversation between a user and a chatbot should be escalated. An escalation occurs when the user is transferred to a human representative because the conversation between the user and the chatbot is failing to progress. In this case, the conversation can be perturbed to determine the importances of user turns in the conversation, instead of, e.g., sentences. Another interesting feature of conversational data is the presence of repetitions in user text. If a user repeats his request multiple times in a conversation, the chances for escalation should intuitively increase as the conversation is obviously not progressing. Thus, each repeated turn should increase in importance. However, if the visualization scheme treats each sample as independent, this information will be lost. Therefore, a visualization method that will highlight the samples most influential to the model in sequential data as well as not assuming independence of samples is desirable.
[0020] In addition to the visualization technique, provided is a measure of how accurately these visualizations are portraying the classifier's decisions. It is not only helpful to create visualizations, but also visualizations that are faithful to the classifier. If a visualization is not faithfully representing the classifier, this will not help in the task of building trust in the classifier. Thus, the present disclosure also considers a faithfulness metric and discusses how to calculate this value for every visualization created.
[0021] The following detailed description provides a discussion of the methodology of a technique according to principles described herein: (1) how perturbations are created; (2) how LPAs are formulated from these perturbations and solved (3) how the solutions of the LPAs are used to create visuals and (4) how faithful the application of the technique is to the classifier.
[0022] For differentiable models that produce a score or a probability for a class, partial derivatives with respect to the input features indicate each feature's relative influence on the classifier's output. This is useful if the input features of the model are already interpretable. For example, in image classification models whose inputs are pixels, the input and gradient can be presented simultaneously to a user, allowing the user to judge whether the model is making the expected associations.
[0023] Gradient-based explanations can be adapted to the case of non-differentiable or black-box models by approximating the classifier globally from a class of differentiable surrogates (Parzen windows, Gaussian processes). Using a surrogate model for explanation also opens up the possibility to choose an alternative feature basis that lends itself more readily to visual presentation.
[0024] Many open questions still exist, not just in developing new techniques for interpreting black box models, but also in adapting existing methods to work with various models and structures of data. For example, DeepLIFT assigns importance scores to inputs by comparing neuron activations to a reference activation that must be user chosen. DeepLIFT is not yet applicable to RNNs. Layerwise relevance propagation, inspired by backpropagation, can determine which features in an input vector contribute the most to a network's output, but was only very recently adapted to textual input and even more recently to LSTMs. Another method is attention, inspired by the principle that animals often focus on specific parts of visual input to determine adequate responses. Bandanau proposed a neural translation model using attention, translating text from one language to another. Attention can be used to highlight important words and sentences in text. Attention, however, like the other previously mentioned methods above, is not model-agnostic. LIME is model-agnostic, relying solely on the input data and classifier prediction probabilities. By perturbing the input and seeing how predictions change, one can approximate the complex model using a simpler, interpretable linear model. However, users must consider how the perturbations are created, which simple model to train, and what features to use in the simpler model. Anchors (by the same authors of LIME) is also model-agnostic, but instead of highlighting elements of text, creates “if-then” rules that apply.
[0025] Present Methodology
[0026] Let be a conversation with N turns, which is represented by an ordered N-tuple:
=(T.sub.1, . . . , T.sub.N). As we wish to consider repetitions in conversations, assume a similarity function S
such that P[i]=1 if Ti∈P (turn i is present in the perturbation). Note that the original conversation is also a trivial perturbation.
[0027] The similarity condition is extended for turns to perturbations. S
[0028] Prediction probabilities are also considered in creating our visuals. Let C
[0029] Define the (maximal) set of distinct perturbations in the following manner: for every P∈
, P belongs to
only if there does not exist any P′∈
, such that S
in the set
are distinct with respect to the similarity function S
[0030] Creating LPAs:
[0031] How the Importances of Each Turn in a Conversation are Represented.
[0032] Given the conversation =(T.sub.1, . . . , T.sub.N), determine the weight w.sub.i>0 for each of the turns T.sub.i such that given any perturbation P of
, the linear combination of the weights of the turns in P best approximates the probability of escalation (C
[0033] In other words, turn weights w={w.sub.1, . . . , w.sub.N} are found such that for each perturbation P∈, the linear combination as given by the dot product w.Math.P.sup.T best approximates C
[0034] This can be formulated as the following optimization problem: minimize Σ.sub.p∈P.sub.
[0035] Note that other possible formulations exist. One could replace the absolute difference in the summation by squares to seek the minimum value of Σ.sub.p∈P.sub.
[0036] Proceeding using the least squares optimization problem, more formally, given a conversation =(T.sub.1, . . . , T.sub.N), compute weights w.sub.1, . . . , w.sub.N for the following problem:
[0037] In escalation, repetition is a very important feature, where if turns i and j are similar and i<j, we want w.sub.i<w.sub.j. This property implies that repetition favors escalation (users tend to clarify their request by repetition), which was empirically shown to be an important factor. This is enforced by adding some constraints to the optimization problem. This requirement can be captured by using recurrence-observant weight vectors.
[0038] Recurrence-observant weight vector: Let =(T.sub.1, . . . , T.sub.N) be a conversation, w be the weights assigned to each turn in
and S
with i<j, S
[0039] If a turn is repeated in a conversation, then the weight of its later occurrence must be higher by at least ε. Given this property, a weight vector is sought that is recurrence-observant and minimizes the least squares sum as follows:
and w.sub.i≤w.sub.j−ε for all T.sub.i,T.sub.j∈ with i<j such that S
[0040] Ideally, if w can be computed such that w.Math.P.sup.T=C
[0041] This is a linear program that approximates the solution to the least squares problem initially formulated, LPA (linear program approximation). The Li-norm of the weight vector is maximized to avoid the trivial solution. This LPA can be solved using the Simplex Algorithm.
[0042] Note that another formulation is possible where instead of maximizing ∥w∥.sub.1 subject to w.Math.P.sup.T≤C (approximation from below), ∥w∥.sub.1 is minimized subject to w.Math.P.sup.T≥C
(approximation from above). The former (maximization) is applied for the of this disclosure.
[0043] One can generate the constraints for the LPA as formulated above, as discussed below. Given the objective function OBJ, as above, observe that C
[0044] Why C
[0045] Lemma 5.1. For any turn T.sub.i, let be the weight of the jth occurrence of T.sub.i as obtained from the LPA, where j∈{1, . . . , a.sub.i}. Then w.sub.i.sup.j≤1−(a.sub.i−j)ε.
[0046] Proof. For any fixed j∈{1, . . . , a.sub.i−j+1}, from constraint C
[0047] Lemma 5.2. Given an ε>0, the maximum value of the objective function OBJ without any constraint from C
[0048] Proof. Without loss of generality, let T.sub.1, . . . , Tn be distinct turns in (w.r.t. the similarity function S
=Σ.sub.i=1.sup.na.sub.i. Fix a turn T.sub.i. Let w.sub.i.sup.j be the weight of the jth occurrence of T.sub.i. Then, from the previous Lemma, we know that w.sub.i.sup.j≤1−(a.sub.i−j)ε. Thus, the value of the objective function is ∥w∥.sub.1≤Σ.sub.i=1.sup.nΣ.sub.j=1.sup.a.sup.
[0049] If ε>⅔(1−p/N), where p=C) for a given N-turn conversation
, then the weights will underapproximate the classifier's outcome. Moreover, for any δ∈(0, p), if ε>⅔(1−(p−δ)/N), then the weights under-approximate the classifier's outcome by δ. Hence, the constraints from C
[0050] Let us now examine how many and which constraints from C=(A, B, B, D). [0051] (1) Cumulative perturbations. For our example, we would include (1) A, (2) A, B, (3) A, B, B, and the original conversation (4) A, B, B, D. [0052] (2) One-turn removal perturbations. This example includes (1) B, B, D, (2) A, B, D, and (3) A, B, B. Note that removing the second occurrence of B would create the same perturbation as removing the first occurrence of B. Thus, it is not included. If there are any duplicate perturbations from creating cumulative perturbations, they are removed. [0053] (3) One-run removal. A run is defined as a continuous sequence of similar turns (as defined by the user-chosen S
[0055] The output of some classifiers depends on the length of their inputs. For example, with an escalation classifier according to principles described herein, removing turns can drastically reduce the probability for escalation. The more turns a conversation has, the more likely an escalation occurs. In the dataset studied, conversations with 2 or fewer turns rarely escalate. Thus, perturbations must be created carefully to avoid the influence of the length of the perturbation (rather than its contents) on the weights of its constituent turns. LIME handles this by using a distance function that weighs perturbations that are farther away from the original sample less heavily to minimize such effects. According to principles described herein a perturbation length threshold τ is user-chosen. Any perturbation with fewer than τ many turns is removed to minimize the effect of perturbation length on turn weights. Note that this threshold may only be considered when the classifier is known to be sensitive to the length of its inputs. The movie reviews classifier is not input length dependent, and, thus, τ need not be considered when approximating the behavior of this classifier using the presently described LPA scheme.
[0056] The weights obtained from the max LPA can be interpreted as providing an estimate of the contribution of each turn to the probability of escalation as reported by the classifier. However, these weights reveal no information about how much a turn contributes to non-escalation. This allows interpretation of the weights as a basic belief assignment from the Dempster-Shafer theory of evidence, where the belief of an event happening may be different (and unrelated in some cases) to the belief of it not happening. To completely characterize the approximation and produce meaningful visualizations, a similar weight vector for the probability of non-escalation can be obtained. Hence, two LPAs—one for each class (escalation and non-escalation)—can be obtained and applied.
[0057] Denoting by 0 the class corresponding to non-escalation, and by 1 the class corresponding to escalation, let weights w.sub.i.sup.0 and w.sub.i.sup.1 correspond to these two classes, respectively, for turn T.sub.i in the conversation C. Then solve two different instances of LPA, denoting them by LPA.sub.0 and LPA.sub.1, with the following changes: [0058] (1) Replace all instances of w.sub.i with w.sub.i.sup.j for LPA.sub.j (for j∈{0, 1}). [0059] (2) For LPA.sub.0, replace C
[0061] Let the solution weight vectors to the two LPs be w.sup.0* and w.sup.1*, respectively. For each turn T.sub.i, we define v.sub.i=(w.sub.i.sup.1*−w.sub.i.sup.0*) to be the difference of the weights obtained by the two LPs. A positive value of v.sub.i indicates that the turn T.sub.i favors escalation of C, whereas a negative value suggests that the turn favors non-escalation. This is important for a direct comparison with the visualization provided by other approximation schemes like LIME [12], as LIME provides visualizations that show the contribution of textual elements for different classes. This is also indicative of the fact that in any given conversation, not all turns may contribute to escalation.
[0062] In our visualization, we use shades of orange 132/232 to denote a positive value of v.sub.i and shades of blue 134/234 otherwise. We normalize v.sub.i prior to assigning color intensities, by dividing all positive weights by the most positive weight (and similarly for negative weights). Example visualizations using our methodology are given in
[0063] A measure was proposed in conjunction to LIME, called the unfaithfulness parameter, is examined to estimate how unfaithful a given approximation is in the locality (defined using some user-chosen distance metric) of the given input to the classifier. For the present method, a slightly modified version of this parameter was applied to measure the quality of the approximation (and visualization) scheme as follows.
[0064] For a given perturbation P∈and σ>0 (we chose σ=25), let the unfaithfulness for class 1 be defined as follows:
.sub.P.sup.1=πc(P)(f.sup.1(P)−g.sup.1(P)).sup.2
[0065] where π(P)=exp(−cos(P, C).sup.2/σ.sup.2) and cos is the cosine distance between the interpretable vector representations of P and
in {0, 1}.sup.N. The classifier output f.sup.1(P)=C
[0066] Similarly, let
.sub.P.sup.0=π
(P)(f.sup.0(P)−g.sup.0(P)).sup.2
where f.sup.0(P)=1−C of our approximation scheme by the following equation:
[0067] Using the minimum to allow each perturbation to be treated as an independent conversation, the sum over all perturbations calculates how close the approximation was to the actual behavior of the classifier, regardless of whether the original conversation escalated or not. As previously mentioned, although progress has been made on visualizing the parts of inputs that contribute greatly to a classifier's decision, much future work is necessary.
[0068] Initial results show that it is possible to use the intuitive LPA approach for creating classifier visualizations, which can help the human representative quickly determine the cause of the escalation by scanning the conversation history and determining the best course of action based on problematic turns (identified by a visual cue, such as color or darker gray scale, e.g.). In addition to building trust for these classifiers, these visualizations can help developers determine ways of improving the classifiers themselves and find causes of escalation that can help improve the chatbots and reduce the need for escalation in the first place.
[0069] The above-described methodology can be adapted to other tasks such as movie reviews, where instead of perturbing turns, sentences are perturbed, and the prediction probability being considered is the probability of being a positive review.
[0070] It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention cover the modifications and variations of this invention provided they come within the scope of the appended claims and their equivalents.
[0071] Throughout this application, various publications may have been referenced. The disclosures of these publications in their entireties are hereby incorporated by reference into this application in order to more fully describe the state of the art to which this invention pertains.
[0072] While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example only, and not limitation. It will be apparent to persons skilled in the relevant art that various changes in form and detail can be made therein without departing from the spirit and scope of the present invention. Thus, the breadth and scope of the present invention should not be limited by any of the above-described exemplary embodiments but should be defined only in accordance with the following claims and their equivalents.