prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. What datasets did they use for evaluation?
Context 1: Introduction
Bidirectional Encoder Representations from Transformers (BERT) is a novel Transformer BIBREF0 model, which recently achieved state-of-the-art performance in several language understanding tasks, such as question answering, natural language inference, semantic similarity, sentiment analysis, and others BIBREF1  While well-suited to dealing with relatively short sequences, Transformers suffer from a major issue that hinders their applicability in classification of long sequences, i e  they are able to consume only a limited context of symbols as their input BIBREF2 
There are several natural language (NLP) processing tasks that involve such long sequences  Of particular interest are topic identification of spoken conversations BIBREF3, BIBREF4, BIBREF5 and call center customer satisfaction prediction BIBREF6, BIBREF7, BIBREF8, BIBREF9  Call center conversations, while usually quite short and to the point, often involve agents trying to solve very complex issues that the customers experience, resulting in some calls taking even an hour or more  For speech analytics purposes, these calls are typically transcribed using an automatic speech recognition (ASR) system, and processed in textual representations further down the NLP pipeline  These transcripts sometimes exceed the length of 5000 words  Furthermore, temporal information might play an important role in tasks like CSAT  For example, a customer may be angry at the beginning of the call, but after her issue is resolved, she would be very satisfied with the way it was handled  Therefore, simple bag of words models, or any model that does not include temporal dependencies between the inputs, may not be well-suited to handle this category of tasks  This motivates us to employ model such as BERT in this task 
In this paper, we propose a method that builds upon BERT's architecture  We split the input text sequence into shorter segments in order to obtain a representation for each of them using BERT  Then, we use either a recurrent LSTM BIBREF10 network, or another Transformer, to perform the actual classification  We call these techniques Recurrence over BERT (RoBERT) and Transformer over BERT (ToBERT)  Given that these models introduce a hierarchy of representations (segment-wise and document-wise), we refer to them as Hierarchical Transformers  To the best of our knowledge, no attempt has been done before to use the Transformer architecture for classification of such long sequences 
Our novel contributions are:
Two extensions - RoBERT and ToBERT - to the BERT model, which enable its application in classification of long texts by performing segmentation and using another layer on top of the segment representations 
State-of-the-art results on the Fisher topic classification task 
Significant improvement on the CSAT prediction task over the MS-CNN model 
Related work
Several dimensionality reduction algorithms such as RBM, autoencoders, subspace multinomial models (SMM) are used to obtain a low dimensional representation of documents from a simple BOW representation and then classify it using a simple linear classifiers BIBREF11, BIBREF12, BIBREF13, BIBREF4  In BIBREF14 hierarchical attention networks are used for document classification  They evaluate their model on several datasets with average number of words around 150  Character-level CNN are explored in BIBREF15 but it is prohibitive for very long documents  In BIBREF16, dataset collected from arXiv papers is used for classification  For classification, they sample random blocks of words and use them together for classification instead of using full document which may work well as arXiv papers are usually coherent and well written on a well defined topic  Their method may not work well on spoken conversations as random block of words usually do not represent topic of full conversation 
Several researchers addressed the problem of predicting customer satisfaction BIBREF6, BIBREF7, BIBREF8, BIBREF9  In most of these works, logistic regression, SVM, CNN are applied on different kinds of representations 
In BIBREF17, authors use BERT for document classification but the average document length is less than BERT maximum length 512  TransformerXL BIBREF2 is an extension to the Transformer architecture that allows it to better deal with long inputs for the language modelling task  It relies on the auto-regressive property of the model, which is not the case in our tasks 
Method ::: BERT
Because our work builds heavily upon BERT, we provide a brief summary of its features  BERT is built upon the Transformer architecture BIBREF0, which uses self-attention, feed-forward layers, residual connections and layer normalization as the main building blocks  It has two pre-training objectives:
Masked language modelling - some of the words in a sentence are being masked and the model has to predict them based on the context (note the difference from the typical autoregressive language model training objective);
Next sentence prediction - given two input sequences, decide whether the second one is the next sentence or not 
BERT has been shown to beat the state-of-the-art performance on 11 tasks with no modifications to the model architecture, besides adding a task-specific output layer BIBREF1  We follow same procedure suggested in BIBREF1 for our tasks  Fig  FIGREF8 shows the BERT model for classification  We obtain two kinds of representation from BERT: pooled output from last transformer block, denoted by H, and posterior probabilities, denoted by P  There are two variants of BERT - BERT-Base and BERT-Large  In this work we are using BERT-Base for faster training and experimentation, however, our methods are applicable to BERT-Large as well  BERT-Base and BERT-Large are different in model parameters such as number of transformer blocks, number of self-attention heads  Total number of parameters in BERT-Base are 110M and 340M in BERT-Large 
BERT suffers from major limitations in terms of handling long sequences  Firstly, the self-attention layer has a quadratic complexity $O(n^2)$ in terms of the sequence length $n$ BIBREF0  Secondly, BERT uses a learned positional embeddings scheme BIBREF1, which means that it won't likely be able to generalize to positions beyond those seen in the training data 
To investigate the effect of fine-tuning BERT on task performance, we use either the pre-trained BERT weights, or the weights from a BERT fine-tuned on the task-specific dataset on a segment-level (i e  we preserve the original label but fine-tune on each segment separately instead of on the whole text sequence)  We compare these results to using the fine-tuned segment-level BERT predictions directly as inputs to the next layer 
Method ::: Recurrence over BERT
Given that BERT is limited to a particular input length, we split the input sequence into segments of a fixed size with overlap  For each of these segments, we obtain H or P from BERT model  We then stack these segment-level representations into a sequence, which serves as input to a small (100-dimensional) LSTM layer  Its output serves as a document embedding  Finally, we use two fully connected layers with ReLU (30-dimensional) and softmax (the same dimensionality as the number of classes) activations to obtain the final predictions 
With this approach, we overcome BERT's computational complexity, reducing it to $O(n/k * k^2) = O(nk)$ for RoBERT, with $k$ denoting the segment size (the LSTM component has negligible linear complexity $O(k)$)  The positional embeddings are also no longer an issue 
Method ::: Transformer over BERT
Given that Transformers' edge over recurrent networks is their ability to effectively capture long distance relationships between words in a sequence BIBREF0, we experiment with replacing the LSTM recurrent layer in favor of a small Transformer model (2 layers of transformer building block containing self-attention, fully connected, etc )  To investigate if preserving the information about the input sequence order is important, we also build a variant of ToBERT which learns positional embeddings at the segment-level representations (but is limited to sequences of length seen during the training) 
ToBERT's computational complexity $O(\frac{n^2}{k^2})$ is asymptotically inferior to RoBERT, as the top-level Transformer model again suffers from quadratic complexity in the number of segments  However, in practice this number is much smaller than the input sequence length (${\frac{n}{k}} << n$), so we haven't observed performance or memory issues with our datasets 
Experiments
We evaluated our models on 3 different datasets:
CSAT dataset for CSAT prediction, consisting of spoken transcripts (automatic via ASR) 
20 newsgroups for topic identification task, consisting of written text;
Fisher Phase 1 corpus for topic identification task, consisting of spoken transcripts (manual);
Experiments ::: CSAT
CSAT dataset consists of US English telephone speech from call centers  For each call in this dataset, customers participated in that call gave a rating on his experience with agent  Originally, this dataset has labels rated on a scale 1-9 with 9 being extremely satisfied and 1 being extremely dissatisfied  Fig  FIGREF16 shows the histogram of ratings for our dataset  As the distribution is skewed towards extremes, we choose to do binary classification with ratings above 4 5 as satisfied and below 4 5 as dissatisfied  Quantization of ratings also helped us to create a balanced dataset  This dataset contains 4331 calls and we split them into 3 sets for our experiments: 2866 calls for training, 362 calls for validation and, finally, 1103 calls for testing 
We obtained the transcripts by employing an ASR system  The ASR system uses TDNN-LSTM acoustic model trained on Fisher and Switchboard datasets with lattice-free maximum mutual information criterion BIBREF18  The word error rates using four-gram language models were 9 2% and 17 3% respectively on Switchboard and CallHome portions of Eval2000 dataset 
Experiments ::: 20 newsgroups
20 newsgroups data set is one of the frequently used datasets in the text processing community for text classification and text clustering  This data set contains approximately 20,000 English documents from 20 topics to be identified, with 11314 documents for training and 7532 for testing  In this work, we used only 90% of documents for training and the remaining 10% for validation  For fair comparison with other publications, we used 53160 words vocabulary set available in the datasets website 
Experiments ::: Fisher
Fisher Phase 1 US English corpus is often used for automatic speech recognition in speech community  In this work, we used it for topic identification as in BIBREF3  The documents are 10-minute long telephone conversations between two people discussing a given topic  We used same training and test splits as BIBREF3 in which 1374 and 1372 documents are used for training and testing respectively  For validation of our model, we used 10% of training dataset and the remaining 90% was used for actual model training  The number of topics in this data set is 40 
Experiments ::: Dataset Statistics
Table TABREF22 shows statistics of our datasets  It can be observed that average length of Fisher is much higher than 20 newsgroups and CSAT  Cumulative distribution of document lengths for each dataset is shown in Fig  FIGREF21  It can be observed that almost all of the documents in Fisher dataset have length more than 1000 words  For CSAT, more than 50% of the documents have length greater than 500 and for 20newsgroups only 10% of the documents have length greater than 500  Note that, for CSAT and 20newsgroups, there are few documents with length more than 5000 
Experiments ::: Architecture and Training Details
In this work, we split document into segments of 200 tokens with a shift of 50 tokens to extract features from BERT model  For RoBERT, LSTM model is trained to minimize cross-entropy loss with Adam optimizer BIBREF19  The initial learning rate is set to $0 001$ and is reduced by a factor of $0 95$ if validation loss does not decrease for 3-epochs  For ToBERT, the Transformer is trained with the default BERT version of Adam optimizer BIBREF1 with an initial learning rate of $5e$-5  We report accuracy in all of our experiments  We chose a model with the best validation accuracy to calculate accuracy on the test set  To accomodate for non-determinism of some TensorFlow GPU operations, we report accuracy averaged over 5 runs 
Results
Table TABREF25 presents results using pre-trained BERT features  We extracted features from the pooled output of final transformer block as these were shown to be working well for most of the tasks BIBREF1  The features extracted from a pre-trained BERT model without any fine-tuning lead to a sub-par performance  However, We also notice that ToBERT model exploited the pre-trained BERT features better than RoBERT  It also converged faster than RoBERT  Table TABREF26 shows results using features extracted after fine-tuning BERT model with our datasets  Significant improvements can be observed compared to using pre-trained BERT features  Also, it can be noticed that ToBERT outperforms RoBERT on Fisher and 20newsgroups dataset by 13 63% and 0 81% respectively  On CSAT, ToBERT performs slightly worse than RoBERT but it is not statistically significant as this dataset is small 
Table TABREF27 presents results using fine-tuned BERT predictions instead of the pooled output from final transformer block  For each document, having obtained segment-wise predictions we can obtain final prediction for the whole document in three ways:
Compute the average of all segment-wise predictions and find the most probable class;
Find the most frequently predicted class;
Train a classification model 
It can be observed from Table TABREF27 that a simple averaging operation or taking most frequent predicted class works competitively for CSAT and 20newsgroups but not for the Fisher dataset  We believe the improvements from using RoBERT or ToBERT, compared to simple averaging or most frequent operations, are proportional to the fraction of long documents in the dataset  CSAT and 20newsgroups have (on average) significantly shorter documents than Fisher, as seen in Fig  FIGREF21  Also, significant improvements for Fisher could be because of less confident predictions from BERT model as this dataset has 40 classes  Fig  FIGREF31 presents the comparison of average voting and ToBERT for various document length ranges for Fisher dataset  We used fine-tuned BERT segment-level predictions (P) for this analysis  It can be observed that ToBERT outperforms average voting in every interval  To the best of our knowledge, this is a state-of-the-art result reported on the Fisher dataset 
Table TABREF32 presents the effect of position embeddings on the model performance  It can be observed that position embeddings did not significantly affect the model performance for Fisher and 20newsgroups, but they helped slightly in CSAT prediction (an absolute improvement of 0 64% F1-score)  We think that this is explained by the fact that Fisher and 20newsgroups are topic identification tasks, and the topic does not change much throughout these documents  However, CSAT may vary during the call, and in some cases a naive assumption that the sequential nature of the transcripts is irrelevant may lead to wrong conclusions 
Table TABREF33 compares our results with previous works  It can be seen that our model ToBERT outperforms CNN based experiments by significant margin on CSAT and Fisher datasets  For CSAT dataset, we used multi-scale CNN (MS-CNN) as the baseline, given its strong results on Fisher and 20newsgroups  The setup was replicated from BIBREF5 for comparison  We also see that our result on 20 newsgroups is 0 6% worse than the state-of-the-art 
Conclusions
In this paper, we presented two methods for long documents using BERT model: RoBERT and ToBERT  We evaluated our experiments on two classification tasks - customer satisfaction prediction and topic identification - using 3 datasets: CSAT, 20newsgroups and Fisher  We observed that ToBERT outperforms RoBERT on pre-trained BERT features and fine-tuned BERT features for all our tasks  Also, we noticed that fine-tuned BERT performs better than pre-trained BERT  We have shown that both RoBERT and ToBERT improved the simple baselines of taking an average (or the most frequent) of segment-wise predictions for long documents to obtain final prediction  Position embeddings did not significantly affect our models performance, but slightly improved the accuracy on the CSAT task  We obtained the best results on Fisher dataset and good improvements for CSAT task compared to the CNN baseline  It is interesting to note that the longer the average input in a given task, the bigger improvement we observe w r t  the baseline for that task  Our results confirm that both RoBERT and ToBERT can be used for long sequences with competitive performance and quick fine-tuning procedure  For future work, we shall focus on training models on long documents directly (i e  in an end-to-end manner) 
Context 2: Introduction
In practice, it is often difficult and costly to annotate sufficient training data for diverse application domains on-the-fly  We may have sufficient labeled data in an existing domain (called the source domain), but very few or no labeled data in a new domain (called the target domain)  This issue has motivated research on cross-domain sentiment classification, where knowledge in the source domain is transferred to the target domain in order to alleviate the required labeling effort 
One key challenge of domain adaptation is that data in the source and target domains are drawn from different distributions  Thus, adaptation performance will decline with an increase in distribution difference  Specifically, in sentiment analysis, reviews of different products have different vocabulary  For instance, restaurants reviews would contain opinion words such as “tender”, “tasty”, or “undercooked” and movie reviews would contain “thrilling”, “horrific”, or “hilarious”  The intersection between these two sets of opinion words could be small which makes domain adaptation difficult 
Several techniques have been proposed for addressing the problem of domain shifting  The aim is to bridge the source and target domains by learning domain-invariant feature representations so that a classifier trained on a source domain can be adapted to another target domain  In cross-domain sentiment classification, many works BIBREF0 , BIBREF1 , BIBREF2 , BIBREF3 , BIBREF4 utilize a key intuition that domain-specific features could be aligned with the help of domain-invariant features (pivot features)  For instance, “hilarious” and “tasty” could be aligned as both of them are relevant to “good” 
Despite their promising results, these works share two major limitations  First, they highly depend on the heuristic selection of pivot features, which may be sensitive to different applications  Thus the learned new representations may not effectively reduce the domain difference  Furthermore, these works only utilize the unlabeled target data for representation learning while the sentiment classifier was solely trained on the source domain  There have not been many studies on exploiting unlabeled target data for refining the classifier, even though it may contain beneficial information  How to effectively leverage unlabeled target data still remains an important challenge for domain adaptation 
In this work, we argue that the information from unlabeled target data is beneficial for domain adaptation and we propose a novel Domain Adaptive Semi-supervised learning framework (DAS) to better exploit it  Our main intuition is to treat the problem as a semi-supervised learning task by considering target instances as unlabeled data, assuming the domain distance can be effectively reduced through domain-invariant representation learning  Specifically, the proposed approach jointly performs feature adaptation and semi-supervised learning in a multi-task learning setting  For feature adaptation, it explicitly minimizes the distance between the encoded representations of the two domains  On this basis, two semi-supervised regularizations – entropy minimization and self-ensemble bootstrapping – are jointly employed to exploit unlabeled target data for classifier refinement 
We evaluate our method rigorously under multiple experimental settings by taking label distribution and corpus size into consideration  The results show that our model is able to obtain significant improvements over strong baselines  We also demonstrate through a series of analysis that the proposed method benefits greatly from incorporating unlabeled target data via semi-supervised learning, which is consistent with our motivation  Our datasets and source code can be obtained from https://github com/ruidan/DAS 
Related Work
Domain Adaptation: The majority of feature adaptation methods for sentiment analysis rely on a key intuition that even though certain opinion words are completely distinct for each domain, they can be aligned if they have high correlation with some domain-invariant opinion words (pivot words) such as “excellent” or “terrible”  Blitzer et al  ( BIBREF0 ) proposed a method based on structural correspondence learning (SCL), which uses pivot feature prediction to induce a projected feature space that works well for both the source and the target domains  The pivot words are selected in a way to cover common domain-invariant opinion words  Subsequent research aims to better align the domain-specific words BIBREF1 , BIBREF5 , BIBREF3 such that the domain discrepancy could be reduced  More recently, Yu and Jiang ( BIBREF4 ) borrow the idea of pivot feature prediction from SCL and extend it to a neural network-based solution with auxiliary tasks  In their experiment, substantial improvement over SCL has been observed due to the use of real-valued word embeddings  Unsupervised representation learning with deep neural networks (DNN) such as denoising autoencoders has also been explored for feature adaptation BIBREF6 , BIBREF7 , BIBREF8   It has been shown that DNNs could learn transferable representations that disentangle the underlying factors of variation behind data samples 
Although the aforementioned methods aim to reduce the domain discrepancy, they do not explicitly minimize the distance between distributions, and some of them highly rely on the selection of pivot features  In our method, we formally construct an objective for this purpose  Similar ideas have been explored in many computer vision problems, where the representations of the underlying domains are encouraged to be similar through explicit objectives BIBREF9 , BIBREF10 , BIBREF11 , BIBREF12 , BIBREF13 such as maximum mean discrepancy (MMD) BIBREF14   In NLP tasks, Li et al  ( BIBREF15 ) and Chen et al  ( BIBREF16 ) both proposed using adversarial training framework for reducing domain difference  In their model, a sub-network is added as a domain discriminator while deep features are learned to confuse the discriminator  The feature adaptation component in our model shares similar intuition with MMD and adversary training  We will show a detailed comparison with them in our experiments 
Semi-supervised Learning: We attempt to treat domain adaptation as a semi-supervised learning task by considering the target instances as unlabeled data  Some efforts have been initiated on transfer learning from unlabeled data BIBREF17 , BIBREF18 , BIBREF19   In our model, we reduce the domain discrepancy by feature adaptation, and thereafter adopt semi-supervised learning techniques to learn from unlabeled data  Primarily motivated by BIBREF20 and BIBREF21 , we employed entropy minimization and self-ensemble bootstrapping as regularizations to incorporate unlabeled data  Our experimental results show that both methods are effective when jointly trained with the feature adaptation objective, which confirms to our motivation 
Notations and Model Overview
We conduct most of our experiments under an unsupervised domain adaptation setting, where we have no labeled data from the target domain  Consider two sets INLINEFORM0 and INLINEFORM1   INLINEFORM2 is from the source domain with INLINEFORM3 labeled examples, where INLINEFORM4 is a one-hot vector representation of sentiment label and INLINEFORM5 denotes the number of classes  INLINEFORM6 is from the target domain with INLINEFORM7 unlabeled examples  INLINEFORM8 denotes the total number of training documents including both labeled and unlabeled  We aim to learn a sentiment classifier from INLINEFORM13 and INLINEFORM14 such that the classifier would work well on the target domain  We also present some results under a setting where we assume that a small number of labeled target examples are available (see Figure FIGREF27 ) 
For the proposed model, we denote INLINEFORM0 parameterized by INLINEFORM1 as a neural-based feature encoder that maps documents from both domains to a shared feature space, and INLINEFORM2 parameterized by INLINEFORM3 as a fully connected layer with softmax activation serving as the sentiment classifier  We aim to learn feature representations that are domain-invariant and at the same time discriminative on both domains, thus we simultaneously consider three factors in our objective: (1) minimize the classification error on the labeled source examples; (2) minimize the domain discrepancy; and (3) leverage unlabeled data via semi-supervised learning 
Suppose we already have the encoded features of documents INLINEFORM0 (see Section SECREF10 ), the objective function for purpose (1) is thus the cross entropy loss on the labeled source examples DISPLAYFORM0
where INLINEFORM0 denotes the predicted label distribution  In the following subsections, we will explain how to perform feature adaptation and domain adaptive semi-supervised learning in details for purpose (2) and (3) respectively 
Feature Adaptation
Unlike prior works BIBREF0 , BIBREF4 , our method does not attempt to align domain-specific words through pivot words  In our preliminary experiments, we found that word embeddings pre-trained on a large corpus are able to adequately capture this information  As we will later show in our experiments, even without adaptation, a naive neural network classifier with pre-trained word embeddings can already achieve reasonably good results 
We attempt to explicitly minimize the distance between the source and target feature representations ( INLINEFORM0 and INLINEFORM1 )  A few methods from literature can be applied such as Maximum Mean Discrepancy (MMD) BIBREF14 or adversary training BIBREF15 , BIBREF16   The main idea of MMD is to estimate the distance between two distributions as the distance between sample means of the projected embeddings in Hilbert space  MMD is implicitly computed through a characteristic kernel, which is used to ensure that the sample mean is injective, leading to the MMD being zero if and only if the distributions are identical  In our implementation, we skip the mapping procedure induced by a characteristic kernel for simplifying the computation and learning  We simply estimate the distribution distance as the distance between the sample means in the current embedding space  Although this approximation cannot preserve all statistical features of the underlying distributions, we find it performs comparably to MMD on our problem  The following equations formally describe the feature adaptation loss INLINEFORM2 : DISPLAYFORM0
INLINEFORM0 normalization is applied on the mean representations INLINEFORM1 and INLINEFORM2 , rescaling the vectors such that all entries sum to 1  We adopt a symmetric version of KL divergence BIBREF12 as the distance function  Given two distribution vectors INLINEFORM3 , INLINEFORM4  
Domain Adaptive Semi-supervised Learning (DAS)
We attempt to exploit the information in target data through semi-supervised learning objectives, which are jointly trained with INLINEFORM0 and INLINEFORM1   Normally, to incorporate target data, we can minimize the cross entropy loss between the true label distributions INLINEFORM2 and the predicted label distributions INLINEFORM3 over target samples  The challenge here is that INLINEFORM4 is unknown, and thus we attempt to estimate it via semi-supervised learning  We use entropy minimization and bootstrapping for this purpose  We will later show in our experiments that both methods are effective, and jointly employing them overall yields the best results 
Entropy Minimization: In this method, INLINEFORM0 is estimated as the predicted label distribution INLINEFORM1 , which is a function of INLINEFORM2 and INLINEFORM3   The loss can thus be written as DISPLAYFORM0
Assume the domain discrepancy can be effectively reduced through feature adaptation, by minimizing the entropy penalty, training of the classifier is influenced by the unlabeled target data and will generally maximize the margins between the target examples and the decision boundaries, increasing the prediction confidence on the target domain 
Self-ensemble Bootstrapping: Another way to estimate INLINEFORM0 corresponds to bootstrapping  The idea is to estimate the unknown labels as the predictions of the model learned from the previous round of training  Bootstrapping has been explored for domain adaptation in previous works BIBREF18 , BIBREF19   However, in their methods, domain discrepancy was not explicitly minimized via feature adaptation  Applying bootstrapping or other semi-supervised learning techniques in this case may worsen the results as the classifier can perform quite bad on the target data 
[t] Pseudocode for training DAS INLINEFORM0 , INLINEFORM1 , INLINEFORM2 , INLINEFORM3 INLINEFORM4 = ensembling momentum, INLINEFORM5 INLINEFORM6 = weight ramp-up function INLINEFORM7 INLINEFORM8 INLINEFORM9 each minibatch INLINEFORM10 , INLINEFORM11 , INLINEFORM12 in
INLINEFORM0 , INLINEFORM1 , INLINEFORM2 compute loss INLINEFORM3 on INLINEFORM4 compute loss INLINEFORM5 on INLINEFORM6 compute loss INLINEFORM7 on INLINEFORM8 compute loss INLINEFORM9 on INLINEFORM10 INLINEFORM11
update network parameters INLINEFORM0 , for INLINEFORM1 INLINEFORM2 INLINEFORM3
Inspired by the ensembling method proposed in BIBREF21 , we estimate INLINEFORM0 by forming ensemble predictions of labels during training, using the outputs on different training epochs  The loss is formulated as follows: DISPLAYFORM0
where INLINEFORM0 denotes the estimated labels computed on the ensemble predictions from different epochs  The loss is applied on all documents  It serves for bootstrapping on the unlabeled target data, and it also serves as a regularization that encourages the network predictions to be consistent in different training epochs  INLINEFORM1 is jointly trained with INLINEFORM2 , INLINEFORM3 , and INLINEFORM4   Algorithm SECREF6 illustrates the overall training process of the proposed domain adaptive semi-supervised learning (DAS) framework 
In Algorithm SECREF6 , INLINEFORM0 , INLINEFORM1 , and INLINEFORM2 are weights to balance the effects of INLINEFORM3 , INLINEFORM4 , and INLINEFORM5 respectively  INLINEFORM6 and INLINEFORM7 are constant hyper-parameters  We set INLINEFORM8 as a Gaussian curve to ramp up the weight from 0 to INLINEFORM9   This is to ensure the ramp-up of the bootstrapping loss component is slow enough in the beginning of the training  After each training epoch, we compute INLINEFORM10 which denotes the predictions made by the network in current epoch, and then the ensemble prediction INLINEFORM11 is updated as a weighted average of the outputs from previous epochs and the current epoch, with recent epochs having larger weight  For generating estimated labels INLINEFORM12 , INLINEFORM13 is converted to a one-hot vector where the entry with the maximum value is set to one and other entries are set to zeros  The self-ensemble bootstrapping is a generalized version of bootstrappings that only use the outputs from the previous round of training BIBREF18 , BIBREF19   The ensemble prediction is likely to be closer to the correct, unknown labels of the target data 
CNN Encoder Implementation
We have left the feature encoder INLINEFORM0 unspecified, for which, a few options can be considered  In our implementation, we adopt a one-layer CNN structure from previous works BIBREF22 , BIBREF4 , as it has been demonstrated to work well for sentiment classification tasks  Given a review document INLINEFORM1 consisting of INLINEFORM2 words, we begin by associating each word with a continuous word embedding BIBREF23 INLINEFORM3 from an embedding matrix INLINEFORM4 , where INLINEFORM5 is the vocabulary size and INLINEFORM6 is the embedding dimension  INLINEFORM7 is jointly updated with other network parameters during training  Given a window of dense word embeddings INLINEFORM8 , the convolution layer first concatenates these vectors to form a vector INLINEFORM9 of length INLINEFORM10 and then the output vector is computed by Equation ( EQREF11 ): DISPLAYFORM0
INLINEFORM0 , INLINEFORM1 is the parameter set of the encoder INLINEFORM2 and is shared across all windows of the sequence  INLINEFORM3 is an element-wise non-linear activation function  The convolution operation can capture local contextual dependencies of the input sequence and the extracted feature vectors are similar to INLINEFORM4 -grams  After the convolution operation is applied to the whole sequence, we obtain a list of hidden vectors INLINEFORM5   A max-over-time pooling layer is applied to obtain the final vector representation INLINEFORM6 of the input document 
Datasets and Experimental Settings
Existing benchmark datasets such as the Amazon benchmark BIBREF0 typically remove reviews with neutral labels in both domains  This is problematic as the label information of the target domain is not accessible in an unsupervised domain adaptation setting  Furthermore, removing neutral instances may bias the dataset favorably for max-margin-based algorithms like ours, since the resulting dataset has all uncertain labels removed, leaving only high confidence examples  Therefore, we construct new datasets by ourselves  The results on the original Amazon benchmark is qualitatively similar, and we present them in Appendix SECREF6 for completeness since most of previous works reported results on it 
Small-scale datasets: Our new dataset was derived from the large-scale Amazon datasets released by McAuley et al  ( BIBREF24 )  It contains four domains: Book (BK), Electronics (E), Beauty (BT), and Music (M)  Each domain contains two datasets  Set 1 contains 6000 instances with exactly balanced class labels, and set 2 contains 6000 instances that are randomly sampled from the large dataset, preserving the original label distribution, which we believe better reflects the label distribution in real life  The examples in these two sets do not overlap  Detailed statistics of the generated datasets are given in Table TABREF9  
In all our experiments on the small-scale datasets, we use set 1 of the source domain as the only source with sentiment label information during training, and we evaluate the trained model on set 1 of the target domain  Since we cannot control the label distribution of unlabeled data during training, we consider two different settings:
Setting (1): Only set 1 of the target domain is used as the unlabeled set  This tells us how the method performs in a condition when the target domain has a close-to-balanced label distribution  As we also evaluate on set 1 of the target domain, this is also considered as a transductive setting 
Setting (2): Set 2 from both the source and target domains are used as unlabeled sets
Context 3: Introduction
Pretrained Language Models (PTLMs) such as BERT BIBREF1 have spearheaded advances on many NLP tasks  Usually, PTLMs are pretrained on unlabeled general-domain and/or mixed-domain text, such as Wikipedia, digital books or the Common Crawl corpus 
When applying PTLMs to specific domains, it can be useful to domain-adapt them  Domain adaptation of PTLMs has typically been achieved by pretraining on target-domain text  One such model is BioBERT BIBREF2, which was initialized from general-domain BERT and then pretrained on biomedical scientific publications  The domain adaptation is shown to be helpful for target-domain tasks such as biomedical Named Entity Recognition (NER) or Question Answering (QA)  On the downside, the computational cost of pretraining can be considerable: BioBERTv1 0 was adapted for ten days on eight large GPUs (see Table TABREF1), which is expensive, environmentally unfriendly, prohibitive for small research labs and students, and may delay prototyping on emerging domains 
We therefore propose a fast, CPU-only domain-adaptation method for PTLMs: We train Word2Vec BIBREF3 on target-domain text and align the resulting word vectors with the wordpiece vectors of an existing general-domain PTLM  The PTLM thus gains domain-specific lexical knowledge in the form of additional word vectors, but its deeper layers remain unchanged  Since Word2Vec and the vector space alignment are efficient models, the process requires a fraction of the resources associated with pretraining the PTLM itself, and it can be done on CPU 
In Section SECREF4, we use the proposed method to domain-adapt BERT on PubMed+PMC (the data used for BioBERTv1 0) and/or CORD-19 (Covid-19 Open Research Dataset)  We improve over general-domain BERT on eight out of eight biomedical NER tasks, using a fraction of the compute cost associated with BioBERT  In Section SECREF5, we show how to quickly adapt an existing Question Answering model to text about the Covid-19 pandemic, without any target-domain Language Model pretraining or finetuning 
Related work ::: The BERT PTLM
For our purpose, a PTLM consists of three parts: A tokenizer $\mathcal {T}_\mathrm {LM} : \mathbb {L}^+ \rightarrow \mathbb {L}_\mathrm {LM}^+$, a wordpiece embedding function $\mathcal {E}_\mathrm {LM}: \mathbb {L}_\mathrm {LM} \rightarrow \mathbb {R}^{d_\mathrm {LM}}$ and an encoder function $\mathcal {F}_\mathrm {LM}$  $\mathbb {L}_\mathrm {LM}$ is a limited vocabulary of wordpieces  All words that are not in $\mathbb {L}_\mathrm {LM}$ are tokenized into sequences of shorter wordpieces, e g , tachycardia becomes ta ##chy ##card ##ia  Given a sentence $S = [w_1, \ldots , w_T]$, tokenized as $\mathcal {T}_\mathrm {LM}(S) = [\mathcal {T}_\mathrm {LM}(w_1); \ldots ; \mathcal {T}_\mathrm {LM}(w_T)]$, $\mathcal {E}_\mathrm {LM}$ embeds every wordpiece in $\mathcal {T}_\mathrm {LM}(S)$ into a real-valued, trainable wordpiece vector  The wordpiece vectors of the entire sequence are stacked and fed into $\mathcal {F}_\mathrm {LM}$  Note that we consider position and segment embeddings to be a part of $\mathcal {F}_\mathrm {LM}$ rather than $\mathcal {E}_\mathrm {LM}$ 
In the case of BERT, $\mathcal {F}_\mathrm {LM}$ is a Transformer BIBREF4, followed by a final Feed-Forward Net  During pretraining, the Feed-Forward Net predicts the identity of masked wordpieces  When finetuning on a supervised task, it is usually replaced with a randomly initialized task-specific layer 
Related work ::: Domain-adapted PTLMs
Domain adaptation of PTLMs is typically achieved by pretraining on unlabeled target-domain text  Some examples of such models are BioBERT BIBREF2, which was pretrained on the PubMed and/or PubMed Central (PMC) corpora, SciBERT BIBREF5, which was pretrained on papers from SemanticScholar, ClinicalBERT BIBREF6, BIBREF7 and ClinicalXLNet BIBREF8, which were pretrained on clinical patient notes, and AdaptaBERT BIBREF9, which was pretrained on Early Modern English text  In most cases, a domain-adapted PTLM is initialized from a general-domain PTLM (e g , standard BERT), though BIBREF5 report better results with a model that was pretrained from scratch with a custom wordpiece vocabulary  In this paper, we focus on BioBERT, as its domain adaptation corpora are publicly available 
Related work ::: Word vectors
Word vectors are distributed representations of words that are trained on unlabeled text  Contrary to PTLMs, word vectors are non-contextual, i e , a word type is always assigned the same vector, regardless of context  In this paper, we use Word2Vec BIBREF3 to train word vectors  We will denote the Word2Vec lookup function as $\mathcal {E}_\mathrm {W2V} : \mathbb {L}_\mathrm {W2V} \rightarrow \mathbb {R}^{d_\mathrm {W2V}}$ 
Related work ::: Word vector space alignment
Word vector space alignment has most frequently been explored in the context of cross-lingual word embeddings  For instance, BIBREF10 align English and Spanish Word2Vec spaces by a simple linear transformation  BIBREF11 use a related method to align cross-lingual word vectors and multilingual BERT wordpiece vectors 
Method
In the following, we assume access to a general-domain PTLM, as described in Section SECREF2, and a corpus of unlabeled target-domain text 
Method ::: Creating new input vectors
In a first step, we train Word2Vec on the target-domain corpus  In a second step, we take the intersection of $\mathbb {L}_\mathrm {LM}$ and $\mathbb {L}_\mathrm {W2V}$  In practice, the intersection mostly contains wordpieces from $\mathbb {L}_\mathrm {LM}$ that correspond to standalone words  It also contains single characters and other noise, however, we found that filtering them does not improve alignment quality  In a third step, we use the intersection to fit an unconstrained linear transformation $\mathbf {W} \in \mathbb {R}^{d_\mathrm {LM} \times d_\mathrm {W2V}}$ via least squares:
Intuitively, $\mathbf {W}$ makes Word2Vec vectors “look like” the PTLM's native wordpiece vectors, just like cross-lingual alignment makes word vectors from one language “look like” word vectors from another language  In Table TABREF7 (top), we show examples of within-space and cross-space nearest neighbors after alignment 
Method ::: Updating the wordpiece embedding layer
Next, we redefine the wordpiece embedding layer of the PTLM  The most radical strategy would be to replace the entire layer with the aligned Word2Vec vectors:
In initial experiments, this strategy led to a drop in performance, presumably because function words are not well represented by Word2Vec, and replacing them disrupts BERT's syntactic abilities  To prevent this problem, we leave existing wordpiece vectors intact and only add new ones:
Method ::: Updating the tokenizer
In a final step, we update the tokenizer to account for the added words  Let $\mathcal {T}_\mathrm {LM}$ be the standard BERT tokenizer, and let $\hat{\mathcal {T}}_\mathrm {LM}$ be the tokenizer that treats all words in $\mathbb {L}_\mathrm {LM} \cup \mathbb {L}_\mathrm {W2V}$ as one-wordpiece tokens, while tokenizing any other words as usual 
In practice, a given word may or may not benefit from being tokenized by $\hat{\mathcal {T}}_\mathrm {LM}$ instead of $\mathcal {T}_\mathrm {LM}$  To give a concrete example, 82% of the words in the BC5CDR NER dataset that end in the suffix -ia are inside a disease entity (e

ground_truth: CSAT dataset, 20 newsgroups, Fisher Phase 1 corpus

CSAT dataset , 20 newsgroups, Fisher Phase 1 corpus

prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. What are the source and target domains?
Context 2:  Since set 2 is directly sampled from millions of reviews, it better reflects real-life sentiment distribution 
Large-scale datasets: We further conduct experiments on four much larger datasets: IMDB (I), Yelp2014 (Y), Cell Phone (C), and Baby (B)  IMDB and Yelp2014 were previously used in BIBREF25 , BIBREF26   Cell phone and Baby are from the large-scale Amazon dataset BIBREF24 , BIBREF27   Detailed statistics are summarized in Table TABREF9   We keep all reviews in the original datasets and consider a transductive setting where all target examples are used for both training (without label information) and evaluation  We perform sampling to balance the classes of labeled source data in each minibatch INLINEFORM3 during training 
Selection of Development Set
Ideally, the development set should be drawn from the same distribution as the test set  However, under the unsupervised domain adaptation setting, we do not have any labeled target data at training phase which could be used as development set  In all of our experiments, for each pair of domains, we instead sample 1000 examples from the training set of the source domain as development set  We train the network for a fixed number of epochs, and the model with the minimum classification error on this development set is saved for evaluation  This approach works well on most of the problems since the target domain is supposed to behave like the source domain if the domain difference is effectively reduced 
Another problem is how to select the values for hyper-parameters  If we tune INLINEFORM0 and INLINEFORM1 directly on the development set from the source domain, most likely both of them will be set to 0, as unlabeled target data is not helpful for improving in-domain accuracy of the source domain  Other neural network models also have the same problem for hyper-parameter tuning  Therefore, our strategy is to use the development set from the target domain to optimize INLINEFORM2 and INLINEFORM3 for one problem (e g , we only do this on E INLINEFORM4 BK), and fix their values on the other problems  This setting assumes that we have at least two labeled domains such that we can optimize the hyper-parameters, and then we fix them for other new unlabeled domains to transfer to 
Training Details and Hyper-parameters
We initialize word embeddings using the 300-dimension GloVe vectors supplied by Pennington et al , ( BIBREF28 ), which were trained on 840 billion tokens from the Common Crawl  For each pair of domains, the vocabulary consists of the top 10000 most frequent words  For words in the vocabulary but not present in the pre-trained embeddings, we randomly initialize them 
We set hyper-parameters of the CNN encoder following previous works BIBREF22 , BIBREF4 without specific tuning on our datasets  The window size is set to 3 and the size of the hidden layer is set to 300  The nonlinear activation function is Relu  For regularization, we also follow their settings and employ dropout with probability set to 0 5 on INLINEFORM0 before feeding it to the output layer INLINEFORM1 , and constrain the INLINEFORM2 -norm of the weight vector INLINEFORM3 , setting its max norm to 3 
On the small-scale datasets and the Aamzon benchmark, INLINEFORM0 and INLINEFORM1 are set to 200 and 1, respectively, tuned on the development set of task E INLINEFORM2 BK under setting 1  On the large-scale datasets, INLINEFORM3 and INLINEFORM4 are set to 500 and 0 2, respectively, tuned on I INLINEFORM5 Y  We use a Gaussian curve INLINEFORM6 to ramp up the weight of the bootstrapping loss INLINEFORM7 from 0 to INLINEFORM8 , where INLINEFORM9 denotes the maximum number of training epochs  We train 30 epochs for all experiments  We set INLINEFORM10 to 3 and INLINEFORM11 to 0 5 for all experiments 
The batch size is set to 50 on the small-scale datasets and the Amazon benchmark  We increase the batch size to 250 on the large-scale datasets to reduce the number of iterations  RMSProp optimizer with learning rate set to 0 0005 is used for all experiments 
Models for Comparison
We compare with the following baselines:
(1) Naive: A non-domain-adaptive baseline with bag-of-words representations and SVM classifier trained on the source domain 
(2) mSDA BIBREF7 : This is the state-of-the-art method based on discrete input features  Top 1000 bag-of-words features are kept as pivot features  We set the number of stacked layers to 3 and the corruption probability to 0 5 
(3) NaiveNN: This is a non-domain-adaptive CNN trained on source domain, which is a variant of our model by setting INLINEFORM0 , INLINEFORM1 , and INLINEFORM2 to zeros 
(4) AuxNN BIBREF4 : This is a neural model that exploits auxiliary tasks, which has achieved state-of-the-art results on cross-domain sentiment classification  The sentence encoder used in this model is the same as ours 
(5) ADAN BIBREF16 : This method exploits adversarial training to reduce representation difference between domains  The original paper uses a simple feedforward network as encoder  For fair comparison, we replace it with our CNN-based encoder  We train 5 iterations on the discriminator per iteration on the encoder and sentiment classifier as suggested in their paper 
(6) MMD: MMD has been widely used for minimizing domain discrepancy on images  In those works BIBREF9 , BIBREF13 , variants of deep CNNs are used for encoding images and the MMDs of multiple layers are jointly minimized  In NLP, adding more layers of CNNs may not be very helpful and thus those models from image-related tasks can not be directly applied to our problem  To compare with MMD-based method, we train a model that jointly minimize the classification loss INLINEFORM0 on the source domain and MMD between INLINEFORM1 and INLINEFORM2   For computing MMD, we use a Gaussian RBF which is a common choice for characteristic kernel 
In addition to the above baselines, we also show results of different variants of our model  DAS as shown in Algorithm SECREF6 denotes our full model  DAS-EM denotes the model with only entropy minimization for semi-supervised learning (set INLINEFORM0 )  DAS-SE denotes the model with only self-ensemble bootstrapping for semi-supervised learning (set INLINEFORM1 )  FANN (feature-adaptation neural network) denotes the model without semi-supervised learning performed (set both INLINEFORM2 and INLINEFORM3 to zeros) 
Main Results
Figure FIGREF17 shows the comparison of adaptation results (see Appendix SECREF7 for the exact numerical numbers)  We report classification accuracy on the small-scale dataset  For the large-scale dataset, macro-F1 is instead used since the label distribution in the test set is extremely unbalanced  Key observations are summarized as follows  (1) Both DAS-EM and DAS-SE perform better in most cases compared with ADAN, MDD, and FANN, in which only feature adaptation is performed  This demonstrates the effectiveness of the proposed domain adaptive semi-supervised learning framework  DAS-EM is more effective than DAS-SE in most cases, and the full model DAS with both techniques jointly employed overall has the best performance  (2) When comparing the two settings on the small-scale dataset, all domain-adaptive methods generally perform better under setting 1  In setting 1, the target examples are balanced in classes, which can provide more diverse opinion-related features  However, when considering unsupervised domain adaptation, we should not presume the label distribution of the unlabeled data  Thus, it is necessary to conduct experiments using datasets that reflect real-life sentiment distribution as what we did on setting2 and the large-scale dataset  Unfortunately, this is ignored by most of previous works  (3) Word-embeddings are very helpful, as we can see even NaiveNN can substantially outperform mSDA on most tasks 
To see the effect of semi-supervised learning alone, we also conduct experiments by setting INLINEFORM0 to eliminate the effect of feature adaptation  Both entropy minimization and bootstrapping perform very badly in this setting  Entropy minimization gives almost random predictions with accuracy below 0 4, and the results of bootstrapping are also much lower compared to NaiveNN  This suggests that the feature adaptation component is essential  Without it, the learned target representations are less meaningful and discriminative  Applying semi-supervised learning in this case is likely to worsen the results 
Further Analysis
In Figure FIGREF23 , we show the change of accuracy with respect to the percentage of unlabeled data used for training on three particular problems under setting 1  The value at INLINEFORM0 denotes the accuracies of NaiveNN which does not utilize any target data  For DAS, we observe a nonlinear increasing trend where the accuracy quickly improves at the beginning, and then gradually stabilizes  For other methods, this trend is less obvious, and adding more unlabeled data sometimes even worsen the results  This finding again suggests that the proposed approach can better exploit the information from unlabeled data 
We also conduct experiments under a setting with a small number of labeled target examples available  Figure FIGREF27 shows the change of accuracy with respect to the number of labeled target examples added for training  We can observe that DAS is still more effective under this setting, while the performance differences to other methods gradually decrease with the increasing number of labeled target examples 
CNN Filter Analysis
In this subsection, we aim to better understand DAS by analyzing sentiment-related CNN filters  To do that, 1) we first select a list of the most related CNN filters for predicting each sentiment label (positive, negative neutral)  Those filters can be identified according to the learned weights INLINEFORM0 of the output layer INLINEFORM1   Higher weight indicates stronger relatedness  2) Recall that in our implementation, each CNN filter has a window size of 3 with Relu activation  We can thus represent each selected filter as a ranked list of trigrams with highest activation values 
We analyze the CNN filters learned by NaiveNN, FANN and DAS respectively on task E INLINEFORM0 BT under setting 1  We focus on E INLINEFORM1 BT for study because electronics and beauty are very different domains and each of them has a diverse set of domain-specific sentiment expressions  For each method, we identify the top 10 most related filters for each sentiment label, and extract the top trigrams of each selected filter on both source and target domains  Since labeled source examples are used for training, we find the filters learned by the three methods capture similar expressions on the source domain, containing both domain-invariant and domain-specific trigrams  On the target domain, DAS captures more target-specific expressions compared to the other two methods  Due to space limitation, we only present a small subset of positive-sentiment-related filters in Table TABREF34   The complete results are provided in Appendix SECREF8   From Table TABREF34 , we can observe that the filters learned by NaiveNN are almost unable to capture target-specific sentiment expressions, while FANN is able to capture limited target-specific words such as “clean” and “scent”  The filters learned by DAS are more domain-adaptive, capturing diverse sentiment expressions in the target domain 
Conclusion
In this work, we propose DAS, a novel framework that jointly performs feature adaptation and semi-supervised learning  We have demonstrated through multiple experiments that DAS can better leverage unlabeled data, and achieve substantial improvements over baseline methods  We have also shown that feature adaptation is an essential component, without which, semi-supervised learning is not able to function properly  The proposed framework could be potentially adapted to other domain adaptation tasks, which is the focus of our future studies 
Results on Amazon Benchmark
Most previous works BIBREF0 , BIBREF1 , BIBREF6 , BIBREF7 , BIBREF29 carried out experiments on the Amazon benchmark released by Blitzer et al  ( BIBREF0 )  The dataset contains 4 different domains: Book (B), DVDs (D), Electronics (E), and Kitchen (K)  Following their experimental settings, we consider the binary classification task to predict whether a review is positive or negative on the target domain  Each domain consists of 1000 positive and 1000 negative reviews respectively  We also allow 4000 unlabeled reviews to be used for both the source and the target domains, of which the positive and negative reviews are balanced as well, following the settings in previous works  We construct 12 cross-domain sentiment classification tasks and split the labeled data in each domain into a training set of 1600 reviews and a test set of 400 reviews  The classifier is trained on the training set of the source domain and is evaluated on the test set of the target domain  The comparison results are shown in Table TABREF37  
Numerical Results of Figure 
Due to space limitation, we only show results in figures in the paper  All numerical numbers used for plotting Figure FIGREF17 are presented in Table TABREF38   We can observe that DAS-EM, DAS-SE, and DAS all achieve substantial improvements over baseline methods under different settings 
CNN Filter Analysis Full Results
As mentioned in Section SECREF36 , we conduct CNN filter analysis on NaiveNN, FANN, and DAS  For each method, we identify the top 10 most related filters for positive, negative, neutral sentiment labels respectively, and then represent each selected filter as a ranked list of trigrams with the highest activation values on it  Table TABREF39 , TABREF40 , TABREF41 in the following pages illustrate the trigrams from the target domain (beauty) captured by the selected filters learned on E INLINEFORM0 BT for each method 
We can observe that compared to NaiveNN and FANN, DAS is able to capture a more diverse set of relevant sentiment expressions on the target domain for each sentiment label  This observation is consistent with our motivation  Since NaiveNN, FANN and other baseline methods solely train the sentiment classifier on the source domain, the learned encoder is not able to produce discriminative features on the target domain  DAS addresses this problem by refining the classifier on the target domain with semi-supervised learning, and the overall objective forces the encoder to learn feature representations that are not only domain-invariant but also discriminative on both domains 
Context 3: g , tachycardia)  $\mathcal {T}_\mathrm {LM}$ tokenizes this word as ta ##chy ##card ##ia, thereby exposing the orthographic cue to the model  As a result, $\mathcal {T}_\mathrm {LM}$ leads to higher recall on -ia diseases  But there are many cases where wordpiece tokenization is meaningless or misleading  For instance euthymia (not a disease) is tokenized by $\mathcal {T}_\mathrm {LM}$ as e ##uth ##ym ##ia, making it likely to be classified as a disease  By contrast, $\hat{\mathcal {T}}_\mathrm {LM}$ gives euthymia a one-wordpiece representation that depends only on distributional semantics  We find that using $\hat{\mathcal {T}}_\mathrm {LM}$ improves precision on -ia diseases 
To combine these complementary strengths, we use a 50/50 mixture of $\mathcal {T}_\mathrm {LM}$-tokenization and $\hat{\mathcal {T}}_\mathrm {LM}$-tokenization when finetuning the PTLM on a task  At test time, we use both tokenizers and mean-pool the outputs  Let $o(\mathcal {T}(S))$ be some output of interest (e g , a logit), given sentence $S$ tokenized by $\mathcal {T}$  We predict:
Experiment 1: Biomedical NER
In this section, we use the proposed method to create GreenBioBERT, an inexpensive and environmentally friendly alternative to BioBERT  Recall that BioBERTv1 0 (biobert_v1 0_pubmed_pmc) was initialized from general-domain BERT (bert-base-cased) and pretrained on PubMed+PMC 
Experiment 1: Biomedical NER ::: Domain adaptation
We train Word2Vec with vector size $d_\mathrm {W2V} = d_\mathrm {LM} = 768$ on PubMed+PMC (see Appendix for details)  Then, we follow the procedure described in Section SECREF3 to update the wordpiece embedding layer and tokenizer of general-domain BERT 
Experiment 1: Biomedical NER ::: Finetuning
We finetune GreenBioBERT on the eight publicly available NER tasks used in BIBREF2  We also do reproduction experiments with general-domain BERT and BioBERTv1 0, using the same setup as our model  We average results over eight random seeds  See Appendix for details on preprocessing, training and hyperparameters 
Experiment 1: Biomedical NER ::: Results and discussion
Table TABREF7 (bottom) shows entity-level precision, recall and F1  For ease of visualization, Figure FIGREF13 shows what portion of the BioBERT – BERT F1 delta is covered  We improve over general-domain BERT on all tasks with varying effect sizes  Depending on the points of reference, we cover an average 52% to 60% of the BioBERT – BERT F1 delta (54% for BioBERTv1 0, 60% for BioBERTv1 1 and 52% for our reproduction experiments)  Table TABREF17 (top) shows the importance of vector space alignment: If we replace the aligned Word2Vec vectors with their non-aligned counterparts (by setting $\mathbf {W} = \mathbf {1}$) or with randomly initialized vectors, F1 drops on all tasks 
Experiment 2: Covid-19 QA
In this section, we use the proposed method to quickly adapt an existing general-domain QA model to an emerging target domain: Covid-19  Our baseline model is SQuADBERT (bert-large-uncased-whole-word-masking-finetuned-squad), a version of BERT that was finetuned on general-domain SQuAD BIBREF19  We evaluate on Deepset-AI Covid-QA, a SQuAD-style dataset with 1380 questions (see Appendix for details on data and preprocessing)  We assume that there is no target-domain finetuning data, which is a realistic setup for a new domain 
Experiment 2: Covid-19 QA ::: Domain adaptation
We train Word2Vec with vector size $d_\mathrm {W2V} = d_\mathrm {LM} = 1024$ on CORD-19 (Covid-19 Open Research Dataset) and/or PubMed+PMC  The process takes less than an hour on CORD-19 and about one day on the combined corpus, again without the need for a GPU  Then, we update SQuADBERT's wordpiece embedding layer and tokenizer, as described in Section SECREF3  We refer to the resulting model as GreenCovidSQuADBERT 
Experiment 2: Covid-19 QA ::: Results and discussion
Table TABREF17 (bottom) shows that GreenCovidSQuADBERT outperforms general-domain SQuADBERT in all metrics  Most of the improvement can be achieved with just the small CORD-19 corpus, which is more specific to the target domain (compare “Cord-19 only” and “Cord-19+PubMed+PMC”) 
Conclusion
As a reaction to the trend towards high-resource models, we have proposed an inexpensive, CPU-only method for domain-adapting Pretrained Language Models: We train Word2Vec vectors on target-domain data and align them with the wordpiece vector space of a general-domain PTLM 
On eight biomedical NER tasks, we cover over 50% of the BioBERT – BERT F1 delta, at 5% of BioBERT's domain adaptation CO$_2$ footprint and 2% of its cloud compute cost  We have also shown how to rapidly adapt an existing BERT QA model to an emerging domain – the Covid-19 pandemic – without the need for target-domain Language Model pretraining or finetuning 
We hope that our approach will benefit practitioners with limited time or resources, and that it will encourage environmentally friendlier NLP 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Word2Vec training
We downloaded the PubMed, PMC and CORD-19 corpora from:
https://ftp ncbi nlm nih gov/pub/pmc/oa_bulk/ [20 January 2020, 68GB raw text]
https://ftp ncbi nlm nih gov/pubmed/baseline/ [20 January 2020, 24GB raw text]
https://pages

ground_truth: Book, electronics, beauty, music, IMDB, Yelp, cell phone, baby, DVDs, kitchen

we use set 1 of the source domain as the only source with sentiment label information during training, and we evaluate the trained model on set 1 of the target domain, Book (BK), Electronics (E), Beauty (BT), and Music (M)

prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. Which eight NER tasks did they evaluate on?
Context 3: semanticscholar org/coronavirus-research [17 April 2020, 2GB raw text]
We extract all abstracts and text bodies and apply the BERT basic tokenizer (a word tokenizer that standard BERT uses before wordpiece tokenization)  Then, we train CBOW Word2Vec with negative sampling  We use default parameters except for the vector size (which we set to $d_\mathrm {W2V} = d_\mathrm {LM}$) 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 1: Biomedical NER ::: Pretrained models
General-domain BERT and BioBERTv1 0 were downloaded from:
https://storage googleapis com/bert_models/2018_10_18/cased_L-12_H-768_A-12 zip
https://github com/naver/biobert-pretrained
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 1: Biomedical NER ::: Data
We downloaded the NER datasets by following instructions on https://github com/dmis-lab/biobert#Datasets  For detailed dataset statistics, see BIBREF2 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 1: Biomedical NER ::: Preprocessing
We cut all sentences into chunks of 30 or fewer whitespace-tokenized words (without splitting inside labeled spans)  Then, we tokenize every chunk $S$ with $\mathcal {T} = \mathcal {T}_\mathrm {LM}$ or $\mathcal {T} = \hat{\mathcal {T}}_\mathrm {LM}$ and add special tokens:
Word-initial wordpieces in $\mathcal {T}(S)$ are labeled as B(egin), I(nside) or O(utside), while non-word-initial wordpieces are labeled as X(ignore) 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 1: Biomedical NER ::: Modeling, training and inference
We follow BIBREF2's implementation (https://github com/dmis-lab/biobert): We add a randomly initialized softmax classifier on top of the last BERT layer to predict the labels  We finetune the entire model to minimize negative log likelihood, with the standard Adam optimizer BIBREF20 and a linear learning rate scheduler (10% warmup)  Like BIBREF2, we finetune on the concatenation of the training and development set  All finetuning runs were done on a GeForce Titan X GPU (12GB) 
Since we do not have the resources for an extensive hyperparameter search, we use defaults and recommendations from the BioBERT repository: Batch size of 32, peak learning rate of $1 \cdot 10^{-5}$, and 100 epochs 
At inference time, we gather the output logits of word-initial wordpieces only  Since the number of word-initial wordpieces is the same for $\mathcal {T}_\mathrm {LM}(S)$ and $\hat{\mathcal {T}}_\mathrm {LM}(S)$, this makes mean-pooling the logits straightforward 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 1: Biomedical NER ::: Note on our reproduction experiments
We found it easier to reproduce or exceed BIBREF2's results for general-domain BERT, compared to their results for BioBERTv1 0 (see Figure FIGREF13, main paper)  While this may be due to hyperparameters, it suggests that BioBERTv1 0 was more strongly tuned than BERT in the original BioBERT paper  This observation does not affect our conclusions, as GreenBioBERT performs better than reproduced BERT as well 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 2: Covid-19 QA ::: Pretrained model
We downloaded the SQuADBERT baseline from:
https://huggingface co/bert-large-uncased-whole-word-masking-finetuned-squad
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 2: Covid-19 QA ::: Data
We downloaded the Deepset-AI Covid-QA dataset from:
https://github com/deepset-ai/COVID-QA/blob/master/data/question-answering/200423_covidQA json [24 April 2020]
At the time of writing, the dataset contains 1380 questions and gold answer spans  Every question is associated with one of 98 research papers (contexts)  We treat the entire dataset as a test set 
Note that there are some important differences between the dataset and SQuAD, which make the task challenging:
The contexts are full documents rather than single paragraphs  Thus, the correct answer may appear several times, often with slightly different wordings  Only a single one of the occurrences is annotated as correct, e g :
What was the prevalence of Coronavirus OC43 in community samples in Ilorin, Nigeria?
13 3% (95% CI 6 9-23 6%) # from main text
(13 3%, 10/75)  # from abstract
SQuAD gold answers are defined as the “shortest span in the paragraph that answered the question” BIBREF19, but many Covid-QA gold answers are longer and contain non-essential context, e g :
When was the Middle East Respiratory Syndrome Coronavirus isolated first?
(MERS-CoV) was first isolated in 2012, in a 60-year-old man who died in Jeddah, KSA due to severe acute pneumonia and multiple organ failure
2012,
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 2: Covid-19 QA ::: Preprocessing
We tokenize every question-context pair $(Q, C)$ with $\mathcal {T} = \mathcal {T}_\mathrm {LM}$ or $\mathcal {T} = \hat{\mathcal {T}}_\mathrm {LM}$, which yields $(\mathcal {T}(Q), \mathcal {T}(C))$  Since $\mathcal {T}(C)$ is usually too long to be digested in a single forward pass, we define a sliding window with width and stride $N = \mathrm {floor}(\frac{509 - |\mathcal {T}(Q)|}{2})$  At step $n$, the “active” window is between $a^{(l)}_n = nN$ and $a^{(r)}_n = \mathrm {min}(|C|, nN+N)$  The input is defined as:
$p^{(l)}_n$ and $p^{(r)}_n$ are chosen such that $|X^{(n)}| = 512$, and such that the active window is in the center of the input (if possible) 
Inexpensive Domain Adaptation of Pretrained Language Models (Appendix) ::: Experiment 2: Covid-19 QA ::: Modeling and inference
Feeding $X^{(n)}$ into the pretrained QA model yields start logits $\mathbf {h^{\prime }}^{(\mathrm {start}, n)} \in \mathbb {R}^{|X^{(n)}|}$ and end logits $\mathbf {h^{\prime }}^{(\mathrm {end},n)} \in \mathbb {R}^{|X^{(n)}|}$  We extract and concatenate the slices that correspond to the active windows of all steps:
Next, we map the logits from the wordpiece level to the word level  This allows us to mean-pool the outputs of $\mathcal {T}_\mathrm {LM}$ and $\hat{\mathcal {T}}_\mathrm {LM}$ even when $|\mathcal {T}_\mathrm {LM}(C)| \ne |\hat{\mathcal {T}}_\mathrm {LM}(C)|$ 
Let $c_i$ be a whitespace-delimited word in $C$  Let $\mathcal {T}(C)_{j:j+|\mathcal {T}(c_i)|}$ be the corresponding wordpieces  The start and end logits of $c_i$ are derived as:
Finally, we return the answer span $C_{k:k^{\prime }}$ that maximizes $o^{(\mathrm {start})}_k + o^{(\mathrm {end})}_{k^{\prime }}$, subject to the constraints that $k^{\prime }$ does not precede $k$ and the answer span is not longer than 500 characters 

ground_truth: BC5CDR-disease, NCBI-disease, BC5CDR-chem, BC4CHEMD, BC2GM, JNLPBA, LINNAEUS, Species-800

BC5CDR-disease, NCBI-disease, BC5CDR-chem, BC4CHEMD, BC2GM, JNLPBA, LINNAEUS, Species-800