<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Detecting Twitter posts with Adverse Drug Reactions using Convolutional Neural Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sarthak Jain</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xun Peng</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Byron C. Wallace</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Northeastern University</institution>
          ,
          <addr-line>Boston, MA</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We describe our system for Shared Task 1, which involves recognizing tweets containing adverse drug reaction mentions. We used a relatively standard CNN architecture coupled with task-specific features and pre-processing steps to achieve an F-score on the test set of 0.412, placing us as the third best-scoring team and 0.015 points beneath the best score. We observe empirically that the test dataset differs substantially from the training corpus; building models to explicitly account for this shift will likely be important to further improve results. We remove all characters except for those in the Basic Latin Set (U+0000 - U+007F) and replace @usernames, urls, numbers and dollar symbols with corresponding special tokens. We also add a space before and after all nonalphanumeric characters. We heuristically replace all drug mentions in sentences with a DRUG token using Drugbank database1 [2]. Finally, we split the sentence into tokens on whitespace and lemmatize each word using nltk [3]. As mentioned above, we use a CNN architecture, which may be viewed as inducing its own feature map from words. We augment this learned representation with manually crafted indicator features based on prior work by [4]2. These include features that encode information derived via synset expansions and use of an ADR Lexicon, those capturing SentiWord Score, topic based and structural features, and features based on cluster assignments and change phrases .</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Overview 2</title>
    </sec>
    <sec id="sec-2">
      <title>Preprocessing 2.1</title>
    </sec>
    <sec id="sec-3">
      <title>Features</title>
      <p>Briefly, our system comprises a standard CNN architecture [1] augmented with manually crafted features and an
embedding projection layer. In this brief note, we describe these components in greater detail.
3.1</p>
    </sec>
    <sec id="sec-4">
      <title>Models</title>
    </sec>
    <sec id="sec-5">
      <title>Projecting embeddings</title>
      <p>
        Embedding based NLP systems have been shown to benefit from pre-training on large volumes of unlabeled data [
        <xref ref-type="bibr" rid="ref4">5</xref>
        ].
While raw documents or texts are usually unannotated, they do contain structure. This can be leveraged to learn word
features in an unsupervised fashion. Context is one strong indicator for word similarity; related words tend to occur
in similar contexts (i.e., words realize some notion of ‘distributional semantics’). A popular approach to capitalizing
on this insight involves estimating word embeddings by maximizing the probability ‘nearby’ words, i.e. those within
a given window size, can be predicted based on the induced representation of the target word. This strategy is used,
e.g., in the popular skipgram and CBOW architectures [
        <xref ref-type="bibr" rid="ref5">6</xref>
        ].
      </p>
      <p>
        However, if these embeddings are retrained using a small amount of labeled data, this can lead to severe overfitting
for the words that are seen in training. Moreover, word vectors corresponding to tokens not present in the small
training corpus will not be updated at all. Thus, rather than retraining or fine-tuning embeddings, we introduced a
transformation layer to project pre-trained embeddings into a task-specific space. This has the indirect effect that all
embeddings in pre-trained space are updated rather than only those in the training set. Instead of hoping the projection
directly learns a desired underlying mapping, we explicitly let it fit a residual mapping. This is inspired by the residual
layers used in deep convolutional networks [
        <xref ref-type="bibr" rid="ref6">7</xref>
        ]. The original mapping is recast into F (W ) + W . Concretely, we remap
words as follows:
1https://www.drugbank.ca/
2Available at https://bitbucket.org/asarker/adrbinaryclassifier
      </p>
      <p>W 0 = ReLU(W</p>
      <p>P ) + W
(1)
Our intuition here is that it is easier to optimize the residual mapping than to optimize vector representations in the
original or source embedding space. In the extreme, if an identity mapping were optimal, it would be easier to push
the residual to zero than to fit an identity mapping.</p>
      <p>
        We use two sets of pre-trained word embeddings in this project: (i) Google News Dataset (300 dim, 3M words) [
        <xref ref-type="bibr" rid="ref5">6</xref>
        ]
and (ii) Twitter Dataset (400 dim, 3M words) [
        <xref ref-type="bibr" rid="ref7">8</xref>
        ]. For each word in our vocabulary, we look up a corresponding word
embedding in pre-trained word2vec vectors. If the embedding is found, we add it to our system. In the case that a
word is not found, we generate a random vector for them if they occur more than 2 times in the dataset. Otherwise,
we replace them with a single UNK token.
3.2
      </p>
    </sec>
    <sec id="sec-6">
      <title>Convolutional Neural Network</title>
      <p>
        Convolutional Neural Networks (CNN)s have been extensively used in many computer vision and, more recently,
NLP tasks. In NLP, CNNs were previously used successfully in sentence classification and sentiment analysis [
        <xref ref-type="bibr" rid="ref8">1, 9</xref>
        ].
CNNs start with a convolutional layer, usually equipped with Rectified Linear Units (ReLUs) as activation units.3
Convolutional filters normally have the same width as the word vectors, thus producing feature maps with only 1
column. The network is then stacked by a max-pooling layer that picks the maximum element from each column. The
last layer is a feed forward layer to an output layer with a softmax activation.
3.3
      </p>
    </sec>
    <sec id="sec-7">
      <title>Feature Only Model</title>
      <p>We also train a multilayer perceptron on the feature vectors that performs binary classification. The MLP comprises
a single hidden layer and an output layer. We use a softmax activation to produce the output and we minimize cross
entropy loss over the training dataset.
3.4</p>
    </sec>
    <sec id="sec-8">
      <title>Feature+CNN Model 3.5</title>
    </sec>
    <sec id="sec-9">
      <title>Training Setup</title>
      <p>In this model, we concatenate the features returned by pooling layer of convolution network with the output of the
hidden layer of feature network before passing them through the softmax layer.</p>
      <p>
        For CNN models, we use filters of size 1-5 with 250 filters for each. We use a dropout layer [
        <xref ref-type="bibr" rid="ref9">10</xref>
        ] with p = 0:5 for
regularization. For feature models, we use a hidden layer of size 300 with `2 regularisation at = 0:001 and Relu
activation function. For each model, we used l2 regularization for dense softmax layer with = 0:001. The models
were trained using Adam Optimiser (lr = 0:01) [
        <xref ref-type="bibr" rid="ref10">11</xref>
        ]. We used early stopping when validation loss doesn’t show
absolute improvement of value &gt; 0:01 for 5 epochs. We use the model with least validation loss during training for
evaluation. All hyperparameter selection is done on the validation set.
      </p>
      <p>We also used an ensemble of all methods for evaluation. To counter the class imbalance problem, rather than using
majority voting, we labeled the data point as positive if at least 2 classifiers labeled it as positive.4 We also set the
threshold for a tweet to be labeled as positive to 0.35. This setting reduced our precision but significantly improved
recall.</p>
      <p>3A ReLU takes an input and returns the original input if it is larger than 0, otherwise, it returns 0.</p>
      <p>4This performed better than alternative ensembling approaches such as ‘stacking’ on the dev dataset.
3.6</p>
    </sec>
    <sec id="sec-10">
      <title>Datasets</title>
      <p>The training data consists on 11293 tweets with 9330 negative samples and 965 positive samples. The test data consists
of 9961 tweets (9190 negative, 771 positive). We will refer this particular train and test split as the original corpus.
Because the training and test datasets were generated by sampling at different times with different drug names, we
wanted to see whether the train and test sets reflected different input feature distributions. To assess this, we combined
the train and test data and shuffled them together. We then randomly divided the total data into 2 parts with the
same distribution of labels as given, i.e., we sampled 9330 negative and 965 positive data points for training and kept
remaining for testing. We will call this train/test split as randomized.</p>
      <p>We use 90/10 split of training data in both sets above for validation purposes.
4</p>
    </sec>
    <sec id="sec-11">
      <title>Results</title>
      <sec id="sec-11-1">
        <title>We present the results of the experiments in Table 1.</title>
      </sec>
      <sec id="sec-11-2">
        <title>Model</title>
      </sec>
      <sec id="sec-11-3">
        <title>CNN (goog)</title>
        <p>Feature
CNN (goog) + Feature
CNN (tw) + Feature
CNN (goog + EP) + Feature
CNN (tw + EP) + Feature
Ensemble
We will mention following observations in regards to our results :</p>
        <p>As can be clearly seen from the table, the models consistently and significantly improved when trained on
randomised datasets. This suggests that our model could benefit from better normalization of texts as well as
the use of external ontologies to map words to concepts like drugs, side effects, and so on. In this work, We do
not explore the differences between training and test set underlying this observation in further detail.
Models with the embedding projection outperform ones with no embedding projection by a small margin.
All models have better precision than recall in the original train/test split.</p>
        <p>Google Embeddings performed better than twitter embeddings, which we found somewhat surprising.
5</p>
      </sec>
    </sec>
    <sec id="sec-12">
      <title>Conclusion</title>
      <p>We proposed a hybrid CNN and feature based system to perform binary classification of tweets containing mentions
of Adverse Drug Reactions (ADRs). We evaluated our system against the training and test dataset provided as part
of the shared task. On using these datasets as they were intended, we achieved an overall F1 score of 0.412. We also
observe that combining the given datasets and dividing it into training and test set randomly significantly improved the
performance of our classifiers. This suggests a shift in the data distributions. In future work, we will further study the
reasons behind this shift and how they can be rectified to generate more precise classifiers.
[1] Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Iain</given-names>
            <surname>Marshall</surname>
          </string-name>
          , Joe¨l Kuiper,
          <string-name>
            <surname>Edward Banner</surname>
          </string-name>
          , and
          <string-name>
            <surname>Byron</surname>
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Wallace</surname>
          </string-name>
          .
          <article-title>Automating biomedical evidence synthesis: Robotreviewer</article-title>
          .
          <source>In Proceedings of ACL</source>
          <year>2017</year>
          ,
          <string-name>
            <given-names>System</given-names>
            <surname>Demonstrations</surname>
          </string-name>
          , pages
          <fpage>7</fpage>
          -
          <lpage>12</lpage>
          , Vancouver, Canada,
          <year>July 2017</year>
          .
          <article-title>Association for Computational Linguistics</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Steven</given-names>
            <surname>Bird</surname>
          </string-name>
          , Ewan Klein, and
          <string-name>
            <given-names>Edward</given-names>
            <surname>Loper. Natural Language Processing with Python. O'Reilly Media</surname>
          </string-name>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Abeed</given-names>
            <surname>Sarker</surname>
          </string-name>
          and
          <string-name>
            <given-names>Graciela</given-names>
            <surname>Gonzalez</surname>
          </string-name>
          .
          <article-title>Portable automatic text classification for adverse drug reaction detection via multi-corpus training</article-title>
          .
          <source>J. of Biomedical Informatics</source>
          , 53(C):
          <fpage>196</fpage>
          -
          <lpage>207</lpage>
          ,
          <year>February 2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Yoav</given-names>
            <surname>Goldberg</surname>
          </string-name>
          .
          <article-title>Neural network methods for natural language processing</article-title>
          .
          <source>Synthesis Lectures on Human Language Technologies</source>
          ,
          <volume>10</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>309</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Mikolov</surname>
          </string-name>
          , Kai Chen, Greg Corrado, and
          <string-name>
            <given-names>Jeffrey</given-names>
            <surname>Dean</surname>
          </string-name>
          .
          <article-title>Efficient estimation of word representations in vector space</article-title>
          .
          <source>arXiv preprint arXiv:1301.3781</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Kaiming</given-names>
            <surname>He</surname>
          </string-name>
          , Xiangyu Zhang, Shaoqing Ren, and
          <string-name>
            <given-names>Jian</given-names>
            <surname>Sun</surname>
          </string-name>
          .
          <article-title>Deep residual learning for image recognition</article-title>
          .
          <source>In Proceedings of the IEEE conference on computer vision and pattern recognition</source>
          , pages
          <fpage>770</fpage>
          -
          <lpage>778</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [8] Fre´deric Godin, Baptist Vandersmissen, Wesley De Neve, and Rik Van de Walle.
          <article-title>Multimedia lab@ acl w-nut ner shared task: named entity recognition for twitter microposts using distributed word representations</article-title>
          .
          <source>ACLIJCNLP</source>
          ,
          <year>2015</year>
          :
          <fpage>146</fpage>
          -
          <lpage>153</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Ye</given-names>
            <surname>Zhang</surname>
          </string-name>
          and
          <string-name>
            <given-names>Byron</given-names>
            <surname>Wallace</surname>
          </string-name>
          .
          <article-title>A sensitivity analysis of (and practitioners' guide to) convolutional neural networks for sentence classification</article-title>
          .
          <source>arXiv preprint arXiv:1510.03820</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Nitish</surname>
            <given-names>Srivastava</given-names>
          </string-name>
          , Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and
          <string-name>
            <given-names>Ruslan</given-names>
            <surname>Salakhutdinov</surname>
          </string-name>
          .
          <article-title>Dropout: A simple way to prevent neural networks from overfitting</article-title>
          .
          <source>J. Mach. Learn. Res.</source>
          ,
          <volume>15</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1929</fpage>
          -
          <lpage>1958</lpage>
          ,
          <year>January 2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Diederik</surname>
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Kingma</surname>
            and
            <given-names>Jimmy</given-names>
          </string-name>
          <string-name>
            <surname>Ba</surname>
          </string-name>
          .
          <article-title>Adam: A method for stochastic optimization</article-title>
          .
          <source>CoRR, abs/1412.6980</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>