<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aana Bansal on Medium]]></title>
        <description><![CDATA[Stories by Aana Bansal on Medium]]></description>
        <link>https://medium.com/@aanabansal?source=rss-99e19a5a16e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GelJ7XUa1t1noVhAlQoFmg.png</url>
            <title>Stories by Aana Bansal on Medium</title>
            <link>https://medium.com/@aanabansal?source=rss-99e19a5a16e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:44:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aanabansal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hubble’s 20/20 Vision]]></title>
            <link>https://medium.com/@aanabansal/hubbles-20-20-vision-3ae16c47b0b5?source=rss-99e19a5a16e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ae16c47b0b5</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Aana Bansal]]></dc:creator>
            <pubDate>Thu, 01 Feb 2018 02:54:43 GMT</pubDate>
            <atom:updated>2018-02-01T02:56:34.196Z</atom:updated>
            <content:encoded><![CDATA[<p>Hubble’s 20/20 Vision</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-mW5_wVT8NLbyRb_MpaUA.png" /></figure><p>Last November, I ran out of contact lenses. Having already used my vision benefits for the year, I was looking for something cheap and just enough to last me until the end of the year. For once, those annoying tracking cookies actually paid off because that evening, I saw an advertisement for “Hubble” in my facebook newsfeed.</p><p>Hubble is a direct-to-consumer subscription service for contact lenses. Signing up took less than a minute and a few days later, my new contacts arrived at my door, for half the price I usually pay. It was liberating to have to put so little time and effort into something I use everyday. In fact, I plan to keep my subscription through 2018.</p><p>It’s rare when a product is both cheaper and more convenient than the market standard — so rare that I was a bit skeptical. I compared Hubble’s specifications with my old Acuvue Oasis lenses (The best selling daily lens brand in the U.S.) They were nearly identical. In fact, the Hubbles were a bit thinner so they felt more comfortable in my eyes.</p><p>So now I was really intrigued. If Hubble was able to sell me quality contacts for 30 cents a lens, why was the industry average nearly twice that? Was Hubble operating at a loss? Is Acuvue a monopoly? Where was the market failure?</p><p>The answer turns out to be quite simple but requires a little bit of background about the contact lens industry. Currently, 97% of the global market is dominated by four manufacturers: Johnson &amp; Johnson (38%), Novartis (29%), Valeant (15%), and Cooper (15%). On average, it costs these companies $3 to manufacture a 30-pack of daily lenses. They sell these lenses to distributers for about $15/pack, who resell the lenses to optometrists for $18/pack. Optometrists eventually resell these lenses to their patients for an average of $33/pack — a whopping 1000% markup from what it cost to manufacture them.</p><p>In most industries, these margins would not be sustainable. But since the supply of contact lenses are controlled by the four big manufacturers, they have been able to collaborate and instate minimum resell prices for their retailers. With their direct to consumer model, Hubble is able to sell their contacts at a much lower price, while maintaining very attractive unit economics.</p><p>The “Direct-to-Consumer” model has had a lot of success recently, especially with hits like Casper and Dollar Shave Club. But Hubble isn’t just another DTC company. Contact lenses are the ideal consumer product because they are a large and repeatable spend (unlike razors which are a small repeatable spend or mattresses which are a large one time spend). Hubble has gone beyond just applying business model X to product Y. It’s one of those really good, rare ideas that seem obvious in hindsight.</p><p>What remains to be seen now is how they will defend against competition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ae16c47b0b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In a Confusing World, Context is Key — A Times Intern Sets Out to Improve Search Results]]></title>
            <link>https://open.nytimes.com/in-a-confusing-world-context-is-key-a-times-intern-sets-out-to-improve-search-results-7b2ceb07cde2?source=rss-99e19a5a16e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b2ceb07cde2</guid>
            <category><![CDATA[search]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Aana Bansal]]></dc:creator>
            <pubDate>Fri, 12 Jan 2018 17:14:33 GMT</pubDate>
            <atom:updated>2018-04-26T20:15:40.609Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MW7AyKcCcowW5XIg." /><figcaption>Illustration by Kevin Zweerink for The New York Times</figcaption></figure><p>The past few years have seen the rise of <a href="https://en.wikipedia.org/wiki/Context_awareness">“context-aware” systems</a>: technologies that can predict your intentions based on information about your environment. If you ask Google’s intelligent personal assistant, “How tall is that building?” it will use your phone’s GPS to see what buildings are near you and guess which building you are asking about. Or, if you add “pick up milk” to the Reminders app on your iPhone, you can choose to have the app remind you the next time you are within a block of a grocery store.</p><p>This use of this technology is a response to one of the most challenging problems of human-computer interaction: <em>humans are terrible at articulating what they want in ways that computers can process. </em>We are used to communicating with other humans who largely exist in the same context as us — they are able to infer what we mean, even if what we say is ambiguous. Algorithms that interface between humans and computers must “guess” the human’s intention, which is the crux of information retrieval (i.e. search) problems.</p><h4><strong>Predicting search queries based on news events</strong></h4><p>I took a stab at this problem during my internship at The Times last summer. In formulating my approach, I made an important assumption: because The New York Times is a news platform, it’s likely that when readers search for things on the website, they are looking for articles that are the most topical.</p><p>This may not be a fair assumption for all use cases: a high-schooler writing a term paper may be looking for archived articles as primary sources, or a print reader may be looking for the digital version of a story to email to a friend. While these use cases do occur, they are much less frequent, so relevance to current news stories was a compelling objective.</p><h4><strong>How The New York Times handles search today</strong></h4><p>Currently, the search feature on nytimes.com uses <a href="http://www.elastic.co/products/elasticsearch">Elasticsearch</a>, which operates on a principle called “TF/IDF” (Term Frequency/Inverse Document Frequency). The basic idea is to determine the significance of each term in an article by looking at how many times the term is repeated, then dividing this by the number of times it appears in all of the documents in The New York Times archive. That way, common terms like “said” and “Mr.” are weighted less heavily than terms like “Amazon” or “Game of Thrones.” Articles are then ranked based on how significant the user’s query terms are to each story. So while the current approach may work well for scientific and encyclopedia articles, it’s not the best approach for news stories. This is because news stories don’t have a ton of repetition.</p><h4><strong>Why we need context</strong></h4><p>Let’s look at <a href="https://www.nytimes.com/2017/08/01/travel/farm-to-table-chef-mohonk-hudson-valley-new-york.html?rref=collection%2Fsectioncollection%2Ftravel&amp;action=click&amp;contentCollection=travel&amp;region=rank&amp;module=package&amp;version=highlights&amp;contentPlacement=3&amp;pgtype=sectionfront">this</a> article published on August 1, 2017 in The Times’ Travel section that details how a restaurant at The Mohonk Resort was able to scale farm-to-table dining to hundreds of guests every night. This idea is summarized in the opening paragraph:</p><blockquote><em>Can you create a farm-to-table restaurant if you have 100 tables in an 8,750-square-foot main dining room, 80 more tables downstairs, nine in a cozy lounge, 50 outside overlooking an Arcadian lake and, on certain nights, eight in a capacious kitchen?</em></blockquote><p>Now, let’s look at the seven most frequently used terms in the article.</p><ol><li>Mr.</li><li>Mohonk</li><li>Palmeri</li><li>New</li><li>York</li><li>Dining</li><li>Restaurant</li></ol><p>The top five terms don’t appear in the first paragraph at all. Based on just term frequencies, the article could just as easily be a restaurant review or a profile of the chef, Jim Palmeri. Word counts don’t tell the whole story so it’s very difficult to tell how relevant a story is to current events just from this information.</p><h4><strong>How topic clustering works</strong></h4><p>So how can an algorithm determine whether a story is topical or not? This is where we can use topic clustering. With this technique, an algorithm “learns” what the main dialogues are at the moment by looking at all of the articles published over a one or two week period. From this set of articles, it extracts the major topics, which are defined by a set of terms. Here are a few examples:</p><p><strong>Topic 1: </strong>Trump, staff, house, secretary, Kelly, director, communications, chief, press, President, white, Scaramucci, Spicer, Priebus</p><p><strong>Topic 2: </strong>Korea, north, nuclear, Pyongyang, missile, states, united, military, test, China, Korean, south</p><p><strong>Topic 3: </strong>affordable, Americans, would, people, percent, republicans, obamacare, health, plan, coverage, medicaid, insurers, insurance, care</p><p>The above topic definitions are produced by using an unsupervised learning algorithm based on a Latent Dirichlet Allocation (LDA) model. I’m going to give a brief overview here, but if you’re interested in learning more, Edwin Chen has published an <a href="http://blog.echen.me/2011/08/22/introduction-to-latent-dirichlet-allocation/">excellent explanation.</a></p><p>Before we begin, let’s define a few things.</p><ol><li><strong>Each article is distributed over a set of k topics.</strong> So if we let k = 4, <a href="https://www.nytimes.com/2017/08/05/us/politics/2020-campaign-president-trump-cotton-sasse-pence.html">this article</a> may be 60% about the Republican Party, 20% about the 2020 election, 20% about President Trump and 0% about penguins.</li><li><strong>Each topic is defined by a distribution over the entire English vocabulary.</strong> So if the 2020 election is a topic, 10% of it may consist of the term “2020,” 5% would be the term “Pence,” 5% would be the term “Cuomo,” and so on. (In reality, these numbers are much smaller, around &lt; 0.5%.)</li></ol><p>So, if 50% of an article is about the 2018 elections and 5% of the election topic consists of the term “Cuomo,” we would expect that 2.5% of the terms in this article are “Cuomo.”</p><p>We begin by assuming that all the articles were stochastically generated in this way, meaning each term is randomly chosen from a given probability distribution. For each article, we decide how long it will be according to a <a href="https://www.umass.edu/wsp/resources/poisson/">Poisson distribution</a> and what the topic mixture will be according to the <a href="https://www.cs.cmu.edu/~epxing/Class/10701-08s/recitation/dirichlet.pdf">Dirichlet distribution</a>. In Bayesian statistics, we call this the prior because it’s what we believe about the data prior to doing any analysis.</p><p>Our goal is now to backtrack to try to learn what the topic mixtures, P(T|D), and topic distributions, P(W|T), actually are.</p><p>To help illustrate this, here’s some pseudocode:</p><pre>For each article a:<br>    For each term w:<br>        For each topic t:<br>             <em># the proportion of terms in a that are assigned to t<br>             </em>Compute p(t | a)</pre><pre># <em>the proportion of assignments to t over all<br>             # assignments that came from w<br>             </em>Compute p(w|t)</pre><pre># <em>This is the probability that t generated w<br>             </em>Randomly reassign w to a new topic t with the<br>             probability p(t|a) * p(w|t)</pre><p>We perform this process thousands of times until we reach a steady state. At this point, we have a pretty good idea of what the current major topics are.</p><h4><strong>How topic clustering improves search</strong></h4><p>I spent the second half of my internship developing a way to use these topic clusters to return more relevant search results. I’ll call the algorithm I built ClusterSearch.</p><p>ClusterSearch maps the user query to a topic if any of the terms were one of the top 15 terms in the topic definition. There are more sophisticated ways to do this — you could take into account the weight of each term in the definition — but this method worked well for my project.</p><p>Once ClusterSearch has determined which topics are relevant, it expands the user query with the top 15 terms from each topic’s definition. Finally it performs Elasticsearch on this expanded query, giving more weight to terms from the user’s original query.</p><p>Let’s look at an example. I did topic clustering on all the articles from the last two weeks of July over 100 topics.</p><p>Let’s say the user searched for “Simpson,” which maps to one topic definition. Here are the top 15 terms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*X6SPUVOrN8kKJvz5." /></figure><p>O.J. Simpson receiving parole was a major story at the end of July. The numbers to the right are the term weights, so the term “simpson,” makes up about 5% of the topic definition. For now, ClusterSearch ignores those weights and just uses the top 15 terms.</p><p>We expand the user’s query with these terms. So the new query becomes, “simpson former parole friend years prison robbery board nine vegas angeles hearing thursday nevada.”</p><p>We boost terms from the user’s original query so “simpson” is weighted slightly heavier than the other terms. This way, even if different user queries map to the same topic, we may return slightly different results to emphasize what the user originally entered. Finally, we run good old Elasticsearch on this expanded query.</p><p>Here are the top three results produced by ClusterSearch:</p><p><a href="https://www.nytimes.com/2017/07/20/us/oj-simpson-parole.html">O.J. Simpson Wins Parole, Claiming He Has Led a ‘Conflict-Free Life’</a><br><a href="http://topics.nytimes.com/top/reference/timestopics/people/s/daniel_simpson/index.html">Simpson, Daniel</a><br><a href="https://www.nytimes.com/by/april-simpson">Simpson, April</a></p><p>And here are the top three results with Elasticsearch:</p><p><a href="http://topics.nytimes.com/top/reference/timestopics/people/s/daniel_simpson/index.html">Simpson, Daniel</a><br><a href="https://www.nytimes.com/by/april-simpson">Simpson, April</a><br><a href="http://topics.nytimes.com/top/news/business/companies/simpson-manufacturing-company-inc/index.html">Simpson Manufacturing Company Inc.</a></p><p>Daniel Simpson and April Simpson are both reporters who left The Times over a decade ago; Simpson Manufacturing is an engineering firm that produces construction materials, but nothing has been published about them recently. In short, ClusterSearch gives us more “topical” results which are more likely to satisfy the user’s intention.</p><h4><strong>Feasibility</strong></h4><p>So how feasible is Topic Clustering? I ran 3000 iterations on 9853 articles over 100 topics. It took about 90 minutes on my CPU. However, we’re lucky because we only need to topic-cluster once to learn what the major news stories of the moment are so we can topic cluster offline. Running the algorithm once a week or even once a day is actually quite practical.</p><h4><strong>What’s next?</strong></h4><p>Search algorithms are really difficult to assess for two reasons.</p><ol><li><strong>You don’t know what the user was looking for<br></strong>There’s no “ground truth” to judge results against. A user searching for “New York” may be looking for travel guides or they could just as easily be looking for news about the upcoming gubernatorial elections. We can only guess.</li><li><strong>Different users have different preferences<br></strong>Even if you know what users are searching for, deciding the best ranking of articles can still be tricky. Should more recent articles go first? Should more relevant articles go first? These aren’t trivial questions.</li></ol><p>To really understand how well ClusterSearch performs, the next step would be to do some user testing.</p><p>In addition, there are a few other things we need to do before it’s deployed:</p><ol><li>Learn optimal number of topics to cluster over. This can be done through <a href="https://en.wikipedia.org/wiki/Hierarchical_Dirichlet_process">Hierarchical Dirichlet processes</a></li><li>Determine how frequently we should run the topic clustering algorithm. This will take some experimenting</li><li>Integrate ClusterSearch into The Times’ search API.</li></ol><h4><strong>Thank You</strong></h4><p>A huge thank you to everyone at The Times I had a chance to work with over the summer; every panel, coffee chat and event left me feeling inspired and excited. A special thank you to my managers John Daniels and Boerge Svingen; my team mentor, Jeremiah Via; my intern buddy, Will Dunning; and the Women in Technology Task Force. I was lucky to have such a wonderful set of mentors and friends to guide my internship.</p><h4><strong>Get in touch!</strong></h4><p>It was an incredible summer interning at The Times. If you have any questions, feedback or want to hear about the time Nicholas Kristof caught me pointing him out to friends in the cafeteria, feel free to get in touch with me at <a href="/service/mailto:aanabansal@gmail.com">aanab@princeton.edu</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b2ceb07cde2" width="1" height="1" alt=""><hr><p><a href="https://open.nytimes.com/in-a-confusing-world-context-is-key-a-times-intern-sets-out-to-improve-search-results-7b2ceb07cde2">In a Confusing World, Context is Key — A Times Intern Sets Out to Improve Search Results</a> was originally published in <a href="https://open.nytimes.com/">NYT Open</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>