Elamur Research

Projecting Embeddings for Domain Adaption: Joint Modeling of Sentiment Analysis in Diverse Domains

Paper · 2018 · Jeremy Barnes, Roman Klinger and Sabine Schulte im Walde

Summary

A sentiment classifier trained on product reviews can recognize praise and criticism in the kinds of reviews it has seen. Give it a short message from Twitter, however, and the words on which it learned to rely may be absent or used differently. Barnes and colleagues ask how to carry out sentiment analysis in that new setting using sentiment labels from the original setting. Their proposal is to give each domain its own route into a shared representation. This lets the classifier draw on the vocabulary of the new domain while using a decision rule learned from the old one.

The method, called BLSE, starts with separate sets of word embeddings, vectors that represent words through their use in text. The authors use a list of words found in both domains to connect the sets. During training, a separate linear transformation on each side brings the vectors for paired words closer together. At the same time, the source transformation has to preserve information that helps classify labeled source texts. The target transformation follows the changes to the source representation through the word pairs. To classify a target text, BLSE averages its target word vectors, applies the target transformation, and sends the result to the same classifier that learned from source labels.

The paper tests this approach on 20 directed transfers involving Amazon reviews and the SemEval Twitter datasets. The authors report the best result on 11 of the 20 transfers. Within Amazon, neural structural correspondence learning leads more often. BLSE achieves 82.2 accuracy when trained on DVD reviews and tested on book reviews, yet scores 70.8 when trained on kitchen reviews and tested on electronics reviews, where neural structural correspondence learning reaches 84.0. When the target is Twitter, BLSE leads in every tested transfer. For DVD reviews to SemEval 2013, it obtains 67.1 macro F₁, compared with 60.6 for neural structural correspondence learning. Macro F₁ gives positive and negative sentiment equal weight when combining their scores, which matters because positive messages are more common in the Twitter data.

The analyses distinguish several possible reasons for that pattern. Twitter messages give the competing approaches fewer features based on individual words or adjacent word pairs. The error breakdown also shows how easily a system can handle the common positive class while missing most negative messages. A broad frequency-based list supplies better projection anchors on the more distant datasets than a small sentiment lexicon does. In a separate experiment, removing the target transformation leaves BLSE able to learn sentiment for books, while the transfer to SemEval 2013 fails to learn useful target predictions. That comparison puts the focus on what the target transformation does during joint training. Word correspondence gives the target representation a way to follow a source representation that is itself changing as it learns to support sentiment classification.

Deep dive: Projecting Embeddings for Domain Adaption: Joint Modeling of Sentiment Analysis in Diverse Domains

Barnes and colleagues align word embeddings to transfer sentiment from product reviews to Twitter and test when projection helps. · about 38 minutes to read

The problem and its context

Why a change in domain can undo a good classifier

In the paper, a domain is a setting that supplies texts for classification. Books and electronics are different review domains because they describe different kinds of products. Twitter messages and Amazon reviews differ in a broader way. They come from different collections and are written as different kinds of texts. The authors are interested in both scales of change. A method that transfers well between product categories has addressed a useful problem, but it has faced only part of the range of differences the paper wants to examine.

The source domain is where labeled examples teach the classifier what counts as positive or negative. The target domain is where the authors ultimately want to make those predictions. A transfer has a direction because the roles of those domains matter. Training on books gives the classifier labeled evidence about sentiment as expressed by book reviewers. Training on electronics supplies a different body of evidence. Even with the same pair of domains, exchanging source and target changes what the classifier learns from and what it is asked to recognize later.

The label names are shared across domains, but the evidence for the labels can change. The paper uses well-written as a book-related expression and reliable as an electronics-related one. Both can help recognize praise in their respective settings. The value of each word comes in part from what people in that domain discuss. A classifier trained on one of those settings would need some basis for recognizing the other expression as serving a comparable role. Merely specifying the same set of output labels gives it no such basis.

A word that appears on both sides can also present a problem. Shared spelling gives the learner a cheap way to identify a possible correspondence. The paper stresses that words can have different semantics across domains, so shared spelling alone cannot settle how a particular word contributes to the task. This is the tension behind the proposal. There is enough common vocabulary to use as an alignment signal, while enough variation remains to make training directly on a single common representation an imperfect solution.

The practical question is therefore how to use unlabeled text in both domains. The paper assumes that sentiment annotation is available in the source and uses target sentiment annotations to evaluate the transfer. Unlabeled text gives access to the vocabulary and patterns of word use on the target side before classification. The authors want the resulting system to use that information without learning a separate target sentiment rule from labeled examples. Seen this way, adaptation is a question about how to make evidence from different settings usable by one classifier. Sentiment classification is the particular text classification task the paper uses to answer it.

Shared features as bridges

The earlier approach that most directly addresses the well-written and reliable problem is structural correspondence learning, or SCL. It begins with pivots. A pivot is a feature whose relevance to the prediction task is expected to be similar across domains. A broadly applicable sentiment word such as good or terrible illustrates the idea. Because those words can occur alongside more specialized language, a learning procedure can use them to discover relationships among features that rarely occur in the same domain. The paper traces this approach to Domain Adaptation with Structural Correspondence Learning.

SCL creates a prediction task for each chosen pivot. The input consists of other features of a text, and the output indicates whether the pivot occurs in that text. The auxiliary task can use unlabeled examples because the pivot's occurrence is observable even when the sentiment label is unavailable. If a book feature and an electronics feature each help predict the same pivot, the learned representation can make their relationship available to a sentiment classifier. The authors describe this as a way to learn common structure while retaining the original features alongside the new representation.

The sentiment adaptation benchmark grew out of an extension of that work. Its creators collected reviews of books, DVDs, electronics, and kitchen products, set aside balanced collections of labeled reviews, and used additional reviews as unlabeled material. Those data made it possible to compare transfer between different product categories while keeping the general form of the input fixed. Barnes and colleagues use the benchmark because it offers an established comparison, then ask whether the conclusions travel to Twitter. The benchmark comes from Biographies, Bollywood, Boom-boxes and Blenders.

The paper describes several ways of exploiting pivots. A graph-based approach groups non-pivot features by using their relationship to pivots. Another approach learns sentence representations from source sentiment and pivot presence as related training tasks. Neural structural correspondence learning, abbreviated NSCL, uses an autoencoder-style hidden representation to predict the occurrence of pivots. In the version evaluated by Barnes and colleagues, pretrained pivot embeddings help connect the hidden representation to those predictions. The paper treats NSCL as a strong comparison and emphasizes its dependence on pivot selection and hyper-parameter tuning.

Pivots make the adaptation mechanism easy to understand. Suppose useful features on either side can be associated with shared words; the association gives the classifier evidence for handling both. The strength of that argument depends on whether the common features capture enough about each domain. When overlap is limited, the shared prediction task may give little guidance about a large part of the useful target vocabulary. A representation built to emphasize what the domains have in common can lose some of the distinctions that matter inside a particular domain. The authors treat that as a reason to explore separate representations connected by a learned mapping.

Reconstruction and cross-domain representations

Autoencoders offer another way to find reusable structure. In the earlier work reviewed by the authors, a denoising autoencoder receives a deliberately corrupted version of a text representation and learns to recover the original. The learned hidden features are supplied to a sentiment classifier along with the original features. The idea is that a representation that helps recover missing or altered features can capture patterns that are needed in both domains. The sentiment classifier can then draw on those patterns in addition to its direct evidence about word occurrence.

The marginalized stacked denoising autoencoder, abbreviated mSDA, makes this procedure more scalable. The paper describes an approach that uses linear transformations with closed-form solutions and applies a nonlinearity afterward. This allows the procedure to handle more input features and reduces the cost of learning them relative to the earlier stacked autoencoder. It remains a representation learned from the feature inventory of the corpora. The authors identify training cost, ease of interpretation, and limited use of the original feature space as concerns in their discussion of the autoencoder family.

Other related work starts at the level of words. One method uses pivots to influence which words a sentiment-topic procedure associates with its topics. Another learns domain-specific embeddings and constrains the representations of pivot words to stay similar. The closest earlier domain adaptation approach, in the authors' account, projects lower-dimensional document representations across domains to predict changes in word distributions. It learns the projection independently of sentiment classification and projects features shared by the domains. That choice matters because a transformation can describe a cross-domain relationship in the data while paying little attention to the distinction the final classifier needs.

The authors' starting point for joint projection comes from cross-lingual sentiment classification. The earlier BLSE approach uses separate embedding spaces for the languages, a translation dictionary, and sentiment labels for the source language. A translation pair provides a reason to make the projected source and target vectors similar. The source labels give the shared space a task-specific purpose. This is the direct precedent for their adaptation method, described in Bilingual Sentiment Embeddings.

The broader precedent is the practice of learning mappings between independently organized embedding spaces. The paper cites work that uses correspondences to align word vectors across languages, including Exploiting Similarities among Languages for Machine Translation and work on bilingual embedding mappings. The transfer to domains changes what can serve as a correspondence. Reviews and tweets use many of the same word forms, so the authors can begin with identical words on each side. They need to learn what those words have in common for sentiment and how the resulting alignment applies to words outside the list.

That background gives the paper a concrete design question. The task calls for a representation that can accommodate different vocabularies and usage patterns, coupled with a classifier that depends on shared sentiment information. Pivots and reconstruction learn features that can be used across domains. Joint projection instead gives each starting space its own adjustable map, then uses source sentiment and cross-domain word correspondences to determine what the maps should preserve.

The method, step by step

Give each domain a way into the shared space

Start with a source text and a target text. Each is represented using vectors looked up in the embedding collection assigned to its own domain. An embedding represents a word as a list of numerical coordinates. These coordinates come from patterns of word use in the training text. Independently trained collections can organize related words in different places, so a coordinate that helps separate positive and negative documents on the source side has no automatic counterpart on the target side.

BLSE learns a pair of linear projections, one for each starting space. A projection is a matrix that transforms an input vector into coordinates in the learned space. The transformations can handle the original coordinates differently because they have separate parameters. Their outputs have a common shape and are constrained through word correspondence. This gives the classification layer one kind of input to work with regardless of the text's domain.

The projection lexicon supplies that correspondence. Its entries pair a source item and a target item. In the primary setup, a word is paired with itself across the two embedding collections. The same form supplies the link, but the vectors going into the two projections can differ. The alignment objective asks the projections to bring the paired outputs together. It does not require the original vectors to coincide, and the authors keep those original embeddings stable during optimization.

There is a second input to training. A labeled source text is represented by the average of its word vectors, using the source embeddings. The source projection transforms that average, and a classification layer predicts its sentiment. An incorrect or uncertain prediction of the observed label changes the classifier and the source projection. The alignment objective also acts on the source projection, so its role is shared between the source texts and the paired words.

The target projection learns through the pairs. As the source projection changes to make sentiment easier to predict, the target side has to bring its paired outputs into agreement with the new source outputs. Source sentiment can therefore affect the space occupied by target words even though the target projection receives no sentiment label for a target document. Both maps take vectors as inputs, which means they can operate on items beyond those explicitly paired in the lexicon.

Training and applying the shared sentiment projection

The steps in order.

Training and applying the shared sentiment projectionStep 1: Prepare source and target word embeddings1. Prepare source and target word embeddingsStep 2: Match shared words across the two spaces2. Match shared words across the two spacesStep 3: Project paired words and penalize disagreement3. Project paired words and penalize disagreementStep 4: Average embeddings for labeled source texts4. Average embeddings for labeled source textsStep 5: Project source averages and predict sentiment5. Project source averages and predict sentimentStep 6: Fit both projections and the shared classifier6. Fit both projections and the shared classifierStep 7: Project target text averages and classify them7. Project target text averages and classify them

The diagram has separate steps for the two kinds of training input because each supplies a different form of evidence. The paired words tell the system which projected representations should agree. The labeled texts tell it which representations support positive and negative decisions. Inference follows a shorter route. It needs the target embedding collection, the learned target projection, and the classification layer. The lexicon has already served its purpose by shaping the projection.

The embedding tables and the alignment loss

The authors write the source embedding table as S and the target table as T. Each row belongs to a word, and the columns hold its embedding coordinates. In the notation below, ℝ denotes real-valued entries, v and v′ are the source and target vocabulary sizes, and d and d′ are their respective embedding widths. The multiplication sign in a shape separates the row and column counts.

S ∈ ℝ^(v × d), T ∈ ℝ^(v′ × d′)

Here ∈ indicates that S and T belong to the indicated sets of matrices. The prime distinguishes a target-side quantity from its source counterpart. The formal setup allows different vocabularies and different input widths. The learned transformations have to produce outputs of the same width for the alignment comparison and the shared classifier.

L = {(sᵢ, tᵢ) : i = 1, …, n}

L is the projection lexicon and n is its number of entries. The index i selects an entry, sᵢ is the source word in it, and tᵢ is the target word. Braces enclose the collection of entries, and the colon introduces the range of the index. In the main experiments, the paired forms are identical. Each member of the pair is still looked up in its own embedding table. The authors also allow the lexicon to connect different forms, such as read in books with watch in movies. That possibility is part of the design and is discussed as future work.

zᵢ = S[sᵢ] · M

S[sᵢ] is the row vector retrieved from S for source word sᵢ. M is the trainable source projection matrix, and the centered dot denotes multiplication of the row vector by the matrix. The result zᵢ is that word's representation in the common space. The subscript keeps track of which entry in L supplied the word.

ẑᵢ = T[tᵢ] · M′

T[tᵢ] is the row retrieved from the target table T for tᵢ. M′ is the trainable target projection matrix, corresponding to the target matrix denoted by a primed M in the paper. The target output ẑᵢ uses a hat to distinguish it from the source output zᵢ. The dot again indicates multiplication by the matrix on the right.

MSE = (1/n) ∑ᵢ₌₁ⁿ ‖zᵢ − ẑᵢ‖²

MSE stands for mean squared error. The summation symbol ∑ adds the alignment errors for all n lexicon entries, starting at i = 1. Subtraction compares matching coordinates of the paired outputs. The squared norm ‖ · ‖² expresses the squared discrepancy of the vectors, and 1/n averages the discrepancies over word pairs. The intended pressure is toward projected vectors that are close for the words supplied as correspondences.

By itself, the alignment term can be minimized by making the outputs collapse to the same location. That would satisfy the demand for agreement and remove distinctions the classifier needs. The source sentiment objective puts a cost on such a solution. If every source text has effectively the same representation, the classifier cannot use its coordinates to distinguish praise from criticism. The two training signals give the common space its meaning for the task. Agreement is useful when it connects representations that still carry evidence for different sentiment labels.

How a source text supplies a sentiment signal

The source corpus is a collection of texts paired with their sentiment labels. The paper uses xᵢ for the text in a labeled example and yᵢ for its label. Here i indexes texts, whereas it indexed word pairs in the alignment equations. The same convention is used for the projected vectors. When the authors describe classification, the projected vector is the representation of an entire input text.

The system retrieves the source embedding for each word in xᵢ and averages the retrieved vectors. The result, aᵢ, has the same coordinate width as an individual source embedding. Averaging allows the same matrix used for single-word correspondences to transform a record containing many words. It also means that the words are combined without recording their positions. A review and a short message can have vectors of the same width even when their lengths differ considerably.

zᵢ = aᵢ · M

Here aᵢ is the average for source text xᵢ, M is the source projection, and zᵢ is the projected text vector. The dot is row-vector multiplication by M. The matrix is the same one the alignment objective applies to individual source embeddings. Since the transformation is linear, applying it to the average also gives the average of the transformed vectors. That relationship is what allows word-level constraints to affect the representation used for whole-text classification.

ŷᵢ = softmax(zᵢ · P)

P is the trainable classification matrix. Multiplying the projected input zᵢ by P produces scores for the sentiment labels. Softmax converts the scores to probabilities across those labels. ŷᵢ denotes the prediction for example i. In the binary loss, the paper uses ŷᵢ for the probability associated with the label encoded as 1, with 1 − ŷᵢ giving the probability of the other label.

H = −∑ᵢ₌₁ⁿ [yᵢ log ŷᵢ + (1 − yᵢ) log(1 − ŷᵢ)]

H is the binary cross-entropy loss. Here n is the number of labeled examples covered by the sum, yᵢ is the observed binary label, and ŷᵢ is the predicted probability of the label encoded as 1. The complementary quantity 1 − yᵢ indicates that the example has the other label, and 1 − ŷᵢ is its estimated probability. The logarithm is written as log. The leading minus sign makes the selected log-probability a penalty. Assigning the observed class a low probability produces a large penalty. A high probability for the observed class makes the penalty small.

The sentiment signal reaches M as well as P. If only P changed, the classifier would have to find a sentiment decision using whatever space resulted from word alignment. Updating M gives the training procedure a way to reshape that space. The same change also affects the projected words in L. Because the alignment term constrains the target outputs against those words, the source labels help determine what M′ has to do, even though there is no target sentence in the sentiment loss.

Fitting the objectives together

The paper expresses joint training as a weighted combination of losses over the source corpus and the projection lexicon. In the combined expression the arguments mark how the loss is used at the level of an example or pair. That distinguishes the per-item contributions from the aggregate forms used to explain cross-entropy and mean squared error.

J = α ∑₍ₓ,ᵧ₎∈C_source H(x, y) + (1 − α) · ∑₍ₛ,ₜ₎∈L MSE(s, t)

J is the joint objective minimized during training. C_source is the labeled source corpus, and (x, y) is a source text together with its label. The first sum ranges over those examples, and H(x, y) denotes their sentiment loss contributions. L is the lexicon, and (s, t) is a paired source and target word. The second sum ranges over those pairs, and MSE(s, t) denotes the corresponding alignment loss contributions. The symbol α weights the sentiment objective, while 1 − α weights the projection objective. The centered dot between a scalar weight and a summed loss means multiplication. The matrices optimized by J are M, M′, and P.

This division of labor matters when interpreting the learned parameters. P is adjusted by the labeled examples because it is the layer producing sentiment probabilities. M′ is adjusted by the alignment term because it handles the target word vectors. M participates in both terms. It is the point at which the requirements of sentiment classification and word correspondence meet. The authors tune α on source validation data, so they choose how much emphasis to place on each term without selecting a value on the basis of target sentiment annotations.

The two projections also make room for a compromise that the authors' one-projection variant cannot make in the same way. A fixed target space could serve as a destination for source embeddings, but its structure would have been determined before the sentiment learner saw any labels. With M′ available, the target inputs can move in the learned space as the joint objective reshapes it. The original target embeddings remain available as stable inputs. Their projected coordinates can accommodate task-specific distinctions.

Applying the learned classifier to target text

At test time a text comes from C_target, the target corpus. The procedure looks up its words in T and averages those vectors. The symbol aᵢ now denotes a target average, with the width of a target embedding. The authors apply M′ to this average before calling the classification layer.

ẑᵢ = aᵢ · M′

In this equation i identifies a target text. Its average embedding is aᵢ, and the dot denotes multiplication by the target projection M′. The output ẑᵢ lies in the same learned space that supplied the inputs to P during source training. Its coordinates come from the target-side lookups and mapping.

ŷᵢ = softmax(ẑᵢ · P)

Here ẑᵢ is the projected target text, P is the classification matrix learned using source labels, and softmax converts the resulting label scores to probabilities. ŷᵢ is the target prediction. The classification parameters are shared between the domains. The difference at inference is which word vectors are averaged and which projection is applied to the average.

The authors train embeddings with the Word2Vec toolkit using skip-gram. The mechanism uses a word and its surrounding context to learn vector coordinates from raw text. The reported settings are 300 dimensions, a sub-sampling setting of 10⁻⁴, a context window of 5, and negative sampling of 15. The window governs the context used in learning, sub-sampling controls how frequently frequent words participate, and negative sampling supplies contrasting examples during training. The Amazon embedding material pools unlabeled reviews across the product domains. The Twitter embeddings use nearly 8 million tokens from tweets gathered through hashtags, with the same embedding settings. When a word is outside the pretrained vocabulary, the procedure uses a vector randomly initialized between −0.25 and 0.25 to approximate the variance of the available vectors. The authors release the BLSE code for their domain adaptation experiments.

The main-run projection dictionary uses the most frequent 20,000 words in the concatenated corpora. The comparison of lexicon choices later introduces a separate general-frequency list taken from Brown. Those descriptions concern different parts of the experimental procedure. In the main runs, the authors tune training epochs, α over 0.1–0.9, and batch size over 20–500 on the source validation data. Epochs govern how many passes training makes over the examples, and batch size controls how many items are processed together for an update. The labeled target test data enter the evaluation after those choices.

Experiments and results

Review categories and Twitter test sets

The Amazon experiments use the labeled portions of the books, DVD, electronics, and kitchen review collections. For each category, there are 1000 positive and 1000 negative reviews in the labeled collection. When a category is the source, 1600 reviews are used for training and 400 for validation. The training split contains 800 reviews per class, and the validation split contains 200 per class. When a category is the target, the test uses all 2000 labeled reviews in that category. The source and target roles therefore determine how the labeled data for a category are used in a particular run.

The review data support a test of transfer within a common kind of document. An electronics review describes a different subject from a book review, but both inputs are product reviews. This setting is also where the strongest adaptive baselines have an established record, making it possible to see whether projection improves on them in their usual setting. The unlabeled review data provide material for learning representations without using target sentiment labels. BLSE uses unlabeled text for the embeddings, while the adaptive baselines use unlabeled data to build features for transfer.

The broader change in input comes from the message polarity corpora for SemEval 2013 and SemEval 2016. The original datasets include positive, negative, and neutral tweets. The authors remove the neutral tweets so that the evaluation uses the same label choices as the Amazon data. The paper reports the message corpora's training and development splits, but the review-to-Twitter transfers evaluated here train sentiment classification on the Amazon source. The Twitter corpora supply target test messages. The earlier task descriptions are SemEval 2013 Twitter Sentiment Analysis and SemEval 2016 Twitter Sentiment Analysis.

The SemEval 2013 test portion contains 946 positive and 316 negative messages in the binary setup. The SemEval 2016 test portion contains 5,619 positive and 2,386 negative messages. Thus the test sets include many more positive messages, and the imbalance makes a metric that treats the classes symmetrically especially informative. The paper denotes the Twitter targets S13 and S16. An arrow in a result such as DVD → S13 means that the labeled classifier is trained on DVD reviews and evaluated on the binary SemEval 2013 test set.

What the comparisons control

The non-adaptive baseline, NOAD, trains a linear support vector machine on bag-of-words features. In a bag-of-words representation, features record words occurring in the text without representing their positions. This baseline answers whether the source-trained decision rule can already do the job using its original features. Its usefulness is important on both kinds of transfer. If an adaptation procedure changes the representation without improving target predictions, direct transfer can be competitive.

The mSDA baseline adds learned features from its denoising procedure to the original feature space. It uses the 30,000 most common unigrams and bigrams, which are individual words and adjacent word pairs. The top 5000 features are used as pivots. The paper fixes the number of layers at 5 and tunes the corruption level and the support vector machine's C parameter on source validation data. The corruption levels considered are 0.5, 0.6, 0.7, 0.8, and 0.9. Corruption controls the perturbation used in the representation-learning task, while C controls the penalty for training errors in the support vector machine.

NSCL learns to predict pivots from its hidden text representation. The version used here takes pretrained embeddings of pivots as part of the reconstruction procedure, which allows it to use relationships among pivots beyond their observed presence or absence. The authors retain the original settings for training the autoencoder with stochastic gradient descent. They consider pivot counts of 100, 200, 300, 400, and 500, and hidden-layer widths of 100, 300, and 500. The number of pivots determines how many shared features guide representation learning. The hidden width governs the size of the representation passed onward. They also tune the C parameter for logistic regression on source validation data. For the Amazon sources, that means the 400-review development split.

These baselines give the comparison different reference points. NOAD measures what direct application of a sparse source classifier can recover. mSDA measures what a denoising-based representation can add to the original input. NSCL tests a method that uses pivot prediction and pretrained pivot embeddings to guide feature learning. BLSE works with dense embeddings throughout its classification route. So a system-level win can depend on how the input was encoded as well as on how the adaptation objective was constructed. The separate analyses are needed to isolate particular design choices inside BLSE.

Transfer within Amazon

The paper reports accuracy on the balanced Amazon target sets. Accuracy counts the proportion of test reviews whose predicted sentiment agrees with the label. Balance makes the figure easy to interpret in this benchmark because positive and negative reviews have equal representation in each target set. The table listing the review transfers is the basis for the accuracy comparisons below.

The strongest result for BLSE within the Amazon experiments comes from DVD → books. Its target accuracy is 82.2, while NSCL scores 77.3, mSDA scores 76.1, and NOAD scores 73.6. This is a case where the learned projection produces a clear improvement over the strongest comparator. The result also shows why the overall Amazon ranking needs to be read alongside the directions individually. The group of Amazon tasks favors NSCL more often, while a particular transfer can favor BLSE decisively.

DVD reviews to Amazon book reviews, target test accuracy

BLSE leads the comparison when DVD reviews supply the labels and book reviews are the target.

DVD reviews to Amazon book reviews, target test accuracyNOAD: 73.6NOAD73.6mSDA: 76.1mSDA76.1NSCL: 77.3NSCL77.3BLSE (this paper): 82.2BLSE (this paper)82.2
The numbers
System or settingaccuracy %
NOAD73.6
mSDA76.1
NSCL77.3
BLSE (this paper)82.2

The other directions in which BLSE beats NSCL are electronics → DVD and kitchen → DVD. On electronics → DVD, BLSE reaches 76.8 compared with 74.5 for NSCL. On kitchen → DVD, it scores 76.5 compared with 76.3. The closeness of the latter comparison is worth preserving when describing the result. A lead on the table can be quite small, and the sizes of the leads vary across the transfers for which the authors report the best result.

Books → DVD is an especially close comparison. NSCL achieves 81.1 accuracy and BLSE achieves 81.0. Both are ahead of mSDA at 78.3 and NOAD at 76.0. BLSE fares less well on the other transfers into books, in spite of its DVD → books result. With electronics as the source, BLSE scores 71.3 on the books target and mSDA leads at 71.9. With kitchen as the source, BLSE scores 69.0 and the highest accuracy is NSCL's 73.0. This variation shows why grouping results by target is helpful but incomplete. A single target can present a different problem depending on the evidence supplied by the source.

NSCL also leads across the transfers into electronics. With books as source, the target accuracy is 76.8 for NSCL and 71.8 for BLSE. With DVD as source, it is 78.1 for NSCL and 70.3 for BLSE. Kitchen → electronics gives the sharpest illustration of difficulty for BLSE. It achieves 70.8 where all the listed comparators score higher, including NOAD at 81.6. The adaptive alternatives reach 84.0 for NSCL and 82.4 for mSDA. A source and target can be similar by the paper's lexical comparison while still giving the projected representation little advantage for sentiment.

Kitchen reviews to Amazon electronics reviews, target test accuracy

BLSE trails all the comparison systems on the electronics target when trained on kitchen reviews.

Kitchen reviews to Amazon electronics reviews, target test accuracyBLSE (this paper): 70.8BLSE (this paper)70.8NOAD: 81.6NOAD81.6mSDA: 82.4mSDA82.4NSCL: 84.0NSCL84.0
The numbers
System or settingaccuracy %
BLSE (this paper)70.8
NOAD81.6
mSDA82.4
NSCL84.0

For the kitchen target, the highest listed accuracy again comes from NSCL in each direction. The books → kitchen scores are 80.1 for NSCL and 73.8 for BLSE. On DVD → kitchen, the corresponding scores are 80.3 and 72.3. On electronics → kitchen, they are 84.6 and 78.3. In that last direction, mSDA also achieves 84.5 and the non-adaptive baseline achieves 82.4. An effective adaptation system has to improve on source evidence that can already work well under a modest shift, which makes a strong direct-transfer baseline especially informative here.

Transfer from Amazon to Twitter

The Twitter evaluation uses macro F₁. For each class, F₁ combines precision and recall. Precision asks how many predictions of that class are correct. Recall asks how many examples belonging to that class are found. The macro average gives the positive and negative class scores equal weight. Because the Twitter sets contain more positive messages, it is possible for a system to predict many labels correctly while doing poorly on negative sentiment. The evaluation makes that failure more visible than accuracy would.

BLSE leads with every Amazon source for the SemEval 2013 target. Trained on books, it achieves 65.8 macro F₁ against NSCL at 62.8. From DVD, it achieves 67.1, with NOAD the closest comparison at 61.5. From electronics, it achieves 65.6, followed by NOAD at 60.9. From kitchen, it achieves 63.9, where mSDA is the strongest of the comparators at 53.2. The closest baseline changes with the source, even though the rank of BLSE at the top stays the same.

DVD reviews to SemEval 2013 Twitter, target test macro F₁

BLSE leads on the imbalanced Twitter test set when sentiment training uses DVD reviews.

DVD reviews to SemEval 2013 Twitter, target test macro F₁mSDA: 45.3mSDA45.3NSCL: 60.6NSCL60.6NOAD: 61.5NOAD61.5BLSE (this paper): 67.1BLSE (this paper)67.1
The numbers
System or settingmacro F₁
mSDA45.3
NSCL60.6
NOAD61.5
BLSE (this paper)67.1

The SemEval 2016 test set shows the same overall ranking at the top. BLSE obtains 65.2 from books, while NSCL reaches 61.5. With DVD as source, BLSE scores 66.1 and NOAD reaches 63.2. With electronics as source, BLSE achieves 67.0 and NSCL reaches 60.7. Finally, BLSE scores 62.8 when trained on kitchen reviews, against NSCL at 57.6. Those outcomes preserve the advantage under a different Twitter test collection and a different balance of positive and negative examples.

The authors report average advantages on the Twitter transfers of 8.2 macro F₁ over NSCL, 15.5 over mSDA, and 6.4 over NOAD. They also report that NSCL beats mSDA in 7 of the 8 Twitter transfers, while beating direct transfer in only 4. The mSDA baseline is ahead of NOAD in the single kitchen → SemEval 2013 transfer. These comparisons matter because the Twitter results include a reversal for methods that are strong on Amazon. The adaptation mechanism has to work when both the vocabulary and the format of the input change. The pattern motivates the feature and class-error analyses that follow.

What the ablations show

Removing the target projection

The most direct architectural test removes M′, the target transformation. In that variant, M projects the source representations toward the target space and P supplies a sentiment prediction. The target embedding coordinates provide the destination for alignment. In the full system, the target coordinates used by P can move because M′ is learned along with M. This comparison asks whether that flexibility is necessary in the authors' implementation.

The paper plots learning behavior with books as the source and SemEval 2013 as the target. The variant without M′ learns to predict sentiment in the source. Its target behavior does not show the corresponding improvement. The full BLSE system learns useful target predictions in that setting. The comparison is valuable because the source result distinguishes successful fitting of labeled sentiment from successful transfer. A learner may find a rule that works for the projected source texts without making that rule applicable to the target texts.

One interpretation follows from the roles of the matrices. If the target space is fixed, moving source information into that space can leave the source classifier relying on patterns that the unchanged target vectors fail to express in the same way. The full system enables the projection loss to update the target representation in response to the source sentiment training. The learning curves support the importance of M′ for this architecture in the books-to-Twitter transfer shown. They leave open what a different training objective or constraint could achieve with a single transformation.

Choosing the word pairs that drive alignment

The lexicon comparison varies the word correspondences supplied to BLSE. The authors examine choices with different rationales while using books as the source for the plotted comparison. A general frequency-based list supplies broad vocabulary coverage. A sentiment lexicon concentrates the alignment on words expected to be useful for polarity. A list selected by mutual information tries to identify correspondences suited to the particular source and target.

For the general frequency variant, the authors take the 20,000 most frequent tokens in the Brown corpus. Their reasoning is that a broad list gives the projections more observations of how the embedding spaces relate to one another. A word can help constrain the mapping even if it carries little direct sentiment by itself. Under a large change of domain, those additional constraints may help the transformation act more consistently on words that never appear as labeled source evidence.

To build the sentiment variant, the authors draw on entries from the Hu and Liu lexicon that appear in the Amazon and SemEval corpora. The resulting list contains 1130 words. These entries concentrate the alignment on words expected to distinguish positive from negative text. The logic resembles the choice of sentiment pivots in earlier adaptation methods. When the domains already share much of their relevant vocabulary, a focused set may put the training signal where it is most useful. In a more distant transfer, the same focus gives the space fewer points of correspondence.

The mutual-information variant is built for each domain pair. Mutual information measures how informative one variable is about another; in selecting pivots, the method uses high-scoring word features to find useful candidates. The authors consider single words and two-word sequences that appear at least 10 times in each domain. The lexicon size depends on how many features meet the selection criteria. It ranges from 100 for DVD → SemEval 2013 to 955 for books → DVD, with an average of 470 entries per pair. The threshold therefore has a practical effect beyond filtering unreliable features. It can leave relatively little material for aligning a pair of distant spaces.

The frequency-based lexicon does better on the more divergent targets in the plotted comparison. The sentiment lexicon does slightly better on similar datasets and performs poorly on the divergent ones. The mutual-information lists give good results across the illustrated cases except SemEval 2013. For the books → SemEval 2013 setting, the authors point to the size of the list, 103 tokens, as a possible reason that it supplies an inadequate mapping. The two smaller lexicon approaches illustrate a tradeoff between the relevance of the selected words and the amount of alignment evidence.

The experiment changes the content of the word pairs along with their number. The frequency list comes from a general corpus, the sentiment list from a polarity resource, and the mutual-information lists depend on a domain pair. A change in performance can reflect any combination of the breadth, size, and composition of the list. The result establishes a comparison of practical lexicon choices. The size explanation offered for the small list remains a hypothesis because the experiment does not hold the selection rule fixed and vary only the number of entries.

Measuring distance between the corpora

The authors use term frequencies to examine whether the Twitter transfers correspond to a larger domain shift. Each corpus is represented as a probability distribution over common terms. The comparison uses the most frequent 10,000 unigrams shared across the domains. Restricting the vocabulary this way makes it possible to compare the relative prominence of words that occur across the corpora. It also specifies which kind of difference the measure can reflect. A term can contribute through differences in relative frequency. A distinctive word outside the common vocabulary cannot contribute directly.

The distance discussion starts with Kullback–Leibler divergence. The paper uses a and b for the probabilities that distributions A and B assign to each vocabulary entry. The expression compares how much probability each distribution assigns to the same event.

D_KL(A ∥ B) = ∑ᵢ₌₁ᴺ aᵢ log(aᵢ/bᵢ)

D_KL is the directed divergence. The argument separator ∥ indicates the order, with A providing the weights aᵢ and B the comparison probabilities bᵢ. N is the number of entries in the vocabulary used for the comparison, i indexes those entries, and the sum accumulates their contributions. The logarithm log operates on the ratio aᵢ/bᵢ. A positive aᵢ paired with a zero bᵢ creates a problem for the ratio, a concern for empirical term distributions. Reversing the two distributions changes the weights and reverses the ratios.

The paper then prints the following expression under its Jensen–Shannon label.

D_JS(A, B) = ½ [D_KL(A ∥ B) + D_KL(B ∥ A)]

D_JS is the symbol the authors use for their comparison of A with B. The bracket contains the two directed Kullback–Leibler divergences, and ½ takes their average. The displayed expression is symmetric because exchanging A and B exchanges the terms inside the bracket. There is a reporting inconsistency when this expression is read with the table. The expression vanishes for identical distributions, while the table gives identical-domain entries a value of 1.000 and the prose treats lower displayed values as evidence of greater separation. The table's ordering can be described as the authors interpret it, while its entries cannot be reproduced directly from the displayed expression alone.

Under that ordering, books and DVD are close at 0.940, and electronics and kitchen are close at 0.908. The two Twitter datasets have a reported entry of 0.921 with each other. The authors single out kitchen as especially distant from the Twitter corpora, with entries of 0.741 for SemEval 2013 and 0.761 for SemEval 2016. The performance analysis orders the transfers by corpus similarity and shows BLSE maintaining its performance towards the more distant end. The baseline results tend to be stronger at the similar end of the comparisons.

The authors connect this pattern to how much evidence a short text supplies. They report an average of 76 features for the Amazon corpora and 17 for SemEval. A sparse word or word-pair representation gives the classifier few active features for a short tweet, and an active feature helps only if the training procedure learned something relevant from it. BLSE can look up a vector for a word and use its coordinates in the text average, including when the word was absent from the paired lexicon. The learned projection can act on its vector because the same matrix applies throughout the space.

This is a plausible reason for the difference in observed robustness. The shorter Twitter texts coincide with a larger shift in vocabulary distributions and a different evaluation setting. The analysis compares existing corpora that differ on these dimensions together. It helps explain why dense features could be useful under this shift, without measuring how much of the gain is attributable separately to message length, lexical distance, or the learned projection.

Which sentiment labels the systems miss

The paper breaks the Twitter errors down by the true class of the example. This gives a direct view of errors that macro F₁ reflects only through the class scores. In particular, a system can be very successful on positive examples and still make a large majority of its decisions incorrectly when the true label is negative. Class-conditioned error exposes that behavior.

Error Rate = e꜀ / n꜀

Here c denotes the sentiment class being examined. The numerator e꜀ counts errors among examples whose true class is c, and the denominator n꜀ counts all examples with that true class. The slash denotes division. In the paper's error table, positive and negative rates are reported separately for each combination of Amazon source and Twitter target. The rates describe how frequently the true class is missed. They do not by themselves state how reliable predictions of that class are.

mSDA gives the clearest example of asymmetric behavior. On DVD → SemEval 2016, its positive-class error is 0.2 and its negative-class error is 98.2. On DVD → SemEval 2013, the corresponding values are 0.2 and 97.8. This pattern is consistent with a classifier that assigns positive sentiment to almost all examples. It explains how a seemingly excellent rate for the common class can coexist with weak macro F₁.

NSCL shows a different pattern because its errors can be concentrated on either class. For DVD → SemEval 2013, its positive error is 18.1 and its negative error is 60.4. For kitchen → SemEval 2016, the positive error is 70.5 and the negative error is 13.2. In the first transfer it makes many more mistakes on negative messages. In the second it has trouble recovering the positive ones. The favored class therefore changes with the transfer.

BLSE frequently reduces the extreme errors, while the advantage varies by class and source. For DVD → SemEval 2016, the positive and negative errors are 28.0 and 36.5. For books → SemEval 2013, they are 26.9 and 35.4. Its kitchen → SemEval 2016 negative error is 50.1, higher than NSCL's 13.2, while its positive error is 23.3, lower than NSCL's 70.5. The latter comparison shows how BLSE can win on macro F₁ even when a comparator is substantially better at recovering a particular class. The full test result depends on the mistakes made across the label set.

Looking at individual embedding neighborhoods

The authors also use nearest neighbors to illustrate differences in the quality of the available embeddings. A nearest neighbor is another word whose vector lies close to the queried word's vector in the space. The paper looks at selected sentiment-bearing words from books and electronics. For a book word such as conceit, the neighboring form conceits gives an immediate indication of a coherent relationship. For the electronics examples, the authors report less coherent neighborhoods, including for words such as indispensable and cumbersome.

This comparison addresses a particular vulnerability of a classifier that relies on embeddings at every step. The projection can exploit relationships encoded in its input and alter how those relationships are expressed. If an important word starts with an uninformative vector, a shared linear transformation has limited evidence about where that word should go. More training text could help with the quality of representations for words important to a domain. The examples illustrate why that explanation is plausible for the weaker Amazon directions. They do not measure the effect of changing the amount of embedding data while keeping the rest of the experiment fixed.

Limitations

Limits the authors identify

The authors point to the dependence on the quality and amount of unlabeled text. BLSE represents texts with embeddings before it can align or classify them, so the initial vocabulary relationships are a substantial part of the input. The Amazon training material is uneven across product categories, and the authors connect that unevenness to weaker representations for some electronics and kitchen terms. They suggest collecting additional reviews in those categories as a way to investigate the problem. The paper gives examples of vector neighborhoods and the resulting transfer performance, while leaving the additional-data experiment for future work.

The authors also flag their use of skip-gram embeddings trained on text from more than one review domain. Pooling offers access to more text, but it leaves the representations exposed to differences in use across those categories. A method that explicitly learns a separate representation for a word in each product setting might preserve distinctions that the pooled Amazon embeddings blur. The paper proposes evaluating such embeddings inside the same projection framework. Its reported results apply to the embedding preparation the authors used.

Word identity is another simplifying choice. The projection method can accept non-identical terms, but the main experiments use shared forms as the connection between domains. The authors suggest aligning conceptually related expressions, using the example of reading in books and watching in movies. They also propose connecting multiword expressions that have comparable sentiment roles in different domains. This would require evidence for choosing correspondences between different forms. Results from shared strings do not quantify the benefit of such a lexicon.

The scope of the classification task is also a stated boundary. The paper evaluates binary polarity at the level of a review or message. The authors identify several harder targets for future investigation, including sentiment with additional classes, sentence-level analysis, and sentiment directed at specific aspects of what is discussed. Their proposed text representation averages word vectors. A different granularity of sentiment could require knowing which words describe which part of the input, or which expression qualifies another. The reported experiments show transfer for the labels and unit of classification used here.

A final stated extension is to learn with multiple domain mappings at once. The evaluations fit and test directed source-target transfers. Using the same classification layer on the two sides of a fitted pair demonstrates a form of reuse. Extending that reuse to a collection of targets under one jointly fitted system is a separate question. The authors present large-scale zero-shot domain adaptation in that sense as a goal for further work.

Limits visible in the setup

The evidence for especially effective transfer across divergent domains comes from Amazon reviews as sources and Twitter messages as targets. The Amazon and Twitter groups differ in several ways at once. Reviews tend to give the classifier more features. Twitter targets are class-imbalanced. Their frequency distributions look more distant under the paper's comparison, and the reported evaluation uses a different metric. These observations support the authors' explanation that BLSE handles the particular wider gap well. They leave open how much each property contributes and whether the same ordering would hold for other kinds of divergent corpora.

The direction of that comparison also matters. A Twitter dataset supplying the labeled training texts could give the classifier different evidence from an Amazon source. Testing on Amazon would change the class balance, document length, and available vocabulary at inference. The paper gives no reverse transfers for those corpora. Its result on divergence concerns the evaluated review-to-Twitter direction and the tested comparisons within reviews.

The direct comparisons measure complete systems, so they combine the effects of the projection architecture, the embedding preparation, and the input format. Both the divergence discussion and the feature counts give reasons that the move from sparse to dense inputs might matter. An experiment with target embeddings and a common sentiment classifier but a different alignment rule could help locate the advantage more precisely. The target-matrix ablation answers a narrower question about whether the authors' system can transfer in the illustrated case when that matrix is removed. The lexicon comparison answers a separate question about which practical sources of word pairs work best in the experiments.

Averaging introduces a further limit that follows from the calculation. Rearranging the same word vectors leaves the average unchanged. Two messages containing the same words in different orders will consequently have the same input to the projection, even if their meanings differ. This limits what the procedure can express about word order and about which word falls inside the scope of a negation or modifier. The experiments do not isolate such cases, so the results describe aggregate binary classification rather than robustness to specific compositional patterns.

The evaluation leaves neutral sentiment outside the shared task. Removing that class makes the source and target label sets comparable and allows useful experiments on a binary decision. A system evaluated this way has not been tested on the decision of whether a target message expresses sentiment at all. Likewise, the class-error analysis compares two classes whose frequencies differ in the target data. It characterizes errors within that binary decision and cannot show how the systems would distribute errors across a neutral category.

Some details of the reporting limit quantitative interpretation. The Amazon results table labels its outcomes as accuracy, while the accompanying discussion refers to F₁ when describing its average comparisons. The directional scores from that table are reported here as accuracy. The domain comparison raises a separate ambiguity because the displayed distance expression and the accompanying table behave differently for identical domains. That ambiguity affects reproduction of the distance calculation, while the paper's reported ordering still describes which corpora it treats as similar or distant.

The authors describe the Twitter advantage as significant, and the reported table shows BLSE ahead in every tested review-to-Twitter direction. The results give point scores for each transfer. They do not give uncertainty intervals or a test statistic for the individual differences. This matters for claims about close Amazon results as well. The directional scores establish the order recorded in the experiments, while the variation of those scores across training runs is left unspecified.

What came after

No later citing study is documented here, so a follow-up result cannot be attributed. The paper itself leaves concrete questions open about how far its method could extend. The fitted classifier works with the two routes into the shared space that training has established. The authors propose learning mappings for several domains together, which would test whether a single sentiment decision layer can draw on several domain-specific representations within the same system.

A related question is how to choose correspondences when the useful expressions differ across domains. The paper's reading and watching example identifies the kind of relation the authors want the lexicon to express. The frequency-based lexicon results show the value of having enough anchors for a distant transfer. A concept-based lexicon would also have to establish that individual anchors are meaningful across the two contexts. The paper leaves that balance between coverage and correspondence quality open, particularly for phrases whose sentiment depends on more than a single word.

The proposed extensions to sentiment granularity and embedding preparation would test different parts of the method. A sentence- or aspect-level task would probe whether the shared space retains the distinctions needed to locate sentiment within a text. More explicitly domain-specific embeddings would probe whether retaining separate patterns of word use improves the input to the projections. The reported experiments supply a baseline for these questions: joint alignment and source sentiment training worked especially well from product reviews to the binary Twitter targets, with more variable results among the product review categories.

Cite

Cite as Jeremy Barnes, Roman Klinger and Sabine Schulte im Walde. 2018. Projecting Embeddings for Domain Adaption: Joint Modeling of Sentiment Analysis in Diverse Domains. Proceedings of the 27th International Conference on Computational Linguistics.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{barnes2018projecting,
  title = {{Projecting Embeddings for Domain Adaption: Joint Modeling of Sentiment Analysis in Diverse Domains}},
  author = {Jeremy Barnes, Roman Klinger and Sabine Schulte im Walde},
  booktitle = {Proceedings of the 27th International Conference on Computational Linguistics},
  year = {2018},
  url = {https://aclanthology.org/C18-1070/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/barnes-2018-projecting-embeddings-domain-adaption-joint/