<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="585"/><title>We're Not in Kansas Anymore: Detecting Domain Changes in Streams</title><pubinfo>Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing,pages 585-595, MIT, Massachusetts, USA, 9-11 October 2010. ©2010 Association for Computational Linguistics</pubinfo><author surname="Dredze" givenname="Mark"><org  name="Johns Hopkins University" country="USA" city="Baltimore"/></author><author surname="Oates" givenname="Tim"><org  name="University of Maryland" country="USA" city="College Park"/></author><author surname="Piatko" givenname="Christine"><org  name="Johns Hopkins University" country="USA" city="Baltimore"/></author></firstpageheader><frontmatter><p><b>We're Not in Kansas Anymore: Detecting Domain Changes in Streams</b></p><p>"ï<b>*Mark Dredze </b>and "ï<b>*Tim Oates </b>and tt<b>Christine Piatko</b></p><p>""Human Language Technology Center of Excellence, *Center for Language and Speech Processing, * Applied Physics Lab Johns Hopkins University * University of Maryland, Baltimore County mdredze@cs.jhu.edu,  oates@umbc.edu, christine.piatko@jhuapl.edu</p></frontmatter><abstract>Domain adaptation, the problem of adapting a natural language processing system trained in one domain to perform well in a differ­ent domain, has received significant attention. This paper addresses an important problem for deployed systems that has received little at­tention - detecting when such adaptation is needed by a system operating in the wild, i.e., performing classification over a stream of unlabeled examples. Our method uses A-distance, a metric for detecting shifts in data streams, combined with classification margins to detect domain shifts. We empirically show effective domain shift detection on a variety of data sets and shift conditions. </abstract></header><body><section number="1" title="Introduction"><p>Consider a named entity recognition system trained on newswire stories. Given annotated documents containing sentences like <i>"Tony Hayward </i>has faced fresh criticism for taking time off to go sailing ..." we would like to learn a model that will allow us to recognize that "Obama" and "BP" are named enti­ties in a sentence like "Obama summoned BP ex­ecutives . . . ". When all of the documents come from one data distribution, like newswire articles, this tends to work well. However, the sentence "OBAMA SUMMONED BP EXECUTIVES ..." from transcribed broadcast news, and others like it, will probably lead to poor results because the fea­tures it relies on have changed. For example, capi­talization patterns are no longer a good indicator of the presence of a named entity and appositives are not indicated by punctuation. This problem of <i>do­main shift </i>is a pervasive problem in NLP in which any kind of model - a parser, a POS tagger, a senti­ment classifier - is tested on data that do not match the training data.</p><p>Given a model and a stream of unlabeled in­stances, we are interested in automatically <i>detecting </i>changes in the feature distribution that negatively impact classification accuracy. For example, a senti­ment classification model trained on book reviews may heavily weight n-grams features like "uplift­ing" and "page turner". Those features may never occur in reviews of kitchen appliances that get mixed in at test time, and useful features in this new do­main like "efficient" and "noisy compressor" will have never been seen during training and therefore not be in the model. Furthermore, we do not assume labeled instances are available to help detect these harmful changes. Other tasks related to changes in data distributions, like detecting concept drift in which the labeling function changes, may require la­beled instances, but that is not the focus of this paper.</p><p>There is significant work on the related problem of adapting a classifier for a known domain shift. Versions of this problem include adapting using only unlabeled target domain data (Blitzer et al., 2006; Blitzer et al., 2007; Jiang and Zhai, 2007), adapt­ing using a limited amount of target domain labeled data (Daume, 2007; Finkel and Manning, 2009), and learning across multiple domains simultaneously in an online setting (Dredze and Crammer, 2008b). However, in practical settings, we do not know <i>if </i>the data distribution will change, and certainly not when. Additionally, we will not know to <i>what </i>domain the shift will happen.<page local="2" global="586"/> A discussion forum de­voted to science fiction books may change over time to focus more on fantasy and then narrow to discus­sions of vampire fiction. Maybe this shift is harm­less and it is possible to identify the sentiment of the discussants with the original model with no loss in accuracy. If not, we seek methods that detect this shift and trigger the use of an adaptation method.</p><p>Our domain shift detection problem can be de­composed into two subproblems: detecting distribu­tional changes in streams of real numbers, and rep­resenting a stream of examples as a stream of real numbers informative for distribution change detec­tion. We select the A-distance metric (Kifer et al., 2004) to solve the first subproblem since it has been previously used in other domain adaptation work (Blitzer et al., 2006; Blitzer et al., 2007). Our main contribution is towards the second problem, repre­senting examples as real numbers for this task. We demonstrate that classification margins, which in­corporate information about features that most im­pact system accuracy, can effectively solve the sec­ond subproblem. Furthermore, we show that the pre­viously proposed Confidence Weighted learning al­gorithm (Dredze et al., 2008) can provide a more informative measure than a simple margin for this task. Our experiments include evaluations on com­monly used domain adaptation data and false change scenarios, as well as comparisons to <i>supervised </i>de­tection methods that observe label values, or have knowledge of the target domain.</p><p>We begin with a description of our task and pre­vious applications to language data. After describ­ing the data used in this paper, we discuss the A-distance metric and how it has previously been used for adaptation. We then show that margin based methods effectively capture information to detect domain shifts, and propose an alternate way of gen­erating informative margin values. Finally, we com­pare our results to settings with supervised knowl­edge, and close with a survey of related work.</p></section><section number="2" title="Domain Shifts in Language Data"><p>The study of domain shifts in language data has been the purview of domain adaptation and transfer learn­ing, which seek to adapt or transfer a model learned on one source domain with labeled data to another target domain with few or no labeled examples. For­mally, errors from such transfers have two sources: differences in feature distributions and changes to la­beling functions (annotation standards) (Ben-David et al., 2006; Ben-David et al., 2009). Empirical work on NLP domain shifts has focused on the former. For example, Blitzer et al. (2007) learned correspon­dences between features across domains and Jiang and Zhai (2007) weighted source domain examples by their similarity to the target distribution.</p><p>We continue in this tradition by making two as­sumptions about our setting. First, a change in do­main will be signaled by a change in the feature distributions. That is, new words, phrases, syntac­tic structures, etc. signal that the system has shifted to a new domain. Second, while there may be a change in the labeling function, i.e., features have a different meaning in each domain, this will be a sec­ondary concern. For example, both Daume (2007) and Dredze and Crammer (2008b) assume that do­mains are more similar than different.</p><p>A similar problem to the one we consider is that of concept drift, where a stream of examples are labeled with a shifting labeling function (concept) (Nishida and Yamauchi, 2007; Widmer and Kubat, 1996). While concept drift is similar there are two important differences. First, concept drift can be measured using a stream of <i>labeled </i>examples, so system accuracy is directly measured. For exam­ple, Klinkenberg and Joachims (2000) detect con­cept drift with support vector machines, using es­timates of leave-one-out performance to adaptively adjust and maintain a training window that mini­mizes estimated generalization error. This is pos­sible only because class labels arrive with the exam­ples in the stream. Another concept drift detection algorithm, STEPD, uses a statistical test to continu­ally monitor the possibly changing stream, measur­ing system accuracy directly, again using the labels it receives for each example (Nishida, 2008). Ob­viously, no such labels are available in our unsuper-vised setting. Second, concept drift assumes only changes in the labeling function, whereas domain adaptation relies on feature distribution changes.</p><p>Several properties of detecting domain shifts in natural language streams distinguish it from tradi­tional domain adaptation, concept drift, and other related tasks:</p><page local="3" global="587"/><p><b>• No Target Distribution Examples </b>Blitzer et al. (2007) estimate the loss in accuracy from domain shift by discriminating between two data distributions. In our setting, we have no knowledge of the target distribution.</p><p><b>• No Labeled Target Data </b>Some approaches to domain adaptation assume a limited number of labeled examples (Daume, 2007; Dredze and Crammer, 2008b; Finkel and Manning, 2009). We assume no labels in our setting.</p><p><b>• Online Setting </b>Domain adaptation typically assumes a batch transfer between two domains. We consider a purely stream (online) setting.</p><p><b>• Computationally Constrained </b>Our approach must be fast, as we expect to run our domain shift detector alongside a deployed NLP sys­tem. This limits both computation and storage.</p><p><b>• Unknown Adaptation </b>A critical assumption of previous work is that a domain change has occurred. We must ascertain this ourselves.</p><p>Despite these challenges, we show unsupervised stream-based methods that effectively identify shifts in domain in language data. Furthermore, our meth­ods are tied directly to the learning task so are sen­sitive to changes in actual task accuracy. Our meth­ods have low false positive rates of change detection, which is important since examples within a single domain display a large amount of variance, which could be mistaken for a domain change.</p><p>Once a change is detected, any number of actions may be appropriate. The maintainer of the system may be notified that performance is suffering, la­bels can be obtained for a sample of instances from the stream for retraining, or large volumes of unla-beled instances can be used for instance reweighting (Jiang and Zhai, 2007).</p></section><section number="3" title="Datasets"><p>We begin the presentation of our methods by de­scribing the data used in our experiments. We se­lected three data sets commonly used in domain adaptation: spam (Jiang and Zhai, 2007), ACE 2005 named entity recognition (Jiang and Zhai, 2007), and sentiment (Blitzer et al., 2007). Sentiment and spam are binary and ACE is multi-class. Note that in all experiments, a shift in the domain yields a de­crease in system accuracy.</p><p>The goal of the spam data is to classify an email (bag-of-words) as either spam or ham (not-spam). Each email user may have different preferences and features. We used unigram and bigram features, fol­lowing Dredze and Crammer (2008b) for feature ex­traction, and used the three task A users as three domains. The ACE 2005 named entity recognition dataset includes 7 named entity class labels (person, organization, location, geopolitical entity, facility, vehicle, weapon) for 5 text genres (newswire, broad­cast news, broadcast conversations, conversational telephone speech, weblogs). We use 4000 examples from each genre and used Jiang and Zhai's feature-extracted data.<footnote anchor="1"/> The sentiment data contains reviews from Amazon for four product types: books, dvds, electronics, and kitchen. We include an additional two types (music and video from Dredze and Cram­mer) in our false shift experiments and use unigram and bigram features, following Blitzer et al.</p></section><section number="4" title="The A-Distance"><p>Our approach to detecting domain shifts in data streams that negatively impact system accuracy is based on the ability to (1) detect distributional changes in streams of real numbers and (2) con­vert document streams to streams of informative real numbers. This section describes how we achieve the former, and the next section describes the latter.</p><p>Theoretical work on domain adaptation showed that the A-distance (Kifer et al., 2004), a stream based measure of difference between two arbitrary probability distributions P and P', can be used to evaluate the difference between two domain distri­butions (Ben-David et al., 2006). In a batch set­ting this corresponds to learning a linear classi­fier to discriminate the domains, and Blitzer et al. (2007) showed correlations with the error from do­main adaptation. Given our interest in streaming data we return to the original stream formulation of A-distance.</p><p>The A-distance detects differences between two arbitrary probability distributions by dividing the range of a random variable into a set of (possibly<page local="4" global="588"/></p><footnote label="1">We thank Jing Jiang for the feature-extracted ACE data.</footnote><p>Figure 1: Fhe A-distance is computed between two win­dows <i>(P </i>and <i>P' </i>in a stream of real-valued data. The sam­ples in each window are divided into intervals, and the A-distance measures the change in the distributions over these intervals between the two windows.</p><p>overlapping) intervals, and then measures changes in the probability that a value drawn for that variable falls into any one of the intervals. If such a change is large, a change in the underlying distribution is de­clared. Let A be a set of real intervals and let <i>A G A </i>be one such interval. For that interval, P(A) is the probability that a value drawn from some unknown distribution falls in A. The A-distance between P and Pi.e. the difference between two distributions over the intervals, is defined as follows:</p><p><i>dA(P,P</i>') = 2 sup <i>AeA\P</i>(A) - P'(A)|.</p><p>Two distributions are said to be different when, for a user-specified threshold e, <i>dA(P, P</i>0 &gt; e. The A-distance is distribution independent. That is, it makes no assumptions about the form of the under­lying distribution nor about the form of the change that might occur, either algorithmically or in the un­derlying theory. Unlike the <i>L\ </i>norm, the A-distance can be shown to require finitely many samples to de­tect distribution differences, a property that is crucial for streaming, sample-based approaches.</p><p>Since the A-distance processes a stream of real numbers, we need to represent an example using a real number, such as the classification margin for that example. The first n of these numbers in the stream are a sample from <i>P, </i>and the most recent n are a sample from P'. We signal a domain shift when the A-distance between P and <i>P<footnote anchor="1"/></i><i> </i>is large (greater than e). Larger values of n result in more accurate estimates of P(A) and slower detection of changes.</p><p>The two windows of samples of size n are shown graphically in Fig. 1. Each increment on the hori­zontal axis represents the arrival of a new document.</p><p>The vertical axis is some value computed from each document, such as its classification margin. To com­pute P and Pone needs to specify A and n, which are shown as two stacks of boxes that are identical except for their position. The width of each box is n, the number of examples used to estimate P(A) and P(A') for A G A, where the real interval A cor­responds to the vertical span of the box. The value P (A) is simply the number of documents whose real value falls inside that interval A divided by n. Note that the first n documents in the stream are used to compute P, and as each new document arrives the location of the stack of boxes used to compute P' is shifted to the right by one.</p><p>In Fig. 1, the number of examples whose real value falls in the top two intervals for P is approxi­mately the same, with no example's value falling in the lower two intervals. For P', almost every one of the n document values falls in the second interval from the top, virtually assuring that <i>dA(P, P</i><i>')</i><i> </i>will be large. Though the intervals in the figure do not overlap, they typically do.</p><p>Given n and intervals A, the value of e is chosen by randomization testing. Because the A-distance is distribution independent, a sample of size m » n is drawn from any distribution that spans A. This sam­ple is treated as a stream as described above, and the largest value of <i>dA(P, P'</i>) is stored. The sam­ple is permuted and this process is repeated l times. Note that any change detection would be a false pos­itive because all values were sampled from the same distribution. The values <i>dA(P, P</i><i>')</i><i> </i>are sorted from largest to smallest, and e is chosen to be the <i>[al\th</i>such value where parameter <i>a </i>is a user specified false positive probability.</p><p>Both the time and space complexity of our ap­proach based on the A-distance are small. Given n and A, n instances must be stored in the sliding window and 2\A\ counters are required to represent P and P'. Note that both values are constants based on user specified parameters, not on the size of the stream. Processing a new instance involves comput­ing its margin and updating P and P', all of which can occur in constant time.</p><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>Aw</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><page local="5" global="589"/><p>Figure 2: Each column of plots is a representative result using an SVM on a single run over a sentiment data shift: dvds — electronics, electronics — books, and kitchen — books, from left to right. The horizontal axis is the number of instances from the stream processed by the classifier. The top plot is the accuracy of the classifier on the last 100 instances. The bottom plot is the absolute value of the SVM classification margin. The vertical line at 500 instances marks the point of domain shift. Horizontal dotted lines indicate the mean of the accuracy/margin before and after the domain shift. Note that in all cases, the mean accuracy drops, as do the mean margin values, demonstrating that both can indicate domain shifts.</p></section><section number="5" title="A-Distance Over Margins"><p>Since shifts in domains correlate with changes in distributions, it is natural to begin by considering the observed features in each example. When we shift from a source domain (e.g., book reviews) to a target domain (e.g., dvd reviews) we expect a change in the distribution for common source words ("author" and "plot" become less common). Since the A-distance assumes a stream of single values, we can apply an A-distance detector to each feature (e.g., unigram and bigram count) individually. However, our exten­sive experiments with this approach (omitted here) show that it suffers from a number of flaws, such as a high false positive rate if all features are tracked, the difficult problem of identifying an informative subset of features for tracking, and deciding how many such features need to change before a shift has occurred, which turns out to be highly variable be­tween shifts.</p><p>Therefore, our goal is to use a single A-distance tracker by collapsing each example to a single value. One way of doing this is to consider the <i>classifica­tion margin </i>produced by the classifier. The mar­gin weighs features by their importance in classi­fication. When more important features disappear, we expect the magnitude of the margin to decrease. Additionally, features that change but do not in­fluence system performance are effectively ignored since they do not influence the margin. This ap­proach has the advantage of task sensitivity, only tracking changes that impact task accuracy. Initial experiments showed effectiveness with the unsigned (absolute value of the) margin, which we use in all experiments.</p><p>We begin by examining visually the information content of the margin with regards to predicting a domain shift. The caption of Fig. 2 describes the setup, and the first row of the figure illustrates the effects of the shift on the source domain classifier's empirical accuracy, measured on a window of the previous 100 examples. The horizontal dashed lines indicate the average accuracy before and after the shift. Note that in each case, average classification accuracy drops after the shift. However, at any one point the accuracy displays considerable variance. Thus, while classification accuracy clearly suffers, it is difficult to measure this even in a supervised set­ting with labeled examples when considering a small portion of the stream.</p><p>The second row of Fig. 2 shows the average un­signed margin value of an SVM classifier computed over the previous 100 examples in the stream. The two dashed horizontal lines indicate the average margin value over source and target examples. There is a clear drop in the average margin value after the shift. This difference suggests that the margin can be examined directly to detect a domain shift. How­ever, these values vary considerably so extracting useful information is not trivial.</p><p>We evaluated the ability of A-distance trackers to detect such changes in margin values by simulat­ing domain shifts using each domain pair in a task (books to dvds, weblogs to newswire, etc.). For each domain shift setting, we first trained a classi­fier on 1000 source domain instances. In our ex­periments, we used three different classification al­gorithms: Support Vector Machines (SVM) (Chang<page local="6" global="590"/></p><p>CWPM CWPM CWPM</p><p>Figure 3: The mean number of instances after a domain change at which the A-distance tracker detects a change. Each point represents the mean number of instances for CWPM (x-axis) and the SVM, MIRA and CW methods (y-axis). Datasets are indicated by different markers. The second row zooms each plot to the bottom left corner of the first row. Points above the diagonal indicate SVM, MIRA or CW took longer to detect a change than CWPM.</p><p>and Lin, 2001), MIRA (Crammer et al., 2006) and Confidence Weighted (CW) learning (Dredze et al., 2008). We evaluated each trained classifier on 500 test examples to measure accuracy on the source do­main, and then used it to label examples in a stream. The first 500 examples in the stream were used for calibrating our change detection methods. The next 500 examples were from the source domain, fol­lowed by 1500 examples from the target domain. Over these 2000 examples we ran each of our de­tection methods. Experiments were repeated over 10 fixed random data permutations.</p><p>We automatically select A-distance intervals as follows. First, we computed the mean and variance of the 500 calibration margins and then added inter­vals for .5 standard deviations away from the mean in each direction, .5 to 1 standard deviation in each direction, and intervals for 1 standard deviation to ±oo. We also added three evenly spaced overlap­ping intervals. To calibrate a FP rate of 0.05 we sampled from a Gaussian with the above mean and variance and used <i>n = </i>200, m = 10000 and l = 50.</p><p>The results for each experiment (38 shifts re­peated averaged over 10 runs each) are shown in</p><p>Fig. 3.<footnote anchor="2"/> Each plot represents one of the three classi­fiers (SVM, MIRA, CW) plotted on the vertical axis, where each point's y-value indicates the number of examples observed after a shift occurred before the A-distance detector registered a change. Smaller values (lower points) are preferred. The second row of plots highlights the 0 to 300 region of the first row. (The x-axis will be discussed in the next sec­tion.) Notice that in many cases, a change was reg­istered within 300 examples, showing that domain shifts can be reasonably detected using the margin values alone.</p><p>Equally important to detecting changes is robust­ness to false changes. We evaluated the margin de­tector for false positives in two ways. First, we logged any incorrectly detected changes before the shift. For all three algorithms, there were very few false positives (Table 1). The highest false positive rate was about 1% (CW), while for the SVM experi­ments, not a single detector fired prematurely in any experiment.</p><footnote label="2">The method plotted on the x-axis will be introduced in the next section. To evaluate the three methods in this section (SVM, MIRA, CW) compare the y-values.</footnote><page local="7" global="591"/><p>Second, we sought to test the robustness of the method over a long stream of examples where no change occurred. In this experiment, we selected 11 domains that had a sufficient number of examples to consider a long stream of source domain exam-ples.<footnote anchor="3"/> Rather than use 500 source domain examples followed by 1500 target domain examples, all 2000 examples were from the source domain. All other settings were the same. For the SVM detector, out of 110 runs we detected 6 false positives, 3 of which were for the same data set (kitchen) (see Table 1.)</p></section><section number="6" title="Confidence Weighted Margins"><p>In the previous section, we showed that margin val­ues could be used to detect domain shifts. We now explore ways to reduce the number of target domain examples needed to detect domain shift by improv­ing the margin values.</p><p>Margin values are often taken as a measure of prediction confidence. From this perspective, the A-distance margin tracker identifies when predic­tion confidence drops. Another task that relies on margins as measures of confidence is active learn­ing, where uncertainty sampling for margin based systems is determined based on the magnitude of the predicted margin. Dredze and Crammer (2008a) showed how Confidence Weighted (CW) learning could be used to generate a more informative mea­sure of confidence for active learning.</p><p>CW is an online algorithm inspired by the MIRA update (Crammer et al., 2006), which ensures a pos­itive margin while minimizing parameter change. CW replaces the Euclidean distance used in the MIRA update with the KL divergence over Gaussian distributions. CW learning maintains a Gaussian distribution over linear weight vectors with mean /it G <i>RN </i>and diagonal covariance S G <i>RN </i>xN.</p><p>Maintaining a distribution over prediction func­tions is appropriate for our task where we con­sider margin values as confidence. We re­place the margin |w • x|, where w is a stan­dard linear classifier, with a probabilistic margin | (Pr^-A/ViÂ) [sign(w • z) = 1])— | . Dredze and Crammer showed that this probabilistic margin can be translated into a <i>corrected </i>geometric margin, which is computed as the normalized margin as MM = <i>M/\fV</i>, where M is the mean M = <i>/i • x </i>and V the variance V = xTSx of a univariate Gaussian dis­tribution over the unsigned-margin M = w • x. We call this method CWPM, for Confidence Weighted Probabilistic Margin.</p><footnote label="3">ACE: bc, bn, cts, nw, wl; Sentiment: books, dvd, electron­ics, kitchen, music, video</footnote><p>We compared using CWPM to the standard mar­gins produced by an SVM, MIRA and CW classifier in the last section. Fig. 3 shows the results of these comparisons. In each plot, CWPM (normalized mar­gin) is plotted on the x-axis, indicating how many examples from the target domain were observed be­fore the detector identified a change. The y-axis in each plot is the number of instances observed for the SVM, MIRA and CW methods. As before, each point is the average of the 10 randomized runs used above (assuming that detectors that did not fire do so at the end of the stream.) Points above the diagonal indicate that CWPM detected a change sooner than the comparative method. Of the 38 shifts, CWPM detected domain shifts faster than an SVM 34 times, MIRA 26 times and CW 27 times.</p><p>We repeated the experiments to detect false posi­tives for each margin based method. Table 1 shows the false positives for the 38 domain shifts consid­ered as well as the 11 false shift domain shifts. The false positive rates are among the lowest for CWPM. This shows that CWPM is a more useful indicator for detecting domain changes.</p></section><section number="7" title="Gradual Shifts"><p>We have shown detection of sudden shifts between the source and target domains. However, some shifts may happen gradually over time. We evaluate this by modifying the stream as follows: the first 500 instances come from the source domain, and the re­maining 1500 are sampled randomly from the source and target domains. The probability of an instance being drawn from the target domain at time i is <i>P</i><i>i(x</i><i> </i>= target) = , where i counts from the start of the shift at index 500. The probability of sam­pling target domain data increases uniformly over the stream. At index 750 after the start of the shift each domain is equally likely. The ACE and Sen­timent datasets had sufficient data to be evaluated in this setting. Fig. 4 shows CWPM still performs best, but results are close (SVM: 22 of 32, MIRA &amp;<page local="8" global="592"/></p><p>CWPM CWPM CWPM</p><figure caption="Figure 4: Gradual shift detection with SVM, MIRA or CW vs. CWPM. There were no false positives."></figure><p>Table 1: False positives (FPs) observed in true domain shift and false domain shift experiments for methods in corresponding sections. Each setting was run 10 times, resulting in 380 true domain shifts and 110 false shifts.</p><p>CW: 17 of 32). As expected, detections happen later in the stream. The closer results are likely due to the increased difficulty of the task. With less clear information, there it is more difficult for all the al­gorithms to recognize a change, and performance across the methods begins to equalize. Even in this more difficult setting, CWPM is the best performer.</p></section><section number="8" title="Comparison to Supervised Information"><p>So far we have considered applying A-distance tracking to information freely available in a real world system: the classification margins. As a use­ful baseline for comparison, we can measure using <i>supervised </i>sources of information, where additional information is provided that is not normally avail­able. In particular, we investigate two types of su­pervised knowledge: the labels of examples in the stream and knowledge of the target domain. In each case, we compare using the A-distance and CWPM versus applying the A-distance to supervised infor­mation.</p><subsection number="8.1" title="Classifier Accuracy"><p>In Sec. 4 we showed that both the margin and recent classifier accuracy indicate when shifts in domains occur (Fig. 2). We developed techniques based on the margin, which is available at test time. We now consider knowledge of the true labels for these test examples, which allows for tracking classifier accu­racy. We can use the A-distance to detect when un­expected changes in accuracy occur.</p><p>For each test example classified by the system, we evaluated whether the system was correct in its prediction by examining the label. If the classifier was correct, we output a 1; otherwise, we output a 0. Over this 1/0 stream produced by checking clas­sifier accuracy we ran an A-distance detector, with intervals set for 1 s and 0s (10,000 uniform samples to calibrate the threshold for a false positive rate of 0.05.) If an unusual number of 0s or 1s occur -more or less mistakes than on the source domain - a change is detected.<footnote anchor="4"/> Results on this accuracy stream are compared to CWPM (Fig. 5.) Despite this su­pervised information, CWPM still detects domain changes faster than with labeled examples. Consider again Fig. 2, which shows both accuracy and margin values over time. While the average accuracy drops, the instantaneous value is very noisy, suggesting that even this additional information may not yield bet­ter domain shift detection. This will be interesting to explore in future work.</p><footnote label="4">An alternate approach would be to measure accuracy di­rectly as a real valued number. However, our experiments showed the discrete approach to be more effective.</footnote><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p><i>Domain Shift FPs</i></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><i>Algorithm</i></p></td><td class="cell"><p><i>True Shift</i></p></td><td class="cell"><p><i>False Shift</i></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Sec. 5: SVM</p></td><td class="cell"><p>0</p></td><td class="cell"><p>6</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Sec. 6: MIRA</p></td><td class="cell"><p>2</p></td><td class="cell"><p>13</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Sec. 6: CW</p></td><td class="cell"><p>5</p></td><td class="cell"><p>10</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Sec. 6: CWPM</p></td><td class="cell"><p>1</p></td><td class="cell"><p>6</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Total tests</p></td><td class="cell"><p>380</p></td><td class="cell"><p>110</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><page local="9" global="593"/><p>Figure 5: An A-distance accuracy detector, run over a stream of Is and Os indicating correct and incorrect predictions of the classifier on examples in a stream. The bulk of points above the line indicate that CWPM is more effective at detecting domain change. CWPM had a single false positive and the accuracy detector had no false positives.</p></subsection><subsection number="8.2" title="Domain Classification"><p>Next, we consider another source of supervision: a selection of examples known to be from the tar­get domain. In this setting, we know that a shift will occur and we know to which domain it will oc­cur. This requires a sample of (unlabeled) target do­main examples when the target domain is not known ahead of time. Using a common approach to detect­ing domain differences when data is available from both domains (Ben-David et al., 2009; Blitzer et al., 2007; Rai et al., 2010), we train a binary classifier to differentiate between the source and target do­main. We learn a CW classifier on 1000 examples (500 from each domain) that do not appear in the test stream. We then label each example as either "source" or "target" and output a 1 or O accordingly. Over this 0/1 stream, we run an A-distance detector with two intervals, one for 1 s and one for Os. The remaining setup is identical to the A-distance exper­iments above.</p><p>Fig. 6 shows the detection rate of CWPM versus A-distance over the domain classifier stream. As ex­pected, the detection rate for the domain classifier is very fast, in almost every case (save 1) less than 400 examples after the shift happens. When CWPM is slow to detect a change (over 400 examples), the domain classifier is the clear winner. However, in the majority of experiments, especially for ACE and spam data, both detectors register a change quickly. These results suggest that while a sample of target domain examples is very helpful, our CWPM ap­proach can also be effective when such samples are not available.</p></subsection></section><section number="9" title="Related Work"><p>Early NLP work in the <i>unsupervised </i>setting moni­tored classification confidence values, setting a con­fidence threshold based on a break-even heuristic, monitoring the rate of (presumed) irrelevant exam­ples based on this threshold, and signaling a change when this rate increased (Lanquillon, 1999).</p><p>Confidence estimation has been used for specific NLP components such as information extraction. The correctness of fields extracted via a conditional random field extractor has been shown to corre­late well to an estimate obtained by a constrained forward-backward technique (Culotta and McCal-lum, 2004). EM-based confidence estimation has been used to estimate the confidence of patterns derived from partially supervised relation extrac­tion (Agichtein, 2006). Confidence estimation has also been used to improve the overall effectiveness of NLP systems. Confidence estimates obtained via neural networks have shown gains for speech recog­nition, spoken language understanding, and machine translation (Gandrabur et al., 2006). Pipeline models using confidence estimates at one stage as weights for further downstream stages improve over base­line dependency parsing and named entity recogni­tion pipeline models (Bunescu, 2008).</p><p>An alternative formulation of domain adaptation trains on different corpora from many different do­mains, then uses linear combinations of models trained on the different corpora(McClosky et al., 2010).</p><p>Work in novelty detection is relevant to the task of detecting domain shifts (Scholkopf et al., 2000),<page local="10" global="594"/></p><p>Figure 6: A-distance over a stream of Is and Os produced by a supervised classifier trained to differentiate between the source and target domain. Samples from the unseen target domain is very effective. However, for many shifts, the margin based A-distance detector is still competitive. CWPM had a single false positive while the domain classifier stream had 2 false positives in these experiments.</p><p>though the rate of occurrence of novel instances is more informative in our setting than the mere fact that novel instances are observed.</p><p>We are also motivated by the problem of detect­ing <i>genre shift </i>in addition to domain shift, as in the ACE 2005 data set shifts from newswire to tran­scripts and blogs. Different text genres occur in tra­ditional settings, such as broadcast news transcripts and newswire, and have begun to proliferate with the variety of social media technologies now avail­able including weblogs. Static genre classification has been explored using a variety of techniques, in­cluding exploiting punctuation (Kessler et al., 1997; Dewdney et al., 2001), TF-IDF statistics (Lee and Myaeng, 2002), and part-of-speech statistics and histograms (Finn and Kushmerick, 2006; Feldman et al., 2009).</p><p>Finally, statistical estimation in a streaming con­text has been considered in data mining applica­tions (Muthukrishnan, 2005). Change detection via sequential hypothesis testing has been effective for streaming applications such as network intrusion detection (Muthukrishnan et al., 2007). Detecting new events in a stream of Twitter posts can be done using constant time and space similarity measures based on a modiication of locality sensitive hash­ing (Petrovic et al., 2010).</p></section><section number="10" title="Conclusion"><p>While there are a number of methods for domain adaptation, a system irst needs to determine that a domain shift has occurred. We have presented methods for automatically detecting such domain shifts from a stream of (unlabeled) examples that require limited computation and memory by virtue of op­erating on fixed-size windows of data. Our meth­ods were evaluated empirically on a variety of do­main shifts using NLP data sets and are shown to be sensitive to shifts while maintaining a low rate of false positives. Additionally, we showed improved detection results using a probabilistic margin based on Conidence Weighted learning. Comparisons to detection with supervised information show that our results are effective even in unlabeled settings. Our methods are promising as tools to accompany the de­ployment of domain adaptation algorithms, so that a complete system can irst identify when a domain shift has occurred before automatically adapting to the new domain.</p></section><section title="Acknowledgments"><p>Thanks to the HLTCOE text processing group for many helpful discussions.</p></section><references><p>Eugene Agichtein. 2006. Conidence estimation meth­ods for partially supervised information extraction. In <i>SDM.</i></p><p>Shai Ben-David, John Blitzer, Koby Crammer, and Fer­nando Pereira. 2006. Analysis of representations for domain adaptation. In <i>NIPS.</i></p><p>Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Vaughan. 2009. A theory of learning from different domains. <i>Machine Learning.</i></p><page local="11" global="595"/><p>John Blitzer, Ryan McDonald, and Fernando Pereira. 2006. Domain adaptation with structural correspon­dence learning. In <i>EMNLP.</i></p><p>John Blitzer, Mark Dredze, and Fernando Pereira. 2007. Biographies, Bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In <i>As­sociation for Computational Linguistics (ACL).</i></p><p>Razvan C. Bunescu. 2008. Learning with probabilistic features for improved pipeline models. In <i>EMNLP.</i></p><p>Chih-Chung Chang and Chih-Jen Lin, 2001. <i>LIB-</i></p><p><i>SVM: a library for support vector machines. </i>Soft­ware available at http://www.csie.ntu.edu. tw/~cjlin/libsvm.</p><p>Koby Crammer, Ofer Dekel, Joseph Keshet, Shai Shalev-Shwartz, and Yoram Singer. 2006. Online passive-aggressive algorithms. <i>Journal ofMachine Learning Research (JMLR).</i></p><p>Aron Culotta and Andrew McCallum. 2004. Confidence estimation for information extraction. In <i>North Amer­ican Chapter of the Association for Computational Linguistics - Human Language Technologies (NAACL-HLT).</i></p><p>Hal Daume. 2007. Frustratingly easy domain adaptation. In <i>Association for Computational Linguistics (ACL).</i></p><p>Nigel Dewdney, Carol VanEss-Dykema, and Richard MacMillan. 2001. The form is the substance: clas-siication of genres in text. In <i>Workshop on Human Language Technology and Knowledge Management.</i></p><p>Mark Dredze and Koby Crammer. 2008a. Active learn­ing with conidence. In <i>Association for Computational Linguistics (ACL).</i></p><p>Mark Dredze and Koby Crammer. 2008b. Online meth­ods for multi-domain learning and adaptation. In</p><p><i>EMNLP.</i></p><p>Mark Dredze, Koby Crammer, and Fernando Pereira. 2008. Conidence-weighted linear classiication. In</p><p><i>ICML.</i></p><p>S. Feldman, M. A. Marin, M. Ostendorf, and M. R. Gupta. 2009. Part-of-speech histograms for genre classiication of text. In <i>International Conference on Acoustics, Speech, and Signal Processing (ICASSP).</i></p><p>Jenny Rose Finkel and Christopher D. Manning. 2009. Hierarchical Bayesian domain adaptation. In <i>NAACL-</i></p><p><i>HLT.</i></p><p>Aidan Finn and Nicholas Kushmerick. 2006. Learning to classify documents according to genre: Special topic section on computational analysis of style. <i>J. Am. Soc. Inf. Sci. Technol., </i>57(11):1506-1518.</p><p>Simona Gandrabur, George Foster, and Guy Lapalme. 2006. Conidence estimation for NLP applications. <i>ACM Trans. Speech Lang. Process., </i>3(3):1-29.</p><p>Jing Jiang and ChengXiang Zhai. 2007. Instance weight­ing for domain adaptation in NLP. In <i>Association for Computational Linguistics (ACL).</i></p><p>Brett Kessler, Geoffrey Numberg, and Hinrich Schütze. 1997. Automatic detection of text genre. In <i>Associa­tion for Computational Linguistics (ACL).</i></p><p>Daniel Kifer, Shai Ben-David, and Johannes Gehrke. 2004. Detecting change in data streams. In <i>Very Large Data Bases (VLDB).</i></p><p>Ralf Klinkenberg and Thorsten Joachims. 2000. Detect­ing concept drift with support vector machines. In <i>In­ternational Conference on Machine Learning (ICML).</i></p><p>C. Lanquillon. 1999. Information iltering in changing domains. In <i>IJCAI.</i></p><p>Yong-Bae Lee and Sung Hyon Myaeng. 2002. Text genre classification with genre-revealing and subject-revealing features. In <i>SIGIR.</i></p><p>David McClosky, Eugene Charniak, and Mark Johnson. 2010. Automatic domain adaptation for parsing. In</p><p><i>NAACL-HLT, </i>pages 28-36, Los Angeles, California,</p><p>June. Association for Computational Linguistics. S. Muthukrishnan, Eric van den Berg, and Yihua Wu. 2007. Sequential change detection on data streams. In <i>IEEE International Conference on Data Mining Work­shops (ICDMW).</i></p><p>S. Muthukrishnan. 2005. Data streams: Algorithms and applications. <i>Foundations and Trends in Theoretical Computer Science, </i>1(2).</p><p>Kyosuke Nishida and Koichiro Yamauchi. 2007. Detect­ing concept drift using statistical testing. In <i>Discovery Science.</i></p><p>Kyosuke Nishida. 2008. <i>Learning and Detecting Con­cept Drift. </i>Ph.D. thesis, Hokkaido University, Japan.</p><p>Sasa Petrovic, Miles Osborne, and Victor Lavrenko. 2010. Streaming irst story detection with application to twitter. In <i>NAACL-HLT, </i>pages 181-189, June.</p><p>P. Rai, A. Saha, H. Daume III, and S. Venkatasubrama-nian. 2010. Domain Adaptation meets Active Learn­ing. In <i>Workshop on Active Learning for Natural Lan­guage Processing (ALNLP), </i>page 27.</p><p>Bernhard Scholkopf, Robert Williamson, Alex Smola, John Shawe-Taylor, and John Platt. 2000. Support vector method for novelty detection. In <i>NIPS.</i></p><p>Gerhard Widmer and Miroslav Kubat. 1996. Learning in the presence of concept drift and hidden contexts. <i>Machine Learning, </i>23:69-101.</p></references></body></article>