<!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>Topics Over Nonparametric Time: A Supervised Topic Model Using Bayesian Nonparametric Density Estimation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Daniel D. Walker</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kevin Seppi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eric K. Ringger</string-name>
          <email>ringgerg@cs.byu.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Computer Science Department Brigham Young University Provo</institution>
          ,
          <addr-line>UT, 84604</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We propose a new supervised topic model that uses a nonparametric density estimator to model the distribution of real-valued metadata given a topic. The model is similar to Topics Over Time, but replaces the beta distributions used in that model with a Dirichlet process mixture of normals. The use of a nonparametric density estimator allows for the fitting of a greater class of metadata densities. We compare our model with existing supervised topic models in terms of prediction and show that it is capable of discovering complex metadata distributions in both synthetic and real data.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Supervised topic models are a class of topic models
that, in addition to modeling documents as mixtures of
topics, each with a distribution over words, also model
metadata associated with each document. Document
collections often include such metadata. For example,
timestamps are commonly associated with documents
that represent the time of the document’s creation.
In the case of online product reviews, “star” ratings
frequently accompany written reviews to quantify the
sentiment of the review’s author.</p>
      <p>There are three basic reasons that make supervised
topic models attractive tools for use with document
collections that include metadata. Better Topics: one
assumption that is often true for document collections
is that the topics being discussed are correlated with
information that is not necessarily directly encoded
in the text. Using the metadata in the inference of
topics provides an extra source of information, which
could lead to an improvement in modeling the topics
that are found. Prediction: given a trained supervised
topic model and a new document with missing
metadata, one can predict the value of the metadata
variable for that document. Even though timestamps are
typically included in modern, natively digital,
documents they may be unavailable or wrong for historical
documents that have dbeen igitized using OCR. Also,
even relatively modern documents can have missing
or incorrect timestamps due to user error or system
mis-configuration. For example, in the full Enron
email corpus1, there are 793 email messages with a
timestamp before 1985, the year Enron was founded.
Of these messages 271 have a timestamp before the
year 100. Analysis: in order to understand a document
collection better, it is often helpful to understand how
the metadata and topics are related. For example, one
might want to analyze the development of a topic over
time, or investigate what the presence of a particular
topic means in terms of the sentiment being expressed
by the author. One may, for example, plot the
distribution of the metadata given a topic from a trained
model. Several supervised topic models can be found
in the literature and will be discussed in more detail
in Section 3. These models make assumptions about
the way in which the metadata are distributed given
the topic or require the user to specify their own
assumptions. Usually, this approach involves using a
unimodal distribution, and the same distribution
family is used to model the metadata across all topics.
1http://www.cs.cmu.edu/˜enron
These modeling assumptions are problematic. First,
it is easy to imagine metadata and topics that have
complex, multi-modal relationships. For example, the
U.S. has been involved in two large conflicts with Iraq
over the last 20 years. A good topic model trained on
news text for that period should ideally discover an
Iraq topic and successfully capture the bimodal
distribution of that topic in time. Existing supervised topic
models, however, will either group both modes into a
single mode, or split the two modes into two separate
topics. Second, it seems incorrect to assume that the
metadata will be distributed similarly across all
topics. Some topics may remain fairly uniform over a
long period of time, others appear quickly and then
fade out over long periods of time (e.g., terrorism after
9/11), others enter the discourse gradually over time
(e.g., healthcare reform), still others appear and
disappear in a relatively short period of time (e.g., many
political scandals).</p>
      <p>
        To address these issues, we introduce a new
supervised topic model, Topics Over Nonparametric Time
(TONPT), based on the Topics Over Time (TOT)
model [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Where TOT uses a per-topic beta
distribution to model topic-conditional metadata
distributions, TONPT uses a nonparametric density estimator,
a Dirichlet process mixture (DPM) of normals.
The remainder of the paper is organized as follows: in
Section 2 we provide a brief discussion of the
Dirichlet process and show how a DPM of normals can be
used to approximate a wide variety of densities.
Section 3 outlines related work. In Section 4 we
introduce the TONPT model and describe the collapsed
Gibbs sampler we used to efficiently conduct
inference in the model on a given dataset. Section 5
describes experiments that were run in order to compare
TONPT with two other supervised topic models and
a baseline. Finally, in Section 6 we summarize our
results and contributions.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Estimating Densities with Dirichlet</title>
    </sec>
    <sec id="sec-3">
      <title>Process Mixtures</title>
      <p>
        Significant work has been done in the document
modeling community to make use of Dirichlet process
mixtures with the goal of eliminating the need to
specify the number of components in a mixture model. For
example, it is possible to cluster documents without
specifying a-priori the number of clusters by
replacing the Dirichlet-multinomial mixing distribution in
the Mixture of Multinomials document model with a
Chinese Restaurant Process. The CRP is the
distribution over partitions created by the clustering effect of
the Dirichlet process [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. So, one way of using the
Dirichlet process is in model-based clustering
applications where it is desirable to let the number of
clusters be determined dynamically by the data, instead of
being specified by the user.
      </p>
      <p>
        The DP is a distribution over probability measures G
with two parameters: a base measure G0 and a
total mass parameter m. Random probability measures
drawn from a DP are generally not suitable as
likelihoods for continuous random variates because they
are discrete. This complication can be overcome by
convolving the G with a continuous kernel density f
[
        <xref ref-type="bibr" rid="ref5 ref6 ref9">9, 5, 6</xref>
        ]:
      </p>
      <p>G
xijG</p>
      <p>DP(m; G0)
Z</p>
      <p>f (xij )dG( )
This model is equivalent to an infinite mixture of f
distributions with hierarchical formulation:</p>
      <p>G
ijG
xij i</p>
      <p>DP(m; G0)
G
f (xij )
In our work we use the normal distribution for f . The
normal distribution has many advantages that make it
a useful choice here. First, the parameters map
intuitively to the idea that the parameters in the DPM are
the “locations” of the point masses of G and so are a
natural fit for the mean parameter of the normal
distribution. Second, because the normal is conjugate to the
mean of a normal with known variance, we can also
choose a conjugate G0 that has intuitive parameters
and simple posterior and marginal forms. Third, the
normal is almost trivially extensible to multivariate
cases. Fourth, the normal can be centered anywhere
on the positive or negative side of the origin which is
not true, for example, of the gamma and beta
distributions. Finally, just as any 1D signal can be
approximated with a sum of sine waves, almost any
probability distribution can be approximated with a weighted
sum of normal densities.
j
zdi
wdi</p>
      <p>Nd
td</p>
    </sec>
    <sec id="sec-4">
      <title>Related Work</title>
      <p>
        In this section we will describe the three models which
are most closely related to our work. In particular,
we focus on the issues of prediction and the posterior
analysis of metadata distributions in order to highlight
the strengths and weaknesses of each model.
The most closely related models to TONPT are
Supervised LDA (sLDA) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and Topics Over Time
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. sLDA uses a generalized linear model (GLM)
to regress the metadata given the topic proportions of
each document. GLMs are flexible in that they allow
for the specification of a link and a dispersion
function that can change the behavior of the regression
model. In practice, however, making such a change
to the model requires non-trivial modifications to the
inference procedure used to learn the topics and
regression co-efficients. In the original sLDA paper, an
identity link function and normal dispersion
distribution were used. The model, shown in Figure 1, has
per-document timestamp variables td Normal(c
zd; 2), where c is the vector of linear model
coefficients and zd is a topic proportion vector for document
d (See Table 1 for a discription of the other variables
in the models shown here). This configuration leads
to a stochastic EM inference procedure in which one
alternately samples from the complete conditional for
each topic assignment, given the current values of all
the other variables, and then finds the regression
coefficients that minimize the sum squared residual of
the linear prediction model. Variations of sLDA have
been used successfully in several applications
including modeling the voting patterns of U.S. legislators [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]
and links between documents [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Prediction in sLDA is very straightforward, as the
latent metadata variable for a document can be
marginalized out to produce a vanilla LDA complete
conditional distribution for the topic assignments. The
procedure for prediction can thus be as simple as first
sampling the topic assignments for each word in an
unseen document given the assignments in the
training set, and then taking the dot product between the
estimated topic proportions for the document and the
GLM coefficients. In terms of the representation of
the distribution of metadata given topics, however, the
model is somewhat lacking. The coefficients learned
during inference convey only one-dimensional
information about the correlation between topics and the
metadata. A large positive coefficient for a given topic
indicates that documents with a higher proportion of
that topic tend to have higher metadata values, and a
large negative coefficient means that documents with
a higher proportion of that topic tend to have lower
metadata values. Coefficients close to zero indicate
low correlation between the topic and the metadata.
In TOT, metadata are treated as per-word
observations, instead of as a single per-document
observation. The model, shown in Figure 2, assumes that
each per-word metadatum tdi is drawn from a
pertopic beta distribution: tdi Beta( zdi1; zdi2). The
inference procedure for TOT is a stochastic EM
algorithm, where the topic assignments for each word
are first sampled with a collapsed Gibbs sampler and
then the shape parameters for the per-topic beta
distributions are point estimated using the Method of
Moments based on the mean and variance of the metadata
values for the words assigned to each topic.
Prediction in TOT is not as straightforward as for
sLDA. Like sLDA, it is possible to integrate out the
random variables directly related to the metadata and
estimate a topic distribution for a held-out document
using vanilla LDA inference. However, because the
model does not include a document-level metadata
variable, there is no obvious way to predict a single
metadata value for held-out documents. We describe
a prediction procedure in Section 5, based on work
one by Wang and McCallum, that yields acceptable
results in practice.</p>
      <p>Despite having a more complicated prediction
procedure, TOT yields a much richer picture of the trends
present in the data. It is possible with TOT, for
example, to get an idea of not only whether the metadata
are correlated with a topic, but also to see the mean
and variance of the per-topic metadata distributions
and even to show whether the distribution is skewed
or symmetric.</p>
      <p>
        Another related model is the Dirichlet Multinomial
Regression (DMR) model [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Whereas the sLDA
and TOT models both model the metadata
generatively, i.e., as random variables conditioned on the
topic assignments for a document, the DMR forgoes
modeling the metadata explicitly, putting the metadata
variables at the “root” of the graphical model and
conditioning the document distributions over topics on the
metadata values. By forgoing a direct modeling of the
metadata, the DMR is able to take advantage of a wide
range of metadata types and even to include multiple
metadata measurements (or “features”) per document.
The authors show how, conditioning on the metadata,
the DMR is able to outperform other supervised topic
models in terms of its ability to fit the observed words
of held-out documents, yielding lower perplexity
values. The DMR is thus able to accomplish one of the
goals of supervised topic modeling very well (the
increase in topic quality). However, because it does not
propose any distribution over metadata values, it is
difficult to conduct the types of analyses or missing
metadata predictions possible in TOT and sLDA
without resorting to ad-hoc procedures. Because of these
deficiencies, we leave the DMR out of the remaining
j
      </p>
      <p>T</p>
      <p>d
zdi
wdi
m
sdi
tdi</p>
      <p>Nd</p>
      <p>D
jk</p>
      <p>Kt</p>
      <p>T
2
j</p>
      <p>T
discussion of supervised topic models.
4</p>
    </sec>
    <sec id="sec-5">
      <title>Topics Over Nonparametric Time</title>
      <p>TONPT models metadata variables associated with
each word in the corpus as being drawn from a
topicspecific Dirichlet process mixture of normals. In
addition, TONPT employs a common base measure G0 for
all of the per-topic DPMs, for which we use a normal
with mean 0 and variance 02.</p>
      <p>The random variables are distributed as follows:
dj
tj
zdij
wdijzdi;</p>
      <p>j2j ;</p>
      <p>Gj jG0; m
tdijGzdi ; z2di</p>
      <sec id="sec-5-1">
        <title>Dirichlet( )</title>
      </sec>
      <sec id="sec-5-2">
        <title>Dirichlet( )</title>
        <sec id="sec-5-2-1">
          <title>Categorical( d)</title>
        </sec>
        <sec id="sec-5-2-2">
          <title>Categorical( zdi )</title>
        </sec>
      </sec>
      <sec id="sec-5-3">
        <title>InverseGamma( ;</title>
        <p>)
DP(G0; m)
Z</p>
        <p>f (tdi; ; z2di )dGzdi ( )
where f ( ; ; 2) is the normal p.d.f. with mean and
variance 2. Also, j 2 f1; : : : ; T g, d 2 f1; : : : ; Dg,
and, given a value for d, i 2 f1; : : : ; Ndg. We note
that, as in TOT, the fact that the metadata variable
is repeated per-word leads to a deficient generative
model, because the metadata are typically observed
at a document level and the assumed constraint that
all of the metadata values for the words in a
document be equivalent is not modeled. The advantage of
Symbol Meaning</p>
        <p>Common Supervised Topic Modeling Variables</p>
        <p>Prior parameter for document-topic
distributions
d Parameter for topic mixing distribution for
document d
Prior parameter for the topic-word
distributions
j Parameter for the jth topic-word distribution
zdi Topic label for word i in document d
z di All topic assignments except that for zdi
w Vector of all word token types
wdi Type of word token i in document d
tdi Timestamp for word i in document d
td Timestamp for document d
t Vector of all metadata variable values
t^ A predicted value for the metadata variable
D The number of documents
T The number of topics
V The number of word types
Nd The number of tokens in document d</p>
        <p>TONPT Specific Variables
m Total mass parameter for DP mixtures
sdi DP component membership for word i in
document d
s di All DP component assignments except that
for sdi
G0 The base measure of the DP mixtures
0 The mean of the base measure
02 The variance of the base measure
jk The mean of the kth mixture component for
topic j</p>
        <p>A vector of all the values
j2 jk Thweivthaoriuatncejkof the components of the jth DP
mixture
2 A vector of all the DPM 2s
, Shape and scale parameters for prior on topic
s
Kj The number of unique observed s for topic j
nj The number of tokens assigned to topic j
njk The number of tokens assigned to the kth
component of topic j
ndj The number of tokens in document d assigned
to topic j
njv The number of times a token of type v was
assigned to topic j
Kz&lt;ddii The number of unique s observed for topic
zdi before the ith token of document d
(jk) The set of all tdi s.t. zdi = j and sdi = k
f (y; ; 2) The normal p.d.f. at y with mean and
variance 2
this approach is that this configuration simplifies
inference, and also naturally balances the plurality of
the word variables with the singularity of the
metadata variable, allowing the metadata to exert a
similarly scaled influence on the topic assignments during
inference. In addition, this modeling choice allows
for a more fine-grained labeling of documents (e.g.,
at the word, phrase, or paragraph level) and for finer
grained prediction. For example, while timestamps
should probably be the same for all words in a
document, sentiment does not need to meet this constraint–
there are often positive comments even in very
negative reviews.</p>
        <p>This model does not lend itself well to inference and
sampling because of the integral in the distribution
over tdi. A typical modification that is made to
facilitate sampling in mixture models is to use an
equivalent hierarchical model. Another modification that
is typically made when sampling in mixture models
is to separate the “clustering,” or mixing, portion of
the distribution from the prior over mixture
component parameters. The mixing distribution in a DPM is
the distribution known as the Chinese Restaurant
Process. The Chinese Restaurant Process is used to
select an assignment to one of the points that makes up
the DP point process for each data observation drawn
from G. The locations of these points are
independently drawn from G0.</p>
        <p>Figure 3 shows the model that results from
decomposing the Dirichlet process into these two component
pieces. The Kj unique values that have been
sampled so far for each topic j are drawn from G0. The
sdi variables are indicator variables that take on values
in 1; : : : ; Kj and represent which of the DPM
components each tdi was drawn from. This model has the
following changes to the variable distributions:
sdijzdi; s&lt;di; m
8= k with prob / n&lt;di
&gt;&lt; zdi;k</p>
        <p>for k = 1; : : : ; Kz&lt;ddii
&gt;:= Kz&lt;ddii + 1 with prob / m
jkjG0</p>
        <p>G0
tdijzdi; szdi ; ; 2</p>
        <p>f tdi; zdisdi ; z2di
Where s&lt;di refers to all the sd0i0 that came “before”
sdi and before is defined to mean all (d0; i0) such that
(d0 &lt; d) or (d0 = d and i0 &lt; i). Likewise, nz&lt;ddi;ik is
the count of the number of times that sd0i0 = k for all
d0; i0 before sdi and Kz&lt;ddii is the highest value of any
sd0i0 (number of unique observed s) before sdi. So,
conditioned on zdi the sdi are distributed according to
a Chinese Restaurant Process with mass parameter m.
The and variables in the model are nuisance
variables: they are not necessary for the assignment of
tokens to topics or for the estimation of the distributions
of the response variables so, as is typical when
conducting Gibbs sampling on these models, we integrate
them out before sampling.
4.1</p>
        <p>Gibbs Sampler Conditionals
Now we derive the complete conditionals for the
collapsed Gibbs sampler used for inference in the model.
There are four groups of variables that must be
sampled during inference: the per-word topic labels z,
the per word DPM component assignment variables
s, the DPM component means , and the per-topic
DPM component variances 2. Note that, because
of normal-normal conjugacy, it would be possible to
collapse the variables from the model. We choose
to sample values for anyway because the
parameters of the DPM are useful artifacts in their own right,
as they enable rich posterior analyses of the per-topic
metadata distributions.
4.1.1</p>
        <p>Complete Conditional for z and s
We choose to sample zdi and sdi in a block, since the
calculations necessary to sample zdi include those
sufficient to sample both variables jointly.</p>
        <p>/ ?dj PV
v=1 ?jv
?jwdi
t; m; ;</p>
        <p>; ; G0; ; )
8&gt;&gt; nnj+jkm f (tdi; jk; j2)
&gt;
&gt;
&lt;</p>
        <p>if k j j j,
&gt;&gt; njm+m f (tdi; 0; 02 + j2)
&gt;
&gt;
:
if k = j j j + 1
(2)
where ?dj = j + ndj , ?jv = v + njv.
4.1.2</p>
        <p>Complete Conditional for
When sampling a zdi; sdi pair if sdi = Kzdi + 1 (i.e.,
we are creating a new component for the DPM for
that topic), then we need to draw a new for the zdith
[zdi; sdi] =p(zdi = j; sdi = kjz di; s di; 2; w; (1)
5</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Experiments</title>
      <p>DPM. Also, each jk needs to be resampled each
iteration of the Gibbs sampler.</p>
      <p>Let (jk) = ftdi : zdi = j and sdi = kg ordered
arbitrarily, which groups the tdi by the topic and DPM
component that they are associated with. The
complete conditional for each is:
[ jk] =p( jkjs; t; w; z;
jk; 2;
; ; m; ; ; 0; 02)
=f
jk; jk?; j2k?
(3)
(4)
where ?2 =
? =
12 + j (j2k)j
0 j</p>
      <p>j (jk) !
02 + Pji=(1jk)2 i
0 j
1
and
2
?
The complete conditional is a common result for
gamma-normal conjugacy. In this case, the likelihood
is restricted to those tdi for which zdi = j:
j2 = InverseGamma (
? ;
? )
(5)
where
? =</p>
      <p>+ n2j ,
? =
+</p>
      <p>PdD=1 PiN=d1[1j (zdi)( zdi;sdi
2
tdi)2]
;
and 1j (x) is the Kronecker delta.</p>
      <p>We inferred topic assignments and metadata
distributions for several real-world datasets using sLDA, TOT,
TONPT, and a baseline method that we will refer to
as PostHoc in which a vanilla LDA model is inferred
over the dataset and then a linear model is fit to the
metadata using the document topic proportions as
predictors.</p>
      <p>Because it is difficult to know a-priori what form the
distributions over metadata given topics will take in
real-world data, we also ran one experiment with
synthetic data, where the metadata distributions were
prespecified. Synthetic data was used in order to
determine whether TONPT can accurately recover
complex metadata distributions in conjunction with topic
distributions.</p>
      <p>
        The focus of our experiments was to measure
quantitatively how well each model can predict metadata
values on unseen data and to assess qualitatively (e.g.,
via inspection) whether the trained models capture
human intuition and domain knowledge with respect to
the correlations between topics and metadata values.
These words are especially common in this corpus
(e.g., in datelines) and provide a strong signal that is
not based on the topical content of the articles (i.e.,
they allowed the models to “cheat”). After feature
selection there were 10,230 non-empty documents in the
final dataset.
We ran our experiments on three real-world datasets.
For each dataset the timestamps of the documents
were extracted and used as the metadata. For all
realworld datasets, stopwords were removed using the
stopwords file included in the MALLET topic
modeling toolkit [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. In addition, words that occurred in
more than a half of the documents in a dataset and
those that occurred in fewer than 1% were culled.
Words were converted to lowercase, and documents
that were empty after pre-processing were removed.
Finally, only for the TOT model, the metadata were
all normalized to the (0; 1) interval to accommodate
usage of the beta distribution.
      </p>
      <p>
        The first dataset consists of the State of the Union
Addresses delivered by Presidents of the United States
from the first address by George Washington in 1790
to the second address by Barack Obama in 2010. The
data was prepared in the manner similar to that of
Wang and McCallum [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], in which addresses were
subdivided into individual documents by paragraph,
resulting in 7507 (three-paragraph) documents. The
metadata for this dataset were address timestamps
which were normalized to the interval [0; 1].
The second dataset was the LDC-annotated portion of
the Enron corpus [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. This dataset consists of 4,935
emails, that were made public as part of the
investigation of illegal activities by the Enron Corporation. It
covers approximately one year of time (January 2001
through December 2001). The metadata timestamps
for this dataset were extracted from the Date header
field of the e-mail messages.
      </p>
      <p>
        The final dataset was the Reuters 21578 corpus[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. We
used the subset of the articles for which topical tags
are available, which consists of 11,367 documents.
The articles were written during a time interval that
spans most of the year 1987. The documents were
processed using the same feature selection as for the
other two datasets with an additional step in which
variants of the names of the months were removed.
In our prediction experiments, models were trained on
90% of the documents and then were used to predict
the metadata values for the remaining 10%. This was
repeated in a cross-validation scheme ten times, with
the training and evaluation sets being randomly
sampled each time. Prediction quality was evaluated using
the formula for the coefficient of determination (R2)
used by Blei and McAuliff [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]:
      </p>
      <p>R2(t; ^t) = 1</p>
      <p>
        Pd(td
Pd(td
t^d)2
t)2
;
where td is the actual metadatum for document d, t^d
is the prediction and t is the mean of the observed tds.
For linear models this metric measures the proportion
of the variability in the data that is accounted for by
the model. More generally, it is one minus the
relative efficiency of the supervised topic model predictor
to a predictor that always predicts the mean of the
observed data points. This value can be negative in cases
where the model being evaluated performs worse than
the mean predictor. The means and standard errors
of the R2 values across all ten folds were recorded.
In order to assess the statistical significance of the
results, a one-sided permutation test was used to
calculate p-values for the hypothesis that the mean R2 for
the model with the highest mean R2 was greater than
the mean R2 for each of the other models being tested.
P-values less than 0.05 were considered significant.
As discussed above, prediction in the case of sLDA is
quite simple. In the case of TOT and TONPT,
prediction is complicated by the fact that these models have
per-word metadata variables, and not per-document
variables. In addition, they do not produce a
prediction using a simple dot product, but instead they
provide a distribution over predicted values given a topic
assignment. In order to perform prediction in TOT
one finds the metadata value with maximal posterior
probability given the topic assignments for all of the
words in the test document[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]:
t^d = arg max Y p(tjzdi)
      </p>
      <p>t i
In order to approximate this value, we first infer topic
assignments for each word in the document using a
version of the model in which the metadata and
related variables have been integrated out (i.e., vanilla
LDA). Next, because the posterior is a fairly
complicated product, and difficult to maximize directly, we
approximate by choosing several discrete points and
check the value of the posterior at each test point. In
the original TOT paper, the candidate points were
chosen to represent decades. In an attempt to be more
general and to choose candidates that are likely to be
of high posterior probability we generate candidates
by sampling a metadata value for each word from the
beta distribution for the topic assigned to that word.
The mean of the sampled points is also added as a
candidate. Finally, to generate a prediction the
posterior density is calculated at each of the candidates and
the one producing the greatest value is chosen.
We found that in the case of TONPT the
multimodality of the p(tjzdi) distribution caused this prediction
algorithm to perform poorly. For TONPT, predictions
are determined by first estimating the d parameter for
the test document using samples obtained from the
model with the metadata marginalized out, and then
using d to estimate the mean of p(tjzdi) as the d
weighted average of the means of the topic DPMs.
For the TONPT runs, G0 was chosen to be a normal
with mean and variance equal to the sample mean and
variance for the observed metadata, was 2.0,
was 1.0, and m was 1. For all runs, the
documenttopic parameter = 0:1, and the topic-word
parameter = 0:01.
5.3</p>
      <p>Synthetic Data Results
The synthetic dataset was created such that there
are 2 topics and a vocabulary of 5 words:
“common”, “semicommon1”, “semicommon2”, “rare1”
and “rare2”. The “common” word occurs with 0.6
probability in both topics, “semicommon1” is slightly
more likely than “semicommon2” in the first topic,
and slightly less likely in the second topic. The
“rare1” word is much more likely in the first topic
than the second and “rare2” is much more likely in
the second topic than the first, but both are much less
common in general than the “semicommon”s.
Each topic was given a fixed metadata distribution:
t0
t1
0:3 f (50; 7) + 0:7 f (80; 7)
f (20; 40)
Figure 4 shows how, for one run of the inference
procedure, the model was able to separate the two topics
and recreate the original metadata distributions with
high degree of fidelity. Some runs result in slightly
better approximations, while others do worse, but
these plots seem to be representative of TONPT’s
performance on this task.
5.4</p>
      <p>Prediction Results
Table 2 shows the performance of the various models
for the prediction task with 40 topics, which we found
to be a number of topics at which peak performance
was observed for most of the models. It can be seen
that TONPT is significantly superior on the State of
the Union and Reuters data, though TOT does come
out ahead on the Enron dataset (but not significantly
so).
5.5</p>
      <p>Posterior Analysis
Figure 5 shows the distribution over time for two
topics found during runs of TONPT on the State of the
Union dataset. The topic shown in 5a is typical of
the majority of the distributions we find (a DPM with
only one observed component and thus very close to a
simple symmetric distribution). It shows the relatively
recent rise in prevalence of the topic of health care in
U.S. politics.</p>
      <p>The topic shown in 5b is an example of a more
complex distribution. This particular example appears
to capture several conflicts the United States was
involved in during the early 1800s, including The War
of 1812 and several conflicts related to the Seminole
Wars in Florida (which was a Spanish territory until it
was ceded to the U.S. in 1821).
6</p>
    </sec>
    <sec id="sec-7">
      <title>Conclusion and Future Work</title>
      <p>We have presented TONPT, a supervised topic model
that models metadata using a nonparametric density
estimator. The model accomplishes the goal of
accommodating a wider range of metadata distributions
and, in the case of the datasets that we evaluated
against, prediction performance remains competitive
with previous models. Future work could extend the
model to multivariate metadata, such as
temporalspatial data including both timestamps and
geolocation information. For example, a multidimensional
version of TONPT could be used to capture the
development of trends in Twitter data, identifying areas
where topics originate and how they spread across the
country over time. A multivariate normal component
distribution would also capture correlations between
metadata elements through a topic covariance matrix.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>David</given-names>
            <surname>Aldous</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Illdar</given-names>
            <surname>Ibragimov</surname>
          </string-name>
          , Jean Jacod, and David Aldous.
          <article-title>Exchangeability and related topics</article-title>
          . In cole d't de Probabilits de Saint-
          <source>Flour XIII</source>
          <year>1983</year>
          , volume
          <volume>1117</volume>
          of Lecture Notes in Mathematics, pages
          <fpage>1</fpage>
          -
          <lpage>198</lpage>
          . Springer Berlin / Heidelberg,
          <year>1985</year>
          .
          <volume>10</volume>
          .1007/BFb0099421.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Michael</surname>
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Berry</surname>
            , Murray Brown, and
            <given-names>Ben</given-names>
          </string-name>
          <string-name>
            <surname>Signer</surname>
          </string-name>
          .
          <source>2001 topic annotated Enron email data set</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>David</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Blei</surname>
          </string-name>
          and
          <string-name>
            <surname>Jon D. McAuliffe</surname>
          </string-name>
          .
          <article-title>Supervised topic models</article-title>
          .
          <source>In arXiv:1003</source>
          .0783,
          <year>March 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Chang</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Blei</surname>
          </string-name>
          .
          <article-title>Relational topic models for document networks</article-title>
          .
          <source>In Artificial Intelligence and Statistics</source>
          , pages
          <fpage>81</fpage>
          -
          <lpage>88</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Escobar</surname>
          </string-name>
          .
          <article-title>Estimating normal means with a dirichlet process prior</article-title>
          .
          <source>Journal of the American Statistical Association</source>
          , pages
          <fpage>268</fpage>
          -
          <lpage>277</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Escobar</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>West</surname>
          </string-name>
          .
          <article-title>Computing nonparametric hierarchical models</article-title>
          .
          <source>Practical nonparametric and semiparametric Bayesian statistics</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>22</lpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.M.</given-names>
            <surname>Gerrish</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.M.</given-names>
            <surname>Blei</surname>
          </string-name>
          .
          <article-title>Predicting legislative roll calls from text</article-title>
          .
          <source>In Proceedings of the 28th Annual International Conference on Machine Learning, number 11</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>D.</given-names>
            <surname>Lewis</surname>
          </string-name>
          .
          <article-title>Reuters-21578 text categorization test collection</article-title>
          . http://www.research.att. com/˜lewis,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>A.Y.</given-names>
            <surname>Lo</surname>
          </string-name>
          .
          <article-title>On a class of bayesian nonparametric estimates: I. density estimates</article-title>
          .
          <source>The Annals of Statistics</source>
          ,
          <volume>12</volume>
          (
          <issue>1</issue>
          ):
          <fpage>351</fpage>
          -
          <lpage>357</lpage>
          ,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Andrew</given-names>
            <surname>Kachites McCallum. MALLET:</surname>
          </string-name>
          <article-title>A machine learning for language toolkit</article-title>
          . http:// mallet.cs.umass.edu,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>D.</given-names>
            <surname>Mimno</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>McCallum</surname>
          </string-name>
          .
          <article-title>Topic models conditioned on arbitrary features with dirichletmultinomial regression</article-title>
          .
          <source>In Uncertainty in Artificial Intelligence</source>
          , pages
          <fpage>411</fpage>
          -
          <lpage>418</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Xuerui</given-names>
            <surname>Wang and Andrew McCallum</surname>
          </string-name>
          .
          <article-title>Topics over time: A non-markov continuous-time model of topical trends</article-title>
          .
          <source>In Proceedings of the 12th ACM SIGKDD international conference(KDD'06)</source>
          , Philadelphia, PA,
          <year>August 2006</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>