<!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>Timely Tip Selection for Foursquare Recommendations</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Max Sklar</string-name>
          <email>max@foursquare.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kristian J. Concepcion</string-name>
          <email>kjc@foursquare.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Table 1: Comparing Food Items with the Highest</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bhattacharyya Similarity to Lunch, English Phrase Score Thai Translated Score</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Foursquare Labs</institution>
          ,
          <addr-line>568 Broadway, 10th Floor, New York, NY</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2014</year>
      </pub-date>
      <abstract>
        <p>This poster summarizes the techniques we use to serve Foursquare tips for a given venue and more speci cally the strategies employed for choosing timely and seasonal tips. salad sandwich turkey sandwich cuban sandwich panini</p>
      </abstract>
      <kwd-group>
        <kwd>bhattacharyya coe cient</kwd>
        <kwd>context-aware recommenders</kwd>
        <kwd>foursquare</kwd>
        <kwd>machine learning</kwd>
        <kwd>natural language processing</kwd>
        <kwd>text classi cation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>Foursquare is a location-based recommendation engine. A
primary action for users is to write a tip, which is a short
public note attached to a venue, often a review or suggestion.
Any given venue is likely to have many tips attached to it,
which vary in quality and relevance. With the recent focus
on search and discovery as well as passive location awareness,
we have developed a number of heuristics in order to serve
the right tips to the right people at the right time.</p>
    </sec>
    <sec id="sec-2">
      <title>TIP SELECTION COMPONENTS</title>
      <p>Language Identi cation: In order to avoid serving
languages that a user does not understand, a language
classier on Foursquare tips was built using an ensemble of open
source and home-grown solutions.</p>
      <p>Global quality: We created a hand-labelled training set
of high and low quality tips based o of a strict set of
quality guidelines. Raw scores from various statistical classi ers
that were trained to identify speci c traits such as sentiment
or spam were used as features to train a quality model.</p>
      <p>Personalization: We developed a number of signals which
take into account the user's tastes and social connections.</p>
      <p>Timeliness and Seasonality: For any given date and
time, a tip is analyzed in order to determine whether it is
appropriate for a particular time of week or time of year.
In this poster, we go into more detail on the system for
analyzing this component.
3.</p>
    </sec>
    <sec id="sec-3">
      <title>TIMELINESS OF PHRASES AND TIPS</title>
      <p>Through our Swarm app, users check in to share their
location and leave a short update for their friends called a
shout. In order to nd phrases which are time-sensitive,
we looked at shouts instead of tips because they were more
speci c to what users were doing at any particular time.</p>
      <p>
        Our model for phrase popularity over the course of the
week mirrors our model for venue popularity[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. For each
supported language, we divided the week into 168 hour
buckets. We then counted the number of times each phrase was
used in a given bucket. We also counted the total number
of shouts in each bucket to produce a baseline distribution.
      </p>
      <p>
        The Bhattacharyya coe cient [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a metric for comparing
the similarity between two probability distributions. Given
two phrase distributions P and Q, we de ne the similarity
to be
      </p>
      <p>S(P; Q) = X pP (w)Q(w)</p>
      <p>w2W
where W is the set of all 168 weekhour buckets.</p>
      <p>For example, the Bhattacharyya coe cient between any
phrase and the word \lunch" provides a measure of how
appropriate that phrase is for lunch time. The food items
which rank most highly in this metric for English and Thai
give interesting insights into the lunch habits of di erent
language groups (Table 1).</p>
      <p>Furthermore, the Bhattacharyya coe cient between any
phrase and the baseline distribution measures the time
sensitivity of that phrase. We extracted all the phrases that meet
a certain threshold for time sensitivity. Then, each
phrasebucket was assigned a timeliness score which is the log-ratio
of the phrase probability and the baseline probability.</p>
      <p>
        We de ned C(p) to be the total number of times phrase
p appears in the corpus, and C(pw) to be the total
number of times p appears in weekhour w. Finally, is a
168dimentional Dirichlet smoothing constant on phrase count
data[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and b is de ned as a phrase to correspond with
the baseline counts. The timeliness score for a phrase at
weekhour w is computed as follows.
      </p>
      <p>T (p; w) = ln</p>
      <p>C(pw) + w
C(p) + Pi i</p>
      <p>C(bw) + w
C(b) + Pi i</p>
      <p>The timeliness score for a tip is the sum of the scores of
its phrases. For example, at Veselka (a popular Ukrainian
restaurant in New York's East Village), a user wrote \They're
open 24/7 - turn up after your night out and partake of
the pierogis with applesauce." The terms \24/7", \turn up",
\night out", and \pierogi" all meet the Bhattacharyya
threshold. Their respective scores for Sunday night at midnight are
1.2, 0.6, 0.3, and -0.6. These sum to 1:5 which is positive
and indicates that this tip is timely on Sunday night.</p>
      <p>
        We supplemented our shout counts with the English
Wordnet[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] food corpus and our English menu database. This
allowed us to associate entries in the Wordnet corpus with
speci c meals (breakfast, lunch, dinner, dessert, and late
night). For phrases in the Wordnet food corpus with
insufcient shout data, we replaced the distribution with that of
the matching abstract mealtimes.
      </p>
      <p>One problem we encountered was with non-compositional
compound phrases. The timeliness of \burrito" is very di
erent from that of \breakfast burrito", but because the burrito
data included all mentions of breakfast burrito as well, its
timeliness score was dampened. To counteract this
problem, we merged phrases in our training data that appeared
more frequently together so that they would be considered
as completely separate entities from their constituent
tokens. In terms of burritos, this meant that all mentions of
breakfast burrito were counted as one term, and all
mentions of burrito not following breakfast were considered as
an entirely separate term.</p>
      <p>e
r
o
c
S
s
s
e
n
i
l
e
m
i
T
e
s
a
r
h
P
2
1
0
1
2
3</p>
      <p>Burrito</p>
      <p>Breakfast Burrito</p>
      <p>Non-Breakfast Burrito
95
100
105
110
115
120</p>
      <p>Hour (96 to 120 is midnight to midnight on Friday)
3.1</p>
    </sec>
    <sec id="sec-4">
      <title>Evaluation</title>
      <p>We evaluated the timeliness score on a hand-labelled set
of 825 tips, each with four abstract meal times: breakfast,
lunch, dinner, and late night. For each tip and time period,
we applied the label of timely, neutral, or untimely. We then
compared those labels to our timeliness scores, the result of
which satis ed us for using the feature in the product.</p>
      <p>The timeliness score serves two purposes: detecting
specifically timely tips, and disqualifying untimely tips. With our
chosen threshold, we achieved 71.3% precision and 74.5%
recall for timely tips against our hand labelled set. Untimely
scoring used a di erent threshold and achieved 74.7%
precision and 67.0% recall.
4.</p>
    </sec>
    <sec id="sec-5">
      <title>EXTENSION TO SEASONALITY</title>
      <p>
        The ability to detect and exploit seasonality is an
important feature for search and recommendation systems[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
There was not enough data to create 365 day-buckets so
instead we chose to create buckets based o of weeks.
Unfortunately, in the unix calendar utility, many popular holidays
crucial to seasonality fall in di erent buckets each year. To
ameliorate this, we forced every month into a 4 week model,
with the last week of the month subsuming all extra days
beyond the 28th. The last week of each month was then
normalized to account for the extra days before the
Bhattacharyya coe cients were calculated.
      </p>
      <p>Another issue was caused by phrases that were seasonal
in only one year. Very popular movies caused us to
associate \James Bond" with mid-November and \Star Trek"
with June. We solved this problem by looking at data for
each year individually and agged outliers. Once agged,
we smoothed the counts to bring the o ending year more in
line with the rest of the data.
4.1</p>
    </sec>
    <sec id="sec-6">
      <title>Future Work</title>
      <p>Some terms follow a di erent seasonal pattern depending
on geographic region and performance would be improved
by geo-fencing phrase distributions by region. For example,
the term \ reworks" was found to be incredibly timely during
the rst week of July for American Independance Day, but
there is also a smaller spike in the rst week of November for
Guy Fawkes Day in Great Britain. Another example was the
term \Rangers" being timely in the summer and the winter.
The Texas Rangers (a baseball team that plays during the
summer) was being con ated with the New York Rangers (a
hockey team that plays during the winter).</p>
      <p>Geo-fencing by climate zone as opposed to national
borders or metropolitan areas would improve results for
weatherrelated phrases such as \outdoor seating"\hot soup", and \air
conditioning".
5.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Bhattacharyya</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>1946</year>
          ).
          <article-title>On a measure of divergence between two multinomial populations</article-title>
          .
          <source>Sankhya: The Indian Journal of Statistics</source>
          ,
          <volume>401</volume>
          -
          <fpage>406</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Miller</surname>
            ,
            <given-names>George A.</given-names>
          </string-name>
          (
          <year>1995</year>
          ).
          <article-title>WordNet: A Lexical Database for English</article-title>
          .
          <source>Communications of the ACM</source>
          Vol.
          <volume>38</volume>
          , No.
          <volume>11</volume>
          :
          <fpage>39</fpage>
          -
          <lpage>41</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Shokouhi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2011</year>
          ,
          <article-title>July)</article-title>
          .
          <article-title>Detecting seasonal queries by time-series analysis</article-title>
          .
          <source>In Proceedings of the 34th international ACM SIGIR conference on Research and development in Information Retrieval</source>
          (pp.
          <fpage>1171</fpage>
          -
          <lpage>1172</lpage>
          ). ACM.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Sklar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shaw</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Hogue</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2012</year>
          ,
          <article-title>September)</article-title>
          .
          <article-title>Recommending interesting events in real-time with foursquare check-ins</article-title>
          .
          <source>In Proceedings of the sixth ACM conference on Recommender systems</source>
          (pp.
          <fpage>311</fpage>
          -
          <lpage>312</lpage>
          ). ACM.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Sklar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Fast MLE Computation for the Dirichlet Multinomial</article-title>
          .
          <source>arXiv preprint arXiv:1405</source>
          .
          <fpage>0099</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>