<?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 Draft&amp;Goal on Medium]]></title>
        <description><![CDATA[Stories by Draft&amp;Goal on Medium]]></description>
        <link>https://medium.com/@draftandgoal?source=rss-246af579130c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LRVkelFClSi_YSmpXZaFBA.jpeg</url>
            <title>Stories by Draft&amp;amp;Goal on Medium</title>
            <link>https://medium.com/@draftandgoal?source=rss-246af579130c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:47:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@draftandgoal/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[Keywords.gg : A Game Changer for SEO]]></title>
            <link>https://medium.com/@draftandgoal/keywords-gg-a-game-changer-for-seo-9f8fc503a90a?source=rss-246af579130c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f8fc503a90a</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Draft&Goal]]></dc:creator>
            <pubDate>Sat, 30 May 2020 10:04:01 GMT</pubDate>
            <atom:updated>2021-03-21T14:58:03.143Z</atom:updated>
            <content:encoded><![CDATA[<h3>Keywords.gg : A Game Changer for SEO</h3><h3>Context</h3><p>Technically, Keywords.gg is an API, taking one or more words as input, and returning a set of terms from a corpus of documents with recorded success in search engines as output.</p><p>So the API can extract the context of a term of one or several words, but using a model where the data come only from content that is efficient w.r.t Google (roughly speaking: webpages with organic traffic).</p><p>e.g. : if I tell you “input, convolutional, network, convolution, neural, pooling, output model, feature”, you may think “Machine Learning” and specifically “CNNs”. Keywords.gg is going exactly the other way, from “CNNs” to the bunch of words defined previously.</p><p><a href="https://www.keywords.gg/">https://www.keywords.gg/</a></p><p>It is a game-changer for SEO with three main advantages:</p><p>Proprietary NLP AI Models</p><ul><li>Built from 10 million data points.</li><li>Data extracted from content with recorded success in search engines.</li><li>Cleaning using proprietary algorithms.</li></ul><p>AI Context Extraction</p><ul><li>Training models done using state of the art customised AI methods (neural networks, machine learning, contextual embedding).</li></ul><p>API</p><ul><li>Low latency thanks to a rock-solid infrastructure (load balancing, sharding, and clustering).</li></ul><h3>Objectives</h3><p>I am going to test this API in a qualitative and a quantitative way, with all the keywords available in the Search Console (more than 30,000 unique keywords)</p><p>Indeed it is crucial to benchmark the performance and quality of the data — We’ll do it in a conservative and staggered manner, as follows:</p><ul><li>Test on 100 keywords</li><li>Test on 1,000 keywords</li><li>Test on 10,000 keywords</li></ul><h3>Methods</h3><p>First off, I tested the API on websites I was familiar with to see I could find the same distribution for my top keywords there.</p><p>Then I checked the execution time to get the data. Each API call returns a set of keywords that I’m grouping together to count their occurrences.</p><p>Example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*Pi-Xn_5dv-rKug5KJSzRyA.jpeg" /></figure><p>the table becomes :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*r6rvvbz4yzgH1LqtpEahdw.jpeg" /></figure><p>Finally, I use PCA to project everything in 2D and highlight clusters’ relevance.</p><h3>Unit Test</h3><p>To use this API, you will need an API token.</p><p>7 days trial: <a href="https://www.keywords.gg/#pricing">https://www.keywords.gg/#pricing</a></p><p>I’m going to use a simple Python function that retrieves the 30 keywords associated with a query, putting a score of 3 for the first predictions, 2 for the next 10, and 1 for the last ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*qKVZeFIApdEBRQuMK3cefA.jpeg" /><figcaption>Results for covid-19 in French</figcaption></figure><h3>Getting Search Console Data</h3><p>1) Sign up for a new project in the Google APIs console at <a href="https://code.google.com/apis/console.">https://code.google.com/apis/console.</a></p><p>2) Choose “Credentials” on the left-hand menu.</p><p>3) Choose “Create Credentials”</p><p>4) Generate an API key for your application.</p><p>5) Copy your client ID, client secret, and redirect URL into the next cell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*zcwLrNKvb_BPd5HE5mK6fg.jpeg" /></figure><p>6) Sort your data by impressions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*BNYgAcLtcCe_N_dTd5H5UA.jpeg" /></figure><h3>Performance Test</h3><p>I will prepare the tests with: 100–1,000–10,000 and finally 30,000 queries</p><p>Here are the performance results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*ZSrZGWuqqUsdxCYGtVu9Ag.jpeg" /><figcaption>Performance</figcaption></figure><ul><li>I would suggest starting with 1,000 keywords, queried at the pace of one request per second.</li><li>If you increase that rate, you may get some server (500) errors.</li></ul><h3>Qualitative Test</h3><p>Here are my results for 10 000 predicted keywords</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*MxNLrIcluTwjOn8r2GcLYA.jpeg" /><figcaption>Quality</figcaption></figure><p>We visualise the most predicted keywords.</p><p>The framework is perfectly coherent with the audited site (here the website topic is the Coronavirus in France).</p><p>We can use dimension reduction to identify the coherence of the main clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*l7akfBvrFufPnC5DnOqthw.png" /></figure><p>The “Virus” and “Coronavirus” clusters are very closely related, as expected. We also observe a significant cluster on “confinement” and on “soin” (French for ‘care’).</p><p>The API is top-notch and will allow you to build tools to optimise your SEO content by :</p><ul><li>Detecting interesting contents</li><li>Optimising your current contents</li><li>Improving your internal linking</li></ul><p>The machine learning model is continuously learning from new data so don’t hesitate to run the model each week.</p><p>Happy testing: <a href="https://colab.research.google.com/drive/14o4qtIgbcNaF4ca1uQlHfcL8rrah9-Dr#scrollTo=S_yFZE8UzHZh">https://colab.research.google.com/drive/14o4qtIgbcNaF4ca1uQlHfcL8rrah9-Dr#scrollTo=S_yFZE8UzHZh</a></p><p>Big thanks to Charly Wargnier <a href="https://twitter.com/DataChaz">https://twitter.com/DataChaz</a> for the editing and proofreading. Also Kudos to t<a href="https://transfer-learning.ai/">ransfer learning</a> and <a href="https://www.datamarketinglabs.com/full-guide-gpt-3">GPT-3: A Full guide</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f8fc503a90a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Successfully predicting Google rankings at the cutting edge of data science]]></title>
            <link>https://medium.com/@draftandgoal/successfully-predicting-google-rankings-at-the-cutting-edge-of-data-science-41a486dcfda1?source=rss-246af579130c------2</link>
            <guid isPermaLink="false">https://medium.com/p/41a486dcfda1</guid>
            <category><![CDATA[seo-training]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[dataiku]]></category>
            <dc:creator><![CDATA[Draft&Goal]]></dc:creator>
            <pubDate>Fri, 22 May 2020 20:41:55 GMT</pubDate>
            <atom:updated>2021-03-21T14:56:57.179Z</atom:updated>
            <content:encoded><![CDATA[<p>Google search rankings are a strategic matter. 91% of clicks on the world’s most famous search engine are made on the first page of results. But how can you be sure of appearing in the top 10? Which SEO rules should you go by to get guaranteed good results? After all, the tech giant’s algorithm is as mysterious as it is dynamic and ever-changing.</p><p>SEO has long been considered magic. In each case, there are at least 500 possible strategies. The challenge is to quickly figure out which strategy will guarantee that you’ll appear on that coveted first page of results. That was what sparked the idea of building a model capable of predicting which pages would rank among the top 10 Google results for specific searches.</p><p>So how can you be 92% sure that a URL will make the top 10 Google searches for a given topic — in just a few minutes? That tool is called the Predictive SEO Tool.</p><h3>Figuring out the best SEO strategy in minutes</h3><p>Used for more than 90% of web searches in France, Google is based on two algorithms — Google RankBrain and Google Bert — boosted by artificial intelligence. The ranking of a search result depends on many factors and variables, such as the field of activity. Different users have different priorities. For one user, page load time could be the most important factor. For another, it could be the terms used.</p><p>The Predictive SEO Tool, therefore, makes use of different tools throughout several stages to estimate all these variables and figure out the best possible strategy. First, Ranxplorer is used to retrieve the top 100 keywords related to a particular topic. Each keyword is associated with the URL of the page concerned. Next, tools such as Cocon.se or Majestic can be used to draw up a list of ranking factors. The machine learning element then comes into play, forming “random forest” decision trees and adjusting the correct variables to define the most appropriate final strategy.</p><h3>Streamlining the process with Dataiku</h3><p>In the early days of the Predictive SEO project, I created an open-source project (DATA SEO LABS GitHub: <a href="https://github.com/dataseolabs/predictive-seo/">https://github.com/dataseolabs/predictive-seo/</a>) and shared the source code in R, but unfortunately, it couldn’t be used without R language knowledge. Eventually, I found a solution to streamline the process of using predication algorithms using a platform named “Dataiku” — an open-source data science platform. Let’s take a closer look at how this tool helped streamline our process for generating accurate ranking predictions…</p><p>The following example describes how to use XgBoost (although the same process could be used with various other algorithms) with a dataset of 200,000 records, including 2,000 distinct keywords/search terms.</p><p><strong>Step 1: Install Dataiku</strong></p><p>First, you need to install Dataiku on your platform. Just follow this tutorial to do so: <a href="https://www.dataiku.com/dss/trynow/">https://www.dataiku.com/dss/trynow/</a></p><p>For this example, I used Dataiku Free Edition for Virtualbox, but whatever version you opt for, your data stays in your infrastructure, and there is no limitation in terms of the volume of data processed. Once it’s installed, you can log in straight away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*wkJtl6IsusAwDEeM.png" /></figure><p><strong>Step 2: Create your project</strong></p><p>You just need to choose a name. Once you’ve done so, you’re ready to import your files. Click on your project link and click on “Import Dataset.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/0*wd1D50WjScpuHxzH.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*qLsXk-lT280kAdnY.png" /></figure><p>Great, you are ready to import files. Click on your project link and Click on “Import Dataset.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/0*6vEvCWtRSBobhXTZ.png" /></figure><p><strong>Step 3: Prepare a new dataset</strong></p><p>Download my prepared dataset (<a href="https://github.com/dataseolabs/predictive-seo/blob/master/dataset/dataset_prepared.csv">https://github.com/dataseolabs/predictive-seo/blob/master/dataset/dataset_prepared.csv</a>) and click on ‘Upload Your Files’ to create your first dataset.</p><p>Click on “Finish”, and choose a name for your dataset (dataset_garden_queries, for example).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/0*EXacN3NFmMVz0Lfj.png" /></figure><p>Don’t worry in the next post; I will teach you how to create your dataset</p><p>Click on “Finish.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zG5fVlNTOgyj56gI" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*G785hpWgt2JTBlx7" /></figure><p>Choose a name for example : dataset_garden_queries</p><p><strong>Step 4: Create your first analysis</strong></p><p>Click on the green wheel in the menu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*UH7cYJE60opVEP87.png" /></figure><p>Click on “New analysis” and choose the previous dataset and click on “Create Analysis.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ME0EqTda4s1pY4rs" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*IjesEGpFvyV4T1tB.png" /></figure><p>If you want to remove a column, click on the column name and click on “Delete.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*KzoQHdUuMBzch1Qg.png" /></figure><p>Choose the column “isTopTen” you want to predict and click on “Create Prediction model.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*2LNnY3GMDzYDDUzH.png" /></figure><p>I recommend that you choose the Performance model and select the “Xgboost” algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*Lh2U5ut0p5727uhf.png" /></figure><p>You can then personalize the model by clicking on “Settings.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/0*JTRvxwUOwD29UZwO.png" /></figure><p>In the left column, click on “Algorithms”. Unselect all algorithms other than Xgboost. In the Xgboost set-up area, you can set the maximum number of trees to 1,000, to improve your results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/0*Jhbyjx_zyti0rtcv.png" /></figure><p>Now, click on “Features” in the left column and remove unneeded features like URL, TextRatio, ExtBackLinks (which is only for homepages), and Keyword.</p><p>Choose “Reject” to ignore a feature and ensure your model only works with your pertinent data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/0*xkHZwkLowRjz3o8l.png" /></figure><p>Once you have finished, click on the green “Train” button.</p><p>Be very patient (I recommend getting a coffee!), as XGboost is very efficient but still takes a while to run.</p><p>Dataiku has industrialized all the steps needed to produce the model: load train set, load test set, collect statistics, pre-process train set, pre-process test set, fit model, save model, and score model. You can, therefore, save a lot of time by testing different algorithms at the same time and comparing their accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*v1CTMMz2anbcN-eN" /></figure><p><strong>Step5: Check results</strong></p><p>Be careful while analyzing the results, because they are valid only for the specified dataset in the thematic, within the specified period. Google personalizes search engine results pages with more than 300 factors, including localization, device, language, thematic, etc.</p><p>In this example, you should be able to get a good idea of what is working effectively. I think it is a good approach to have the best results for a specific term/keyword and the worst term/keyword to give an ML algorithm the ability to either confirm or reject a feature.</p><p>Now you have established the accuracy of each algorithm, you can hopefully see the importance of the variables. Click on the link of your algorithm, and you access a menu where you can discover your important variables and measure the performance of your algorithm with a selection of different methods (roc curve, confusion matrix, decision chart net etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e0Yc5YoFSF-k04bj.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Ue3-GgAigKzR9eN.png" /></figure><p><strong>Going further</strong></p><p>This is a good example of how you can import and manipulate a dataset quickly and use prediction algorithms with a single click, but it’s just the first step. If you want to test your prediction model on the new or updated page, you can follow this great tutorial: <a href="https://academy.dataiku.com/latest/tutorial/machine-learning/index.html">https://www.dataiku.com/learn/guide/tutorials/103-part2.html </a>Furthermore, Dataiku allows you to code in R or Python and makes it easy to share your whole workflow, by putting the source code in a zip file.</p><h3>Developing together with an open-source approach</h3><p>The Predictive SEO Tool offers a potential gain of three to five days for SEO projects. It now takes just a few minutes to figure out the right strategy, which is an environment as competitive and fast-changing as SEO, is a significant advantage and a serious game-changer.</p><p>The SEO world’s fast-paced evolution is the main reason the Predictive SEO project was designed using open-source code. This way, the tool benefits from our community’s collective intelligence, so that everyone can benefit from its capabilities.</p><p>Since it was launched, the Predictive SEO project has been widely praised and copied, which we’re very proud of. Currently, we work on a second version, which will take into account even more parameters and be accessible to even more people thanks to an API that we explain during DATA MARKETING LABS courses: <a href="https://dataseolabs.com/">https://www.datamarketinglabs.com</a>. Also Kudos to t<a href="https://transfer-learning.ai/">ransfer learning</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41a486dcfda1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Search Console Clustering]]></title>
            <link>https://medium.com/@draftandgoal/google-search-console-clustering-44af1b053a29?source=rss-246af579130c------2</link>
            <guid isPermaLink="false">https://medium.com/p/44af1b053a29</guid>
            <category><![CDATA[bert]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Draft&Goal]]></dc:creator>
            <pubDate>Wed, 11 Mar 2020 08:28:06 GMT</pubDate>
            <atom:updated>2021-03-21T14:53:51.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Since the last <a href="https://www.catalystdigital.com/techseoboost/">TechSEOBoost </a>where I presented my text generator based on GPT-2 on Google Colab, I have seen many innovative projects leveraging the same technologies, primarily ones integrating with Google Search Console data.</p><p>I’m going to use JR Oakes’ open source code (released early February 2020), which extracts queries from Google Search Console, aggregates them by category and finds semantically close categories via BERT.</p><p>I really like this model as it is easy to understand and easily reproducible. However, I wanted to go the extra mile by adding a Search Console connector (so anyone could work with their own data), and, most importantly, add a multilingual mode to categorise across 6 languages: French, Italian, Dutch, German, Portuguese and English.</p><p>Here’s the Colab workbook if you want to test it. Improvements are welcomed! <a href="https://colab.research.google.com/drive/14JC2uQniiVDNAUpVEjdNTyK7rmepwjWB">https://colab.research.google.com/drive/14JC2uQniiVDNAUpVEjdNTyK7rmepwjWB</a></p><h3>INSPIRATION</h3><p>The original article from JR can be found <a href="https://searchengineland.com/using-the-apriori-algorithm-and-bert-embeddings-to-visualize-change-in-search-console-rankings-328702">here</a>.</p><p>His work is inspired by the Apriori algorithm created by Rakesh Agrawal and Ramakrishnan Sikrant in 1994 . It is an algorithm used to recognise properties recurring in datasets, as well as inferring related categorisations. To find out more, check the <a href="https://en.wikipedia.org/wiki/Association_rule_learning#Apriori_algorithm">learning rules of association</a>.</p><p>For example, an ecommerce site can utilise this algorithm to find products often purchased together.</p><p>Now here’s JR’s clever twist: rather than focusing on transactions, the script runs on queries from Search Console, leveraging state-of-the-art technologies such as Spacy, HuggingFace, and of course BERT. More on that later.</p><h3>A QUICK WORD ON GOOGLE COLAB</h3><p>Google Colab is a cloud service based on Jupyter Notebooks, designed for training and research. With it you can train Machine Learning models without having to install anything on your computer.</p><p>First, it’s important to note that the notebook won’t run by default, you must to open it in “playground mode”, by clicking here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MTAVMhNIPiMG7L9c.png" /></figure><p>You will then have to perform each step sequentially, by running the code cells and filling in the forms — do not worry, I will walk you through this below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*gXfRqo1DUbthXWuF.png" /></figure><p>Ready? let’s go!</p><h3>BEFORE STARTING, A QUICK WORD ON HUGGING FACE</h3><p>Created about a year ago on GitHub, the start-up Hugging Face launched the “Transformers” project, aiming to create a community around their own NLP library. More than 250 contributors are currently working on this ambitious project, already used by more than a thousand companies around the world.</p><p>At the moment, <a href="https://huggingface.co/models">https://huggingface.co/models</a>’s internal search engine does not yet allow you to find models based on languages. Therefore, when searching for a language specific model, you have to know the model name, for instance: ‘camemBERT-french‘, ‘flauBERT-french‘ etc</p><p>Here, I used CamemBERT and FlauBERT, two accurate models for French.</p><p>Before starting the notebook, you have to write the name of your model and choose your language:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*eImhaZFSj_U10hj0.jpg" /></figure><p>Once done, let’s fetch our data via the Google Search Console API.</p><h3>CREATE ACCESS TO THE GOOGLE SEARCH CONSOLE API</h3><p>To get your data, you first need to authenticate your Google account.</p><p>1) Create a new project or use an existing one in the Google API console, via: <a href="https://code.google.com/apis/console">https://code.google.com/apis/console</a></p><p>2) Click on ‘library’ and verify that you have enabled the Google Search Console API. If not, click on “Enable”: <a href="https://console.developers.google.com/apis/library">https://console.developers.google.com/apis/library</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*llcoS3Ui-Ucwi0G8.jpg" /></figure><p>3) Select “Credentials” from the left menu.</p><p>4) Select “Create Credentials”.</p><p>5) Generate an API key for your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*ZAga_XIhRPkvWpuG.jpg" /></figure><p>6) Write down your client ID, your client secret to copy them later in the following cell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*Gmr7CtLWj9isBmKK.png" /></figure><p>A link will then be generated, just follow the authentication steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*-PX5hvJ2Nu3Wlq2x.png" /></figure><p>Once you have authorised the application, you will get a code that you need to copy and paste into the Notebook. If successful, a project selector will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/0*IBfCiJtYTKu7xGXt.png" /></figure><p>With Google Colab, you can create advanced forms -e.g. if you use the “Choose your project” form, the code will generate a selector with all your projects in the Search Console. This way you can easily test the script on the project you want.</p><p>Once selected, the script is ready to use..</p><h3>DATA PREPARATION</h3><p>Then, the “<em>Get your data</em>” and “<em>Prepare Comparative data</em>” forms format your data compliantly.</p><p>Note that if you specify a 30-day period, the script will split the data in two and compare the last 15 days with the first 15.</p><h3>LET’S TEST THE QUERYCAT LIBRARY TO CATEGORISE QUERIES</h3><p>The <em>querycat.Categorize</em> function, takes the following arguments.<br>– position 1: a Pandas Dataframe that includes at least a column of search queries.<br>– col: The name of the query column from the DataFrame<br>– alg: <em>apriori </em>(Apriori Algorithm), or <em>fpgrowth </em>(FP Growth Algorithm)<br>– min_support: The number of times the subset terms should be found in the dataset.</p><p>When run, it will print the number of found categories, as well as the frequency distribution of queries in each category:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/0*BDUAuWB2Fs1W9x9J.jpg" /></figure><p>Here for example, the script found 15 categories.</p><p>Then, there is another form called ‘<em>Show original data</em>‘ which appends each category to each search query.</p><p>You can also save that dataset to a csv file via this line of code:</p><pre><em>catz.df.to_csv(&#39;filename.csv&#39;, index=False)</em></pre><p>Finally, the “Convey upwards and downwards variations” form calculates upward or downward variations between the two periods.</p><h3>GO TO THE MOST INTERESTING PART WITH BERT.</h3><p>BERT is included in the Hugging Face library detailed above, itself included in the <em>querycat.BERTSim</em> function.</p><p>This function will identify the categories that are semantically close.</p><p>To initialise the <em>BERTSim class</em>, you must specify the model to use (we already defined it above).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/0*r61sU6Xqy6oGP-5B.png" /></figure><p>Then there are two useful functions:<br>– <em>get_similar_df </em>retrieves the top matching categories<br>– <em>diff_plot </em>plots the output in 2d vector space</p><h4>CALCULATE A SIMILARITY SCORE</h4><p>The <em>get_similar_df </em>function takes a term as a parameter (corresponding to a category ) and returns the top matching categories by cosine similarity (for connoisseurs, a similarity score from 0 to 1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*ToOIoNYhA7lzht4M.png" /></figure><p>The above screenshot shows an example in French where BERT understands the connection between ‘cruise‘, ‘trip‘ and ‘voyage‘.</p><h4>VIEW THE RESULTS</h4><p>The <em>diff_plot</em> function can plot your categories in a 2d vector space, adding information about click variations:<br>– green for a positive variation<br>– red for a negative variation<br>– the size of the bubbles indicates the magnitude of the change</p><p>With this function, you can test dimension reduction strategies (algorithms such as tnse, umap or pca), simplifying the 768 dimensions of BERT embeddings down to two dimensions.</p><p>We will leave it to the reader to investigate these algorithms, but as JR pointed out in his post, “umap” usually has a good mixture of quality and efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ZmE0MOQRCGLwr5Rr.png" /></figure><h3>CONCLUSION</h3><p>Now you have a plug and play solution to:<br>– auto-categorise Search Console queries semantically in 6 different languages.<br>– narrow down the time frame.<br>– visualise results and follow trends on a weekly basis.</p><p>Big thanks to Charly Wargnier <a href="https://twitter.com/DataChaz">https://twitter.com/DataChaz</a> for the editing and proofreading. Also Kudos to JR Oakes, author of the original script. Also Kudos to t<a href="https://transfer-learning.ai/">ransfer learning</a> and <a href="https://www.datamarketinglabs.com/">datamarketinglabs.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44af1b053a29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>