<?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 Julien Dumazert on Medium]]></title>
        <description><![CDATA[Stories by Julien Dumazert on Medium]]></description>
        <link>https://medium.com/@DumazertJulien?source=rss-8efafd7e431a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RG4EGiLV2TZXuCUSxGmRig.jpeg</url>
            <title>Stories by Julien Dumazert on Medium</title>
            <link>https://medium.com/@DumazertJulien?source=rss-8efafd7e431a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:07:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@DumazertJulien/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[A/B testing in a long-distance carpooling marketplace]]></title>
            <link>https://medium.com/blablacar/a-b-testing-in-a-long-distance-carpooling-marketplace-35a67737f4b?source=rss-8efafd7e431a------2</link>
            <guid isPermaLink="false">https://medium.com/p/35a67737f4b</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[ab-test]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Julien Dumazert]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 09:03:16 GMT</pubDate>
            <atom:updated>2018-04-25T09:03:16.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_vFO2hkJvsA1IgY1hMiqA.jpeg" /></figure><p>A/B testing is a common tool to assess the performance of a new feature in data-driven companies. Yet there are many ways to get it wrong, so we felt it was worth sharing our case and our solution.</p><p>At BlaBlaCar, we nurture a marketplace comprising drivers posting rides and passengers booking seats on those rides. The interaction between those two populations makes it dangerous to trust the results of a classic randomized A/B test: so-called interferences arise and create a bias in measurements.</p><p>Read on to learn more about the problem and the solution we designed. Lyft Engineering posted a series of blog posts entitled <a href="https://eng.lyft.com/experimentation-in-a-ridesharing-marketplace-b39db027a66e">Experimentation in a Ridesharing Marketplace</a> that proved a great entry point into the literature about causal inference and interference. Our experimental design has benefited a lot from what they learned, although the contexts and final solutions differ.</p><h3>How the marketplace works</h3><p>Drivers define a ride as:</p><ul><li>a departure point</li><li>an arrival point</li><li>a departure time</li><li>a list of intermediate stopovers.</li></ul><p>Passengers then perform searches and can book a seat on rides that have stops matching their search query. A drawing goes a long way towards explaining the mechanism:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*o_6VKDiyH1ZeO7ljsd8PNg.png" /><figcaption>A match between a passenger and a ride.</figcaption></figure><p>BlaBlaCar’s marketplace is actually much more complex if you consider pricing, time constraints and additional options, but it’s not necessary to go as far for the purpose of this article.</p><h3>Introducing a new feature</h3><p>As a passenger, traveling for hours on the backseat of a full car can be uncomfortable. For this reason, BlaBlaCar introduced “two max in the back”, a flag that a driver can set to indicate… well, that only two passengers can travel on the backseat.</p><p>The impact of this feature on the marketplace is hard to predict: “two max in the back” can attract comfort-sensitive passengers, but at the same time limits the number of seats available. Will more passengers travel at the end of the day?</p><p>Ideally, we would need to observe and measure performance in two parallel universes: one where drivers can set the “two max in the back” flag and another where drivers can’t.</p><p>Unfortunately, we can only observe one universe. But we get to choose the conditions: all drivers can set the flag? None? Only a fraction? All drivers can set the flag, but some passengers can’t see it?</p><p>The goal of the experimenter is to select the design that constitutes the best proxy to measure the difference in performance between the two ideal universes (“two max in the back” for all versus “two max in the back” for none).</p><h3>Measurements in ideal universes</h3><p>For now, let’s use a toy example to compute the performance of the marketplace with or without “two max in the back”.</p><p>Here’s our marketplace: two drivers, D1 and D2, go from city A to city B, and a passenger P wants to do the same. Additionally, D1 and D2 think “two max in the back” is a good idea and set the flag if they are given the choice.</p><p>Passenger P can either decide to use another means of transportation, to book a seat in D1’s car, or to book a seat in D2’s car. Let’s assume the following probabilities in this toy example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*lt4U2VSfzQfA1ZIL3L80bw.png" /><figcaption>Probability table of the toy marketplace.</figcaption></figure><p>In practice of course, these probabilities are unknown.</p><p>The expected number of booked rides is thus 0.5 in the control universe where no driver has the feature (first row). In the treatment universe where both drivers have the feature, the expectation is 0.6 (second row).</p><p>Hence, the impact of the “two max in the back” feature on the number of booked rides is of +20%. This is the uplift that we would like to measure by performing an A/B test.</p><h3>Randomizing drivers</h3><p>The classical method for performing an A/B test is to show the new feature only to a fraction of the population, chosen randomly.</p><p>In our toy example with the “two max in the back” feature, this means letting some drivers set the flag while others can’t. If D1 has the feature (she is in the control group), her expected number of bookings is 0.4. D2 (in the treatment group) has an expected number of bookings of 0.2. Comparing the two results, we would erroneously claim that the uplift created by “two max in the back” is +100%, when it actually is only +20%! The same happens if control and treatment are inverted.</p><h3>Learnings from the example</h3><p>Surely, the example above seems rather contrived: does a full marketplace work the same under randomization? Is it not just a problem of small sample size? Is the probability table not tweaked in order to yield those results?</p><p>Indeed, the toy marketplace example serves the only purpose of exposing a measurement bias caused by competition between drivers. But simulating more realistic and bigger marketplaces helps one realize that this behavior is carried over at scale.</p><p>What have we learned from the example? Competition between drivers for passengers causes a bias in the measurements made under the classic randomization setup. Here, it takes the form of a zero-sum game: what one driver gains in terms of probability of booking is the loss of another driver.</p><p>A different toy example would show that the reverse is also happening in a marketplace: passengers are in competition for the seats on rides offered by drivers. Even more bias!</p><p>In statistical parlance, the competition between actors on the marketplace causes interference: control units (<em>e.g.</em> drivers not having the “two max in the back” feature) influence the performance of treatment units (<em>e.g.</em> drivers having the feature), and vice versa.</p><p>The emblematic example is that of vaccines for infectious diseases. If a person receives the vaccine, his family and friends benefit from him being immunized. In general, the treatment received by a subject decreases the probability that another catch the disease, thus creating an interference.</p><p>For more information on the problem of statistical inference, see the Lyft blog post series <a href="https://eng.lyft.com/experimentation-in-a-ridesharing-marketplace-b39db027a66e">Experimentation in a Ridesharing Marketplace</a>.</p><h3>Better experiment designs</h3><p>Let us state again our objective: measure the uplift caused by the introduction of a feature on the marketplace. How to do so without suffering from interference?</p><p>The general idea comes from the two-parallel-universe setting we try to approximate: let us create independent sub-marketplaces, and reveal the new feature to some of those marketplaces and not to others. Then by comparing the aggregated performance of treatment marketplaces to that of control marketplaces, we can assess the uplift caused by the new feature.</p><p>How to create independent sub-marketplaces? This is mostly domain-specific, as every marketplace can and should be partitioned differently. Yet, another general issue arises when trying to create independent marketplaces: the introduction of selection bias.</p><p>To demonstrate selection bias, let’s take this dumb example: two countries are used to test the feature, one is used as control and the other is used as treatment and has the new feature. Comparing the two countries to assess the performance of the feature makes no sense, as the two countries, though independent, may differ in many other ways.</p><p>A less dumb example is to alternate the activation of the feature over time over the whole marketplace. Hopefully, there is less selection bias than in the experiment design above. It is however possible that an unexpected event happens in one of the time slots, perturbing the measurement.</p><p>This goes to show that <strong>to prevent statistical interference, we have to accept a little selection bias</strong>. The objective is then to find the best tradeoff.</p><p>Finally, there is another implicit requirement, the test must include as many units (be they drivers, passengers, or vaccine subjects) as possible, in order to preserve statistical power.</p><p>As a recap, here is the recipe. The objective is to create sub-marketplaces that:</p><ul><li>are approximately independent</li><li>do not suffer from too much selection bias when compared to each other</li><li>collectively cover as much of the marketplace as possible.</li></ul><p>Let’s now apply these ideas to BlaBlaCar!</p><h3>Experiment designs in a carpooling marketplace</h3><p>At BlaBlaCar, we have chosen to activate features based on rides offered by drivers. Adopting this point of view, an interference arises when a passenger’s search results shows rides from both control and treatment groups.</p><p>In order to segment drivers into non-competing groups, there are two natural dimensions: geography and time. Indeed, trips that are geographically different do no compete, neither do trips with different departure dates.</p><p>As stated above, pure geographical or time segmentations create a sizeable selection bias. As a consequence, we have chosen to mix both dimensions into the experiment design below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*UI9SQ3PAMiKw1FUoiPZTyA.png" /></figure><p>The geographical buckets will be defined below.</p><p>Why is this better than pure geo or time segmentations?</p><ul><li>Pure geographical segmentation introduces an obvious selection bias that cannot be mitigated.</li><li>Provided there is some seasonal correlation between the two geographical buckets, the design above suffers less from selection bias due to seasonality than pure time slot alternance.</li></ul><p>Note that we cannot use finer time slots than days because passengers tend to be very flexible regarding the departure hour.</p><h3>Geographical buckets</h3><p>The last remaining task is to divide the drivers into non-competing groups based on their geography, the “geo buckets”.</p><p>At this point, it is important to note that the stopovers described in the first section of this post impose severe restrictions to how we can segment drivers.</p><p>For instance, assume that we divide rides according to their departure point:</p><ul><li>rides departing from northern France constitute geo bucket 1</li><li>rides departing from southern France constitute geo bucket 2.</li></ul><p>Imagine a ride going from Paris (northern France) to Montpellier (southern France) and declaring a stopover at Clermont-Ferrand (southern France). This ride is in geo bucket 1, but on the Clermont-Ferrand-Montpellier segment, it may compete against rides from geo bucket 2! Note that we cannot activate and deactivate the A/B-tested feature depending on segments within a ride, otherwise the driver would see the two versions, which is an interference.</p><p>Taking this into account, we have designed the following partition based on direction rather than location:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*gcvkJmkEcm_pJi1UTFzSsA.png" /></figure><ul><li>all rides whose segments are northbound fall in the northbound bucket,</li><li>all rides whose segments are southbound fall in the southbound bucket,</li><li>all rides containing alternating directions are not considered.</li></ul><p>The strict condition on segments ensures that a passenger has little chance to see two rides from bucket 1 and 2 in the same search results. Of course, it’s more frequent to see a mix of rides from a bucket and out-of-test rides. But out-of-test rides are few and they only cause indirect competition between the two buckets.</p><p>All these properties can be quantified (the lower the better for all):</p><ul><li>proportion of out-of-test rides</li><li>proportion of passengers who see rides from buckets 1 and 2</li><li>proportion of passengers who see rides from a bucket and out-of-test rides.</li></ul><p>We have thus been able to compare different partitions:</p><ol><li>the partition on the departure point used as an example above</li><li>the direction-based partition explained above</li><li>another partition wherein the country is divided into two areas and cross-area rides are out of test.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*8VFcelFgH34VPqtSU041yw.png" /></figure><p>The table above indicates that the best tradeoff between selection bias and interference is reached by the direction-based partition.</p><h3>Recap</h3><p>If you happen to post a ride on BlaBlaCar, depending on the direction of your ride and the parity of the departure date, you may end up in a control or treatment group!</p><p>This non-trivial experiment design enables us to assess the impact of new features with the following properties:</p><ul><li>Little interference (almost only indirect competition through the out-of-test rides)</li><li>Limited geo and seasonal selection biases by mixing the two dimensions</li><li>More than 4 rides out of 5 are inside the experiment.</li></ul><p>This design comes with its own set of limitations: the duration of the test must be a multiple of two weeks, so that control and treatment groups contain each weekday; some special dates like the first day of school holidays create a selection bias in favor of one of the two groups (<em>e.g.</em> French families flocking down south on July 14th).</p><p>Additionally, we would benefit from building a more accurate set of simulation tools to further confirm the validity of the experiment design. As of today, it has been tested in simple simulations and real-life A/A tests.</p><p>Nevertheless, this solution has already allowed us to test some major marketplace-level features, with more confidence in the results than ever before.</p><p>At BlaBlaCar, we believe investing time into sounder statistical tools and methodology is key to making good product decisions. Don’t hesitate to contact us to exchange about this topic or share experience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35a67737f4b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blablacar/a-b-testing-in-a-long-distance-carpooling-marketplace-35a67737f4b">A/B testing in a long-distance carpooling marketplace</a> was originally published in <a href="https://medium.com/blablacar">BlaBlaCar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the layout of webpages using automatic zone recognition]]></title>
            <link>https://medium.com/contentsquare-engineering-blog/automatic-zone-recognition-in-webpages-68fb2efab822?source=rss-8efafd7e431a------2</link>
            <guid isPermaLink="false">https://medium.com/p/68fb2efab822</guid>
            <category><![CDATA[e-commerce-website-design]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Julien Dumazert]]></dc:creator>
            <pubDate>Mon, 06 Mar 2017 12:59:18 GMT</pubDate>
            <atom:updated>2021-04-07T12:32:48.905Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>** This blog has moved! Please read this article here:<br></strong><a href="https://engineering.contentsquare.com/2017/automatic-zone-recognition-in-webpages/"><strong>https://engineering.contentsquare.com/2017/automatic-zone-recognition-in-webpages/</strong></a><strong> **</strong></p><p>At ContentSquare, we empower our clients to analyze user interactions with every part of their website, from entire pages down to HTML elements. Aggregating the information in human-readable blocks is key; which is why we ask our clients to cluster URLs into pages (list pages, product pages, home pages, etc) and key HTML elements into zones of interest. Figure 1 shows a product page segmented into different zones: search bar, logo, menu, “add to cart” button, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0tA0d6dPxuQ5orfx." /><figcaption>Figure 1. A webpage segmented into zones of interest. The displayed values are metrics associated with those zones.</figcaption></figure><p>Segmenting a webpage similar to the one above, is a time consuming operation, regardless of the tools you use. What if we could automatically find zones of interest and segment webpages? This is what we’d like to focus on in this blog post, so if this topic is of interest, read on.</p><h3>First thoughts</h3><p>There are several ways of tackling this problem, depending on the expected result.</p><p>A natural approach is to view the problem as a clustering task. HTML elements would be grouped in clusters, and those clusters would constitute the zones of interest we’re after. Those clusters would be unlabelled though: another algorithm would have to label those clusters, that is to infer their category (menu, “add to cart” button, etc).</p><p>In our case, we want the algorithm to find and label a few meaningful zones (menu, “add to cart” button, etc) rather than segment the page in unlabelled clusters. For this reason, unsupervised approaches like the one above are not a good match in our context.</p><p>There have been papers identifying blocks present across several pages of the website. This is a good idea for zones like the menu, but unfit to our case: the interesting zones frequently live on few pages, like the “add to cart” button that can be found in product pages only.</p><p>At ContentSquare, we have listed the most common page and zone categories across e-commerce websites. So it only seems natural to use this domain knowledge and build “zone detectors” rather than “global page segmenters”.</p><p>The advantage is that the task at hand is reduced to supervised binary classification: is this HTML element the root HTML element of the DOM subtree constituting the menu? Performance evaluation is easy and many algorithms exist.</p><p>The downside to this is that we need to build a model for every zone!</p><p>Nevertheless this is the solution we adopted and, as a proof of concept we set out to build models that detect menus and “add to cart” buttons in product pages. In our first iteration, we trained a classifier that assigns to every HTML element a score of being the zone of interest. The element with highest score is then selected to be the zone of interest.</p><p>Throughout the rest of the article, we will use menus and “add to cart” buttons on product pages as examples of zones of interest.</p><h3>Gathering the data</h3><p>To detect menus and “add to cart” buttons on product pages, we needed a fair number of product pages. So we built a crawler that collects product pages. We collected more than a thousand of them from numerous websites.</p><p>Next, we developed a small web interface that allowed us to tag HTML elements as “menu” and “add to cart” button. Let me thank the colleagues who spent several hours tagging pages for us!</p><p>Technically, a JS script was injected into the webpage. This script allowed the user to select HTML elements with the mouse and assign them a category.</p><p>Once finished, we had a dataset of 1,089 product pages with a tagged menu and 1,102 product pages with a tagged “add to cart” button.</p><h3>The algorithm</h3><p>The algorithm is divided into four steps (see figure 2):</p><ol><li>Web page scraping: a Js script run by PhantomJs extracts data about the different HTML elements of the page.</li><li>Feature transformation: the data scraped from the web page is transformed into a proper set of features for all HTML elements. Bag of words models for text data, standardization for numerical data, etc.</li><li>Prediction of the probability of being the zone of interest (<em>e.g.</em> the menu) for all HTML elements.</li><li>Selection of the zone of interest from the probabilities outputted at step 3. In this first iteration, the HTML element with highest score is selected.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/0*dp7T5zKlvGKGlBSf." /><figcaption>Figure 2. Outline of the algorithm.</figcaption></figure><p>In figure 2, HTML elements are represented by their path in the DOM tree: “div#content&gt;a:eq(1)” means the second “a” tag within a “div” tag with id “content”.</p><h4>Web page scraping</h4><p>We extract all kinds of information from the web page: from the size of HTML elements and their position in the DOM tree to their ids and CSS class names.</p><p>To perform this task, we use a JS script that is run by PhantomJS. It produces a text file containing structured JSON objects for almost every HTML element in the page.</p><p>At this step, we only filter out elements which have no chance of being a zone of interest, such as special HTML tags or “non-physical” elements.</p><h4>Feature transformation</h4><p>Once structured data is extracted for each HTML element, they have to be turned into proper feature vectors. We have tried many features and preprocessing steps as part of our cross-validation routine, and we kept the ones yielding best performance and moved them in the final model.</p><p>As we will see below, developer data like element id and CSS class names represent a huge amount of information. We separated the words according to all possible naming conventions: camel case, pascal case, underscores, hyphens, etc. Then a bag-of-words model was applied to the obtained words. This allowed us to capture the semantic meaning chosen by the developer. Of course, it is implicitly assumed that the developer gives meaningful names to their entities: poorly written or obfuscated source code is not supported at this time.</p><p>Among the numerical features we have extracted from the HTML elements, some have a great impact on the performance of the model. Let’s mention width and height of the element, depth and number of descendants in the DOM. We applied standardization before logistic regression, and no feature transformation before random forests.</p><h4>Machine learning</h4><p>As mentioned above, our algorithm yields the probability of being the menu for every HTML element. The menu is selected based on those probabilities.</p><p>This way, we have effectively reduced the problem to the task of classifying elements as “menu” and “non-menu”. Figure 3 below gives an overview of the dataset. For every page, there is one unique element with the label set to 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*ZPnkgh8EN7es75m3yhF2gA.png" /><figcaption>Figure 3. Schematic description of a dataset.</figcaption></figure><p>Since the final selection of the zone of interest is based on probabilities assigned to the HTML elements, we used classifiers that <em>naturally</em> yield probabilities and scores, like logistic regression and random forests (in contrast with SVM for instance).</p><p>For cross-validation and grid-searching on parameters, we used a custom loss function representing our task: the proportion of web pages in our dataset for which the algorithm selected the correct zone.</p><p>This loss function is rather binary though: it does not take into account how “far” the predicted zone of interest is from the actual one. So we also worked on finer loss functions that take into account the severity of the error: distance in the DOM tree and area overlap between the two elements. Still, as a first step, we decided to stick to a metric that would be easy to explain to the stakeholders for our proof of concept.</p><h3>Results and numbers</h3><p>We divided our two 1000-page datasets for “menu” and “add to cart” button into training and test sets with a ratio of 70/30.</p><p>We mainly tested logistic regression and random forests, and the best-performing model was the random forest classifier. This is no surprise since decision trees are more susceptible to capture the nonlinear relationships present in the DOM tree.</p><p>The overall performance of the random forest classifier on the test set is given in figure 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*lLCJeIcaF0NpeM7FGxTlCw.png" /><figcaption>Figure 4. Performance of the algorithm on two types of zone of interest.</figcaption></figure><p>This performance is both encouraging and disappointing. Encouraging, because out of the thousands of HTML elements of a webpage, the precise good one is found 3 out of 5 times. Disappointing, because a customer of our solution will expect better performance.</p><p>So we decided to measure the severity of the error using the distance in the DOM tree. The results are shown in figure 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*nFYzv4tTMA2Ft90F_rYLDQ.png" /><figcaption>Figure 5. Severity of the error made by the algorithm when detecting zones of interest. Distance is the distance in the DOM tree, measured in number of branches.</figcaption></figure><p>The model detects 4 menus out of 5 with a distance less or equal to one in the DOM tree, and 3 “add to cart” buttons out of 4.</p><p>The predictions are somehow completely off on some pages, according to this DOM tree distance (the 5+ row). Again, to ease our minds, we visually checked some of the results.</p><p>In the two examples below (figures 6 &amp; 7), the blue zone is the menu tagged by a human operator, and the red one is predicted by the model. One can see that the results are visually satisfying, which is what we aim for in the end. As a side note, the choices made by the algorithm are as justifiable as those made by the human operator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qjHCIYvlFg5Re9AQ." /><figcaption>Figure 6. Example of detection of the menu. The zone in blue was manually selected by an operator. The zone in red was found by the algorithm.</figcaption></figure><p>Of course, the predictions of the model were completely invalid on some pages. More often than not, it is not clear an actual menu exists on those pages, but the human operator made a (dubious) choice nonetheless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C7fCnv4B6vwPkFkp." /><figcaption>Figure 7. Example of detection of the “add to cart” button. The zone in blue was manually selected by an operator. The zone in red was found by the algorithm.</figcaption></figure><p>It is also interesting to review the importance of the features used by the algorithms. Those three broad categories of features were highly ranked by our best random forest model for menu detection:</p><ul><li>Dimension and position of the HTML element</li><li>Words “menu”, “nav”, “navbar”, etc in the id or class names of the HTML element</li><li>Depth and number of descendants of the HTML element in the DOM tree</li></ul><h3>Discussion</h3><p>The results described above make it impossible to leave the whole task of segmenting webpages to the machine. We would need a much higher accuracy for that. Yet, the algorithm can be leveraged to provide the user with suggestions of zones to be created. This kind of assistant can save a lot of time for novice users.</p><p>There are many areas of improvement to be explored in the future. Gathering the data is expensive, yet we are confident that more pages in our datasets will result in increased performance; the model that will serve our customers will be trained over a bigger and cleaner dataset. Indeed, the tagging of the zones of interest by the human operator is key, and we have seen that different people produce different quality levels. We would surely benefit from cross-checking.</p><p>Also, we have opted for a solution wherein a model is created for every type of zone. Creating proper datasets will require some investment: it is unclear how to gather other categories of pages, for instance list pages or cart pages; besides, once this is done, the human operators will be required to tag all those pages.</p><p>There is also much to be done regarding the model. First, producing a probability for every HTML element and selecting the most probable element to be the zone of interest can certainly be regarded as naive. A more elaborate model would leverage the tree structure of the DOM to yield better performance.</p><p>Also, some natural special cases are not handled. What if there is no menu? It is better to detect no menu than a bad menu. Besides, several instances of a same zone of interest may exist in a page (product cards in a list page for instance) and the algorithm should support it.</p><p>Eventually, much work could be done on the machine learning part itself. There are many features we have not tried, and we have only used simple models. Indeed, the objective was to provide a proof of concept for a machine-learning-based detector and labeller of zones of interest!</p><p>If you have read this far, I hope you have enjoyed yourself as much as we have, working on this proof of concept. On our side, we are eager to go to the next level and push this into production. If you feel like learning more or want to help us build products to increase user experience on all kinds of websites, do not hesitate to reach out!</p><p>PS: <a href="http://www.welcometothejungle.co/companies/contentsquare/jobs">we are hiring!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68fb2efab822" width="1" height="1" alt=""><hr><p><a href="https://medium.com/contentsquare-engineering-blog/automatic-zone-recognition-in-webpages-68fb2efab822">Understanding the layout of webpages using automatic zone recognition</a> was originally published in <a href="https://medium.com/contentsquare-engineering-blog">Contentsquare Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>