<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Charlotte Faure on Medium]]></title>
        <description><![CDATA[Stories by Charlotte Faure on Medium]]></description>
        <link>https://medium.com/@cfaure_63726?source=rss-2fb0aea759c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AHeEtBJ2DvLHVsDvlovIWg.jpeg</url>
            <title>Stories by Charlotte Faure on Medium</title>
            <link>https://medium.com/@cfaure_63726?source=rss-2fb0aea759c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:44:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cfaure_63726/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Boosting Semantic Categorization with recent AI paradigm]]></title>
            <link>https://medium.com/weborama/boosting-semantic-categorization-with-recent-ai-paradigm-9357324da74a?source=rss-2fb0aea759c3------2</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>
    </channel>
</rss>