<?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[Weborama - Medium]]></title>
        <description><![CDATA[Weborama’s 4 business solutions connect for the 1st time advanced consumer knowledge with ready-to-be-activated segments at scale - Medium]]></description>
        <link>https://medium.com/weborama?source=rss----1eed1a1cdf24---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Weborama - Medium</title>
            <link>https://medium.com/weborama?source=rss----1eed1a1cdf24---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:32:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/weborama" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Vector Database: Benchmark indexing parameters]]></title>
            <link>https://medium.com/weborama/vector-database-benchmark-indexing-parameters-7e0932387034?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/7e0932387034</guid>
            <category><![CDATA[milvus]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[indexing]]></category>
            <dc:creator><![CDATA[Grégoire Guémas]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 13:30:21 GMT</pubDate>
            <atom:updated>2025-01-23T13:30:21.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hm9S6kQWL4-DU2d9mJxAuA.png" /></figure><p>Managing hundreds of millions of vectors in a scalable and efficient way is a persistent challenge in modern data systems. For our use case — ranking URLs from a large-scale dataset — <strong>Milvus</strong> emerged as a natural choice. This state-of-the-art vector database is designed to perform fast and accurate approximate nearest neighbor (ANN) searches, even with datasets containing hundreds of millions of high-dimensional vectors.</p><p>The challenge we faced was identifying the optimal parameters for Milvus’s <strong>IVF-PQ indexing</strong>, balancing indexing time, query latency, and recall to ensure relevant results while maintaining resource efficiency. This article details our experiment to uncover the best parameter configuration for our needs.</p><p>At Weborama, we have several use cases where we need to rank hundreds of millions of vectors for a specific query multiple times per second. Since it’s nearly impossible to compute the cosine similarity across the entire dataset in a reasonable amount of time, we transitioned to a vector database. You can read more about this transition in<a href="https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5"> our Medium article</a>.</p><p><strong>Understanding IVF-PQ Indexing</strong></p><p>Although this article focuses on parameter optimization, here’s a brief overview of IVF-PQ indexing for context:</p><p>The <strong>IVF-PQ</strong> indexing mechanism in Milvus combines two powerful techniques:</p><ol><li><strong>Inverted File (IVF)</strong>: Divides the vector space into clusters and assigns vectors to the nearest cluster centroid, reducing the search space during queries.</li><li><strong>Product Quantization (PQ)</strong>: Compresses vectors into compact codes, significantly reducing memory usage and increasing search speed.</li></ol><p><strong>Key Parameters Influencing IVF-PQ Performance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*MnOe_0m2u_CLoavW1Xkv4Q.png" /></figure><p><strong>PQ Compression</strong></p><p>Product Quantization compresses vectors by dividing them into <strong>m</strong> subvectors and encoding each subvector using a codebook. Each subvector has a size of dim / m, effectively playing a dimension reduction role.</p><p><strong>Experiment Setup</strong></p><h4>Environment</h4><p>We conducted our experiments using a dedicated <strong>n2-standard-16 VM</strong> from Google Cloud Platform (GCP), equipped with 16 CPUs and 64 GiB of RAM. Python 3.11 was used to run the benchmarks.</p><h4>Dataset</h4><p>We utilized <strong>7 million real vectors</strong> extracted from the Weborama Crawler dataset, each vector having <strong>1024 dimensions</strong>. These embeddings provide a realistic dataset for benchmarking, ensuring consistency with real-world use cases.</p><p><strong>Why 7 Million Vectors?</strong></p><blockquote>Although our ultimate goal involves working with hundreds of millions of vectors, we started with a smaller subset of real-world data. This allowed us to design and validate our benchmarks without overloading resources. Once the configurations were tested and optimized, we scaled up the benchmarks to much larger datasets.</blockquote><p><strong>Database and Disk Preparation</strong></p><ol><li><strong>Database Population</strong>: We populated the <strong>Milvus database</strong> with the 7 million vectors.</li><li><strong>Memory-Mapped File</strong>: We created a <strong>numpy memory-mapped (mmap) file</strong> to store the vectors on disk for further computations.</li><li><strong>URL Index</strong>: Using Python’s pickle module, we saved a parallel index mapping each vector to its corresponding URL.</li></ol><blockquote>About <a href="https://numpy.org/doc/2.1/reference/generated/numpy.memmap.html">numpy.mmap</a></blockquote><blockquote>Handling 7 million vectors of 1024 dimensions would require storing: 7 millions vectors 1024 dimensions 32 bits = ~29Gi.</blockquote><blockquote>Since each vector is accessed only once per benchmark, keeping all vectors in memory is inefficient. Instead, we utilized <strong>numpy’s mmap</strong>, which maps the numpy array to a file on disk. This allows the matrix to be accessed as if it were in memory while only loading the necessary portions on demand.</blockquote><blockquote>Using numpy.mmap proved especially beneficial in a <strong>parallelized environment</strong>, where each object in memory is duplicated for each thread. By avoiding in-memory duplication, we significantly reduced resource consumption.</blockquote><p><strong>Parameter Testing (Indexing)</strong></p><p>We tested combinations of the following parameters:</p><ul><li><strong>n_list:</strong> Ranging from 125 to 5000.</li><li><strong>m:</strong> Starting from 16 to 256</li><li><strong>nbits:</strong> Keep default value to 8 bits.</li></ul><p><strong>Average Vector Distribution:</strong></p><p>With 7 million vectors in our database, the data is divided into <strong>nlist</strong> clusters. This means:</p><ul><li>For <strong>nlist = 125</strong>, each cluster contains approximately <strong>56,000 vectors</strong> (7,000,000 ÷ 125).</li><li>For <strong>nlist = 5,000</strong>, each cluster contains approximately <strong>1,400 vectors</strong> (7,000,000 ÷ 5,000).</li></ul><p><strong>Impact of m</strong>:<br>The parameter <strong>m</strong> divides each vector into subvectors for product quantization:</p><ul><li>For <strong>m = 16</strong>, each subvector consists of <strong>1024 ÷ 16 = 64 coefficients</strong>.</li><li>For <strong>m = 256</strong>, each subvector consists of <strong>1024 ÷ 256 = 4 coefficients</strong>.<br>As <strong>m</strong> increases, the size of each subvector decreases, allowing for finer granularity but requiring more memory for encoding.</li><li>Increasing <strong>m</strong> improves recall by providing finer granularity in vector encoding but comes at the cost of increased memory usage.</li></ul><p>With <strong>nbits = 8</strong>, each subvector is encoded using a codebook of 256 entries (2⁸). The size of each cluster impacts how many vectors are represented by a single centroid index in the codebook:</p><ul><li>For <strong>nlist = 125</strong>, each cluster has 56,000 vectors, and each codebook entry represents ~218 vectors (56,000 ÷ 256).</li><li>For <strong>nlist = 5,000</strong>, each cluster has 1,400 vectors, and each codebook entry represents ~5 vectors (1,400 ÷ 256).</li></ul><blockquote>Setting <strong>nbits</strong> higher than 8 (e.g., 16, which allows for 2¹⁶ = 65,536 centroids) does not make sense for our use case because the number of centroids would far exceed the average number of vectors per cluster.</blockquote><blockquote>In contrast, using 8 bits (2⁸ = 256 centroids) strikes a balance by providing sufficient resolution to distinguish between vectors within a cluster while avoiding the inefficiencies of excessive granularity. This ensures both computational efficiency and effective search performance.</blockquote><p><strong>Parameter Testing (Searching)</strong></p><p>For each configuration, we performed searches across a range of <strong>top_k</strong> values: 100, 500, 1,000, 5,000, 10,000, 50,000, 100,000, 500,000, and 1,000,000.</p><p>To evaluate query granularity in relation to <strong>nlist</strong>, we varied the <strong>nprobe </strong>parameter (how many clusters we want to use in a query) using percentages: 1%, 3%, 5%, 10%, and 20% of <strong>nlist</strong>. Using a relative percentage rather than an absolute value (e.g., <strong>nprobe = 10</strong>) ensures consistency across benchmarks, as the impact of <strong>nprobe</strong> depends heavily on the value of <strong>nlist</strong>. For instance, <strong>nprobe = 10</strong> behaves very differently when <strong>nlist = 125</strong> compared to <strong>nlist = 5000</strong>. By adopting a percentage-based approach, we ensured fair comparisons and a scalable evaluation across all configurations.</p><h3>Ground-Truth Comparison</h3><p>To calculate recall, we computed cosine similarity between the query vector and all database vectors. This was achieved using <a href="https://numba.pydata.org/">numba</a> for parallel computation:</p><pre>@numba.jit(nopython=True, parallel=True)<br>def fast_cosine_matrix(u, M):<br>   scores = np.zeros(M.shape[0])<br>   for i in numba.prange(M.shape[0]):<br>       v = M[i]<br>       m = u.shape[0]<br>       udotv = 0<br>       u_norm = 0<br>       v_norm = 0<br>       for j in range(m):<br>           if (np.isnan(u[j])) or (np.isnan(v[j])):<br>               continue<br>           udotv += u[j] * v[j]<br>           u_norm += u[j] * u[j]<br>           v_norm += v[j] * v[j]<br><br><br>       u_norm = np.sqrt(u_norm)<br>       v_norm = np.sqrt(v_norm)<br><br><br>       if (u_norm == 0) or (v_norm == 0):<br>           ratio = 1.0<br>       else:<br>           ratio = udotv / (u_norm * v_norm)<br>       scores[i] = ratio<br>   return scores</pre><p>Using numba like this allows:</p><ul><li><strong>parallel=True</strong>: Parallel computation (i.e spawn many slaves processes to work on each line of the matrix).</li><li><strong>nopython=True</strong>: where Python objects and the Global Interpreter Lock (GIL) are bypassed. This reduces overhead and allows the code to run almost as fast as pure C code.</li></ul><p>As the matrix is considerably large, and since we are only interested in retrieving the top 1 million most similar vectors, we process it in batches. For each batch, a subset of vectors is loaded from the disk into memory and passed to the fast_cosine_matrix function. The function computes similarities and returns an array of shape (1,BATCH_SIZE), which contains the similarity scores. Each score, along with its corresponding vector index, is pushed into a <strong>priority queue</strong>. To maintain only the top <em>K</em> results, any insertion that causes the queue size to exceed <em>K</em> results trigger the removal of the lowest similarity score.</p><h3>Computing Recall at K</h3><p>Recall was measured by comparing Milvus results against the ground-truth top K results, ensuring that Milvus retrieved a significant proportion of the most relevant vectors. This step validated the efficiency and accuracy of each configuration.</p><p><strong>Results</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EV7xh1NoOU0HAPXd" /><figcaption>Ratio common URLs between Milvus topk and Ground truth topk</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*4xNjKb7Ra9DbBL6c" /></figure><blockquote>As top k is increasing, some statistical events degrade the quality of the recall</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*H9usKpzM7ojNNC2X" /></figure><ul><li>Increasing the <strong>m</strong> parameter significantly boosts recall, but it comes at the cost of higher memory usage, which doubles with each increment of <strong>m, </strong>as theoretically expected.</li><li>Raising the <strong>nlist</strong> value slightly reduces recall but greatly decreases search time up to a certain threshold. Beyond this point, further increasing <strong>nlist</strong> becomes inefficient and yields diminishing returns.</li></ul><h3>Conclusion</h3><p>At Weborama, we have developed an automated benchmarking system to identify the optimal parameters for our use case, balancing recall and cost effectively. As demonstrated in this article, this system allows us to fine-tune configurations dynamically and perform regular evaluations to ensure our parameters continue to deliver high-quality results.</p><h3>Next Steps</h3><p>We plan to extend our testing to datasets containing 100 million and 1 billion vectors to analyze how parameter configurations need to adapt as dataset size scales up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e0932387034" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/vector-database-benchmark-indexing-parameters-7e0932387034">Vector Database: Benchmark indexing parameters</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LR is all you need]]></title>
            <link>https://medium.com/weborama/lr-is-all-you-need-20963d683e88?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/20963d683e88</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[embedding-model]]></category>
            <dc:creator><![CDATA[Nicolas Tastevin]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 08:40:05 GMT</pubDate>
            <atom:updated>2025-01-09T08:40:04.930Z</atom:updated>
            <content:encoded><![CDATA[<p>Naturally, <strong>LR (</strong>Logistic Regression) isn’t the only machine learning model to have in hands. The title here is deliberately “provocative” for two reasons:</p><ol><li>It pays homage to the seminal paper <em>“</em><a href="https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf"><em>Attention Is All You Need</em></a><em>”</em> which sparked a major leap forward in natural language understanding, and thus boosted Weborama semantic AI suite.</li><li>It serves as a tongue-in-cheek challenge to the typical AI mindset that automatically opts for the most sophisticated model.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFCJCeSXindkbBMSk_EJqQ.png" /><figcaption>LR is all you need — AI generated</figcaption></figure><h3><strong>Aligning Tools with Tasks</strong></h3><p>We want to stress that tackling a small-scale data science challenge and deploying a large-scale solution are two different tasks , though being able to do both is certainly valuable. The primary differences stem not only from MLOps architectural choices but also from fundamental data science considerations. In this short article, we’ll showcase a scenario where Logistic Regression is, in fact, the right ML model for the job.</p><p>AI is becoming more accessible to everyone, from the general public (as shown by the rapid adoption of ChatGPT), to those with minimal tech skills (building an internal chatbot from documentation is now relatively straightforward), to engineers, and to professionals in a wide range of fields. However, what we’re really witnessing is the adoption of Large Language Models (LLMs), rather than the complete AI ecosystem.</p><p>It’s true that LLMs can solve many problems quickly without requiring a deep understanding of the technology behind them. But there are still situations where opting for a simpler, more “modest” solution, needing some depth understanding in AI, is the better choice, at least for now.</p><p>We can revisit the metaphor from the<a href="https://huggingface.co/blog/modernbert"> ModernBert release blog post</a> to illustrate that every scenario calls for its own distinct AI solution.</p><blockquote>“Basically, a frontier model like OpenAI’s O1 is like a Ferrari SF-23. It’s an obvious triumph of engineering, designed to win races, and that’s why we talk about it. But it takes a special pit crew just to change the tires and you can’t buy one for yourself. In contrast, a BERT model is like a Honda Civic. It’s <em>also</em> an engineering triumph, but more subtly, since <em>it</em> is engineered to be affordable, fuel-efficient, reliable, and extremely useful. And that’s why they’re absolutely everywhere.”</blockquote><p>In continuation of our recent previous Medium articles:</p><ul><li><a href="https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a">Boosting Semantic Categorization with recent AI paradigm</a></li><li><a href="https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5">Document Similarities: A Continuous Loop Between POCs and Production</a></li></ul><p>which offer a glimpse into our work on scaling semantic categorization with Transformers, we briefly note that we chose a Logistic Regression (vs LightGBM for example) model to refine the rankings originally provided by a cosine similarity score. While this might seem surprising at first, once you consider the entire system, the choice makes perfect sense, this is our “Honda Civic.”</p><h3><strong>Synergy in Action: Blending Vector Databases and Linear Models</strong></h3><p>As a quick recap, our previous work focused on finding and rank <strong>a large set of URLs</strong> most relevant to a given topic. Essentially, we transform an input text into a vector using a Transformer model, then use a big vector database, relying on cosine similarity, to identify URLs that align with this input text. This method leverages cutting-edge AI to target URLs based on natural language cues in an ad marketing ecosystem. This scenario differs from typical RAG (Retrieval-Augmented Generation) chatbot use cases, which only extract a small number of documents to enrich a prompt, and from standard recommender systems which generally return a small set of items to the user.</p><p>In that work, we showed that combining an LLM to label “good” URLs with an additional ML model for URL scoring significantly boosts precision. At Weborama, we operate in a Big Data environment (handling billions of URLs) with strict response-time requirements. To achieve quick, large-scale results (as outlined in our previous article), we use a vector database. Our aim was to build on that existing system while adding an ML model on top.</p><p>However, using a more complex, non-linear model than LR like LightGBM isn’t feasible here. Doing so would mean abandoning our vector database and spinning up a massive GPU cluster to score up to a billion URLs per query in parallel, clearly not practical. While we do have a cluster for creating embedding vectors for URLs, it’s not equipped to handle real-time scoring during user interactions. This distinction is, in a way, comparable to the difference between employing a bi-encoder and a cross-encoder architecture. With a cross-encoder, each incoming query must be evaluated against the entire database by passing it through the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*_jsY6VzPDNbE5tQU" /><figcaption>Bi-Encoder VS Cross-encoder (credits: <a href="https://www.sbert.net/examples/applications/cross-encoder/README.html">https://www.sbert.net/examples/applications/cross-encoder/README.html</a>)</figcaption></figure><p>For us, it felt like the same challenge: how do we avoid applying the <strong>predict</strong> function of the query-specific ML model over the entire database every time a user tweaks their query?</p><p>The key insight is that we can still take advantage of our vector database by using a linear model. While this doesn’t completely eliminate running the model on the entire database whenever a user refines their query, it avoids using the predict function in a naive way as we would do with a ML library such as <a href="https://scikit-learn.org/stable/">scikit-learn</a>. In fact, if we understand how ML models work behind the scenes, we don’t need to stuck to calling the <strong>predict</strong> method of the Logistic Regression at all. Instead, we can simply extract the model’s learned coefficients and use them as an input vector for our vector database. And thus, we can retrieve our desired set of URLs just as quickly as performing a normal query on the vector database.</p><p>This highlights just how important it is for a team working on Data Science projects to own a solid grasp of theoretical concepts. Here, we illustrate this point with a simple example using Logistic Regression, but the same logic also applies to Transformer models. For instance, it’s important to understand how to interpret the raw cosine similarity score in models trained with a contrastive loss (see our <a href="https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a">previous article</a> for more details).</p><p><strong>Why Marrying Vector Databases with Linear Models Just Works?</strong></p><p>Let A and B be two vectors in R^{n}.</p><p>When both vectors are normalized so their L2 norms equal 1, <strong>their cosine similarity is effectively the same as their inner product</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*35bQlOrXCucnic4C" /></figure><p>As a consequence, in a vector database setting, if your vectors are normalized with L2 norm, there’s no difference between using cosine similarity or the inner product. In our case, we store normalized vectors, so to compute the cosine score, we simply use the <strong>inner product</strong> metric.</p><p>A <strong>Logistic Regression</strong> model is used for binary classification, where the decision boundary between two classes is determined by the weighted sum of the input features:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*TmEhFag_EXej4LOaPyGzkw.png" /></figure><p>where:</p><ul><li><strong>x</strong> is the feature vector (e.g: the embedding vector of an URL).</li><li><strong>w</strong> are the learned weights of the model (<strong>also a vector</strong>). The LR model tries to learn the optimal <strong>w </strong>vector (weights), thus the better linear combination of the input features (input features are in our use case the coefficients of the embedding vector of URLs).</li><li><strong>b</strong> is the bias term (as in a affine transformation).</li><li><strong>σ</strong> is the <strong>sigmoid function.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/152/0*2ri3UvpG9ynx87uV" /></figure><p>When we have trained a Logistic Regression model, the learned weights vector <strong>w</strong> represents the model’s understanding of the importance of each feature in distinguishing between classes (URL is positive or negative). We can use this weight vector <strong>w</strong> to compute the inner product with the vectors of all the URLs in our database.</p><p><em>fun fact 1</em>: thus if we have a vector Database where the <strong>metric type is Inner Product,</strong> we can <strong>directly perform a vector database query with the weight vector</strong> <strong>W </strong>to rank URLs. However, the score at this point will not be a probability.</p><p><em>fun fact 2</em>: to convert the inner product into a probability score, just add the learned bias term <strong>b</strong> and apply the sigmoid function. Of course, the probability score can be skewed if the training data contains an uneven proportion of positive and negative labels. In most cases, sticking to “fun fact 1” alone is sufficient.</p><p>Hence, to rank the URLs in our database according to a user query, we train a Logistic Regression model and extract its coefficients as the query vector. This demonstrates how to layer an ML model on top of a vector database to refine a straightforward cosine similarity score.</p><p>An alternative perspective is to see Logistic Regression as a more sophisticated way of deriving a query vector from positive URL examples, compared to the simpler non-ML approach of averaging those vectors (centroid). The main difference is that Logistic Regression also incorporates negative URLs to refine the query vector through an optimization process, whereas the naive centroid method relies only on positive samples and a simple average.</p><h3>Conclusion</h3><p>At Weborama, when we set out to enhance our semantic AI suite using the latest language model advances, we approached the project with an industrial mindset, ensuring it could scale to the massive datasets we handle. Achieving this required more than just hands-on practice, it demanded a solid theoretical understanding of vector databases and machine learning models behind the scenes. This blog post highlights the importance of choosing the right tool for the right job and of having a comprehensive grasp of the AI ecosystem to build actionable solutions for specific use cases.</p><p>Feel free to explore all our Medium posts that delve into this use case:</p><ul><li><a href="https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a">Boosting Semantic Categorization with recent AI paradigm</a></li><li><a href="https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5">Document Similarities: A Continuous Loop Between POCs and Production</a></li></ul><p>Finally, I’d like to thanks the entire Data Science team for their contributions throughout this project. Their collective expertise made it possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20963d683e88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/lr-is-all-you-need-20963d683e88">LR is all you need</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Document Similarities: A Continuous Loop Between POCs and Production]]></title>
            <link>https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/db3acdc019a5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[faiss]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Thang Dinh]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 09:37:07 GMT</pubDate>
            <atom:updated>2025-01-07T09:37:07.506Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we would like to share an overview of our system from two perspectives: POC (Proof Of Concept) and Production. Our aim is to identify a large number of relevant documents using vector similarities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*av9YD_2s8V-ws9sHoJF2Ng.jpeg" /><figcaption>Exploring document similarity in a digital matrix (generated with DALL-E).</figcaption></figure><h3>Problem and context</h3><p>We handle a variety of data types, including text, audio, and images, which come from multiple sources like URLs, videos, or customer data. For simplicity, we’ll focus on text-based documents. Our challenge can be described as follows:</p><ul><li><strong>Inputs</strong>: a document or a set of documents,</li><li><strong>Output</strong>: Quickly identify the top_k documents that are similar to the input document(s), even when dealing with up to billions of documents.</li></ul><p>Meeting the near-real-time response requirement while managing large volumes is both crucial and challenging for our system.</p><p>At first glance, our task might seem like a recommendation problem. However, recommendation systems typically aim to find a small set of items or documents similar to the target, rather than handling large volumes. For common recommendation scenarios, like music, a user is satisfied if a few of the top 10 songs are relevant, allowing them to continue listening. But at Weborama, all recommended elements must be positive since we’re dealing with an activation use case (boosting the overall performance of a marketing campaign vs. picking the next song). Maximizing the number of high-quality recommended elements is more critical for us.</p><p>Our problem also relates to re-ranking, where the goal is to provide better results — a topic we’re exploring in our roadmap. In this article, though, we’re focusing on similarity.</p><p>The key question is: <strong><em>from our data, how do we define the similarity to choose the top_k?</em></strong> In other words, <strong><em>how can we score documents to compare them effectively?</em></strong></p><p>In this piece, we’re detailing our method based on vector similarities. For additional context on our work with vector embeddings, check out our earlier article “<a href="https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a">Boosting Semantic Categorization with recent AI paradigm</a>”.</p><h3>Vectors and embeddings</h3><p>Unstructured data contains rich semantics, making it tough to analyze. With the rise of Machine Learning (ML) and Deep Learning (DL), embeddings were developed to transform unstructured data into numerical vectors, helping us manage the complexity of these rich semantics. Embeddings are techniques for representing data as vectors to capture meaningful information, semantic relationships, or contextual characteristics.</p><p>While embeddings emphasize the meaningfulness and structure of data representation, a vector refers to the numerical form itself. In the context of vector embeddings, “embeddings” and “vectors” can be used interchangeably, referring to the numerical representations of data where each point is represented by a vector in a high-dimensional space. These representations enable machines to understand and process data more effectively.</p><p>For text data, we have specific types of embeddings: <strong><em>word embeddings</em></strong> for words, <strong><em>sentence embeddings</em></strong> for sentences, and <strong><em>document embeddings</em></strong> for documents, turning them into vectors.</p><p>Vector embeddings can be applied in various areas, boosting efficiency and accuracy in numerous applications. Common use cases include finding similar documents, recommender systems, anomaly detection, improving search relevance with semantic search, and accelerating drug discovery, among others. Brief descriptions of these use cases are available in <a href="https://milvus.io/intro">this document</a>. We’re specifically focusing on using document embeddings to search for similar content by comparing these embedded representations using distance metrics, like <a href="https://en.wikipedia.org/wiki/Cosine_similarity"><em>cosine similarity</em></a>.</p><p>In the remainder of this article, we’ll briefly introduce the architectural design of our system and explain how we handle our pre-production and production environments.</p><h3>Architecture</h3><p>This figure below illustrates a simplified architecture of our production system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*WiQNecxSknXdSus5LR4UpQ.png" /><figcaption>Simplified Architecture</figcaption></figure><p><strong>Incoming data: </strong>In real-time, our message queue (RabbitMQ), contains documents along with their content. Behind the scenes, we use <a href="https://hbase.apache.org/">HBase</a> to store a large number of document contents.</p><p><strong>Document embedding service (DocEmbService)</strong>:</p><ul><li><strong><em>Read from the message queue</em></strong> to identify which document needs embedding. Document fetching, parsing, preprocessing, and synchronization steps, although critical, are not covered in this article.</li><li><strong>Document embedding<br>- </strong>We leverage a well-suited open multilingual embedding model as the foundation of our system. This model selection stems from ongoing, crucial efforts at Weborama to answer questions like “How to choose a good open embedding model for each kind of data?” and “When and how to upgrade the system with a new embedding model?”.<br>- Every document is swiftly transformed into a vector in near real-time. This service is deployed on a GPU-based cluster to enhance computation speeds, and our code is optimized to maximize GPU capacity utilization.</li></ul><p><strong>Vector database</strong>: Milvus serves as the core database supporting our similarity search.</p><p><strong><em>VectorSimilarService</em></strong> and <strong><em>VectorSimilarAPI</em></strong>: Built upon Milvus, these components can function either as a Batch Service or a <a href="https://www.techtarget.com/searchapparchitecture/definition/RESTful-API#:~:text=A%20RESTful%20API%20is%20an,deleting%20operations%20related%20to%20resources.">REST API</a>. Our batch <strong><em>VectorSimilarService</em></strong> handles large volumes of data.</p><p>During our analysis, we identified a vector database as the core technology for our service. We invite readers to explore the next section for more on this choice. For our tech stack, we use Python-based ecosystems, including Python 3.11, RabbitMQ, FastAPI, Transformers, HuggingFace, Docker, and Kubernetes.</p><h3>Vector database and Milvus</h3><p>To shed light on the concept of a vector database, I’ll summarize some key points from <a href="https://milvus.io/intro">this source</a> that explains it well.</p><p><strong>Vector database</strong></p><ul><li>Are specialized systems designed for managing and retrieving unstructured data through vector embeddings and numerical representations.</li><li>Unlike traditional relational databases that handle structured data with precise search operations, vector databases excel in semantic similarity searches using techniques such as the Approximate Nearest Neighbor (ANN) algorithm.</li></ul><p><strong>Vector Search Library</strong></p><ul><li>Vector search libraries like <a href="https://github.com/facebookresearch/faiss">Faiss</a>, <a href="https://github.com/google-research/google-research/tree/master/scann">ScaNN</a>, and <a href="https://github.com/nmslib/hnswlib">HNSW</a> offer foundational tools for building prototype systems capable of performing efficient similarity searches and dense vector clustering. These libraries, while powerful and open-source, are designed primarily for vector retrieval and offer rapid setup with capabilities like handling large vector collections and providing interfaces for evaluation and parameter tuning. However, they fall short in terms of scalability, multi-tenancy, and dynamic data modification, making them less suitable for larger, more complex datasets and growing user bases.</li></ul><p><strong>Vector search plugins for traditional databases</strong></p><ul><li>Plugins offer vector search capabilities within existing database architectures, functioning as enhancements rather than comprehensive solutions. These plugins lack a full-stack approach to embedding management and vector search, resulting in limitations and suboptimal performance for unstructured data applications.</li></ul><p>Once we established the overall architecture, our next task was to decide “Which vector database should we use in our system?”. Our criteria at Weborama were clear:</p><ul><li><strong>Open-Source</strong>: It should be an open-source solution, aligning with our global policy.</li><li><strong>Big-Volume Support</strong>: It needs to effectively manage our data volume and traffic, up to billions of vectors.</li><li><strong>Batch and Near Real-Time Response</strong>: It should accommodate both use cases.</li><li><strong>Full Maintenance</strong>: It should offer full features like scalability, multi-tenancy, dynamic data modification, and easy maintenance with fault tolerance.</li></ul><p>We conducted a survey focusing on technology and identified some potential candidates among existing solutions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vXmRRdHH8-967EEE" /><figcaption>Vector databases</figcaption></figure><p>We decided to conduct our preliminary experimental study with the following:</p><ul><li><strong>Plugins</strong>: Since our tech stack includes ElasticSearch and Couchbase, we:<br>- First tested the KNN with ElasticSearch version 7.8.0,<br>- Later tried the similarity search feature with Couchbase (mid 2023).</li><li><strong>Vector databases</strong>: We explored open-source options, including Quadrant, Vespa, Weaviate, and Milvus.</li><li><strong>Data</strong>: Our tests involved up to 100 million vectors.</li></ul><p><strong>During this stage, we were focusing on measuring 5 above criteria and having two big results:</strong></p><ul><li><strong>Understanding Vector Database Methods:<br>- </strong>We enhanced our grasp of the state-of-the-art methods used in vector databases. For large datasets, similarity searches are typically <strong><em>approximated</em></strong> using a data structure called an <strong><em>index</em></strong>. <strong><em>Indexing</em></strong> is the process of building this data structure from input vectors. More details on this will be provided in the next section.</li><li><strong>Choosing </strong><a href="https://milvus.io/"><strong>Milvus</strong></a>: Milvus largely meets our criteria for long-term development.<br>- Plugins within ElasticSearch and Couchbase revealed limitations with increasing volume and response times.<br>- Qdrant, Vespa, and Weaviate, which rely solely on HNSW (tested early 2023), struggled with large data.<br>- Our experimental benchmarks and SRE evaluations ultimately led us to choose Milvus.</li></ul><p>Our SRE team has worked to build Milvus clusters with:</p><ul><li>Separate data nodes for indexing and searching to enhance scalability.</li><li>Integration with our Kubernetes cluster.</li><li>Distinct pre-production and production clusters.</li></ul><p>Document vectors are progressively computed, inserted, and indexed into Milvus. It adapts well to scaling up and down based on our traffic input. We’ve resolved quantitative data challenges with our VectorSimilarService by:</p><ul><li>Utilizing Milvus’s <a href="https://milvus.io/docs/v2.3.x/within_range.md">range_search</a> feature to iterate from the largest distance to smaller distances until achieving the desired volume.</li></ul><p>Experimenting with the new <a href="https://milvus.io/api-reference/pymilvus/v2.4.x/ORM/Collection/search_iterator.md">search_iterator</a> feature in Milvus, which improves performance and caching compared to multiple repeated range_search operations. However, as of version 2.4.x, this feature only supports a single input vector, while we often work with multiple vectors. We await future Milvus updates to improve this aspect.</p><p>We also face qualitative data questions, such as:</p><ul><li>Since similarity is calculated approximately, how do we measure effective recall? If the recall is insufficient, how can we optimize our Milvus cluster?</li><li>When and how should we apply different indexing methods to different datasets for optimal performance?</li></ul><p>For answers to these qualitative questions, we invite readers to explore our next article (coming soon) on our experiments with Milvus.</p><h3>Methods used in Vector databases</h3><p>To delve deeper into the methods used for similarity search, we recognize that there exists many similarity search algorithms, which can be applied in diverse domains and can be classed into different categories. Some of these categories include:</p><ul><li>E<strong><em>xact algorithms</em></strong> such as Linear Search, Binary Search etc.,</li><li><strong><em>Distance-based algorithms</em></strong> such as Euclidean, Cosine etc.,</li><li><strong><em>Approximate Algorithm</em></strong> such as Product Quantization, Hierarchical Navigable Small-World (HNSW) Graphs etc,</li></ul><p>For a complete list of these algorithms, you can refer to <a href="https://crucialbits.com/blog/a-comprehensive-list-of-similarity-search-algorithms/">this document</a>.</p><p>In the realm of vector search — especially with massive datasets — libraries often rely on vector similarity scores and Approximate Nearest Neighbors (<strong><em>ANN</em></strong>) algorithms. These leverage Approximate Nearest Neighbors to trade off perfect accuracy for efficiency in high-dimensional embedding spaces at scale. The foundational structure here is an index that stores numerous database vectors, which are gradually added. At search time, a query vector is submitted, and the index returns database vectors closest to the query vector in terms of distance.</p><p>In practical applications, building an index requires prioritizing between recall, latency, and memory usage. For optimal performance, <strong><em>composite indexes</em></strong> are typically used.</p><p>A composite index can be thought of as a series of vector transformations and one or more indexing methods, akin to assembling Lego blocks. This approach allows for stacking multiple indexes and processing steps to create our ‘ideal’ index. However, customization brings a risk of creating indexes with poor recall, latency, or memory usage.</p><p>In summary, a <a href="https://www.pinecone.io/learn/series/faiss/composite-indexes/">composite index may consist</a> of:</p><ul><li><strong>Vector transform</strong>: a pre-processing step applied to vectors before indexing (PCA, OPQ).</li><li><strong>Coarse quantizer</strong>: rough organization of vectors to sub-domains for restricting search scope, including IVF, IMI, and HNSW. It refers to the clustering of vectors to enable non-exhaustive search by limiting the search scope.</li><li><strong>Fine quantizer</strong>: a finer compression of vectors into smaller domains for compressing index size. It describes the compression of vectors into codes (as with PQ). The purpose of this is to reduce the memory usage of the index.</li><li><strong>Refinement</strong>: a final step at search-time which re-orders results using distance calculations on the original flat vectors. Alternatively, another index (non-flat) index can be used.</li></ul><p>For more detailed information about potential components in a composite index, refer to the table and further reading available on this <a href="https://www.pinecone.io/learn/series/faiss/composite-indexes/">page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jIIooGf_fvDyEaiu" /></figure><p>In Milvus, when dealing with smaller datasets (fewer than 10 million vectors) we utilize the IVF-SQ8 indexing method. For exact similarity searches, we occasionally employ the IVF-FLAT approach. For handling large datasets, we rely on the IVF-PQ. However, from the <a href="https://github.com/zilliztech/attu">Attu UI</a> or with Milvus client, while indexing, we are limited to the usage of params: the number of coarse clusters (‘nlist’), the ‘m’ and ‘nbits’ for the PQ.</p><h3>Faiss, auto-faiss and ElasticSearch for POCs</h3><p>With Milvus set up in our pre-production and production environments, we have confirmed two points we discovered during our vector database selection phase:</p><ul><li><strong>Cost</strong>: Full cluster installations can be quite expensive, so we must approach our Preprod cluster setup prudently.</li><li><strong>Fixed Index Parameters</strong>: It is challenging to benchmark further, especially when comparing different indexing composites as we need multiple indexes of the same data.</li></ul><p>In the data science development cycle at Weborama, we typically investigate:</p><ul><li><strong>Embedding Models</strong>: Evaluation of new open-source embedding models for quality.</li><li><strong>Embedding Strategy</strong>: We focus on both sentence and document embeddings.</li><li><strong>Document Embedding</strong>: Various strategies for selecting text to embed.</li><li><strong>Comparison</strong>: We compare approximate methods with exact methods.</li></ul><p>For our POCs, data is often fixed to facilitate model and method comparisons, meaning real-time data updates aren’t necessary. However, managing multiple versions of the same data becomes expensive with a Milvus cluster. Thus, we decided to use Faiss and ElasticSearch for our POCs. A significant advantage of Faiss is the ability to later control index components to meet dynamic needs.</p><p><a href="https://github.com/facebookresearch/faiss"><strong>Faiss</strong></a><strong> and </strong><a href="https://github.com/criteo/autofaiss"><strong>Autofaiss</strong></a></p><p><a href="https://arxiv.org/pdf/2401.08281">The Faiss library</a>, developed by Facebook (Meta), is one of the first libraries for ANNs. Milvus later uses its<a href="https://milvus.io/docs/knowhere.md"> Knowhere</a> library, which relies on Faiss as one of its core engines. Faiss introduces also the<a href="https://github.com/facebookresearch/faiss/wiki/The-index-factory"> index_factory</a>, allowing for the construction of composite indexes in a clear, elegant manner.</p><p><a href="https://github.com/criteo/autofaiss">Autofaiss</a>, developed by Criteo, automatically creates Faiss indices with optimal similarity search parameters. It selects the best indexing parameters to achieve the highest recall, considering memory and query speed constraints. Specifically, using the<a href="https://github.com/facebookresearch/faiss/wiki/The-index-factory"> Faiss bench-marking</a> and Faiss index_factory, Auto-Faiss provides parameters to identify the best index components and parameters for each component. For instance, it determines optimal batch size, quantization, and minimum values for best neighbors coverage. Details are available in the<a href="https://github.com/criteo/autofaiss/blob/master/autofaiss/external/optimize.py"> autofaiss optimize code</a>. At the end of training index with autofaiss, we obtain metadata information such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/0*g_OqNiSkxBcVUDJ0" /></figure><p>Given arbitrary documents as input, we subsequently measure recall in a separate process. It’s important to note that Faiss indexes contain only vectors and their corresponding IDs; they do not integrate or manage document metadata like URLs, titles, descriptions, or content. To achieve this mapping alongside Faiss indexes, we use ElasticSearch.</p><p><a href="https://www.elastic.co/elasticsearch"><strong>Elasticsearch</strong></a></p><p>ElasticSearch is an open-source, distributed, RESTful search and analytics engine. At Weborama, it supports various production services, ranging from log and infrastructure monitoring to our search-based applications. When working with Faiss indexes, which only allow retrieval of vector IDs, ElasticSearch becomes essential for storing associated document information. Specifically, it facilitates:</p><ul><li><strong>Document ID Mapping</strong>: We utilize the same IDs in both ElasticSearch and Faiss indexes to map document content to vectors.</li><li><strong>Document Content Retrieval</strong>: This can be directly observed via ElasticSearch requests.</li></ul><p><strong>Handling Large Corpora</strong>: Faiss indexes can return a large number of IDs, but ElasticSearch queries are limited to returning no more than 10,000 rows at once. To manage this, we developed wrappers that progressively retrieve document contents, querying up to 10,000 documents at a time, until the expected volume is achieved.</p><h3>Conclusions</h3><ul><li>In the nature of our data science work with numerous proof-of-concept projects where only the best results move to production, it’s crucial to have tailored environments and solutions:<br>- <strong>Flexibility in POC Phase</strong>: Utilizing the Faiss library and ElasticSearch gives us flexibility during the POC phase, allowing a comprehensive understanding of index components. This approach is also more cost-effective. Filtering data with ElasticSearch is simpler, more visible, and practical compared to using the <a href="https://github.com/zilliztech/attu">Attu UI</a> with Milvus.<br>- <strong>Milvus in Production</strong>: Milvus proves to be an excellent vector database for our production needs. We have gained experience in managing and scaling the production cluster effectively.</li><li>Our production environment is robust and well-scaled, while the POC process has become more streamlined and efficient:<br>- <strong>Experimentation and validation: </strong>We’ve worked on document embedding across multiple markets and languages (8 languages and about 20 countries) using various embedding models.<br>- <strong>Sentence-based studies</strong>: We have handled databases with up to 115 million vectors.<br>- <strong>Document-based studies</strong>: We have explored different strategies for selecting text to embed.</li></ul><p>This article offers an overview of our approach to tackling the challenge of finding similarities in large volumes. Our system continues to evolve and improve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db3acdc019a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5">Document Similarities: A Continuous Loop Between POCs and Production</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boosting Semantic Categorization with recent AI paradigm]]></title>
            <link>https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/9357324da74a</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[dense-vector]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Charlotte Faure]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 13:50:05 GMT</pubDate>
            <atom:updated>2025-01-17T14:31:27.147Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unlocking New Potential for Weborama</h4><h4><strong>What are we doing?</strong></h4><p>At Weborama, a cornerstone of the business is classifying semantically URLs into one or several “categories” to better reach the range of customers a specific advertiser needs to target for each of its individual campaigns.<br>In other words, we need to understand what an internet user is interested in, what the pages he or she browses are <em>about</em>.<br>A client might need to differentiate between very specialized themes in which case Weborama will work on ad hoc categorization, but the company currently provides a comprehensive set of subjects that we call “Generic Taxonomy”. It comprises a certain amount of themes, that you’ll find here under the name “segments” that may be very wide such as “Sports” or very specific like “Gluten free” and is published in 8 languages.</p><p>Weborama’s legacy method of analyzing content is based on lemmatization, which is a NLP process that aims at leading back any inflected word (conjugated or declensed, feminine and plural forms, <em>etc</em>.) to one unique form in order to represent the meaning only (not the grammatical function in the specific sentence) and better account for the number of times the semantic idea behind the “word” is evoked in a text. The lemmas are then computed into n-grams to better grasp complex semantic concepts (such as car insurance vs home insurance) or proper nouns (like Massachusetts Institute of Technology or The Beatles). The longer an n-gram is, the better the semantic disambiguation is: it is more precise to recognize MIT than it is to know the text is about both Massachusetts and Technologies).</p><p>Our current Generic Taxonomy is therefore based on choosing a certain amount of lemmas that best represent the targeted subject in order to classify webpages (more on this in a previous article).<br>This set of segments has been curated by our NLP and product teams over time, determining with clients and French &amp; international business units the most recurrent needs. It is constantly maintained, updated, enhanced and pruned to fit Weborama’s and its client’s uses.</p><p>In the advertisement industry, since 1998, the Interactive Advertising Bureau (known as IAB) has been developing frameworks and tools, putting norms into place in the publicity business. One of those norms/tools are three taxonomies that define, as our “generic taxonomy” does, several categories in which texts, pages, or anything can be classified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yOiGOdwld7I1Wsy6.png" /></figure><p>As this bureau gained in popularity and reliability, this segmentation has also gained in credibility and this is why, at Weborama, we started looking into integrating their taxonomy in our resources to be able to match this work and offer to our clients a “basic” classification that matches international standards.</p><p>The taxonomy we chose to work with is the “Content Taxonomy” (in its 3.0 version as of this moment).<br>The issue was the following: while our own classification has been gradually built over time, the automation process was quite limited to one language at a time, a few segments at a time, <em>etc</em>. The IAB’s product, on the other hand already comprises more than 700 segments organized into a hierarchy (Sports &gt; Extreme Sports &gt; Scuba Diving) which makes it difficult to humanly create content to match every segment quickly, especially given that some of the categories are extremely specific (<em>e.g.</em> “College Football” which doesn’t exist at all in France) or might require some field expertise (for instance each type of music genre).</p><p>After having considered an automated process to populate the segments with lemmas in order to reduce the manual annotation, we were reserved on the quality of such produced lemmas and decided that for this aspect of the pipeline, we’d rather keep a high quality (human interpretation) of lemmas, given than the whole classification process is easy to analyze by humans if our partners (internal teams or clients) are dissatisfied with some of the classification or if we want to change/refine it.</p><p>This is the reason why the DataScience team started poking around to see what could be done to integrate a lot of segments with minimal manual work but using a totally different approach: classifying URLs entirely without using lemmas.</p><blockquote>Since using vector embeddings, similarity measures and possibly some machine learning is, in itself, harder to dissect 🔒, we didn’t want to outright try and replace our current process (that we want to keep as efficient <strong>and</strong> transparent as possible 🔓). This is why experimenting with this new probabilistic strategy matched perfectly a new use case of integrating a whole new taxonomy. We still kept in mind that if this yielded good results, we might be able to use it to boost or update our legacy lemmas method.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bWdWKTuW5YUUx6Jx" /><figcaption>Categorizing Web contents — AI generated</figcaption></figure><h4><strong>Sentence Transformers and Vector Embedding</strong></h4><p>These past few years, Weborama’s stack has been enriched with new technologies (as have the overall tech trends), integrating more and more machine learning and AI tools, specifically the use of dense vector embedding to represent text and enhance the semantic aspect of our analysis.</p><p>So our first idea was to vectorize both a “segment” and a URL in order to be able to calculate a semantic similarity between a given text (URL) and several segments, finding the one or those to which the content is closest.<br>Because during other exploratory projects, some work had already been done on strategies to embed URLs (we will not go into detail but there is a challenge regarding text length and text selection, versus a lemmas matching approach), the team decided that we would use the same approach in the study.</p><p>We then needed to choose what to use to represent the segments themselves.<br>Still during previous work attempting another approach for populating the segments — that was closer to how the pipeline currently works — we needed to translate the IAB segment titles for our multilingual environment. One issue we encountered at that point was that the title is the only thing that the IAB provides, making it sometimes difficult to be sure what the category is supposed to be about. Because no one at Weborama speaks all 8 languages, we turned to a Large Language Model (Generative AI) to generate translations for the segment titles. This step has shown us that the segment titles are not long or descriptive enough to be used on their own, especially given that we work in this multilingual framework.<br>The translated titles were sometimes wrong or didn’t sound idiomatic in the target language. This could stem from the aforementioned specificity of the themes, using field-centric vocabulary or more simply from the ambiguity of a term in English, the target language or both.</p><blockquote>For example, the hyper-category “Genres” in English was correctly translated into “Genres” in French, which is also the noun given to literary/movies categories. But the term in French also refers to the gender of an individual. The provided title in French, we found out, would not be enough to automate further the categorization process, producing a category about feminism, gender and transsexual literature/artwork that didn’t match the original segment’s meaning.</blockquote><p>Using the same Large Language Model (“LLM” from here on), we chose to precede the translation step by a “description” one, asking our LLM to generate a short description, or definition of each of the IAB categories, including the segment’s title in the description. We spread the 700 segments description into the team and manually reviewed those descriptions to check it matched the meaning but also the specificity level or the segment, that it included a sense of the hierarchy given by the different tiers of the IAB and that is not reflected directly into each title.</p><blockquote>For example the segment called “Comic Books” in the IAB is inscribed under the Hobbies and Interests &gt; Collecting tiers 1 and 2. Providing what we called context (upper themes) to the LLM helped us make sure that the description generated for “Comic Books” would tend toward the collection aspect of it.</blockquote><p>One challenge for the human review process was to ensure each member had an overall knowledge of the IAB, so that two segments, close in names, weren’t misinterpreted/confused for one another.<br>To illustrate this, we can again use the example of the “Comic Books” segment as in “Collecting comic books as a hobby” versus the “Comic Books and Graphic Novels” segment in the main theme “Literature”. Not knowing the “hyperonymic” context here could lead to two similar descriptions even though the focus of each should be different.<br>To overcome this, we spread segments not entirely randomly but hierarchically and created a super-review role to a team member who made a second pass.<br>Once satisfied with the descriptions, we used them with the titles to support each other in the task of translating both titles and descriptions into our target languages.<br>So when it was time to select what to embed to best represent each segment, we chose those descriptions. They all contained the segment’s title and a few sentences in natural language.</p><blockquote>We know we could have explored for a more optimal solution but this made for a good starting point. For example, we are exploring other strategies such as covering one topic with a bunch of orthogonal sentences that represent it more broadly. Moreover we have some arguments explaining why relying on a single piece of text to embed is a good property, at least for taking into account industrializing needs. But all those discussions are out of the scope of this article.</blockquote><p>The next step was to embed each segment and each URL of our benchmark database and to compute a simple cosine similarity for each pair.</p><blockquote>To constitute this benchmark database, we extracted a small portion of Weborama’s URLs collection: ~1.2M URLs chosen amongst one month’s worth of data.<br>Work to scale up this volume in production is in progress but explaining it is off-target for this piece. We always try to keep a scaling and industrial point of view from the very start when designing our research experiments in order to maximize success in production.<br>More on this in <a href="https://medium.com/weborama/document-similarities-a-continuous-loop-between-pocs-and-production-db3acdc019a5">this article</a>.</blockquote><p>We could now extract the top <em>n</em> URLs according to the similarity between content and segment description for any given segment.</p><p>Two problems arose here:</p><ul><li>The <strong>reliability</strong> of the ranking given by the cosine score in our scenario<br>– confirm that the top URLs really are relevant. (pretty easy to check by manually evaluating the pertinence of a subset chosen in the top ranks),<br>– check the proportion of false positives and false negatives in our ranking. Given the size of the database, how to evaluate the number of ill-ranked URLs that we consider should have been higher up on the scale of relevant content? Our data isn’t annotated, so we don’t have the material to calculate metrics.</li><li>The well known <strong>limitation in interpretability</strong> of the cosine score in a context of a model learned with a contrastive loss. Indeed, in such a context, a cosine score is to be considered relatively to others only. The raw value doesn’t really bear any meaning, except a metric to rank elements . For one segment a score of 0.67 could be very good and for another very bad. A same gap for different segments could be insignificant or establish a very long ranking distance. What method to use to determine a threshold indicating positive and negative URLs for a given segment and how to determine more thresholds to split up the positive data into quantiles expressing how pertinent the URL is.</li></ul><p>In this article, we focus on the first issue while for the second promising directions are currently in study.</p><h4><strong>Using a LLM again to “annotate” the data and align cosine to “human readable” ranking</strong></h4><p>Since we didn’t have any reference data nor the resource to annotate manually enough URLs in order to measure the quality of this simple cosine similarity ranking we decided we could use the LLM again as a human.<br>Plus, obtaining interesting results by starting out with un-annotated data will be a good indicator for the future possibility of classifying into custom-made segments that would be dynamically chosen (as opposed to categories in a closed set of pre-selected themes).<br>We designed a prompt — aligned with our needs — asking the LLM to evaluate, on a discrete scale from 1 to 5, whether an URL matches a segment.</p><blockquote><strong>Here’s how the 5 possible grades were described to the LLM :</strong></blockquote><blockquote>5- Perfect equivalence -&gt; the content fits perfectly with the provided theme.<br>4- Good equivalence -&gt; the content mainly fits the theme but is maybe not as precise.<br>3- Hard negative -&gt; the content is close but doesn’t really fit the theme, maybe some vocabulary in common. The match isn’t positive but it is difficult to say so.<br>2- Bad equivalence -&gt; the content doesn’t really fit, maybe some words are common between theme and content but overall, there is no match.<br>1- No equivalence at all -&gt; the content and the theme have nothing in common.</blockquote><p>The first way we used this LLM annotation was to assess the overall number of positive URLs for a given segment in our whole test database.<br>For this job, we annotated around 1% randomly selected URLs in our whole testing sample spread over several segments and we used the total number of positive URLs (scenario 1: either 4 and 5-graded URLs, or scenario 2: only 5-graded URLs for super-positivity) to estimate the total number of positive URLs in each segment.<br>This gave varying results depending widely on the specificity of the theme. More generic segments gave higher estimates and more specific themes lower figures.</p><blockquote>At some point in this process we took time to make sure that the LLM did “as good” a job as humans would have. Because, even if our first results were satisfying, why go on if the LLM had done a bad job at grading the URLs? We needed to make sure that we could rely on the output of this task.<br>In order to do this, we extracted 4 URLs for each grade (1 through 5) for each one of 70 annotated segments. 2 of those 4 were chosen in the cosine top 10,000 URLs and 2 of those were chosen in a set of randomly chosen URLs with a rank &gt; 10,000.<br>[Why 10k? You ask. Because it stands for ~1% of the sample, so we considered that being below the top 1% should in majority lead to true negative some exception being the very generic subjects such as “Automotive”]<br>When it wasn’t possible to find those, we completed our dataset with grades where we did manage to find some.<br>For example the <em>randomly</em> selected URLs might not contain 2 super-positive links since the ranks were far from the top.<br>This yielded around 1400 URLs with their LLM grade. The team split this dataset and we annotated it ourselves in order to compare cross-annotator agreement AND annotator/LLM agreement.<br>Leading unbiased and trustful annotations within a team is not that easy, but we ended up with the conclusion that agreement among humans showed no more consistency than between LLM or human-LLM agreement. The deviation between human estimation and LLM grades was usually small which led us to keep using the LLM as an easily automated reference.</blockquote><p>Once those estimates had been calculated we went on to automatically annotate the top 200,000 URLs per tested segment according to cosine similarity. As a reminder, the top 200,000 represents around the top 20% of our sample and hence were supposed cover a very big part of true positive URLs given a segment, which, compared to annotating the whole sample to have a full distribution, saved us some LLM budgets while not degrading the experiment reliance.</p><p>We had two goals: checking that the total number of positive URLs in this top 200,000 wasn’t too far away from the estimate (based on 1% of random URLs) and visually plotting the evolution of the number of positive URLs while going down the cosine top.<br>In order to deal with those two tasks, we simply computed the cumulative sum of “true positive” URLs in the top 200K (true positive being when the LLM scored that specific URL 4 or 5). The number is supposed to plateau around what should be a good estimate of the total number of positive URLs (since we have annotated the top 20% we can hope even more than earlier that most positives have been ranked in those 20%).</p><p><strong>Representation in the DB: evaluation</strong><br>Here are a few examples of the total positive estimated based on the random annotation versus the cumulative sum in the top 200K:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*Yf-V2uo62xqGfGpl6DtU5w.png" /><figcaption>Statistical assessment of segments’ representativity</figcaption></figure><p>The figures confirm our assumption that we could limit the annotation to the top 200K URLs during the experiment to have a covering of very most positive URLs when exploring.</p><p>The total cumulative sum of positive URLs throughout several segments also gave us some reassurance on the way the LLM understands subjects since we can see that segments that are hierarchically above others in the IAB taxonomy usually amass more positive URLs than their sub-segments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*gmN7B9R5HVl3kdEGiXWHyg.png" /><figcaption>Comparison of volumes for different segments</figcaption></figure><p>This table shows that, as we could have expected from Tier 1 (most generic) segments of the IAB, “Automotive” and “Books and Literature” match a wide number of URLs.<br>That “Diabetes”, a tier 3 segment (under “Medical Health” &gt; “Diseases”) <em>i.e.</em> pretty specific gathers less positive URLS.<br>Moreover the tier 2 segment “Auto Technology”, which is a direct child-segment of “Automotive” matches less URLs than its parent.</p><p><strong>Comparing cosine ranking with “true positives”</strong><br>Plotting a curve showing how the cumulative sum of positive URLs evolve when going down this ranking gives us a sense of how “fast” our cosine similarity ranking finds the entirety of our positive contents.<br>Indeed in a perfect world, with a perfect ranking, our “Automotive” segment would be ranked with the 53,000 overall positive URLs positioned on the 53,000 first ranks with the cumulative sum plateauing at rank 53 001. It would look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*khMofuFoMquCa5my" /><figcaption>Ideal classification for a top 200K</figcaption></figure><p>Comparing this ideal ranking to the actual curves shows us that there is room for optimization regarding the cosine ranking since the total positive URLs are scattered over the top 200,000 positions (the green curve [Positive cum sum] represents both 4 and 5-graded URLs):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*uQv5BAvrahuBlP_r" /><figcaption>Dogs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*sMr-DwOzxsZ7ae2C" /><figcaption>Automotive</figcaption></figure><p>A first observation is (and we tested this on more than just those two segments), the top 200,000 already is too much. We take notice that we only need 100,000 to see the growth of positive URLs slowing down. This will let us gain some time and LLM calls.</p><p>Looking at those curves, we veered toward looking for methods to squish those positive URLs at the very beginning of our ranking.</p><h4><strong>Enhancing the ranking: different strategies</strong></h4><p>We tried to tackle this issue of collecting the most true positive URLs at the beginning of our ranking with two different approaches.</p><ul><li>One way is simply to use our now (more) qualified data to train some Machine Learning models</li><li>We also wanted to explore existing models of a certain type, which matches exactly with our need: the re-rankers.</li></ul><p><strong>Custom Models</strong><br>For the very first model we trained, we simply took out the top 10,000 URLs of our cosine ranking and added a randomly chosen set of 10,000 URLs outside of that top. The LLM’s grade was used as the training target. We went for Logistic Regression.<br>This approach of including random URLs, we hoped, would be able to “recover” positive URLs badly scored with the cosine similarity by “showing” the logistic regression model positive URLs further down the ranking. Also, if results are convincing, it will show us that annotating only 20,000 URLs could provide a satisfying classification model, which would again reduce our time/calls costs.</p><blockquote>We decided here to focus our presentation on Logistic Regression models. Some may be surprised we didn’t go with the famous LightGBM or other fancy models. The main reason we selected this option to start with was to — as early on as possible into the research process — try to think about the future development steps and accommodate industrialization needs for our very large scaled prod data. Linear models are well suited for being used alongside a vector database cluster where vectors are also inputted to make vector search queries. For example, you can simply consider Logistic Regression Coefficients as an input vector and thus take benefit of the complex vector database cluster to score URLs. We elaborate on this choice in our article <a href="https://medium.com/weborama/lr-is-all-you-need-20963d683e88"><em>LR is All you Need</em></a>.</blockquote><p>This was expected to perform pretty well since we’re using the LLM’s “opinion” both to train and validate our data so the resulting model was expected to match closely the LLM’s results.</p><p><strong>Re-rankers</strong><br>Re-ranker models are models specifically designed to handle an <strong>already relevant</strong> set of documents (URLs in our case) and <strong>re-order </strong>them. They are supposed to offer better accuracy due to the cross-encoder design (in comparison to bi-encoder) but it implies inputting pairs of (segment, url) into the transformer for <em>all</em> the top URLs (100K now) to get a similarity instead of simply applying a cosine score between the segment and the already pre-embedded database. Using them directly to extract the closest URLs for each of our segments would be resource-greedy but if we notice a really significant improvement, we might very well consider it for off-line scenarios when the segments are known beforehand (impossible to apply it to live/dynamic custom segments because of the computing times).<br>We selected two <em>reasonably sized</em> different re-rankers and computed the new scores for each URL of our top 100K.</p><p><strong>Performances</strong><br>To compare how each way of re-arranging the top 100,000 URLs, we plotted the cumulative sum “evolution” curves. You can compare how cosine vs re-ranker 1 vs re-ranker 2 did.<br>The following graph shows the ranking for the testing data.<br>⚠️ Showing only the testing data necessarily hinders the cosine, since we plot only the URLs that have not been used to train the model, which means there none of the top 10,000 URLs.<br>We can see that the LR model is very efficient, finding very quickly all positives left-overs that the cosine hadn’t placed in the very top.<br>The re-rankers seems to be able to better assemble those left-overs too, whereas the cosine had them well spread over the whole of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*nubvD_0wra3mSAry5Ol_QQ.png" /><figcaption>Test set</figcaption></figure><p>To have a better idea of how the re-rankers specifically perform, we can have a look at how every method re-ranks the whole sample data (train + test). This will unfairly advantage the Logistic Regression Model, of course, since the data used for training will also be present in the graph. But for cosine vs. re-rankers comparison, you’ll see that it sheds a cruder light on the efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*fX3JFnIX3Hn0KDGOKF3Q2w.png" /><figcaption>Train + Test sets</figcaption></figure><p>It is important to note that for <em>some</em> of the segments, the re-rankers (or at least of out of the two) performed better than the cosine. But the proportion of themes for which it wasn’t the case was important enough for us to choose to show such an example.<br>In a notable proportion of the tests indeed, the re-rankers we tried weren’t quite able to offer a better ranking, scattering even more the true positive URLs in their top 100K.<br>Even though re-rankers are supposed to be <em>more</em> efficient, we would have needed a “heavier” re-ranker to gain quality on our original ranking . Our original bi-encoder is sturdy enough to have a quite good result on the first try whereas we specifically chose light cross-encoders for those tests.</p><p>We could of course try again with bigger cross-encoders and that should yield better results, but instead of diving into benchmarking re-rankers right away, we’ll try to exploit more of our already embedded content by exploring more of the first option: using our LLM annotations and pre-GenAI Machine Learning to train<em> ad-hoc</em> models, since our first results were pretty outstanding.</p><h4><strong>Custom trained models: from re-ranking to direct classification</strong></h4><p>Since relying on reasonable size re-rankers yielded unsatisfactory results, we thought we might try to “enhance” our ranking in some other ways. This led us to think about training more simple linear machine learning models on top of embedding vectors upon labelized URLs. In the end, if those models, used to predict a new ranking in our top 100K, show better gathering of the positive URLs at the beginning of the ranking, we came to the conclusion that we could then simply use the best one to directly classify URLs into this model’s segment: we would use the embeddings, cosine similarity and LLM annotations to train one model per segment.</p><p>Back to our results for the “Dogs” segment, we can see that, confirming our expectations, this simple logistic regression model gathered way more densely the positive content at the beginning of the ranking, reaching the plateau quicker than the cosine (and of course the re-rankers which we established to be less effective).<br>These results seemed to be quite promising for our objective of classifying directly using the custom model. However, training a model for each IAB segment with this method would entail the annotation of 20,000 URLs by segment, with as many calls to the chosen LLM. Which can take time and make us pretty dependent.</p><p>Could we maybe obtain fair results by using less LLM annotations in the training (or even none?)<br>Using our annotated 100K over a few different segments, we tried around 10 different URLs-labelling configurations to train our models.</p><p>For example, some of the models used the LLM grade as a base to train the model: a certain percentage of the URLs deemed positive by the LLM were marked as positive in the training data, and some of the negative URLs were used for the negative training set. Some only relied on a top rank cosine rule, etc. Here’s a table summing up the selected data. This first line represents the “reference LR model” which results you saw hereinabove.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*D3dcUf-Hos3lqw9p4JW2hQ.png" /><figcaption>Table A — Training configuration</figcaption></figure><p>Keeping in mind the performance of the simple cosine ranking and the logistic regression model using a lot of “annotated” positive and negative entries, we trained those 9 other LR models.</p><p>On this graph representing again the “speed” at which the positives are matched in the War and Conflicts segment (with non-normalized values here), we can see that different training methods yielded different qualities of ranking (10 models, cosine ranking and first re-ranker ranking (we kept the most efficient for comparison)):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*ImGuU3gkt7YVcTN73wD_DQ.png" /><figcaption>Train + Test set — Cf Table A</figcaption></figure><p>The inner-most and outer-most curves are respectively our reference rankings: the cosine ranking and the reference LR model.<br>Here are the same 12 progression curves for the segment “Women’s Health”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*WpzPmsQKwJWtUQx24gwEXQ.png" /><figcaption>Train + Test set — Cf Table A</figcaption></figure><blockquote>For both graphs, see table above for colour coded matching</blockquote><p>The pink and citrus/khaki green curves showed interesting results, using <em>some</em> annotations by LLM but not 20,000, making it easier to industrialize.</p><p>For more readability, here’s the graphs, with only the reference LR model, the reference evolution for cosine ranking and the curve representing one of the models trained with the top 1000 LLM-validated URLs plus some random URLs to add to the negative part of the training set (citrus/khaki green):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4sKGyMiTBzJDI4sK-SP7BQ.png" /><figcaption>Train + Test set</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8Z45Nrp6uxPAsuj0L3b3w.png" /><figcaption>Train + Test set</figcaption></figure><p>By training our logistic regression model with only 1,000 URLs from the cosine top but using the validation from the LLM grade, we obtain a lot more positive URLs positioned at the first ranks without having to make too many calls to the LLM. It seems like a good trade-off.</p><h4><strong>Conclusion</strong></h4><p>Those first results of using automatic annotations to train models in order to better recognize URLs belonging to a specific theme/segment are pretty encouraging.<br>Using dense vectors to find good URLs to feed a training model opens up the field of classification that takes into account more of the semantics behind natural language than with lemmas/keywords.</p><p>It’s also promising in terms of feasibility: populating 700 new segments now seems within reach without banking on months of human annotation. It is also an approach that frees us of the need for people with knowledge of each one of those segments.</p><p>We have monitored the emergence of GenAI since it has become a staple of the data science and big data industries. Studying what it could bring Weborama seemed necessary, and doing it early on would let us make the most of the community’s research and progress, but we didn’t want to dive into it without a clear objective. This project was the perfect opportunity for us to discover what kind of doors it opened to the company, whether it could entirely replace our current methods and what its limitations were.</p><p>Integrating dense vectors and LLM usage into our classification process might be a way for us to integrate new data such as the IAB taxonomies at a reasonable human/time cost but also shows opportunities of letting our user define dynamically a new segment (with one short description as we did for this experiment or with a set of orthogonal sub-topics as mentioned at the beginning of this piece and is currently under examination) without having curated the theme internally first.</p><p>This experiment stops here, but we already know what the future steps are: automate a way of finding a cut-off value for our trained model predictions. We know that the “positivity” of an URL in regards to a segment is subjective and depends on the original need (matching a lot of content with a flexible matching level vs. less content with strict semantic relationship). In order to match each demand, we need to determine what score matches what level.<br>We also want to work on the aforementioned possibility of describing one subject with several descriptions (vectors), the semantic sum of which covers the whole subject.<br>As we’ve said in this article, we’ve done our best from the start to think about the future development phase while researching this issue and we are now starting the process of industrializing the pipeline, scaling up to the kind of volumes Weborama parses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9357324da74a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a">Boosting Semantic Categorization with recent AI paradigm</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Clean Rooms: the Go-To Product in a Privacy-First Reality]]></title>
            <link>https://medium.com/weborama/data-clean-rooms-the-go-to-product-in-a-privacy-first-reality-bfcf660d83ff?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/bfcf660d83ff</guid>
            <category><![CDATA[cleanroom]]></category>
            <category><![CDATA[digital-advertising]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Alexis Sukrieh]]></dc:creator>
            <pubDate>Fri, 22 Sep 2023 14:14:48 GMT</pubDate>
            <atom:updated>2023-09-29T09:41:44.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1IYoi8P44j5vZlJtFIVTA.png" /></figure><h3>The “IDLess” World is already there</h3><p><em>It’s been clear for some time: Browsers like Safari and Firefox have already abandoned third-party cookies. Now, Chrome, with its commanding 60% market share, is following suit, setting its sights on the Privacy Sandbox implementation by 2024. Once fully activated, we could observe an overwhelming 97% of web traffic without cross-site identification capabilities. Coupled with GDPR implications, the ‘identifiable inventory’ is even smaller in Europe. This isn’t a distant prediction; it’s today’s marketing environment.</em></p><p><em>We’re witnessing </em><strong><em>a paradigm shift</em></strong><em>: we’re transitioning from an </em><strong><em>individual-based</em></strong><em> marketing to a </em><strong><em>cohort-based </em></strong><em>approach. This is major and redefines the way we should see our industry if we want to successfully adapt to this new game.</em></p><p><em>First-Party Data and Data Clean Rooms (DCRs) are emerging as the key assets in this new playbook.</em></p><h3>The Decline of Cross-Context Identifiers</h3><p>In recent years, changes in digital marketing have largely been influenced by the reduction of cross-context identifiers. Among these, third-party cookies have been the most affected due to browser updates:</p><ul><li><strong>Safari (19.85%)</strong>: Apple’s Safari browser, which holds a significant portion of users, <a href="https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/">started the trend in 2018</a>. Its Intelligent Tracking Prevention (ITP) limited tracking capabilities by blocking third-party cookies and reducing the lifespan of first-party cookies.</li><li><strong>Firefox (2.94%):</strong> Despite its smaller market share, Mozilla’s Firefox made changes in 2022. Through its Enhanced Tracking Protection (ETP) and <a href="https://techcrunch.com/2022/06/14/firefox-gets-a-privacy-boost-as-total-cookie-protection-becomes-the-default-for-all-users/#:~:text=The%20feature%20was%20first%20introduced,Firefox%2089%20later%20that%20year.">Total Cookie Protection</a> it began blocking third-party cookies and restricting fingerprinting techniques.</li><li><strong>Chrome (63.56%):</strong> Google Chrome, holding the lion’s share of the browser market, has also taken a major step towards privacy. It announced its <a href="https://privacysandbox.com/">Privacy Sandbox</a> and plans a full implementation by 2024, which will stop cross-site cookies from functioning on the most used browser on the planet.</li></ul><p><em>Browser Market Share Source: </em><a href="https://gs.statcounter.com/browser-market-share"><em>gstats.com (year 2022)</em></a></p><p>Currently, <strong>23%</strong> of digital inventory is cookieless, mainly due to actions taken by <strong>Safari</strong> and <strong>Firefox</strong>. Once Chrome activates its <strong>Privacy Sandbox</strong> (set for a 2024 rollout), this will likely <strong>jump to 87%</strong> of all traffic.</p><h3>A Decline Amplified by GDPR and Browsing Practices</h3><p>Beyond browser changes, <a href="https://www.researchgate.net/publication/364035563_The_Impact_of_Privacy_Regulation_on_Web_Traffic_Evidence_From_the_GDPR">a research has highlighted GDPR’s effects on website visits and engagement</a>. Analyzing 5,000 domains in Europe and the US, the study found that GDPR’s requirement for clear user consent before data collection means <strong>15% fewer third-party cookies are set</strong> due to users <strong>not providing consent</strong>.</p><p>Hence, at the time of this writing<strong>, about 38% (23% + 15%) of web traffic cannot be addressed with cookies</strong>. But with Chrome’s full Privacy Sandbox adoption, this <strong>could rise to an estimated 97%</strong> of web traffic being without cookies or user consent, making cross-site identification basically a thing of the past.</p><p>Keep in mind that these figures represent a (very) <strong>conservative estimate</strong>. In practice, a sizable number of <strong>Chrome users activate Private Mode</strong> or manually <strong>disable third-party cookies </strong>in their settings, further reducing the traffic advertisers can target. This can potentially <a href="https://advertisingweek.com/70-of-your-consumers-are-now-invisible-to-your-adtech-stack-how-did-this-happen-and-what-can-you-do-about-it/">double the estimated percentage of unaddressable web traffic</a>, leaving <strong>as little as 30% of the open web accessible</strong> to advertisers.</p><p>Let me emphasize: This isn’t a hypothetical scenario for years down the line; it’s the very <strong>reality digital marketers are facing today</strong>.</p><h3>Further Setbacks: The Fall of Mobile and Universal IDs</h3><p>In addition to the decline of third-party cookies and the rise of consentless traffic, alternative ID solutions face significant hurdles. Measures like <a href="https://developer.chrome.com/docs/privacy-sandbox/ip-protection/">IP masking</a>, the <a href="https://developer.chrome.com/docs/privacy-sandbox/user-agent/">freezing of User Agents</a>, detection of <a href="https://developer.chrome.com/docs/privacy-sandbox/bounce-tracking-mitigations/">bounce trackers</a>, and the <a href="https://developer.chrome.com/docs/privacy-sandbox/privacy-budget/">limitations of browser fingerprinting techniques</a> are undermining their effectiveness, making them very likely obsolete in the months to come.</p><p>Last but not least, Mobile IDs are also facing deprecation. <a href="https://techcrunch.com/2021/04/26/apples-app-tracking-transparency-feature-has-arrived-heres-what-you-need-to-know/">Apple’s ATT (2021)</a> has significantly limited their use, and Google’s upcoming release of a <a href="https://developer.android.com/design-for-safety/privacy-sandbox">Privacy Sandbox for Android</a> signals the <a href="https://blog.google/products/android/introducing-privacy-sandbox-android/">killing of the widespread use of GAID</a>.</p><h3>Data Collaboration and the Emergence of Data Clean Rooms</h3><p>In a landscape where <strong>recognizing individuals across multiple websites</strong> or apps becomes <strong>increasingly challenging,</strong> as we just saw, businesses must <strong>adapt their strategies</strong> for audience engagement. Their only viable option is to build these strategies on their own digital assets, leveraging their <strong>First-Party data</strong>.</p><p>Why? Because with the disappearance of third-party cookies and fingerprinting techniques (or mobile IDs), First-Party data emerges as <strong>the sole dependable source</strong> for understanding and <strong>engaging with users</strong>. This data, collected directly from customer interactions on a brand’s properties, offers valuable insights into user behaviors, preferences, and interests.</p><p>However,<strong> First-Party data is not a silver-bullet</strong>, it comes with<strong> two main issues</strong> to address:</p><ol><li><strong>Scarcity</strong>: Emails, when it comes to logged traffic, are relatively rare. They account for just a small portion of total traffic, with estimates suggesting they make up 5% to 15% of traffic on average, depending on the domain.</li><li><strong>Sensitivity</strong>: Emails are highly sensitive from a privacy perspective as they are classified as Personally Identifiable Information (PII). Therefore, they cannot be used as a new cross-domain ID without violating user privacy regulations and risking potential legal repercussions.</li></ol><p>To address these challenges, <strong>Data Clean Rooms</strong> (DCRs) come into play. DCRs are specialized tools designed to <strong>facilitate collaboration</strong> while <strong>safeguarding user privacy</strong>. They enable organizations to work together <strong>on aggregated intersections of First-Party</strong> data <strong>without exposing or exporting PII</strong>, such as email addresses.</p><h3>The Data Clean Room: the go-to product in the First-Party realm</h3><h4>Understanding Data Clean Rooms</h4><p>DCRs are not just a buzzword or a guise for “privacy-washing” — they’re a <strong>concrete, security-focused product solution</strong> aimed at preserving user privacy while enabling businesses to leverage their data effectively.</p><p>A Data Clean Room is a <strong>secure environment</strong> that allows for the controlled sharing and processing of data, <strong>ensuring that no PII is exposed or exported.</strong></p><h4>The Golden Rule: No PII Outflow</h4><p>The golden rule for a DCR is that it should <strong>never allow PII</strong>, such as IDs, email addresses, or any PII-related information, <strong>to exit</strong> the environment or <strong>be displayed</strong>. Failure to adhere to this rule disqualifies a system as a DCR.</p><p>Now, to really hit the mark, a DCR needs certain key features. Here are the top five must-haves for any solid DCR.</p><h4>Data Fusion Without PII Exposure</h4><p>At their core, DCRs have <strong>the capability to merge two or more First-Party data sets</strong> based on a <strong>common identifier</strong>, such as email addresses. However, as explained below, these common identifiers (or pivots) <strong>remain hidden </strong>and are <strong>never exported</strong> out of the DCR, ensuring that while data sets are combined, no individual-level data is ever exposed or exported.</p><h4>Aggregated Segments</h4><p>In DCRs, queries always yield <strong>grouped results</strong> rather than individual records. This ensures that participants in a DCR can gain general insights without targeting specific users. A foundational element to this is <a href="https://en.wikipedia.org/wiki/K-anonymity">the k-anonymity principle</a>. It ensures results from queries always come in groups of a minimum size, not as individual records or small groups of individuals. This way, <strong>data remains generalized enough </strong>to protect user identities.</p><h4>No PII Exposure or Export</h4><p>Given that DCRs operate on aggregated data segments, they inherently <strong>prevent the exposure of PII</strong>. Since all queries are executed on these aggregated segments, no PII can ever be returned by design.</p><p>To maintain strict privacy standards, it’s essential that DCRs prevent any PII from leaving the platform. This stops participants from matching results with external data sets, which would violate core privacy guidelines.</p><h4>Controlled Access</h4><p>DCRs<strong> </strong>incorporate <strong>strict user permission systems </strong>and advanced security measures, ensuring that only approved individuals can access specific datasets, and <strong>always under well-defined conditions</strong>.</p><p>For instance, some queries within a DCR might have a <strong>predetermined expiration</strong>, meaning they become inaccessible after a set number of days. Also, to protect the data and maintain consistent results, the information used to run a query <strong>can be locked or set in an “immutable” state</strong>. This means that even if a participating party updates their data, the original query results remain consistent. This immutability is crucial as it prevents potential data triangulation attacks by a malicious participant in the DCR.</p><h4>Data Source Verification</h4><p>DCRs prioritize data from verified and trusted sources. Before data is integrated into the system, it undergoes preprocessing. This step involves potentially <strong>identifying and flagging any columns as containing PII</strong>, or selecting <strong>specific columns to be accessible</strong> within the DCR. Participants also have the authority to stipulate conditions, like <strong>predefined query templates</strong>, under which their datasets can be accessed.</p><p>This focus on data integrity ensures that businesses can confidently derive insights from legitimate data while maintaining the protection and discretion of each participant’s contributed data.</p><h3>DCR Use Cases, how to do things in this new era?</h3><p>There are plenty of potential use cases for DCRs, each offering strong opportunities to extract value while staying within the boundaries of privacy regulations. A deep dive into these use cases would deserve a dedicated article, but a brief exploration can highlight how things will be done in this Privacy-First era.</p><h4>Insights</h4><p>Consider a retail brand aiming to decode the preferences of their loyal customers without overstepping privacy boundaries. Through DCRs, this brand has the capability to merge its first-party data with that of a partner, say, a publisher boasting a sizable audience.</p><p>Utilizing <strong>logged-traffic as a basis</strong>, the overlapping of these datasets could <strong>unveil trends</strong>, such as segments of customers who are more inclined to make a purchase based on the content they engage with on the publisher’s sites.</p><p>Armed with these insights (and to stress, these are 100% free of PII), the brand is able to make informed inventory decisions, adjust its marketing approach, or perhaps roll out new product lines.</p><h4>Ad Campaign Measurement</h4><p>In a digital landscape where tracking pixels and cookies are gradually fading, determining the efficacy of ad campaigns is more and more challenging.</p><p>The once straightforward process of connecting users from ad impression to the ultimate conversion now encounters heavy obstacles. This is where <strong>DCRs, leveraging logged traffic data</strong>, come into play.</p><p>Take the example of an e-commerce platform launching a campaign for a fresh product lineup. With DCRs, they’re enabled to analyze the logged traffic post-ad display and compute conversion metrics, leveraging the First-Party data of big publishers broadcasting their advertisements. This way, it’s now possible to measure the performance of a campaign — even without pinpointing who exactly is there — by comparing conversion rates of those who were exposed to the ad to those who were not.</p><h3>Activation</h3><p>How can one activate a DCR segment without exporting the PII?</p><p>This question is perhaps <strong>the most significant challenge</strong> in this new era. As it stands, the answer remains open-ended.</p><p>Notably, the IAB’s white paper titled “<a href="https://iabtechlab.com/wp-content/uploads/2023/02/FINAL-DRAFT-PUBLIC-COMMENT-Open-Private-Join-Activation-IAB-Tech-Lab.pdf">Open Private Join and Activation</a>” delves deeply into this issue. The suggested approach is to <strong>export the PII intended for targeting, but ensuring it’s encrypted</strong> throughout the supply-chain. While promising, it’s essential to realize that this method introduces a certain level of complexity. Each participant in the process would need to adopt this encryption for it to be effective.</p><p>Alternatively, <strong>DCR vendors might offer an activation service</strong> that operates in real-time. Upon receiving an encrypted PII-application key pair, it would then return a set of approved DCR segment IDs. This method might be easier to set up. Moreover, it could incorporate a system similar to the <a href="https://developer.chrome.com/docs/privacy-sandbox/topics/overview/">Privacy Sandbox’s TOPICS API</a>, occasionally adding false segments. This slight distortion could enhance privacy by making the segment a bit more blurry.</p><h4>Data Scarcity: the Key Challenge of all DCR Use Cases</h4><p>A crucial factor to bear in mind when leveraging DCRs is the limitation of available first-party data.</p><p>With Machine Learning and Contextual targeting, we have two essential tools in addressing this challenge.</p><h4>Machine Learning</h4><p>Consider an advertiser aiming to broaden its DCR segment, which is inherently limited due to it relying on the shared logged traffic with a Publisher partner.</p><p>Within the DCR tool, the advertiser can utilize machine learning algorithms that hinge on publisher signals. Leveraging the subset of users who engaged with their ads as positive examples (using shared logged traffic), they can identify similar users within the publisher’s data set who aren’t present in the advertiser’s own data, drawing from the publisher’s features.</p><h4>Contextual Targeting</h4><p>On the other hand, integrating Contextual segments with DCR proves to be highly effective. This method capitalizes on the semantic context related to the user in the DCR segment, enabling advertisers to target akin contextual areas across the web.</p><p>What stands out with this approach is its <strong>IDless nature</strong>. The reliance on logged-traffic is eliminated. This opens doors to a <strong>wider inventory spectrum</strong>, covering browsers like Safari and Firefox.</p><p>And here’s the kicker: <strong>no consent is required. </strong>There’s no use of PII, no pseudonymous IDs, and absolutely no trace of browsing history in signals used to target the ad. <strong>Targeting is completely user-agnostic</strong>, focusing solely on content.</p><h3>Combining Top-Tier DCR Technology with User-Friendly No-Code Design</h3><p>At Weborama, we’re rolling out a DCR app within our <a href="https://weborama.com/en/data-management-platform-dmp/">Data Intelligence Platform</a>. I’m personally thrilled to be working on this innovative initiative with my team.</p><p><strong>First, because it really matters to me</strong> (and to *a lot* of <a href="https://weborama.com/">my colleagues</a>) to commit to advancing the cause of privacy in our industry. We truly believe that <a href="https://www.adexchanger.com/marketers/an-industry-in-conflict-its-time-for-tough-questions-and-hard-decisions/">the future of marketing has no choice but to meet high Privacy-First standards</a>.</p><p>But this isn’t just about “meeting industry standards”, <strong>it’s about setting them</strong>.</p><p>Sure, adding a GDPR layer to an app might earn the ‘DCR’ label in some circles. But as I’ve pointed out in this piece, genuine DCRs involve so much more.</p><p><strong>It’s a paradigm shift.</strong></p><p>The online marketing landscape we once knew, <strong>built on individual data tracking</strong>, is coming to an end. This approach sometimes resulted in major data breaches and excessive tracking and retargeting, which logically raised public concern about privacy, as evidenced by incidents like Cambridge Analytica, to name the creepiest. Things are changing.</p><p><strong>We’re transitioning to a world centered on cohorts</strong>, not individuals. With this shift comes enhanced privacy, but also the challenges of data scarcity and complexity.</p><p>DCRs? They’re the tools for this new era, guiding us through the maze where data is both precious and guarded. I’m glad to be both a witness to this evolution and, with Weborama’s offerings, a contributor to shaping it.</p><p><strong>And secondly</strong>, what really motivates me in this journey, is that there’s another layer to our innovation: <strong>usability</strong>.</p><p>While most DCRs demand a strong grasp of SQL or similar technical skills, at Weborama we’re pioneering a new approach.</p><p>We’re layering our <strong>state-of-the-art DCR technology </strong>(based on <a href="https://www.snowflake.com/blog/distributed-data-clean-rooms-powered-by-snowflake/">the powerful Snowflake DCR framework</a>) <strong>with an intuitive no-code interface</strong>, truly making it accessible without compromising on its robust capabilities.</p><p><em>Interested in what we’re crafting? </em><a href="https://weborama.com/en/contact-us/"><em>Drop us a line. We’d love to chat</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfcf660d83ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/data-clean-rooms-the-go-to-product-in-a-privacy-first-reality-bfcf660d83ff">Data Clean Rooms: the Go-To Product in a Privacy-First Reality</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring technologies at Weborama: The Rust language]]></title>
            <link>https://medium.com/weborama/introduction-to-the-rust-programming-language-4dbf8f3016de?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/4dbf8f3016de</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Eric Mercier]]></dc:creator>
            <pubDate>Tue, 27 Sep 2022 10:21:35 GMT</pubDate>
            <atom:updated>2022-11-03T17:23:02.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*shd_u_ZpOnucYa0Z" /><figcaption>Photo by <a href="https://unsplash.com/ja/@chanphoto?utm_source=medium&amp;utm_medium=referral">Chandler Cruttenden</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>At Weborama, we use (or used to use) a lot of programming languages: Perl, Ruby, PHP, JavaScript, Typescript, Clojure, Python, Groovy…</p><p>Today, we mainly use <a href="https://www.java.com/">Java</a> (with the <a href="https://spring.io/">Spring</a> stack) and <a href="https://go.dev/">Go</a>, for our back-end services (we also are a big <a href="https://vuejs.org/">Vue.JS</a> shop, but this is another story).</p><p>While we are perfectly happy with Java and Go, with their ecosystem and with the way they fit our needs, we try to keep our eyes open and are frequently looking at new technologies that could help us improve performances or reduce resource consumption.</p><p>This mindset is well-shared within our engineering teams. For example, we progressively migrated our stacks to micro-service architectures powered by <a href="https://www.docker.co/">Docker</a> and <a href="https://kubernetes.io/">Kubernetes</a>, as many of other companies in the industry did. We also experiment with new database systems regularly or even try new cloud services provided either by <a href="https://cloud.google.com/">Google Cloud Platform</a> or <a href="https://aws.amazon.com/">Amazon Web Services</a> (we like to be hybrid!).</p><p>Of course, we want to remain pragmatic, and we won’t revolutionize our coding guidelines every semester. But on the other hand, testing new approaches (or in this case, new languages), is an interesting exercise to do, helps staying up-to-date with state-of-the-art practices and gives perspective on our current way of working.</p><p>So, long story short, <strong>Rust entered our radar</strong>.</p><h3>The Rust language in a nutshell</h3><p>If I had to summarize it with one sentence, I’d say <em>Rust offers good performances while being resource-efficient.</em></p><p>More specifically, its <a href="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html">ownership memory management system</a> makes it memory safe and avoids race conditions. Its community is solid and helpful, and even if the ecosystem is still young, it’s growing at fast pace, <a href="https://github.com/UgurcanAkkok/AreWeRustYet">in all domains</a>. There is a lot of well written documentation to help new <a href="https://rustaceans.org/"><em>rustaceans</em></a> in their journey, and the existing tools (<em>cargo</em>, <em>clippy</em>, or <em>rust-analyzer</em> to name a few) are super useful.</p><p>All of this made Rust the most beloved language for 6 years in a row, according to <a href="https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted">Stack Overflow 2021 insights</a>.</p><p>So, we wanted to give it a try.</p><h3>Testing Rust at Weborama</h3><p>We came up with a small benchmark that we tried to make as close as possible to a real use-case: a micro service that exposes a <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">ReST</a> endpoint, does some computation and a database call, sends a message to a broker and returns the message in the HTTP response.</p><p>Of course, our real-life programs do more complex stuff in reality, but this small example should give us some insights on how Rust would behave in a close-enough technical environment.</p><p>For this benchmark, I asked some of my friendly colleagues to play this little game with me by implementing the test service in their favorite language, without searching for over-optimization. We ended up with a total of 7 challengers:</p><ul><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/rust">Rust (obviously)</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/go">Go</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/java-spring">Java Spring MVC</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/java-spring-reactive">Java Spring Reactive</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/python">Python</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/clojure">Clojure</a></li><li><a href="https://github.com/Weborama/RustBenchmark/tree/main/groovy">Groovy</a></li></ul><p>All of them were built as a <a href="https://www.docker.com/">Docker</a> image and deployed on a <a href="https://kubernetes.io/">Kubernetes</a> cluster, along side with a <a href="https://www.postgresql.org/">PostgreSQL</a> database and a <a href="https://www.rabbitmq.com/">RabbitMQ</a> message broker. Of course, all the implementations were given the same amount of resources on the cluster.</p><p>We looked at 3 metrics: <em>time </em>to complete a request, <em>memory</em> consumption and <em>CPU</em> usage.</p><p>We used <a href="https://jmeter.apache.org/">Apache JMeter</a> to send <strong>50 concurrent requests</strong> during <strong>30 seconds</strong> for each implementations, after a warmup round. The Kubernetes cluster is located on the <em>eu-west-1</em> AWS zone, in Ireland and the client is located near Paris, in France.</p><p>So enough with the chitchat, let’s see the result! Here is the number of samples ran by each implementation in the given time:</p><ul><li>Clojure: 7658</li><li>Go: 6755</li><li>Groovy: 6890</li><li>Java Reactive: 7303</li><li>Java Spring MVC: 7147</li><li>Python: 6379</li><li>Rust: <strong>8019</strong></li></ul><p>We can see that <strong>Rust wins the challenge</strong> (it’s the only implementation able to run more than 8000 samples), but <strong>by a really small margin</strong> on average.</p><p>Looking at the <strong>response time percentiles</strong>, we can see that all implementations are roughly performing the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*fu7pZ5vq7Ax1ZinUvE1KQA.jpeg" /><figcaption>Response Time Percentiles (more or less the same for all implementations)</figcaption></figure><p>So what can we conclude there? Well, <strong>good performances are there</strong>, for <strong>every runtime environment</strong>, but the next question is: <em>at which price, resource-wise</em>?</p><h3>Resource Consumption Analysis</h3><p>To monitor the resource consumption on our cluster, we’ll rely on our fantastic <a href="https://grafana.com/oss/prometheus/">Prometheus/Grafana</a> stack. Here, I made a small comparison of <strong>memory</strong> and <strong>CPU</strong> consumption for each container.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52563dfe5d5cf29571516ee64a3b9098/href">https://medium.com/media/52563dfe5d5cf29571516ee64a3b9098/href</a></iframe><p>We can obviously split the results in two families: <strong>JVM based</strong> and <strong>non-JVM based</strong> languages.</p><p>As much as I love the JVM, all its wonders come with a price: <strong>memory </strong>(not really a surprise, I agree). Indeed, Clojure, Groovy and Spring implementations are the most memory intensive. Since the JVM allows rapid and robust development, and given that today’s computers are filled with RAM, it’s a price we agree to pay <em>most of the time</em>.</p><p>Among non-JVM languages, Rust is a clear winner here. It uses at bit more than <strong>half of the memory of the Go implementation</strong>, and <strong>close to 10% of the Spring one</strong>…</p><p>A first conclusion could be: <em>if you want to save memory, Rust should clearly be considered.</em></p><p>Speaking about the CPU usage, none of the contenders uses 100% of the allocated CPU, meaning we probably hit a bottleneck somewhere. Is this the I/O with RabbitMQ or with PostgreSQL? To be fair, I didn’t take the time to dig into this issue. All we can see is that <strong>our Rust implementation uses less CPU than the others</strong>.</p><p><strong>So, we can see that with Rust, we can do <em>the same</em> (if not <em>more</em>) with <em>less</em>.</strong></p><p>This reminds me a <a href="https://www.cloudcity.io/blog/2018/11/08/parsing-logs-230x-faster-with-rust/">blog post</a> I read few years ago: it talks about a guy who needed to parse a lot of files and ended up with a Rust implementation that was so fast it allowed him to parse 500 GB of logs per day while staying in the free tier of <a href="https://aws.amazon.com/lambda/">AWS lambda</a>!</p><h3>What about Rust drawbacks?</h3><p>But of course, there’s no such thing as perfection, and everything in life comes at a price.</p><p>One of the drawback of the Rust adoption is its <strong>steep learning curve</strong>. Even if its memory management is easier than with C for example, it’s still something you have to learn and <em>master</em> during your development phases.</p><p>When you’re used to having garbage collection nearby (like with Java or Go), it’s quite tough to go back to <strong>thinking about memory</strong> in your code, particularly since the Rust compiler is really severe (and it’s a good thing, if you ask me!) when it comes to <a href="https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html">borrow checking</a>.</p><p>Also, you will probably hate `<strong>rustc</strong>` at first… (before falling in love with it, as it will prevent you from doing a lot of mistakes, trust me).</p><p>Another thing that could be frustrating is <strong>the compile time</strong>. It can be long, particularly the first time you build your project with all its dependencies. But this is something Rust engineers are aware of, they are <a href="https://github.com/rust-lang/rust/issues/48547">working on it</a> and let’s be honest: it’s not <em>that</em> bad and I’d rather “pay” more compile time to save some run time and memory footprint.</p><h3>So, what to conclude about Rust?</h3><p>I had a lot of fun working with Rust for this little study. I think this is a really interesting language with a lot of powerful capabilities, and I believe, in situations where memory space is limited, performances expected and bullet-proof robustness aimed for, it’s probably the best option out there.</p><p>Of course, in reality, many considerations come into play when you want to introduce a new language in a company, or even in a team. You have to think about team work, maintainability and of course, hiring.</p><p>What I know for now, is that if at some point we’re facing a performance or memory footprint issue at Weborama, we’ll know that Rust will be a solid option to consider.</p><p>It’s also interesting to see that Rust is becoming more and more popular in big Tech companies such as Facebook, Google or Amazon, and it’s another reason why we should keep it close to our eyes.</p><p>If you’re using Rust at your company, feel free to leave a comment below. It’s always interesting to see real-life examples and testimonials when looking at new languages.</p><p><em>A huge thank to my colleagues David, Fabrice, Gabriel, Nelson, Nicolas, Rachid and Valentin, who contributed to the code written for this article and helped me to set up the environment and Alexis for proofreading this article. You rock guys!</em></p><p><em>You can find all the sources </em><a href="https://github.com/Weborama/RustBenchmark"><em>here</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dbf8f3016de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/introduction-to-the-rust-programming-language-4dbf8f3016de">Exploring technologies at Weborama: The Rust language</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding Google Topics (3/3)]]></title>
            <link>https://medium.com/weborama/decoding-google-topics-3-3-5d91053911d1?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d91053911d1</guid>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Nicolas Tastevin]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 14:10:15 GMT</pubDate>
            <atom:updated>2022-09-12T14:36:48.783Z</atom:updated>
            <content:encoded><![CDATA[<p><em>On July 27th, Google announced that the phasing out of 3rd party cookies in Chrome was postponed to S2 2024. Google has also decided to expand the origin trials that were supposed to end on Aug 22. We are publishing our article based on the initial trial period; we will continue to test the Topics API and will come back with further observations.</em></p><p>At the beginning of 2022, Google dropped the FLoC solution and proposed Topics, a new initiative to enhance privacy on the Web. Quickly, Google published some guidelines describing the Topics API mechanism, making it possible for Weborama to simulate the approach on our Web Surfing history database. At the end of March, we published episodes <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">1</a> and <a href="https://medium.com/weborama/decoding-google-topics-2-2-8415b14d11f7">2</a> focusing on this simulation and presenting the first obtained results. We also evoked some use cases and highlighted how Topics could be used in the AdTech industry. In April, Google Origin Trials for Topics API started, conducting us to do more research and to write this third episode.</p><h3>Chrome Origin Trials</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1dfY8prXuVwKnNETH4v1A.jpeg" /><figcaption><strong>Mountain bike trials</strong></figcaption></figure><p>The <a href="https://developer.chrome.com/origintrials/#/trials/active">Origin Trials</a> are a way for Chrome to experiment with new features before making them available to all users. Origin Trials for the Topics API started in April 2022. By design, Origin trials only run on a very small portion of overall Chrome Traffic. Indeed only opt-in users, using Chrome 101 <a href="https://www.google.com/chrome/beta/">Beta</a> or above, surfing on websites having enabled Origin Trials, can lead to a topic set output. At Weborama we have collected Topics API output whenever it has been possible in the European market. User opt-in and site opt-in requirements lead unsurprisingly, a fortiori in the European Market, to a low volume of data. By means of example, in our surfing history data on the FR market, records with topics represent only around 0.001% of the total traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*AdEnSlrFzhJibOluuuHk6g.png" /><figcaption>Example of Topics API output obtained for a web visit</figcaption></figure><p>As explained in the two previous episodes, Topics mechanism relies on a classifier which maps web hostnames to topics. When a user visits an URL, the classifier takes as input only the host part of the URL, attaches topics to the visited URL and then builds Topics browsing history for the user. During Origin Trials multiple classifier model versions have been released. We have recorded 5 different versions with the following volume:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*RKYMN7rph9C4ceuSNK2ZgA.png" /><figcaption>Number of hits per model version</figcaption></figure><p>Note that the version name corresponds to the date of the release. Each version corresponds to a different experiment. Each model is used in a separate process. This means that, for example, the process involving the model version <em>2206021246</em> is completely unaware of what happened with the model version <em>2205161354</em>. So to explore output obtained from the Topics API, we decided to only focus on one model, the model <em>2206021246</em> implying the highest traffic.</p><h3>Volume Evolution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*vOCVTfV7bbcRJYSX" /><figcaption>Number of Topics API outputs per day (including all model versions)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/0*Hp4FZUSVbsoupqcT" /><figcaption>Number outputs per day, model version <em>2206021246, </em>with conditions on the number of topics present in the output.</figcaption></figure><p>The picture above reflects well an aspect of the <a href="https://github.com/patcg-individual-drafts/topics">specific details</a> described in the documentation of the Topics API. As a reminder, the API returns for a user a maximum of 3 topics, each one associated to a different previous epoch (week) of the web surfing history of the user. That’s why it is not surprising to see a one week shift between the beginning of the increase of the blue, orange and green curves. Similarly, to get Topics output for a user on a specific website, we need to wait at least one week after the first time the user has been seen. This is the time needed to compute the user’s top 5 topics based on his web surfing history. That is why the blue curve does not start straight after the model <em>2206021246 </em>was released<em>.</em></p><p>We also notice that the curve presents week seasonality corresponding to classic Web traffic seasonality in Europe.</p><h3>User exploration</h3><p>Topics Origin Trials happen in a context where cookies are still available, making it possible to collect cookie IDs alongside Topics output. Thanks to cookie ID collection, we can get the set of users involved in the Origin Trials in our surfing history database and draw a profile of Origin Trials web users.</p><p>As a reminder from the first episode, Weborama has created and maintained for several years a Generic Taxonomy covering many basic topics (e.g: baseball, dogs, literature, minivan …). Each one is linked to a list of lemmas allowing to score each Web URL upon the Generic Taxonomy segments. By extension, we can also score a web user upon the Generic Taxonomy by aggregating scores obtained on visited URLs.</p><p>In order to profile the set of users participating in the Origin Trials in the French market, we aggregated the Generic Taxonomy profile of those users. Then we removed bias from the results by transforming scores thanks to an uplift measure, taking as reference the whole set of users in our FR surfing history database. Thus we could highlight Generic Taxonomy subjects over-represented in the set of Origin Trials users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*UaD-Z0DSJvNxuKzP0kSoFA.png" /><figcaption>Top 10 GT over-represented segments in the French market — Origin Trials population</figcaption></figure><p>According to the results, it seems that web users involved in Topics Origin Trials are <strong>“Tech-lovers”</strong>. Since users participate in the Origin Trials by opting-in, it is not very surprising to obtain such an aggregated profile, that could be assimilated to developers’ area of interests. Indeed only a very few web visitors are aware of the new Topics API and want to study it.</p><p>For the most curious, the topic in last position is <em>Reality Television</em>.</p><h3>Site Exploration</h3><p>Let’s now focus on the websites involved in the Origin Trials. Similar to users, websites need to opt-in to be taken into account in the Topics API process. During first part of Origin trials, we have encountered around 600 web domains, which is very small,. Note that this low number can be explained both by the site opt-in process, but also by the user opt-in process. Indeed, even if a website opts in, if there is no opt-in user visiting the site, it will never output topics.</p><p>Anyway, we have run the Chrome classifier model on collected domains. In addition to the model, Chrome has provided a manual annotation file mapping around 10K very popular domains to topics.The file annotation prevails and overrides classifier output for those domains. All in all, we have classified the domains involved in Origin Trials in our surfing database. We see that only 56 topics among 349 topics are represented among the domains collected. Below the top 10 topics with highest traffic attached to domains during Origin Trials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*8ofCTDNUCrgG04VH" /><figcaption>Percentage of Origin Trials traffic covered by topics assigned to domains</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*Xjss9qiwoQIMaLD-ZiKVjg.png" /><figcaption>Example of topics attached to domains</figcaption></figure><p>The table above shows examples of topics mapping to domains. The source indicates if topics were obtained thanks to the classifier or thanks to the manual annotation list which overrides classifier results. We see that the model encounters difficulties to correctly classify the <a href="http://www.mma.fr/"><em>www.mma.fr</em></a><em> </em>website which is a famous French insurance company. Indeed, as the model relies only on the domain name, results got mixed up with the MMA martial art. Anyway, from what we see, globally the model works well. The <a href="http://www.leboncoin.fr/"><em>leboncoin.fr</em></a><em> </em>example illustrates well the loss of information when operating at domain scale, especially for domains tackling lots of topics. Did the leboncoin visitor search for DIY tools or laptops when visiting the website?</p><p>It is important not to be confused between Topics attached to domains, and Topics output by the API on a web visit. The first one corresponds to topics tackled by the website while the second one corresponds to topics drawn from the past surfing history of the user.</p><p>Besides, while we have found only 59 different topics when exploring topics attached to domains, we have found the whole 349 topics in API outputs. The additional 290 topics come from random topics elected with a 5% probability. Indeed, the API outputs with a 5% chance a topic randomly chosen among the full taxonomy. Although a caller only sees, for a user, topics corresponding to sites it has observed the user visit, topics elected by the random mechanism escape this rule, explaining why we were able to catch the whole 349 topics even if domains we have collected only covered 56 topics. In our case, decoding one of those 290 does not make any sense as we are sure they were picked randomly and do not correspond to any web behavior.</p><p>In the chart above, we see that <em>News </em>topic domains covered more than 30% of the traffic during Origin Trials in our database. Because this topic is often attached to domains, by construction most users will have <em>News </em>topic in their top 5 web navigation topics thus leading to Topics API outputs containing most of the time <em>News </em>topic. For Origin Trials, at user scale, this can be a bit deceiving because it dilutes information and avoids, in a way, tracking in the past web navigation of the user that makes them different from other users.</p><p>Let’s see below the distribution of topic sets obtained by the Topics API during Origin Trials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*serYV33PKEELLiuf" /><figcaption>Topic set distribution during Origin Trials</figcaption></figure><p>As expected we see that most topic sets are equal to “News”, an information which has little value.</p><h3>Back to simulations</h3><p>From what we said previously, values at user scale will only exist for some users visiting a lot of specific topics on the web. But “average” users not having a strong connection with a specific topic, risk to always output common “high traffic” topics in the database such as “News” in our case, and random topics. Here, due to the low volume of records during the Origin Trials, because of opt-in mechanisms on both user and site sides, it is difficult to make a deeper exploration involving statistics to compute a “dilution factor” in order to see to what extent this phenomenon impacts tracking. But we can expect that in a higher volume context, for example if Topics API were made available to every Chrome users, this “dilution” could not be a real problem. Indeed, it will act as a filter which will only reveal users very attracted by a topic and reject “average” users. Volume being high, the set of filtered users should be enough to reach a good audience. We just have to be cautious regarding “rare” topics which could come from random scenarios. When dealing with an “average” user returning common and less informative high traffic topics, an adtech actor could always use contextual targeting on the url. It would be possible to switch and/or combine Topics API output with a contextual approach.</p><p>Topics API mechanism could evolve in the future and actors could expect that it will integrate, inside the pipeline, an uplift correction when building the top 5 topics attached to a user to detect weak signals instead of common high traffic topics. At this step, this is discussed but only an hypothesis.</p><p>Anyway, when doing macro studies such as Decoding Topics, Topics API output brings lots of information. Indeed with huge amounts of data, we can collect a high number of topic sets which are not very common and thus with the help of uplift metric applied at the end of the pipeline, we can highlight interesting insights. That’s what we have done in previous episodes by building a simulation of Topics API in our full GB market database.</p><p>When writing episodes 1 and 2, we did not know how to attach topics to domains. That’s why we had used a Word2vec model to generate a list of lemmas describing each topic and then scored domains by detecting key lemmas in the content of URLs being part of a domain. However, as part of the Origin Trials, Chrome provided publically the model to attach topics to domains. So, we relaunched our simulation by replacing the <em>Domains to Topics</em> mapping step of the pipeline by the true Chrome classifier model.</p><p>We run our Decoder tool upon the topic: Games/Computer &amp; Video Games. To have a better understanding of the way the Decoder works, you may refer to <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">episode 1</a>. Below we show obtained results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*en_cs99ajAwHKEjV" /><figcaption>Most over-represented co-occurring topics with Games/Computer &amp; Video Games</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/0*j5zAu7_qsbWFjunI" /><figcaption>Most over-represented domains with Games/Computer &amp; Video Games</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*ePyuRe2v299Dh4e9ok6PNg.png" /><figcaption>Most over-represented Generic Taxonomy segments with Games/Computer &amp; Video Games</figcaption></figure><p>Pictures above show that the mapping proposed by Chrome is accurate enough, even if operating only on the domain name, to get interesting insights and to make a macro study of topics output. Keep in mind that high traffic domains are manually annotated and stored in an override file, so even if the classifier could be wrong regarding some domains, important ones are perfectly mapped. Moreover, at a big scale, we collect enough not diluted information to be able to describe a particular topic. Those observations bring hope into the Topics API.</p><p>To go further in this direction of a macro study and illustrate how we can combine a contextual approach with the Topics API output, we designed a new tool aiming at profiling a domain/URL. The purpose is to build the behavioral profile of a domain/URL by highlighting over-represented topics returned on a domain/URL. The tool works as follows. It looks for all entries in the surfing history where the domain/URL is involved. Then it collects all topics returned on these hits. Thanks to an uplift metric, we can get over-represented topics. This set of top topics characterize the most probable area of interest of users visiting the domain/URL. In a nutshell, the tool gives insights about the behavior profile of a site visitor.</p><p>Below results obtained on the domain <a href="http://www.planetf1.com/">www.planetf1.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*U8PmOQTGnUbngD8r8NLhCQ.png" /><figcaption>User’s behavior profile of <a href="http://www.planetf1.com/">www.planetf1.com</a> website</figcaption></figure><p>For example, an adtech actor could take advantage of a macro observation of Topics API to learn that he could target <em>Classic Rock &amp; Oldies </em>lovers by targeting <a href="http://www.planetf1.com/">www.planetf1.com</a> visitors. In a cookieless world, this is impossible to do for a third party player, making Topics API valuable. This illustrates well why the dilution aspect of the Topics mechanism is not that crucial.</p><p>To sum up, when facing a hit with common user topic set output, resulting from the dilution effect, it could be possible to use a contextual approach or the domain behavioral profiler presented above. This would lead to more reach. When facing specific and less common topics, it would be possible to target them directly based on the topic set output with a high accuracy — except if it comes from the random selection process of course.</p><h3>Conclusion</h3><p>This post detailed observations we made as part of Topics Origin Trials. Even if the volume collected was low, we could get enough data to illustrate Topics API mechanism, showing the epoch system, and observing the random selection process. Low volume was also enough to describe the potential dilution effect.</p><p>Topics Origin Trials brought with them the method to map topics to domains which was unknown during previous posts. It was the occasion to re-do some simulation taking into account this new piece of information. We discover that observations made during <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">episode 1</a> and <a href="https://medium.com/weborama/decoding-google-topics-2-2-8415b14d11f7">2</a> remain relevant today with this mapping. Furthermore, it encouraged us to develop a new tool aiming at building a domain/URL behavioral profile, thanks to the Topics API output. Such a tool could help third party players obtain insights on a domain/URL audience without owning any first party data.</p><p>We noticed that Origin Trials population has started to increase significantly since August and will continue to increase a lot in the future, as July 27th <a href="https://blog.google/products/chrome/update-testing-privacy-sandbox-web/">Google blog post</a> states. Google aims at expanding trials to millions of users globally, opt-in process will remain but it will be simplified by a prompt message giving users option to participate, instead of proposing a more technical enrolling process as done in the first part of Origin Trials. Future exploration will rely on a higher volume context. We’ll get back to this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d91053911d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/decoding-google-topics-3-3-5d91053911d1">Decoding Google Topics (3/3)</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding Google Topics (2/3)]]></title>
            <link>https://medium.com/weborama/decoding-google-topics-2-2-8415b14d11f7?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/8415b14d11f7</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[adtech]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Nicolas Tastevin]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 13:56:19 GMT</pubDate>
            <atom:updated>2022-09-12T14:18:12.592Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*eZ51uXqV9tITHzmzZcXVDg.png" /></figure><p>In the <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">first episode</a> we presented a faithful simulation of the Topics API, the new Google initiative to enhance privacy on the Web while preserving the behavioral ad tech industry. This simulation was based on Weborama Surfing History database, allowing us to test the Topics API behavior <a href="https://blog.chromium.org/2022/03/what-to-expect-from-ps-testing.html">in advance</a> and to share some observations before its broad release. We also introduced the Decoder which aims at decoding a Google topic set (up to three topics), with bar-charts showing co-occurring topics, dominant web domains for a topic or a topic set, representative lemmas (words) and correlated Weborama Generic Taxonomy semantic segments.</p><p>The first study revealed hidden connections between simulated Google topics, the possibility to build insights based on topics, and the potential gain for a marketer to study topic combinations before launching a digital campaign. First observations encouraged us to pursue our Topics API simulation, and see how we can leverage this thanks to the use of semantic AI tools.</p><p>As a quick reminder, a caller requesting the Topics API at the time of the visit of a web user on a URL will receive at most three topics related only to the past web navigation of the user. This will help AdTech companies to market campaigns based on user behavior in a cookieless world. And this can come in addition to contextual marketing directly inferred from site content.</p><p>We are now going to see how interest based ad targeting may survive in a cookieless environment, or even be reinforced in certain conditions, and how we could do the most of the solution proposed by Google. What’s at stake for us at Weborama, and for many other companies of the AdTech sector is the evolution of the Product offer. For instance: how should a behavioral targeting feature be adapted to Topics API, and lead to campaigns targeted on complex topic sets (combinations)? How could a contextual tool be strengthened by the Topics API?</p><p><strong>TL ; DR</strong></p><p>This article describes ways an AdTech could benefit from the Topics API for digital marketing:</p><blockquote><em>The Topics API can be exploited in order to enhance </em><strong><em>contextual targeting</em></strong><em> with the help of semantic similarity algorithms, and dataviz tools</em></blockquote><p>i) a topic set can directly lead to a web inventory — that is, a set of web pages — thanks to a tool like the Decoder:</p><ul><li>this set of web pages (URLs) can be used as is for contextual targeting (<em>from Google Topics to Contextual Targeting</em>)</li><li>the URL list can be amplified and turned into a web contextual inventory thanks to the use of lookalikes computed via semantic AI (w2v or SBERT): reach may be increased</li></ul><p>ii) another way is to extract insights from the inventory directly matching the topic set:</p><ul><li>this would allow the user to answer the question: what kind of content is truly, deeply, behind a Google topic set? Is there something more than just a label? Is the content attached to a label, or a few labels (on the intersection mode) consistent? How specific may it be?</li><li>in order to achieve this, we use SunFish, a Weborama interactive visualization tool allowing the exploration and selection of semantic segments</li><li>these semantic segments may then be used as a basis in order to build a matching web inventory</li></ul><blockquote><em>The Topics API can be used for rich semantic </em><strong><em>behavioral targeting</em></strong><em>, thanks to a recommendation engine</em></blockquote><ul><li>a user may enter words, explore the semantic universe, create a custom segment, and this can be translated into most representative, specific, topic sets, for behavioral targeting</li></ul><h3>Use Case</h3><p>Let’s consider an organization — for instance, the website nature.org — promoting an ecology event with a digital campaign. Obviously, they can start by directly targeting websites with ecology content. But such a simple interpretation could lead to low volumes and to an audience made of environment-conscious people only.</p><p>Nature.org would have to find connected topics, typical user behaviors to broaden their target and maybe draw the attention of people showing similar navigation patterns.</p><p>Google Topics API aims at solving this. In this case, the organization targets topic sets including either <em>Science/Ecology &amp; Environment</em> or <em>Food &amp; Drink/Cooking &amp; Recipes/Cuisines/Vegetarian </em>or <em>Cuisine/Vegan Cuisine.</em> But, due to the special randomness of the Topics API (one topic is selected among the user’s <strong>top</strong> five per week), volumes would be lower than the ones obtained with a classic cookie based scenario. In other words, a user slightly interested in ecology will not be associated with this Google topic (because it would not be in the user’s top 5), and may not be even if the topic is a great interest for them, simply because of the randomness in the process.</p><p>Moreover nature.org would have no control over what’s behind those Google topics, and cannot be sure they are accurate enough for the campaign’s purpose. That’s why we think it is important to start by decoding in depth a topic set, and we do this by generating rich visual insights.</p><h3>Visual Semantic Insights</h3><p>In addition to drawing bar charts, the <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">Decoder</a> allows users to download the set of URLs derived from a topic set. Those URLs are simply all the URLs where the Topics API has returned a combination of topics which includes the targeted topic set. Due to the behavioral property of the Topic API, it is important to keep in mind that a URL derived from a topic set does not necessarily embed content directly related to it. That’s why decoding the set of URLs obtained thanks to visual semantic insights should bring added value and widen the area of interest of web users attached to the topic set in the first place.</p><p>Weborama’s semantic tool, SunFish, allows the description of a corpus via word bubbles organized hierarchically and grouped according to semantic similarity. (Nota Bene : insight extraction is not limited to web content and can be performed on various kinds of sources. For example, the <a href="https://medium.com/weborama/ai-big-brother-ea79e8d09bd4"><em>AI &amp; Big Brother</em></a> post demonstrates how visual semantic insights may suggest a new reading experience of the novel <a href="https://en.wikipedia.org/wiki/Nineteen_Eighty-Four">1984</a>. Visual insights may also be applied to encyclopedic content like Wikipedia which we commonly use at Weborama, in particular but not only for training purposes.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vRX7P8puHjZl9Xop" /><figcaption>View of a corpus about <em>Ecology</em> (source Wikipedia)</figcaption></figure><p>The hierarchical lemma bubble view can have up to 4 depth levels. This means a lemma bubble may have one parent, one grandparent, one great grandparent bubble. For instance, the lemma <em>wildfire </em>is included in the <em>Natural disasters </em>bubble, itself included in the <em>Phenomena </em>bubble, itself included in the <em>Natural environment </em>bubble.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/0*Octr6roJMfaVvsAO" /><figcaption>Zoom in on a depth-2 bubble <em>Natural Environment</em></figcaption></figure><p>SunFish Bubble View relies on 4 big tech modules:</p><ul><li>a lemmatization module whose goal is to transform a text into canonical forms of inflected words called lemmas</li><li>a keyword extraction module inspired from the <a href="https://en.wikipedia.org/wiki/PageRank">page rank</a> algorithm, which is a good compromise between fast computational time and accuracy</li><li>a custom hierarchical clustering algorithm (dendrogram computation)</li><li>a bubble tagging method allowing to assign a common concept label to a set of lemmas. (Nota Bene: this has been and remains a challenge for many reasons. First, no rule could be established from global occurrence on the web. Parents could be less specific than children (e.g:<em> sports</em> is more present on the web than <em>handball), </em>or parents could be more specific than children (<em>immunology</em> is less present than <em>vaccination</em>). Also, a lemma can have a huge number of acceptable parents (e.g: <em>Iphone</em> could belong to <em>smartphone</em>, <em>Apple product</em>s…)</li></ul><p>But let’s go back to our use case — Nature.org.</p><p>The organization feeds SunFish with the ensemble of URLs obtained with the decoder, matching the desired topic sets. We expect to get a very different Bubble View than the one corresponding to a Wikipedia corpus. For two reasons : a) content is web content, and not encyclopedic ; b) this is subtle difference : it’s a user-centric approach since content will come from sites visited by users interested in Ecology, and not a site-centric approach where content would be directly parsed from sites about Ecology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*roQjE0S7lnsDTnkP" /><figcaption>Bubble View of {Ecology, Vegan} (source Google Topics API)</figcaption></figure><p>Without any surprise we encounter vocabulary about weather, animals, edible fruits, nuclear etc. Those segments can be selected, refined, and activated for a contextual campaign. Other segments, having an indirect connection to the underlying topic, such as <em>Social Sciences</em>, may be explored before taking actions. As we zoom in on this bubble, sub-bubbles appear, including one tagged with <em>childcare</em> which is itself divided into new sub-bubbles as we can see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*opxs_DdayNGwOZDW" /><figcaption>Zoom in on the <em>Social Sciences</em> bubble</figcaption></figure><p>The client, nature.org, can use SunFish in order to explore the corpus, and highlight some selected lemmas, this will give context:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/0*qajt1q_M8hmVlkbj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/0*kLYy5MEfIE0wVu-D" /></figure><p>Now we understand that web users flagged with the topic set {ecology, vegan} visit websites about parenting, family life. Knowing that, in our use case, the client can create an accurate semantic segment set about parenting, childcare, working mom, to get a bigger audience for their contextual digital campaign. They could also quickly decode the <em>People &amp; Society/Family &amp; Relationships/Parenting </em>Google topic so as to decide whether to include this topic or not in the campaign.</p><h3>Enriching the Contextual Campaign</h3><p>As we’ve seen, using visual semantic insights will help to go beyond the obvious and create large and specific contextual campaigns based on lemma segments. The visual insights also confirm in a way the relevance of the chosen topic set. Another possibility for nature.org is to directly use the URLs obtained with the decoding phase as an advertising inventory. Targeting a URL inventory presents some advantages and drawbacks over targeting topic sets.</p><p>A URL set can be enriched using AI methods, based on URL similarity calculation. At Weborama, we built a set of algorithms solving this problem with various strategies. Most techniques rely on URL content — it comes to vectorizing the content in space where proximity between URLs is measured thanks to a <a href="https://scikit-learn.org/stable/modules/metrics.html#cosine-similarity">cosine similarity</a> metric. We used <a href="https://en.wikipedia.org/wiki/Word2vec">w2v</a> to take advantage of our <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">lexicon</a> on the one hand, and on the other hand with the help of transformers and state of the art deep learning techniques. Another direction is to embed a URL according to User Surfing History. The algorithm mimics the philosophy of the skip-gram w2v implementation, but using sequences of consecutive URLs visited by a user as input, instead of sentences made of lemmas. We call this “Prime Profiling”.</p><p>However the traffic of a web page is evolutive and a URL can have a large traffic only during a short period of time. That’s the case of course of news articles and blog sites. That’s why targeting a fixed inventory of past URLs could lead to a poor audience, which is not the case a priori regarding topic sets since these are frequently refreshed and returned on the fly each time the API is called. But contextual targeting may also be operated in a streaming mode, where new URLs are constantly feeding the inventory. Furthermore, a temporal model allows us to predict the future of a URL in terms of traffic. This is useful to see to what extent the URL set is ephemeral, and thus to anticipate the volume.</p><h3>From Custom Semantic Segments to Google Topics Behavioral Targeting</h3><p>So we have described an approach which starts with a topic set. We decode the topic set, explore and create a taxonomy, build an inventory of URLs ready for contextual targeting : <em>From Topics to Contextual</em>. But another strategy would be to use a reciprocal process: starting with a custom taxonomy made of words owned by the brand, and create a list of relevant matching topic sets that can be used for behavioral targeting: <em>From Custom Semantic Segments to Behavioral.</em></p><p>Classically when building a cookie based behavioral campaign, we begin by elaborating a taxonomy of topics we want to target. We collect past data, user IDs visiting websites matching the taxonomy. Then we activate the audience. Allowing marketers to construct taxonomies is crucial. The more the lemmas in the segment, the more accurate they are, the bigger the volume of relevant user IDs will be available for the client. We are going to check how this method can lead to Google topic sets and not cookies or user IDs.</p><p>Here is a snapshot of the recommendation engine we use to build semantic segments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b6J832KYZDFFKPEf" /><figcaption>MoonFish in action</figcaption></figure><p>The user enters a seedword, a word representing its taxonomy, and the engine will recommend lemmas that can be added into the taxonomy. The user gets a real time audience estimation: numbers of cookies or IDs matching the words. The accuracy of the engine depends in particular on the underlying lexicon, its capacity to handle N-grams and disambiguation. We <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">emphasized</a> for instance that bigrams usually are more specific than unigrams. Let’s illustrate this fact by comparing the recommandations obtained with the unigram <em>climate, </em>used as seedword, to the ones obtained with the bigram <em>climate change</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/0*eRlZMHhROST3-GCC" /><figcaption>Recommendation for a unigram</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*1TtCChmLhDE8vbW4" /><figcaption>Recommendations for a bigram</figcaption></figure><p>In a cookie-less world, collecting user IDs becomes impossible for third party players. <strong>But we can adapt the strategy by replacing the collection of user IDs by a collection of topic sets.</strong></p><p>In our use case, the client nature.org creates in MoonFish, Weborama’s product, a custom segment of lemmas representing the Ecology theme with the recommendation engine. Then MoonFish will filter the Surf History table on URLs matching this segment and collect Google topics returned by the Topics API on those touchpoints. Thanks to an <a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">uplift metric</a>, the adapted MoonFish will draw a bar-chart presenting dominant topic sets on the matching corpus of URLs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xx06nZ3wYd9HczPu" /><figcaption>Topics MoonFish Creation Menu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c1cvgOmhdqk5p-al" /><figcaption>Topics MoonFish Exploration Menu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a2LLfUkxRm0NYD9b" /><figcaption>Bar Chart Zoom</figcaption></figure><p>Let’s have a close look at the returned topic sets. The combination {<em>Food &amp; Drink, Early Childhood Education, News/Weather</em>} appears in first position and confirms SunFish previous insights exploration about childcare.</p><p>Regarding the <em>Ecology &amp; Environment</em> topic, it appears in the fifth topic set. One can wonder legitimately why this topic does not belong to the top topic set. The thing is that Google Topics aims at synthesizing past navigation of users — Topics are derived from browsing behavior patterns. And most people visiting URLs related to ecology do have other areas of interest in life. For example, environment-conscious people are overrepresented among students, maybe searching for a solution to finance their university tuition with a personal loan, and this could very well explain the presence of the Loans topic.</p><p>Moreover, Google Topics decided to assign topics at the domain level while a web visit happens at the finer URL level. As a consequence, a news website domain dealing with multiple society subjects (politics, sports, economy, people, justice, ecology …) will not necessarily be related to {<em>Ecology &amp; Environment} </em>even if it publishes a large amount of ecology articles. In fact, websites focusing especially on this topic will have higher chances to be profiled with this topic. And so, in our example, apparently many URLs dealing with ecology belong to domains not restricted to ecology. This is consistent with the coarse grained approach purposely established by Google.</p><p>That’s why converting a custom taxonomy into a collection of topic sets is essential to reach a large audience. Limiting the activation to the <em>Ecology &amp; Environment</em> a priori matching topic would result in capturing only people frequently visiting specialized ecology websites, people strongly involved in the cause.</p><p>The client may finally activate a campaign by targeting the obtained topic sets. They now have full control regarding the description of their audience, in a more accurate and flexible way than just choosing directly coarse grained Google topics. Also, this reciprocal process allows clients to design behavioral audiences in areas that do not exist in the Google Topics Taxonomy. In a way, the adapted MoonFish acts as a <em>Custom Taxonomy ⇒ Google Topics </em>converter.</p><h3><strong>Conclusion</strong></h3><p>This post shows how, as a player of the AdTech industry, we can make the most of the Topics API as it is presented by Google, in order to enhance both Contextual and Behavioral Targeting. All this preliminary work has been possible due to a simulation of Google Topics API, the official API not being available broadly at the time this article has been written. Topics are currently testable (via the JavaScript API) in the <a href="https://www.google.com/intl/fr/chrome/canary/">development version of Chrome: Canari</a>, by activating the experimental flag privacy-sandbox-ads-apis.</p><p>The trials have been <a href="https://groups.google.com/a/chromium.org/g/blink-dev/c/oTwd6VwCwqs/m/jPkW3T-mCgAJ?pli=1">announced by Google</a>, and Google also <a href="https://privacysandbox.com/intl/en_us/open-web/#:~:text=Fight%20spam%20and%20fraud%20on%20the%20web%20proposals%20phases%3A%20Testing,%2C%20stage%202%3A%20Q3%202023.&amp;text=OT%20STARTED%3A%20The%20Trust%20Tokens,open%20since%20Q3%20of%202020.">shares a timeline for the privacy sandbox</a>. Once Topics get deployed in the real world (meaning, available by default on real Chrome instances on the web), we’ll be able to collect them on our network, and to describe real world tests with observed and collected Google Topics data. How will a 3rd party player be impacted by Google’s strategy, limiting the scope of accessible data? What will the distribution of topics on URLs look like? Will Google use a <a href="https://github.com/patcg-individual-drafts/topics/issues/42#issuecomment-1033828347">TF-IDF strategy</a>? This is something we would be able to observe and monitor. What may be expected in terms of accuracy, reach, and of course, performance? This will be for our next episode.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8415b14d11f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/decoding-google-topics-2-2-8415b14d11f7">Decoding Google Topics (2/3)</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding Google Topics (1/3)]]></title>
            <link>https://medium.com/weborama/decoding-google-topics-9356502105ba?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/9356502105ba</guid>
            <category><![CDATA[adtech]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[google-topics]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Nicolas Tastevin]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 17:01:54 GMT</pubDate>
            <atom:updated>2022-09-12T14:17:52.260Z</atom:updated>
            <content:encoded><![CDATA[<p>At the beginning of 2020, Google announced the Privacy Sandbox initiative designed to enhance privacy on the Web, making third party cookies obsolete. But the AdTech ecosystem and interest-based advertising have been relying on third party cookies and Chrome represents around<a href="https://gs.statcounter.com/browser-market-share"> 65% of browser market share</a>.</p><p>In order to both ensure user privacy and preserve the advertisement business, Google envisaged, among other things, a controversial <a href="https://privacysandbox.com/proposals/floc">FLoC</a> (Federated Learning of Cohorts) proposal. Chrome users would be aggregated into cohorts depending on their surfing behavior, and these cohorts would be communicated to third party players. However Google recently dropped this solution since FLoCs would add fingerprinting surface — <a href="https://www.reuters.com/article/alphabet-google-advertising-privacy-idCNL1N2U41TE"><em>the system carried the risk of exposing an individual’s browsing history</em></a>, according to Google product director Vinay Goel. Now the Topics API, driven by the aim of providing more human-understandable transparency, replaces FLoC. Topics involve a certain amount of randomness and are supposed to be a lot less granular than FLoCs, at least when they’re considered individually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*LZ9JvjKiuIByuL9HnCgD3Q.jpeg" /></figure><p>What could we expect from the Topics API, in terms of insights, interest-based ad capabilities, and of course, performance?</p><p>Trying to answer these questions, thanks to in-house NLP and semantic AI tools, is the purpose of our series of articles.</p><p>As we’re writing this first episode, Topics proposal has not yet been launched for testing. Trials <a href="https://www.mindmedia.fr/adtechs-martechs/privacy-sandbox-google-va-lancer-les-tests-pour-ses-api-fledge-topics-et-attribution-reporting/">have just been announced</a>, but we’ve decided a while ago not to wait for the trials and to start exploring the subject by building our own <strong>simulations</strong>, relying on the collect data accessible to Weborama’s Data Science Team.</p><p><strong>Too Long ; Didn’t Read</strong></p><ul><li>Google is replacing the FLoC initiative by <a href="https://blog.chromium.org/2022/03/what-to-expect-from-ps-testing.html">Topics API</a> which is supposed to provide less granularity in terms of insights (but to what extent?), and to be more efficient regarding privacy.</li><li>Weborama wants to question the Topics API approach: usefulness for behavioral targeting, richness of information and insights, consistency, contextual targeting opportunities.</li><li>Topics not being available yet, Weborama has decided to start working on data computed based on Surf History thanks to semantic AI, reproducing Google’s announced methodology: we’ve launched simulations, and we’ve built a Decoder app.</li><li>The Decoder allows us by design to understand what a topic or a topic set is actually made of, semantically speaking: what are its representative lemmas (words)?</li><li>First results from the Decoder let us believe that there will be insights when considering not only topics, but topic sets (up to 3 topics combined), making these combinations relevant for behavioral targeting.</li></ul><h3>Google Topics briefly explained</h3><p>We won’t deep dive into the Google Topics process, you may check the <a href="https://github.com/jkarlin/topics">Topics Github</a> if you’d like to have a close look.</p><p>A reminder of the key Topics API concepts should be enough to follow the process of the experiments described further. Third party players calling Chrome Topics API will receive a set of maximum 3 ad topics (this set is referred to below as a <strong>topic set</strong>) for a page visitor — one topic per past week. Thus AdTechs will be aware of user interests without receiving any kind of identity information.</p><p><strong><em>Topics selection process</em></strong></p><p>A web user surf history is divided into 7 day epochs by Google. For each of the last 3 complete epochs, the top 5 most visited topics on web pages (NB: topics for a web page only depend on the page’s domain, all web pages within a domain get the same topic profile according to Google’s methodology) are retained. 1 additional random topic is considered. Then with a 95% rate, 1 of the top 5 topics is selected randomly per epoch. The remaining 5% times, the additional random topic is selected. Whatever topic is selected for a given epoch, will continue to be returned for a third party player on that site for the three following epochs. A caller will not get topics inferred from the navigation of the user on sites outside of the caller’s observed touchpoints.</p><p>In a nutshell it is important to keep in mind those two concepts:</p><ul><li>The non ordered topic set returned for a call made on a site visited by a user remains unchanged during a full epoch</li><li>Sites visited weekly will learn at most one new topic per week per user</li></ul><p>Due to the randomness injected in the selection process, different sites often get different topic sets for the same user, making it hard to cross-identify the user. This strongly encourages privacy.</p><h3>Weborama’s simulation</h3><p><strong><em>Assigning G-Topics to domains</em></strong></p><p>Google provides an<a href="https://github.com/jkarlin/topics/blob/main/taxonomy_v1.md"> initial hierarchical taxonomy</a> containing 349 topics such as “Sports”, “Sports/Skiing &amp; Snowboarding”, “Finance”, “Finance/Insurance/Health Insurance”, etc. The first thing we have to do is to assign a maximum of 5 of these Google topics organized in tiers to every domain site in Weborama’s database.</p><p>Weborama’s Surfing History database records touchpoints (visits) of users (cookies) on web pages in the scope of our collect layer. We store data such as the visitor id, the url, the date of the touchpoint. In addition we extract the content of the page and lemmatize it. Lemmatization is a Natural Language Processing task, aiming at transforming a text into canonical forms of inflected words called <strong>lemmas. </strong>Lemmatization and morphosyntactic analysis facilitate<strong> </strong>text mining operations using AI tools. These tasks also include challenges such as N-gram grouping and disambiguation. As a rule of thumb, bigrams are often less ambiguous than unigrams, three-grams less ambiguous than bigrams, etc. Think of words like “Roissy Charles de Gaulle” (which refers directly to the airport) — disambiguated compared to “Roissy” (city), and “Charles de Gaulle” (person), or the 4-gram “12 year old whiskey”, which has a complete different meaning than “12 year old”, and is more specific than “whiskey” or even “old whiskey”. Part of speech tagging and disambiguation are enhanced when relying on an up-to-date lexicon. Weborama’s lexicon is continuously enriched with filtered, annotated, “realistic”, Web data.</p><p>For every topic in the taxonomy suggested by Google, we started by automatically generating a list of specific lemmas belonging to the topic. Then we scored domains by looking up (that’s what we call semantic matching) these lemmas inside lemmatized URL content. Lists of lemmas have been established thanks to the <a href="https://en.wikipedia.org/wiki/Word2vec">W2V model</a>, a model learning semantic proximity between lemmas. When a Google topic is entered as input, the model will recommend a list of lemmas corresponding to the topic. Historically, the W2V algorithm has been broadly used in Weborama products. We periodically retrain such a model on the corpus made of lemmatized web pages in our database, leading to very accurate and unique word embeddings. That’s why we decided to use these embeddings to score domains. In addition, we included a normalization phase to make sure that low level, specific, tier-2 or tier-3 topics get a higher chance to be assigned to a domain, rather than high level, more common, topics (e.g. “Pets &amp; Animals/Pets/Dogs” vs. “Pets &amp; Animals”).</p><p>Example for the “Beauty &amp; Fitness/Fitness/Bodybuilding” tier-3 Google topic.</p><p>Here is a list (sample) of lemmas matching the topic:</p><blockquote>[‘bodybuilding’, ‘bodybuilder’, ‘powerlifting’, ‘Dorian Yates’, ‘Mr. Olympia’, ‘CrossFit’, ‘powerlifter’, ‘Phil Heath’, ‘Functional Fitness’, ‘Ronnie Coleman’, ‘Olympic weightlifting’, ‘weightlifter’, ‘kickbox’, ‘Arnold Classic’, ‘weight training’, ‘weightlifting’, ‘calisthenics’, ‘IFBB’, ‘Mat Fraser’, ‘kickboxing’…]</blockquote><p>And here’s a list (sample) of domains within our collect perimeter matching the topic (we also show other matching Google topics) :</p><blockquote><a href="http://www.muscleandfitness.com/">www.muscleandfitness.com</a></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness</blockquote><blockquote>Sports/Running &amp; Walking</blockquote><blockquote><a href="https://strengthlevel.com/">strengthlevel.com</a></blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Sports/Gymnastics</blockquote><blockquote>Autos &amp; Vehicles/Motor Vehicles (By Type)/Hybrid &amp; Alternative Vehicles</blockquote><blockquote>Beauty &amp; Fitness/Face &amp; Body Care/Clean Beauty</blockquote><blockquote><a href="http://www.setforset.com/">www.setforset.com</a></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>News</blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Business &amp; Industrial/Business Operations/Flexible Work Arrangements</blockquote><blockquote><a href="http://www.bellamagazine.co.uk/">www.bellamagazine.co.uk</a></blockquote><blockquote>Home &amp; Garden/Home &amp; Interior Decor</blockquote><blockquote>Arts &amp; Entertainment/Concerts &amp; Music Festivals</blockquote><blockquote>Arts &amp; Entertainment/TV Shows &amp; Programs/TV Dramas/TV Soap Operas</blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Hobbies &amp; Leisure/Diving &amp; Underwater Activities</blockquote><blockquote><a href="http://www.t-nation.com/">www.t-nation.com</a></blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Sports/Running &amp; Walking</blockquote><blockquote>Internet &amp; Telecom/Web Design &amp; Development</blockquote><blockquote><a href="https://barbend.com/">barbend.com</a></blockquote><blockquote>Internet &amp; Telecom/Email</blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Sports/Running &amp; Walking</blockquote><blockquote><a href="https://powerliftingtechnique.com/">powerliftingtechnique.com</a></blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Beauty &amp; Fitness/Fashion &amp; Style</blockquote><blockquote>Arts &amp; Entertainment/Visual Art &amp; Design/Design</blockquote><blockquote><a href="https://fitnessvolt.com/">fitnessvolt.com</a></blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Home &amp; Garden/Home &amp; Interior Decor</blockquote><blockquote>Sports/Rugby</blockquote><blockquote><a href="http://www.trailrunningmag.co.uk/">www.trailrunningmag.co.uk</a></blockquote><blockquote>Sports/Running &amp; Walking</blockquote><blockquote><strong>Beauty &amp; Fitness/Fitness/Bodybuilding</strong></blockquote><blockquote>Beauty &amp; Fitness/Fitness</blockquote><blockquote>Arts &amp; Entertainment/Music &amp; Audio/Musical Instruments</blockquote><p><strong><em>Selecting the topic set</em></strong></p><p>Now that domains are characterized by 5 Google Topics max, the second part of the job is to emulate the Google Topics API behavior explained earlier. In order to do this we followed the details described in the<a href="https://github.com/jkarlin/topics"> Topic github</a>, and we took the discussed <a href="https://github.com/jkarlin/topics/issues">issues</a> into account. We wanted to go through all the process without making it simpler than it already purposely is.</p><p>Technically, this simulation hasn’t been done on the fly on streaming data. We used a BigQuery snapshot of our Surfing History data between September 2021 and February 2022. The idea was to backtrack the simulation and run it over 6 months. For example this period on the French market represents 3,728,664,822 web visits, 163,853,950 web users and 40,019,697 URLs.</p><p>The topic sets returned after a web visit have been added to each record of the Surfing History database, thus replicating, or rather, <em>anticipating</em>, real world data we should obtain when the Google Topics API is launched.</p><h3>Topics Decoder Streamlit APP</h3><p>In the past four years, we, the Weborama R&amp;D Data Science Team, have started to build our own (Flask/Python) Web Apps. And that’s what we did to explore our new Surfing History table enriched by Google Topics. But we’ve deviated from our Flask technology habit to test the popular and simple<a href="https://docs.streamlit.io/"> Streamlit</a> open-source Python library, which perfectly fits our needs here — mainly having to display bar charts.</p><figure><img alt="Home Page of the App" src="https://cdn-images-1.medium.com/max/800/0*VIikYvSQ6R4aucRX" /><figcaption>Home Page of the App</figcaption></figure><p>The web app is quite simple. The user selects 1, 2 or 3 Google topics, which will be looked up in our Surfing History table. Bar charts of the most important elements characterizing the topic set are then displayed:</p><ul><li>Lemmas (e.g. what are the most representative words on web pages related to a user interested in Gardening?)</li><li>Topics <em>co-occurring</em> with the entered topic set (e.g. if a user is interested in Electric Cars, what are his or her other interests?)</li><li>Weborama Generic Taxonomy segments (we will describe what this is further)</li></ul><p>Let’s take the example of “Lemmas” to explain how our Topics Decoder works.</p><p>Once the user has selected the topic combination they wish to inspect (example: {“Books &amp; Literature”, “Food &amp; Drink”}), they indicate the period of the desired study (example: February 2022).</p><p>The decoder starts by retrieving from our Web Surfing History table visits occurring on web pages, in the specified period, where the simulated Topics API has returned a topic set containing all the topics entered by the user. Then it counts the occurrences of every lemma appearing in these web pages. Simply ranking the lemmas according to their frequency would be naive because very common lemmas (“be”, “do”, “have” …) will most of the time have much higher counts than specific lemmas (“house music”, “apple pie” …). To solve this we prefer to use an uplift metric, which has the same spirit and goal as <a href="https://scikit-learn.org/stable/modules/feature_extraction.html#tfidf-term-weighting">TFIDF</a> . We need to both calculate:</p><ul><li>counts of lemmas in the <strong>global </strong>surfing history table on the desired period</li><li>counts in the<strong> local</strong> table (the one obtained after filtering the global table on the topics requested by the users)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*1ii8zckA2UV3lyzz" /><figcaption>Uplift formula</figcaption></figure><p>We also propose a set of options to the user for refined results but it is out of the scope of this article. All in all we obtain the following bar charts showing most important lemmas characterizing the topic set in a <strong>Google Topics Web Surf context</strong> (another approach would be to directly use topic assignments to Web pages, which corresponds in fact to an option in the Topics decoder):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*NRaLRFcpWJE3srnD" /><figcaption>Uplift of top 10 lemmas for the topic set {“Books &amp; Literature” , “Food &amp; Drink”}</figcaption></figure><p>We notice that the top lemmas could match a “cooking blog” vocabulary, which seems to be well related with the topic set {“Books &amp; Literature” , “Food &amp; Drink”}.</p><p>We also check the topics that are co-occurring with the ({“Books &amp; Literature” , “Food &amp; Drink”}) topic set entered by the user, and display a bar chart for the most relevant co-occurring topic, as it could be very useful, for our clients, to discover hidden associations between topics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*94epNtxrR8oeEZnn" /><figcaption>Top co-occurring topics with the {“Books &amp; Literature”, “Food &amp; Drink”} topic set</figcaption></figure><p>Using this type of representation, we may sometimes confirm expectations: we see here that the “Home appliances” topic often co-occurs in user profiles with the {“Books &amp; Literature” , “Food &amp; Drink”} topic set, and this seems to make sense. But thanks to this view, we also find out that “Jobs &amp; Education”, appearing in the 5th position, is correlated with the input topic couple.</p><p>Let’s now introduce the Weborama Generic Taxonomy. In order to analyze web URLs and build audiences, Weborama has created and maintained for several years a Generic Taxonomy. The philosophy is quite similar to the one we have constructed based on Google’s approach. The main difference is that the Generic Taxonomy is very detailed and accurate while the one we have emulated regarding Google Topics has been calculated thanks to W2V recommendations without any human annotation. It becomes interesting for us to visualize the Weborama Generic Taxonomy clusters and how they relate to Google Topics, using Surfing History data, to see what this kind of mapping could look like. We hope this can bring extra insights and widen results previously obtained with co-occurring topics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*8k_L9O_17uFvce06" /><figcaption>Top Weborama Generic Taxonomy topics describing URLs linked to the {“Books &amp; Literature” , “Food &amp; Drink”} topic set</figcaption></figure><p>As expected, Topics related to foods appear on top. But now we know <em>what kind of food </em>specifically. Moreover this view is consistent with the “co-occurring Google topics” decoding described earlier: “Kitchen Appliances” pops up again. The Decoder used with the Weborama Generic Taxonomy reveals that the cluster “Laundry” is not far away.</p><p>In the following episodes, we will see:</p><ul><li>How content can be derived from the Decoder, leading to the creation of visual semantic insights.</li><li>How this content can be used as is, or extended via Lookalike algorithms, or even broken down into specific semantic segments allowing therefore a bridge between Topics — made in the first place for Behavioral Targeting — and Contextual Targeting.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9356502105ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/decoding-google-topics-9356502105ba">Decoding Google Topics (1/3)</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI & Big Brother]]></title>
            <link>https://medium.com/weborama/ai-big-brother-ea79e8d09bd4?source=rss----1eed1a1cdf24---4</link>
            <guid isPermaLink="false">https://medium.com/p/ea79e8d09bd4</guid>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[big-brother]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[François J. Mariet]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 14:55:07 GMT</pubDate>
            <atom:updated>2022-03-24T14:55:07.070Z</atom:updated>
            <content:encoded><![CDATA[<p>Published in June 1949 while the author was slowly dying of tuberculosis, the novel <em>1984</em> is now more than 70 years old. The book entered the public domain in Europe in January 2021 and will enter the US public domain in 25 years (2046).</p><p>How should one read this novel now? Internal reading? External reading? Is it still contemporary? What does it tell us? What are the right tools for understanding what it says, beyond first appearances. Since its publication, and particularly during the Cold War, the novel has mainly been read as a description of everyday life in the Soviet Union. Back then, Joseph Stalin was the central figure, with his mustache and his smile: he was Big Brother, the dictator of the country according to <em>1984</em>, the boss of the one and only party and the chief of police (GPU, NKVD which managed the Gulags, <em>etc</em>.).</p><p>The novel more or less mirrors reality. The past reality first: the character Emmanuel Goldstein¹, “the Enemy of the People” represents Leon Trotsky, whose book, <em>The Revolution Betrayed. What is the Soviet Union and where is it going? </em>was published in 1936… The other inspiration is Nazi Germany (1933–1945) and, perhaps, Adolph Hitler’s <em>Mein Kampf</em>, published in July 1925.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/0*DBW4T1PaSHFrm58W" /></figure><p>This picture, reduced to just the face, is what Winston Smith sees everywhere, with the caption “BIG BROTHER WATCHING YOU”. “The face of Big Brother, black-haired, black mustachio’d, full of power and mysterious calm” was “on coins, on stamps, on the covers of books, on banners, on posters, and on the wrapping of a cigarette packet — everywhere.”</p><p>And now? People still quote George Orwell². For instance, in French: in a very recent re-edition of an essay by Jean-Paul Sartre on intellectuals, the preface quotes George Orwell³.</p><p>Artificial Intelligence, or more precisely Machine Learning, contributes to numerous fields such as medicine and healthcare, computer vision, speech recognition, multilingual translation and more. Many other applications are becoming decisive too, completing the vast ArtificiaI Intelligence family. We count an increasing number of subsets of AI and machine learning: biometric and facial recognition, Natural Language Processing (NLP), robotics companies, chatbots (conversational AI), <em>etc</em>. NLP, for instance, is present in many fields: hospital management, healthcare, life science, law or finance. Can computers understand human language? How well?</p><p>No-code software is for non-specialists, so we might go from data scientists to field-specialists. Not to mention other technologies: new blockchain startups, quantum computing companies and companies that might be developed tomorrow (metaverse, NFTs, <em>etc</em>.). None of these types of companies were present or even mentioned in <em>1984</em>. At most, we note television, which appeared just after the war, with the BBC in the UK or the major stations and networks in the USA. George Orwell may possibly have had an idea of the role television would come to hold in our societies. The “telescreen”, omnipresent and symbolic in <em>1984</em>, is always on. TV as it is mentioned in <em>1984,</em> has only one channel and uses Newspeak, the political language of Oceania, the country where <em>1984</em> is supposed to take place. One TV, one channel, one language: it is supposed to be mass media. How important is TV for us today? It is considered to be a mass media, although it increasingly targets only people who watch it: its targeting is mainly for advertising purposes. <a href="https://www.youtube.com/index?gl=FR&amp;hl=fr">YouTube</a>, <a href="http://weibo.com/">Weibo (微博)</a>, <em>etc</em>.,“social media” may become the media of the near future, media which targets people who want it. Television is a media which wants to be wanted. It may become a part of social media: television seduces.</p><p>How different is it from what we observe nowadays in countries where political and economic competition exists? Can we count on Artificial Intelligence to validate the news? Artificial Intelligence may not be powerful enough to remove hate speech and violent contents. In the novel, there is a program, “Two Minutes Hate”, that no one can avoid. That kind of program does exist in our societies but we can always turn off the TV, and people could choose to watch, or not, such a program. And although we have so many different programs, are they really so different? Karl Popper, the Austrian-British philosopher and the French sociologist Pierre Bourdieu both see television as a danger for our societies⁴.</p><p>Artificial Intelligence (AI), <em>aka</em> Machine Learning, is already our present; it may very well become our future. Out of the companies in our database of companies around the world (n = 27 600), at least 1800 use Artificial Intelligence and / or Machine Learning. Obviously, Artificial Intelligence is one of the most important technologies used by tech companies.</p><p>Should we also mention the socio-psychological effects of social media? Our language and speech are continually analyzed by linguists to improve the production and reception of news programs as well as to enrich advertising for the products they promote. In both cases, the objective is to improve the precision of targeting, to refine it, to make it more effective, at the lowest cost.Targeting affects everyone, young and less young, in an effort to optimize the frequency and duration of people’s engagement. Social media especially treats the very young as commodities, looking to manipulate them and promote longer screen time engagement, thereby enabling more and more data extraction. Not to mention an effort to promote affiliation and, finally, action: buying and consuming the advertised products. Then, is GRP still king? Probably: but is frequency times reach still the right definition? In that case what is the effective frequency⁵? TV might now be more a macluhanian tool than an orwellian one.</p><p>In order to analyze <em>1984</em>, we are going to use SunFish, a tool we developed at <a href="https://weborama.com/en/">Weborama</a>. Why? We are going to exploit this tool to study a decisive work, historically speaking, a work which was science-fiction: a dystopian novel describing England after a nuclear war: <em>1984</em> (the initial title was <em>The Last Man in Europe</em>)<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FaQHeP0Cqx1qHjyD" /></figure><p>A global view of the 1,298 most relevant words of the novel “1984”, classified into bubbles by SunFish, depending on their semantic proximity, calculated thanks to Machine Learning algorithms.</p><p>As a new kind of company, Weborama can be observed from two perspectives: first as an already mature company, founded more than twenty years ago, which deals with the traditional advertising market, while evolving and adapting to this ever-changing market in order to survive. But it is also a very young company, methodologically inventing its new path every single day. While looking for new paths, Weborama has always depended on research, to solve new problems and find new solutions.</p><p>For many years, Weborama has invested in Artificial Intelligence and machine learning in order to understand how the new socio-economic science is developing. Weborama not only works on media speeches or advertising strategies but also on literary works to understand how they are built, how they produce sense, how to better understand them, much more precisely than traditional literary analysis which is — at best — mostly intuitive. So, with SunFish, a semantic artificial intelligence tool, we try to better appreciate the way an author organizes their poetry or novel. This is the Weborama tool that we will use.</p><p>According to Weborama, the story takes place in 48 locations and 9 dates.</p><p>Our analysis will cover a few major points selected from the novel. First, “Newspeak” which one day will be the language spoken and written by the heroes of <em>1984</em>. We will then look at the situation of a class of people in the novel, the “proles” (proletariat). What kind of social class is this? Do they have a future? Finally, we will examine two new tools of power, among the new inventions of the people which govern this new country: the “Telescreen” and the “Speakwrite”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3Ekio40bxcZT83I" /></figure><p>Searching the word “Newspeak” in 1984: the word appears 75 times in the novel, all mentions are ranked according to their order of appearance. Among its semantic neighbours: “telesecreen”, “prole”.</p><h3>What will become Newspeak ?</h3><p>Newspeak is “the official language of Oceania” that meets “the ideological needs of Ingsoc or English Socialism”. For example, <em>The Times</em>, the official newspaper in the novel, is written “entirely in Newspeak”. The Appendix of <em>1984</em> gives the main principles of Newspeak (13 pages in three parts).</p><p>Newspeak is to supersede Standard English (Oldspeak) by 2050. An Eleventh Edition of the dictionary is supposed to be published before long.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2mx08IRwtvErjO5D" /></figure><p>80 sentences are associated with “Newspeak” ; positive sentences appear in green, negative ones appear in red.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OW15wQ8AWZBx7B3P" /></figure><p>Only 2 are identified by SunFish as positive, including: “It’s fascinating.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zihyYXglWUTItXOB" /></figure><p>A SunFish view of the 523 words of 1984 that are related to Newspeak.</p><p>Newspeak will permit speakers to express themselves and will thereby preclude other forms of expression. It offers ideal control from the source of the language to the thinking. Censorship would therefore become useless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WZHVfEvGY_AMoExH" /></figure><p>Looking for the word “mental” in the SunFish view centered on Newspeak.</p><p>Here’s a verbatim from the book, found thanks to SunFish (searched word in bold). The first number indicates the location of the passage in the book:</p><pre>6478 ( 96.7% ) The purpose of Newspeak was not only to provide a medium of expression for the world-view and <strong>mental</strong> habits proper to the devotees of Ingsoc, but to make all other modes of thought impossible.</pre><p>Can one describe Newspeak as a habitus? It is certainly a “habit-forming force”, as some sociologists would call it⁶, which focuses on primary socialization. It is said that habitus has two major characteristics: its durability (it lasts forever once acquired) and it works for all fields of social praxis. Here, we are in the presence of “mental habits”: they permit some expressions but forestall others.</p><p>In the novel, there are people like Syme who are philologists, specialists in Newspeak (Syme soon disappears from the novel, he is “vaporized”). But they are not “<em>Philologen</em>” as Friedrich Nietzsche⁷ called himself when he was teaching classical philology at the Basler University (Switzerland, 1869); they are the exact opposite of those who learn and like languages. The Newspeak philologists want to make vocabulary more limited, they want to get rid of as many words as they can. They dislike language since language can help people think. For these specialists, to improve the language is to make it much simpler, more circumscribed. Words should not permit various kinds of thinking. But they might use the same tools as Friedrich Nietzsche, only with a different goal.</p><p>If we were to follow Saussure, we could say that “Newspeak” tends to become a pure “lexicological” language (versus “grammatical”), more like Chinese (“ultra-lexicological”) and less like German. Newspeak, the new English, is more “immotivated” or arbitrary than German. It is thus easier to simplify English than German⁸. “Le trésor mental de la langue⁹” is created and enriched (or impoverished) by “improvisation”.</p><p>In the novel, Newspeak will gradually forge a new <em>habitus</em>. This new <em>habitus</em> will not only “provide a medium of expression for the world-view and mental habits proper to the devotees of Ingsoc, but also make all other modes of thought impossible”, as explained by the author of <em>1984</em>. So, its vocabulary is, little by little, more circumspect.</p><p>As we said before, we will use a tool from Weborama, SunFish, to better understand the multiple dimensions of Newspeak. We type “Newspeak” in the box (top, left). What do we get on the top right part of the screen, in the “Preview” or “All Documents”?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VABThi3gNIbyoSOw" /></figure><pre>929 ( 14.4% ) Do you know that <strong>Newspeak</strong> is the only language in the world whose <strong>vocabulary</strong> gets smaller every year?<br>907 ( 14.1% ) Of course the great wastage is in the <strong>verbs</strong> and <strong>adjectives</strong>, but there are hundreds of <strong>nouns</strong> that can be got rid of as well.<br>914 ( 14.2% ) Or again, if you want a stronger version of “good”, what sense is there in having a whole string of <strong>vague</strong> useless words like “excellent” and “splendid” and all the rest of them.<br>‘Don’t you see that the whole aim of <strong>Newspeak</strong> is to narrow the range of thought?<br>943 ( 14.6% ) ‘Newspeak is Ingsoc and Ingsoc is <strong>Newspeak</strong>,’ he added with a sort of mystical satisfaction. Ingsoc is “English Socialism”.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iLGOdqHJygbNeUJX.png" /></figure><pre>6474 ( 96.6% ) It was expected that <strong>Newspeak</strong> would have finally superseded Oldspeak.6475 ( 96.6% ) Meanwhile it gained ground steadily, all Party members tending to use <strong>Newspeak</strong> words and <strong>grammatical</strong> constructions more and more in their everyday speech.6476 ( 96.6% ) The version in use in 1984, and embodied in the Ninth and Tenth Editions of the <strong>Newspeak</strong> <strong>Dictionary</strong>, was a provisional one, and contained many superfluous words and <strong>archaic</strong> formations which were due to be suppressed later.</pre><p>In time, as we said earlier, Newspeak will become the new English spoken by the people in the novel, as they give up Oldspeak.</p><p>It’s interesting to note that some of the words of Newspeak are part of common language, and have been recognized as such by SunFish. But SunFish includes a Name Entity Recognition software that allows us to spot new words that are not part of common language — words that we may add to the bubble view for analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*UsRdd3AmyB6boy5a" /></figure><p>On top, a list of words recognized by Sunfish as common language, related to Newspeak in 1984, below a list of words coming from the same source but not recognized as common language.</p><h3>The grammar of Newspeak</h3><p>Newspeak grammar is mainly explained in the Appendix of <em>1984</em>. Newspeak becomes simple and regular with a few exceptions. Let’s look at some examples produced by SunFish:</p><pre>6521 ( 97.3% ) The second distinguishing mark of <strong>Newspeak</strong> <strong>grammar</strong> was its regularity.6523 ( 97.3% ) Thus, in all <strong>verbs</strong> the <strong>preterite</strong> and the <strong>past participle</strong> were the same and ended in — ED.6524 ( 97.3% ) The <strong>preterite</strong> of STEAL was STEALED, the <strong>preterite</strong> of THINK was THINKED, and so on throughout the language, all such forms as SWAM, GAVE, BROUGHT, SPOKE, TAKEN, etc., being abolished.6525 ( 97.4% ) All <strong>plurals</strong> were made by adding — S or — ES as the case might be.6526 ( 97.4% ) The <strong>plurals</strong> OF MAN, OX, LIFE, were MANS, OXES, LIFES.6527 ( 97.4% ) Comparison of <strong>adjectives</strong> was invariably made by adding — ER, — EST6528 ( 97.4% ) The only classes of words that were still allowed to inflect irregularly were the pronouns, the relatives, the demonstrative <strong>adjectives</strong>, and the auxiliary <strong>verbs</strong>.</pre><p>What are the effects of these simplifications? What do we lose with this new grammar? We lose the history of the language. But we make it easier for people to learn and use the language (see the example of Chinese¹⁰).</p><h3>The vocabulary of Newspeak</h3><p>Reduction of the vocabulary is the main rule of Newspeak. It should be simpler to speak the new English. Any trace of the old grammar, the old vocabulary should disappear. But this process will be slow; the authorities foresee the year 2050… And it ignores the creation of new vocabulary by those new generations who speak it.</p><pre>6480 ( 96.7% ) Its <strong>vocabulary</strong> was so constructed as to give exact and often very subtle expression to every meaning that a Party member could properly wish to express, while excluding all other meanings and also the possibility of arriving at them by indirect methods.6483 ( 96.7% ) The word FREE still existed in <strong>Newspeak</strong>, but it could only be used in such statements as ‘This dog is free from lice’ or ‘This field is free from weeds’.6485 ( 96.8% ) Quite apart from the suppression of definitely heretical words, reduction of <strong>vocabulary</strong> was regarded as an end in itself, and no word that could be dispensed with was allowed to survive.6486 ( 96.8% ) <strong>Newspeak</strong> was designed not to extend but to DIMINISH the range of thought, and this purpose was indirectly assisted by cutting the choice of words down to a minimum6491 ( 96.9% ) The A <strong>vocabulary</strong> consisted of the words needed for the business of everyday life — for such things as eating, drinking, working, putting on one’s clothes, going up and down stairs, riding in vehicles, gardening, cooking, and the like.6492 ( 96.9% ) It was composed almost entirely of words that we already possess words like HIT, RUN, DOG, TREE, SUGAR, HOUSE, FIELD- but in comparison with the present-day English <strong>vocabulary</strong> their number was extremely small, while their meanings were far more rigidly defined.6494 ( 96.9% ) So far as it could be achieved, a <strong>Newspeak</strong> word of this class was simply a staccato sound expressing ONE clearly understood concept.</pre><p>As in some languages (Chinese, for instance), verbs can be adjectives or nouns. This depends on a word’s place in a sentence and on its complements.</p><p>The new reform does not take etymology into account: it does not refer to the history of the language.</p><pre>6500 ( 97.0% ) Between the <strong>verb</strong> and the <strong>noun</strong> form, when they were of the same root, there was never any variation, this rule of itself involving the destruction of many <strong>archaic</strong> forms.6501 ( 97.0% ) The word THOUGHT, for example, did not exist in <strong>Newspeak</strong>.6502 ( 97.0% ) Its place was taken by THINK, which did duty for both <strong>noun</strong> and <strong>verb</strong>.6503 ( 97.0% ) No <strong>etymological</strong> <strong>principle</strong> was followed here: in some cases it was the original <strong>noun</strong> that was chosen for retention, in other cases the <strong>verb</strong>.6504 ( 97.1% ) Even where a <strong>noun</strong> and <strong>verb</strong> of kindred meaning were not etymologically connected, one or other of them was frequently suppressed.6506 ( 97.1% ) <strong>Adjectives</strong> were formed by adding the suffix — FUL to the noun-verb, and <strong>adverbs</strong> by adding — WISE.6509 ( 97.1% ) Certain of our present-day <strong>adjectives</strong>, such as GOOD, STRONG, BIG, BLACK, SOFT, were retained, but their total number was very small.6511 ( 97.2% ) None of the now-existing <strong>adverbs</strong> was retained, except for a very few already ending in — WISE: the — WISE termination was invariable.6514 ( 97.2% ) In addition, any word — this again applied in <strong>principle</strong> to every word in the language — could be negatived by adding the affix UN-, or could be strengthened by the affix PLUS-, or, for still greater emphasis, DOUBLEPLUS-.6615 ( 98.7% ) Almost invariably these words — GOODTHINK, MINIPAX, PROLEFEED, SEXCRIME, JOYCAMP, INGSOC, BELLYFEEL, THINKPOL, and countless others — were words of two or three <strong>syllables</strong>, with the stress distributed equally between the first <strong>syllable</strong> and the last.6635 ( 99.0% ) Only a very few words were common to all lists, and there was no <strong>vocabulary</strong> expressing the function of Science as a habit of mind, or a method of thought, irrespective of its particular branches.6531 ( 97.5% ) A word which was difficult to utter, or was liable to be incorrectly heard, was held to be ipso facto a bad word, occasionally therefore, for the sake of euphony, extra letters were inserted into a word or an <strong>archaic</strong> formation was retained.6543 ( 97.6% ) To take a single example: the word GOODTHINK, meaning, very roughly, ‘orthodoxy’, or, if one chose to regard it as a <strong>verb</strong>, ‘to think in an orthodox manner’.6544 ( 97.6% ) This follows: noun-verb, GOODTHINK, past tense and <strong>past participle</strong>, GOODTHINKED, present <strong>adjective</strong>,6548 ( 97.7% ) The B words were not constructed on any <strong>etymological</strong> plan.6549 ( 97.7% ) The words of which they were made up could be any <strong>parts of speech</strong>, and could be placed in any order and mutilated in any way which made them easy to pronounce while indicating their <strong>derivation</strong>.6564 ( 97.9% ) The greatest difficulty facing the compilers of the <strong>Newspeak</strong> <strong>Dictionary</strong> was not to invent new words, but, having invented them, to make sure what they meant: to make sure, that is to say, what ranges of words they cancelled by their existence.6583 ( 98.2% ) In <strong>Newspeak</strong> it was seldom possible to follow a heretical thought further than the perception that it WAS heretical: beyond that point the necessary words were nonexistent.6611 ( 98.6% ) In <strong>Newspeak</strong>, euphony outweighed every <strong>consideration</strong> other than exactitude of meaning.6637 ( 99.0% ) From the foregoing account it will be seen that in <strong>Newspeak</strong> the expression of unorthodox opinions, above a very low level, was well-nigh impossible.6647 ( 99.2% ) In 1984, when Oldspeak was still the normal means of communication, the danger theoretically existed that in using <strong>Newspeak</strong> words one might remember their original meanings.6649 ( 99.2% ) A person growing up with <strong>Newspeak</strong> as his sole language would no more know that EQUAL had once had the secondary meaning of ‘politically equal’, or that FREE had once meant ‘intellectually free’, than for instance, a person who had never heard of chess would be aware of the secondary meanings attaching to QUEEN and ROOK.6651 ( 99.2% ) And it was to be foreseen that with the <strong>passage</strong> of time the distinguishing characteristics of <strong>Newspeak</strong> would become more and more pronounced — its words growing fewer and fewer, their meanings more and more rigid, and the chance of putting them to improper uses always diminishing.6668 ( 99.5% ) <strong>Considerations</strong> of prestige made it desirable to preserve the memory of certain historical figures, while at the same time bringing their achievements into line with the <strong>philosophy</strong> of Ingsoc.6672 ( 99.5% ) It was chiefly in order to allow time for the preliminary work of translation that the final adoption of <strong>Newspeak</strong> had been fixed for so late a date as 2050.</pre><h3>A non-social class: the proles</h3><p>In English, proles is a “derogatory” term, if we are to believe the Oxford English Dictionary (second edition). It designates the proletariat. In Ancient Rome, the proletariat was a class which “contributed nothing to the state but offspring”.</p><p>Normally, according to a Marxist view, the proletariat that <em>1984</em> probably refers to, becomes a major player in the class struggle (“<em>Klassenkampf</em>)” of modern times. According to Karl Marx and Friedrich Engels : “The bourgeoisie produces its own grave-diggers. The fall of the bourgeoisie and the victory of the proletariat are equally inevitable” (<em>The Manifesto of the Communist Party,</em> 1848<em> </em>). In the end, the proletariat will win, since it is the most numerous and is becoming the most powerful class. This is, however, not what we see in the novel: the proles have no future, even though Winton Smith sees it differently.</p><p>When we enter the word “prole” in the top left box, we see three main ideas concerning this social class : first, its members are, at best, “a leisure class” (drinking and betting, and they are “not human beings”), nevertheless, in Winston Smith’s opinion at least, they are the only hope for the world. The Proles are seen to be both wise: for O’Brien they are not “human beings” but a sort of animal, whereas Winston Smith sees them as the future of society. The proles are given “<em>panem et circenses¹¹</em>” in the form of gin, the lottery, “a game of darts”, <em>etc</em>. (“the principle, if not the only, reason for remaining alive” p.75).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uh8aWBEr6rJGR6cs" /></figure><p>A SunFish view with the word “prole” selected, and associated documents displayed.</p><pre>948 ( 14.7% ) ‘The <strong>proles</strong> are not human beings,’ he said carelessly.1662 ( 25.3% ) The <strong>proles</strong> were supposed not to drink gin, though in practice they could get hold of it easily enough1597 ( 24.3% ) The Lottery, with its weekly pay-out of enormous prizes, was the one public event to which the <strong>proles</strong> paid serious attention1526 ( 23.3% ) ‘If there is hope,’ he had written in the diary, ‘it lies in the <strong>proles</strong>.’4381 ( 65.6% ) The future belonged to the <strong>proles</strong>1597 ( 24.3% ) The Lottery, with its weekly pay-out of enormous prizes, was the one public event to which the <strong>proles</strong> paid serious attention.</pre><p>Society regularly produces the tools necessary for the proles (“das <em>Opium des Volks</em>”, as Karl Marx would call them¹²). The “versificator” composes the different kinds of the media products needed: “There was a whole chain of separate departments dealing with proletarian literature, music, drama, and entertainment generally”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9F4GcLmhHanOus1t" /></figure><pre>68 ( 12.0% ) Here were produced rubbishy newspapers containing almost nothing except sport, crime and astrology, sensational five-cent novelettes, films oozing with sex, and sentimental songs which were composed entirely by <strong>mechanical</strong> means on a special kind of kaleidoscope known as a versificator.</pre><p>If we dive deeper with SunFish, what we get is not very different.</p><pre>1292 ( 19.8% ) ‘If there is hope,’ wrote Winston, ‘it lies in the <strong>proles</strong>.’ If there was hope, it MUST lie in the <strong>proles</strong>, because only there in those swarming disregarded masses, 85 per cent of the population of Oceania, could the force to destroy the Party ever be generated.4381 ( 65.6% ) The future belonged to the <strong>proles</strong>.</pre><p>“Proles and animals are free” (p. 64). And proles represent 85% of the total population of Oceania.</p><p>But “Only the proles use scent” and they sing too. Signs of potential happiness which the other classes do not share.</p><pre>4394 ( 65.8% ) The birds sang, the <strong>proles</strong> sang.368 ( 50.6% ) The <strong>proles</strong> had stayed human.1327 ( 20.3% ) But simultaneously, true to the Principles of doublethink, the Party taught that the <strong>proles</strong> were natural inferiors who must be kept in subjection, like animals, by the application of a few simple rules.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D_mUROKN0WoeTtbV" /></figure><pre>597 ( 24.3% ) The Lottery, with its weekly pay-out of enormous prizes, was the one public event to which the <strong>proles</strong> paid serious attention.1598 ( 24.3% ) It was probable that there were some millions of <strong>proles</strong> for whom the Lottery was the principal if not the only reason for remaining alive.1662 ( 25.3% ) The <strong>proles</strong> were supposed not to drink gin, though in practice they could get hold of it easily enough.3367 ( 50.6% ) For the first time in his life he did not despise the <strong>proles</strong> or think of them merely as an inert force which would one day spring to life and regenerate the world.3905 ( 58.5% ) Nevertheless, the few luxuries that he does enjoy his large, well-appointed flat, the better texture of his clothes, the better quality of his food and drink and tobacco, his two or three servants, his private motor-car or helicopter — set him in a different world from a member of the Outer Party, and the members of the Outer Party have a similar advantage in comparison with the submerged masses whom we call ‘the <strong>proles</strong>’.1883 ( 28.6% ) The hunting-down and destruction of books had been done with the same thoroughness in the <strong>prole</strong> quarters as everywhere else.2920 ( 43.9% ) One never saw a double bed nowadays, except in the homes of the <strong>proles</strong>.</pre><p>Love, music (singing): the proles stay human.</p><h3>A new technology?</h3><h3>The Telescreen</h3><p>The word “Telescreen” is one of the most important words in the book. The telescreen is the eyes and ears of the government, of the police. It is omnipresent all the time, in all rooms, in all habitations but not those of the proles (or rarely).</p><p>Is this a prediction? Nowadays, it would probably be a computer screen and all its tools. According to current measurements, some of our households almost always have the TV on. In <em>1984</em>, it cannot be turned off except for the members of the party elite¹³ and even then for only half an hour. And, if is not TV, it may be a phone or a tablet where someone watches a program or TV or participates in social media (so-called “interactivity”). And given the measurement systems, “the Nielsen’s”, one will know more and more about what people watch, what they may think of it, how they interact with it. But, if TV viewers agree to cooperate!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qud-TrRRdzT2jWvM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iqdIkGBM1AH5N-2R" /></figure><h3>The Speakwrite</h3><p>Close to the “versificator” which produces media content for the proles, the “speakwrite” is a very common tool for bureaucrats. They use it to “rectify”, for instance, the daily newspaper <em>The Times</em>. Dictation is an active media experience; it is an action. Close to this writing tool is a memory hole where they can discard obsolete texts. Thanks to these two tools, “all history was a palimpsest” (p. 35). This description reminds us of the way books and newspapers were censored in the USSR¹⁴: As David King, the British historian, writes, “physical eradication” was followed by “obliteration of their pictorial existence¹⁵”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vJUUE7GN_UVu_sRe" /></figure><p>The speakwrite is a kind of dictation machine. Since it continuously updates its content, it lies all the time. That is what <em>1984</em> says.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qj7J4E6wMmDia00m" /></figure><pre>3783 ( 56.7% ) In so far as he had time to remember it, he was not troubled by the fact that every word he murmured into the <strong>speakwrite</strong>, every stroke of his ink-pencil, was a deliberate lie.</pre><p>But is it always a lie? This is not so sure: history is a human science and is always evolving and improving (new facts, new hypotheses, new theories).</p><p>If we compare the two schemas for the “speakwrite” (<em>cf.supra</em>), we observe that there are two families of references: the top one mentions the social usage and the second one refers to the material and technical environment of the tool. This demonstrates the rich power of SunFish and the importance of using it.</p><h3>How to conclude?</h3><p>What did we learn with this quick re-reading of <em>1984</em> using Weborama’s tool, SunFish? It was a new and extremely interesting reading experience. To sum things up, we noticed:</p><ul><li>The absolute exhaustivity of what we are looking for. We do not miss anything.</li></ul><p>SunFish puts the book in a new order, an order determined by the reader’s questioning. This questioning is not necessarily universal; it changes with the reader and can change with the way he or she reads. But the answer to the questions is always true.</p><ul><li>The rich variety of results, according to what we use from among the multiple possibilities that SunFish provides. How to explain this? How to improve these results and show (demonstrate) their dependence on the way we use SunFish?</li><li>What we can do is incredible. There is no comparison with the usual text analysis that we perform in traditional literature classes, not to mention journalists’ book reviews. SunFish proposes a number of ways to analyze the text. How can we compare them? Which one shall we use? When?</li><li>Internal or external reading? Is SunFish able to sublate this opposition in history analysis? Or is it just a question of internal reading?</li></ul><p>This is our first use of SunFish (a very modest use), a new Weborama tool. We are clearly conscious of our limitations. Now, we should perhaps further test this software on different books, newspaper or magazine articles.</p><p><em>This article has been written by François Mariet, researcher at Weborama, with the support of Stéphane Lévy, Head of Data Science at Weborama.</em></p><h3>Bibliography (recent books on “1984)</h3><p>Dirian Lynskey, <em>The Ministry of Truth. A Biography of George Orwell’s 1984</em>, 2019, London, Picador, Index, 369 p.</p><p>Richard Bradford, <em>ORWELL. A Man of Our Time</em>, London, Bloomsbury Caravel, 2020, Bibliography, Index, 294 p.</p><p>Hilary Spurling, <em>The Girl from the Fiction Department. A Portrait of Sonia Orwell</em>, Hamish Hamilton, 2002, 193 p.</p><p>D.J. Taylor, <em>On Nineteen Eighty-For. A Biography</em>, New York, Abrams Press, Chronology, Index., 2019, 194 p.</p><p>Notes</p><p>[1] Leon Trotsky’s real name was Lev Davidovich Bronstein. Emmanuel is the romanization of the Hebrew first name, Immanuel.</p><p>[2] Concerning a recent controversy involving a tennis player: “The Serbian president criticized the Australian government, denouncing the process as “harassment” and “Orwellian,” and saying that Djokovic would be welcomed home”. <em>The New York Times</em>, Monday Briefing, January 17, 2022.</p><p>[3] Gérard Noiriel, Préface au <em>Plaidoyer pour les intellectuels</em>, Paris, Gallimard, 2020, p. 38. Gérard Noiriel ends his preface by quoting George Orwell as saying that intellectuals are those who are able to tell people “what they do not feel like listening to”. Or, <a href="https://www.cnbc.com/2022/01/26/tennessee-school-board-bans-holocaust-comic-maus-by-art-spiegelman.html">CNBC</a>, “Tennessee school board bans Holocaust graphic novel ‘Maus’ — author Art Spiegelman condemns the move as ‘Orwellian’, Jan 26 2022.</p><p>[4] <em>cf.</em> from Karl Popper, <em>Television a danger to democracy</em>, (1993 and later), to Pierre Bourdieu, <em>Sur la télévision</em>, (1996).</p><p>[5] cf. Michael J. Naples, <em>Effective Frequency. The Relationship between Frequency and Advertising Effectiveness</em>, 1979, Association of National Advertisers, New York, 140 p.</p><p>[6] Erwin Panofsky, Erwin Panofsky, <em>Gothic Architecture and Scholasticism</em>, 1951, Meridian (Penguin Books USA, 1957), 157 p. + illustrations, or translated into French, <em>Architecture gothique et pensée scolastique</em>, traduction et postface de Pierre Bourdieu, Paris, Les Editions de Minuit, deuxième édition revue et corrigée, 1967, 211 p., glossaire, bibliographie, Index, Illustrations</p><p>[7] Nietzsche, <em>Wir Philologen</em>, Kröner, Dritter Band, p. 323.</p><p>[8] Ferdinand de Saussure : “l’anglais donne une place plus considérable à l’immotivé que l’allemand ; mais le type de l’ultra-lexicologique est le chinois, tandis que l’indo-européen et le sanskrit sont des spécimens de l’ultra-grammatical”. <em>cf</em>. <em>Cours de linguistique générale</em>, Payot, Paris, p.183.</p><p>[9] Ferdinand de Saussure : “Toute innovation arrive par improvisation, en parlant, et pénètre de là soit dans le trésor intime de l’auditeur ou celui de l’orateur, mais se produit donc à propos du langage discursif”, <em>Ecrits de linguistique générale</em>, Paris, Gallimard, 2002, p. 95</p><p>[10] Constantin Milsky, <em>Préparation de la réforme de l’écriture en République populaire de Chine 1949–1954,</em> Paris, Mouton &amp; C°, 1974, 507 p., glossaire. Or for a simpler approach, Viviane Alleton, <em>L’écriture chinoise. Le défi de la modernité</em>, Paris, 240 p., Albin Michel, 2008.</p><p>[11] Juvenal (first years of the first century) thought that Roman people only wished for two things, “bread and games”, (<em>Satires</em>, X, 81). See also Keith Bradley, <em>Slavery and Society at Rome</em>, London, Cambridge University Press, 1994, 202 p., Bibliogr., Index</p><p>[12] <em>Cf</em>. Karl Marx : “Das religiöse Elend ist in einem der <em>Ausdruck</em> des wirklichen Elendes und in einem die <em>Protestation</em> gegen das wirkliche Elend. Die Religion ist der Seufzer der bedrängten Kreatur, das Gemüt einer herzlosen Welt, wie sie der Geist geistloser Zustände ist. Sie ist das <em>Opium</em> des Volkes”, <em>Zur Kritik der Hegelschen Rechtsphilosophie</em>, Marx Engels Werke, Band 1, Dietz Verlag Berlin, 1964, pp. 378.</p><p>[13] We will see O’Brien admitting : “Yes, said O’Brien, we can turn it off. We have that privilege”.</p><p>[14] In 1922 was created the Glavlit (Главлит) which was the Main Administration for Literary and Publishing Affairs under the People’s Commissariat of Education of the RSFSR (Главное управление по делам <strong>лит</strong>ературы и издательств при Наркомате просвещения РСФСР). In 1946, it became the Administration for the Protection of Military and State Secrets in the Press under the USSR Council of Ministers. (управление по охране военных и государственных тайн в печати при СМ СССР).</p><p>[15] David King, <em>The Commissar vanishes. The falsification of Photographs and Art in Stalin’s Russia</em>, New York, Metropolitan Books, 192 p. Illustrations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea79e8d09bd4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weborama/ai-big-brother-ea79e8d09bd4">AI &amp; Big Brother</a> was originally published in <a href="https://medium.com/weborama">Weborama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>