{"id":10603,"date":"2019-04-10T17:07:08","date_gmt":"2019-04-10T17:07:08","guid":{"rendered":"https:\/\/wordlift.io\/blog\/en\/?p=10603"},"modified":"2021-03-02T08:05:46","modified_gmt":"2021-03-02T07:05:46","slug":"keyword-suggestion-tool-tensorflow","status":"publish","type":"post","link":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/","title":{"rendered":"How to build a keyword suggestion tool using TensorFlow"},"content":{"rendered":"<p><span style=\"font-weight: 400\">One of the most fascinating features of deep neural networks applied to <a class=\"wl-entity-page-link\" title=\"Natural language processing\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/natural-language-processing\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/natural_language_processing;http:\/\/rdf.freebase.com\/ns\/m.05flf;http:\/\/dbpedia.org\/resource\/Natural_language_processing;http:\/\/be.dbpedia.org\/resource\/\u0410\u043f\u0440\u0430\u0446\u043e\u045e\u043a\u0430_\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u0430\u0439_\u043c\u043e\u0432\u044b;http:\/\/ru.dbpedia.org\/resource\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e_\u044f\u0437\u044b\u043a\u0430;http:\/\/pt.dbpedia.org\/resource\/Processamento_de_linguagem_natural;http:\/\/bg.dbpedia.org\/resource\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043d\u0430_\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d_\u0435\u0437\u0438\u043a;http:\/\/lt.dbpedia.org\/resource\/Nat\u016bralios_kalbos_apdorojimas;http:\/\/fr.dbpedia.org\/resource\/Traitement_automatique_du_langage_naturel;http:\/\/uk.dbpedia.org\/resource\/\u041e\u0431\u0440\u043e\u0431\u043a\u0430_\u043f\u0440\u0438\u0440\u043e\u0434\u043d\u043e\u0457_\u043c\u043e\u0432\u0438;http:\/\/id.dbpedia.org\/resource\/Pemrosesan_bahasa_alami;http:\/\/ca.dbpedia.org\/resource\/Processament_de_llenguatge_natural;http:\/\/sr.dbpedia.org\/resource\/Obrada_prirodnih_jezika;http:\/\/en.dbpedia.org\/resource\/Natural_language_processing;http:\/\/is.dbpedia.org\/resource\/M\u00e1lgreining;http:\/\/it.dbpedia.org\/resource\/Elaborazione_del_linguaggio_naturale;http:\/\/es.dbpedia.org\/resource\/Procesamiento_de_lenguajes_naturales;http:\/\/cs.dbpedia.org\/resource\/Zpracov\u00e1n\u00ed_p\u0159irozen\u00e9ho_jazyka;http:\/\/pl.dbpedia.org\/resource\/Przetwarzanie_j\u0119zyka_naturalnego;http:\/\/ro.dbpedia.org\/resource\/Prelucrarea_limbajului_natural;http:\/\/da.dbpedia.org\/resource\/Sprogteknologi;http:\/\/tr.dbpedia.org\/resource\/Do\u011fal_dil_i\u015fleme\" >NLP<\/a> is that, provided with enough examples of human language, they can generate text and help us discover many of the subtle variations in meanings. In a <\/span><a href=\"https:\/\/ai.googleblog.com\/2017\/05\/efficient-smart-reply-now-for-gmail.html\"><span style=\"font-weight: 400\">recent blog post<\/span><\/a><span style=\"font-weight: 400\"> by Google research scientist Brian Strope and engineering director <a class=\"wl-entity-page-link\" title=\"Kurzweil\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/ray-kurzweil\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/ray_kurzweil;http:\/\/rdf.freebase.com\/ns\/m.06gyd;http:\/\/yago-knowledge.org\/resource\/Ray_Kurzweil;http:\/\/dbpedia.org\/resource\/Ray_Kurzweil\" >Ray Kurzweil<\/a> we read:<\/span><\/p>\n<blockquote><p><span style=\"font-weight: 400\">\u201cThe content of language is deeply hierarchical, reflected in the structure of language itself, going from letters to words to phrases to sentences to paragraphs to sections to chapters to books to authors to libraries, etc.\u201d <\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400\">Following this hierarchical structure, new computational language models, aim at simplifying the way we communicate and have silently entered our daily lives; from Gmail \u201cSmart Reply\u201d feature to the keyboard in our smartphones, recurrent neural network, and character-word level prediction using LSTM (<\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Long_short-term_memory\"><span style=\"font-weight: 400\">Long Short Term Memory<\/span><\/a><span style=\"font-weight: 400\">) have paved the way for a new generation of agentive applications. <\/span><\/p>\n<h2><span style=\"font-weight: 400\">From keyword research to keyword generation<\/span><\/h2>\n<p><span style=\"font-weight: 400\">As usual with my <a class=\"wl-entity-page-link\" title=\"Artificial intelligence\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/artificial-intelligence\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/artificial_intelligence;http:\/\/rdf.freebase.com\/ns\/m.0mkz;http:\/\/dbpedia.org\/resource\/Artificial_intelligence;http:\/\/data.wordlift.io\/wl0216\/entity\/artificial_intelligence_2;http:\/\/data.wordlift.io\/wl0216\/entity\/artificial_intelligence;http:\/\/data.wordlift.io\/wl0216\/entity\/artificial_intelligence_2;http:\/\/pt.dbpedia.org\/resource\/Intelig\u00eancia_artificial;http:\/\/hr.dbpedia.org\/resource\/Umjetna_inteligencija;http:\/\/hu.dbpedia.org\/resource\/Mesters\u00e9ges_intelligencia;http:\/\/id.dbpedia.org\/resource\/Kecerdasan_buatan;http:\/\/is.dbpedia.org\/resource\/Gervigreind;http:\/\/it.dbpedia.org\/resource\/Intelligenza_artificiale;http:\/\/ro.dbpedia.org\/resource\/Inteligen\u021b\u0103_artificial\u0103;http:\/\/be.dbpedia.org\/resource\/\u0428\u0442\u0443\u0447\u043d\u044b_\u0456\u043d\u0442\u044d\u043b\u0435\u043a\u0442;http:\/\/ru.dbpedia.org\/resource\/\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439_\u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442;http:\/\/bg.dbpedia.org\/resource\/\u0418\u0437\u043a\u0443\u0441\u0442\u0432\u0435\u043d_\u0438\u043d\u0442\u0435\u043b\u0435\u043a\u0442;http:\/\/sk.dbpedia.org\/resource\/Umel\u00e1_inteligencia;http:\/\/sl.dbpedia.org\/resource\/Umetna_inteligenca;http:\/\/ca.dbpedia.org\/resource\/Intel\u00b7lig\u00e8ncia_artificial;http:\/\/sq.dbpedia.org\/resource\/Inteligjenca_artificiale;http:\/\/sr.dbpedia.org\/resource\/\u0412\u0458\u0435\u0448\u0442\u0430\u0447\u043a\u0430_\u0438\u043d\u0442\u0435\u043b\u0438\u0433\u0435\u043d\u0446\u0438\u0458\u0430;http:\/\/sv.dbpedia.org\/resource\/Artificiell_intelligens;http:\/\/cs.dbpedia.org\/resource\/Um\u011bl\u00e1_inteligence;http:\/\/da.dbpedia.org\/resource\/Kunstig_intelligens;http:\/\/tr.dbpedia.org\/resource\/Yapay_zek\u00e2;http:\/\/de.dbpedia.org\/resource\/K\u00fcnstliche_Intelligenz;http:\/\/lt.dbpedia.org\/resource\/Dirbtinis_intelektas;http:\/\/lv.dbpedia.org\/resource\/M\u0101ksl\u012bgais_intelekts;http:\/\/uk.dbpedia.org\/resource\/\u0428\u0442\u0443\u0447\u043d\u0438\u0439_\u0456\u043d\u0442\u0435\u043b\u0435\u043a\u0442;http:\/\/en.dbpedia.org\/resource\/Artificial_intelligence;http:\/\/es.dbpedia.org\/resource\/Inteligencia_artificial;http:\/\/et.dbpedia.org\/resource\/Tehisintellekt;http:\/\/nl.dbpedia.org\/resource\/Kunstmatige_intelligentie;http:\/\/no.dbpedia.org\/resource\/Kunstig_intelligens;http:\/\/fi.dbpedia.org\/resource\/Teko\u00e4ly;http:\/\/fr.dbpedia.org\/resource\/Intelligence_artificielle;http:\/\/pl.dbpedia.org\/resource\/Sztuczna_inteligencja\" >AI<\/a>-powered SEO experiments, I started with a concrete use-case. One of our strongest publishers in the tech sector was asking us <\/span><b>new unexplored search intents<\/b><span style=\"font-weight: 400\"> to invest on with articles and how to guides. Search marketers, copywriters and SEOs, in the last 20 years have been scouting for the right keyword to connect with their audience. While there is a large number of available tools for doing keyword research I thought,&nbsp;<span>wouldn\u2019t it be better if our client could have <strong>a smart auto-complete to generate any number of keywords<\/strong> in their semantic domain, instead than keyword data generated by us?<\/span><\/span><b>&nbsp;<\/b><span style=\"font-weight: 400\">The way a search intent (or query) can be generated, I also thought, is also quite similar to the way a title could be suggested during the editing phase of an article. And titles (or SEO titles), with a trained language model that takes into account what people search, could help us find the audience we\u2019re looking for in a simpler way.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><img decoding=\"async\" class=\"aligncenter wp-image-10367\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/03\/colab_favicon_256px.png\" alt=\"\" width=\"83\" height=\"73\"><\/td>\n<td><span style=\"font-weight: 400\">Jump directly to the code: <a href=\"https:\/\/colab.research.google.com\/drive\/1kJ_0X4RwO1jT1j4lXDOHtMYMsrI_TDBC\"><strong>Interactive textgenrnn Demo w\/ GPU for keyword generation<\/strong><\/a><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span style=\"font-weight: 400\">The unfair advantage of Recurrent Neural Networks<\/span><\/h2>\n<p><span style=\"font-weight: 400\">What makes an RNNs \u201cmore intelligent\u201d when compared to feed-forward networks, is that <\/span><span style=\"font-weight: 400\">rather than working on a fixed number of steps they compute sequences of vectors. They are not limited to process only the current input, but also everything that they have perceived previously in time.<\/span><\/p>\n<figure id=\"attachment_10605\" aria-describedby=\"caption-attachment-10605\" style=\"width: 545px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10605\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/srn_elman.png\" alt=\"A diagram of a Simple Recurring Network by Jeff Helman\" width=\"545\" height=\"318\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/srn_elman.png 545w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/srn_elman-300x175.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/srn_elman-150x88.png 150w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><figcaption id=\"caption-attachment-10605\" class=\"wp-caption-text\">A diagram of a Simple Recurring Network by <a href=\"https:\/\/web.stanford.edu\/group\/pdplab\/pdphandbook\/handbookch8.html\"><span style=\"font-weight: 400\">Jeff Helman<\/span><\/a><\/figcaption><\/figure>\n<p><span style=\"font-weight: 400\">This characteristic makes them particularly efficient in processing human language (a sequence of letters, words, sentences, and paragraphs) as well as music (a sequence of notes, measures, and phrases) or videos (a sequence of images). <\/span><\/p>\n<p><span style=\"font-weight: 400\">RNN, I learned in the <\/span><a href=\"http:\/\/karpathy.github.io\/2015\/05\/21\/rnn-effectiveness\/\"><span style=\"font-weight: 400\">seminal blog post by Andrej Karpathy<\/span><\/a><span style=\"font-weight: 400\"> on their effectiveness, are considered <\/span><a href=\"http:\/\/binds.cs.umass.edu\/papers\/1995_Siegelmann_Science.pdf\"><span style=\"font-weight: 400\">Turing-Complete<\/span><\/a><span style=\"font-weight: 400\">: this basically means that they can potentially build complete programs. &nbsp;<\/span><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-10606\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21.png\" alt=\"RNN vs FFNN\" width=\"1600\" height=\"884\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21.png 1600w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-300x166.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-1024x566.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-768x424.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-1536x849.png 1536w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-150x83.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/0_mRHhGAbsKaJPbT21-1080x597.png 1080w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Here above you can see the difference between a recurrent neural network and a feed-forward neural network. Basically, RNNs&nbsp;have a short-memory that allow them to store the information processed by the previous layers. The hidden state is looped back as part of the input. LSTMs are an extension of RNNs whose goal is to \u201cprolong\u201d or \u201cextend\u201d this internal memory &#8211; hence allowing them to remember previous words, previous sentences or any other value from the beginning of a long sequence.<\/span><\/p>\n<figure id=\"attachment_10608\" aria-describedby=\"caption-attachment-10608\" style=\"width: 1656px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10608\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm.png\" alt=\"\" width=\"1656\" height=\"648\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm.png 1656w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-300x117.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-1024x401.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-768x301.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-1536x601.png 1536w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-150x59.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/lstm-1080x423.png 1080w\" sizes=\"(max-width: 1656px) 100vw, 1656px\" \/><figcaption id=\"caption-attachment-10608\" class=\"wp-caption-text\">The LSTM cell where each gate works like a perceptron.<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400\">Imagine a long article where I explained that I am Italian at the beginning of it and then this information is followed by other let\u2019s say 2.000 words. An LSTM is designed in such a way that it can \u201c<a class=\"wl-entity-page-link\" title=\"precision\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/precision-and-recall\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/precision_and_recall;http:\/\/dbpedia.org\/resource\/Precision_and_recall;http:\/\/rdf.freebase.com\/ns\/m.03d144\" >recall<\/a>\u201d that piece of information while processing the last sentence of the article and use it to infer, for example, that I speak Italian. A common LSTM cell is made of an <\/span><b>input gate<\/b><span style=\"font-weight: 400\"><\/span>, an <b>output gate<\/b><span style=\"font-weight: 400\"><\/span> and a <b>forget gate<\/b><span style=\"font-weight: 400\"><\/span>. The cell remembers values over a time interval and the three gates <i><span style=\"font-weight: 400\">regulate the flow of information<\/span><\/i><span style=\"font-weight: 400\"> into and out of the cell much like a mini neural network. In this way, LSTMs can overcome the <\/span><a href=\"https:\/\/www.superdatascience.com\/recurrent-neural-networks-rnn-the-vanishing-gradient-problem\/\"><i><span style=\"font-weight: 400\">vanishing gradient problem<\/span><\/i><\/a><span style=\"font-weight: 400\"> of traditional RNNs. <\/span><span style=\"font-weight: 400\">&nbsp;<\/span><span style=\"font-weight: 400\">&nbsp;&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">If you want to learn more in-depth on the mathematics behind recurrent neural networks and LSTMs, go ahead and read <\/span><a href=\"http:\/\/colah.github.io\/posts\/2015-08-Understanding-LSTMs\/\"><span style=\"font-weight: 400\">this article<\/span><\/a><span style=\"font-weight: 400\"> by Christopher Olah. &nbsp;<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Let\u2019s get started: \u201cIo sono un compleanno!\u201d<\/span><\/h2>\n<p><span style=\"font-weight: 400\">After reading Andrej Karpathy\u2019s blog post I found <\/span><b>a terrific Python library called <\/b><a href=\"https:\/\/pypi.org\/project\/textgenrnn\/\"><b>textgenrnn<\/b><\/a><span style=\"font-weight: 400\"> by <\/span><a href=\"https:\/\/minimaxir.com\/\"><span style=\"font-weight: 400\">Max Woolf<\/span><\/a><span style=\"font-weight: 400\">. This library is developed on top of TensorFlow and makes it super easy to experiment with Recurrent Neural Network for text generation.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Before looking at generating keywords for our client I decided to learn text generation and how to tune the <\/span><span style=\"font-weight: 400\">hyperparameters in textgenrnn <\/span><span style=\"font-weight: 400\">by doing a few experiments. <\/span><\/p>\n<blockquote><p><b>AI is interdisciplinary<\/b><span style=\"font-weight: 400\"> by definition, the goal of every project is to bridge the gap between computer science and human intelligence. <\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400\">I started my tests by throwing in the process a large text file in English that I found on Peter Norvig\u2019s website (<\/span><a href=\"https:\/\/norvig.com\/big.txt\"><span style=\"font-weight: 400\">https:\/\/norvig.com\/big.txt<\/span><\/a><span style=\"font-weight: 400\">) and I end up, thanks to the help of <\/span><a href=\"https:\/\/www.linkedin.com\/in\/priscilladepace\/\"><span style=\"font-weight: 400\">Priscilla<\/span><\/a><span style=\"font-weight: 400\"> (a clever content writer collaborating with us), \u201c<\/span><i><span style=\"font-weight: 400\">resurrecting<\/span><\/i><span style=\"font-weight: 400\">\u201d <\/span><b>David Foster Wallace<\/b><span style=\"font-weight: 400\"><\/span> with its monumental Infinite Jest (provided in Italian from Priscilla\u2019s ebook library and spiced up with some of her random writings).<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-10611\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\" alt=\"\" width=\"3608\" height=\"1200\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png 3608w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-300x100.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-1024x341.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-768x255.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-1536x511.png 1536w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-2048x681.png 2048w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-150x50.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20-1080x359.png 1080w\" sizes=\"(max-width: 3608px) 100vw, 3608px\" \/><\/p>\n<p><span style=\"font-weight: 400\">At the beginning of the training process &#8211; in a character by character configuration &#8211; you can see exactly what the network sees: a nonsensical sequence of characters that few epochs (training iteration cycles) after will transform into proper words. &nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">As I became more accustomed to the training process I was able to generate the following phrase: <\/span><\/p>\n<blockquote><p><b>\u201cIo sono un compleanno. Io non voglio temere niente? Come no, ancora per Lenz.\u201d<\/b><\/p>\n<p><span style=\"font-weight: 400\">\u201c<\/span><i><span style=\"font-weight: 400\">I&#8217;m a birthday. I don&#8217;t want to fear anything? And, of course, still for Lenz.<\/span><\/i><span style=\"font-weight: 400\">\u201d<\/span><\/p><\/blockquote>\n<figure id=\"attachment_10613\" aria-describedby=\"caption-attachment-10613\" style=\"width: 284px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10613\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/images.jpeg\" alt=\"David Foster Wallace\" width=\"284\" height=\"178\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/images.jpeg 284w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/images-150x94.jpeg 150w\" sizes=\"(max-width: 284px) 100vw, 284px\" \/><figcaption id=\"caption-attachment-10613\" class=\"wp-caption-text\">David Foster Wallace<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400\">Unquestionably a great piece of literature ?that gave me the confidence to move ahead in creating <\/span><b>a smart keyword suggest tool<\/b><span style=\"font-weight: 400\"> for our tech magazine.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">The dataset used to train the model<\/span><\/h2>\n<p><span style=\"font-weight: 400\">As soon as I was confident enough to get things working (this means basically being able to find a configuration that &#8211; with the given dataset &#8211; could produce a language model with a loss value equal or below 1.0), I asked Doreid, our SEO expert to work on WooRank\u2019s API and to prepare <\/span><b>a list of 100.000 search queries<\/b><span style=\"font-weight: 400\"> that could be relevant for the website. <\/span><\/p>\n<p><span style=\"font-weight: 400\">To scale up the number we began by querying Wikidata to get a list of software for Windows that our readers might be interested to read about. As for any <a class=\"wl-entity-page-link\" title=\"Machine Learning\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/machine-learning\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/machine_learning;http:\/\/dbpedia.org\/resource\/Machine_learning;https:\/\/www.wikidata.org\/wiki\/Q2539\" >ML<\/a>, project <\/span><b>data is the most strategic asset<\/b><span style=\"font-weight: 400\">. So while we want to be able to generate <\/span><i><span style=\"font-weight: 400\">never-seen-before queries<\/span><\/i><span style=\"font-weight: 400\"> we also want to train the machine on something that is unquestionably good from the start. <\/span><\/p>\n<p><span style=\"font-weight: 400\">The best way to connect words to concepts is to define a context for these words. In our specific use case, the context is primarily represented by <\/span><b>software applications that run on the Microsoft Windows operating system<\/b><span style=\"font-weight: 400\">. We began by slicing the Wikidata graph with <\/span><a href=\"http:\/\/tinyurl.com\/yyq4ylsx\"><span style=\"font-weight: 400\">a simple query<\/span><\/a><span style=\"font-weight: 400\"> that provided us with the list of 3.780+ software apps that runs on Windows and 470+ related software categories. By expanding this list of keywords and categories, Doreid came up with a CSV file containing the training dataset for our generator.<\/span><\/p>\n<figure id=\"attachment_10618\" aria-describedby=\"caption-attachment-10618\" style=\"width: 1126px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10618\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training.png\" alt=\"The first rows in the training dataset. \" width=\"1126\" height=\"646\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training.png 1126w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training-300x172.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training-1024x587.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training-768x441.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training-150x86.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/keyword-training-1080x620.png 1080w\" sizes=\"(max-width: 1126px) 100vw, 1126px\" \/><figcaption id=\"caption-attachment-10618\" class=\"wp-caption-text\">The first rows in the training dataset.<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400\">After several iterations, I was able to define the <strong>top performing configuration<\/strong> by applying the values below. I moved from character-level to word-level and this greatly increased the speed of the training. As you can see I have 6 layers with 128 cells on each layer and I am running the training for 100 epochs. This is indeed limited, depending on the size of the dataset, by the fact that <\/span><b>Google Colab after 4 hours of training stops the session<\/b><span style=\"font-weight: 400\"><\/span> (this is also <i><span style=\"font-weight: 400\">a gentle reminder<\/span><\/i><span style=\"font-weight: 400\"> that it might be the right time to move from Google Colab to Cloud Datalab &#8211; the paid version in Google Cloud). <\/span><\/p>\n<figure id=\"attachment_10619\" aria-describedby=\"caption-attachment-10619\" style=\"width: 1880px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10619\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn.png\" alt=\"Textgenrnn configuration\" width=\"1880\" height=\"516\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn.png 1880w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-300x82.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-1024x281.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-768x211.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-1536x422.png 1536w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-150x41.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/configuration-rnn-1080x296.png 1080w\" sizes=\"(max-width: 1880px) 100vw, 1880px\" \/><figcaption id=\"caption-attachment-10619\" class=\"wp-caption-text\">Textgenrnn configuration<\/figcaption><\/figure>\n<figure id=\"attachment_10620\" aria-describedby=\"caption-attachment-10620\" style=\"width: 1722px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-10620\" src=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn.png\" alt=\"\" width=\"1722\" height=\"854\" srcset=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn.png 1722w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-300x149.png 300w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-1024x508.png 1024w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-768x381.png 768w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-1536x762.png 1536w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-150x74.png 150w, https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/training-textgenrnn-1080x536.png 1080w\" sizes=\"(max-width: 1722px) 100vw, 1722px\" \/><figcaption id=\"caption-attachment-10620\" class=\"wp-caption-text\">Here we see the initial keywords being generated while training the model<\/figcaption><\/figure>\n<h2><span style=\"font-weight: 400\">Rock &amp; Roll, the fun part<\/span><\/h2>\n<p><span style=\"font-weight: 400\">After a few hours of training, the model was ready to generate our <\/span><strong>never-seen-before search intents<\/strong><span style=\"font-weight: 400\"> with a simple python script containing the following lines. &nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">Here a few examples of generated queries:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">where to find google drive downloads<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">where to find my bookmarks on google chrome<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how to change your turn on google chrome<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how to remove invalid server certificate error in google chrome<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how to delete a google account from chrome<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how to remove google chrome from windows 8 mode<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how to completely remove google chrome from windows 7<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">how do i remove google chrome from my laptop<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">You can play with <\/span><span style=\"font-weight: 400\">temperatures<\/span><span style=\"font-weight: 400\"> to <\/span><i><span style=\"font-weight: 400\">improve the creativity<\/span><\/i><span style=\"font-weight: 400\"><\/span> of the results or provide a <span style=\"font-weight: 400\">prefix<span style=\"font-weight: 400\"><\/span> to indicate the first words of the keyword that you might have in mind and let the generator figure out the rest.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Takeaways and future work<\/span><\/h2>\n<p><b>\u201cSmart Reply\u201d suggestions can be applied to <\/b><b><i>keyword research work<\/i><\/b> <span style=\"font-weight: 400\">and is worth assessing in a systematic way the quality of these suggestions in terms of:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><i><span style=\"font-weight: 400\">validity <\/span><\/i><span style=\"font-weight: 400\">&#8211; is this meaningful or not? Does it make sense for a human?<\/span><\/li>\n<li style=\"font-weight: 400\"><i><span style=\"font-weight: 400\">relevance <\/span><\/i><span style=\"font-weight: 400\">&#8211; is this query really hitting on the target audience the website has? Or is it off-topic? and<\/span><\/li>\n<li style=\"font-weight: 400\"><i><span style=\"font-weight: 400\">impact<\/span><\/i><span style=\"font-weight: 400\"> &#8211; is this keyword well-balanced in terms of competitiveness and volume considering the website we are working for?<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">The initial results are promising, all of the initial 200+ generated queries were different from the ones in the training set and, by increasing the temperature, we could explore new angles on an existing topic (i.e. \u201cwhere is area 51 on google earth?\u201d) or even evaluate new topics (ie. \u201chow to watch android photos in Dropbox\u201d or \u201cadvertising plugin for google chrome\u201d). <\/span><\/p>\n<p><span style=\"font-weight: 400\">It would be simply terrific to implement &#8211; with a Generative Adversarial Network (or using Reinforcement Learning) &#8211; a way to help the generator <\/span><b>produce only valuable keywords<\/b><span style=\"font-weight: 400\"> (keywords that &#8211; given the website &#8211; are valid, relevant and impactful in terms of competitiveness and reach). Once again, it is crucial to define the right mix of keywords we need to train our model (can we source them from a graph as we did in this case? shall we only use the top ranking keywords from our best competitors? Should we mainly focus on long tail, conversational queries and leave out the rest?).<\/span><\/p>\n<p><span style=\"font-weight: 400\">One thing that emerged very clearly is that: experiments like this one (combining LSTMs and data sourcing using public <a class=\"wl-entity-page-link\" title=\"Knowledge Graph\" href=\"https:\/\/wordlift.io\/blog\/en\/entity\/knowledge-graph\/\" data-id=\"http:\/\/data.wordlift.io\/wl0216\/entity\/knowledge_graph;https:\/\/www.wikidata.org\/wiki\/Q33002955\" >knowledge graphs<\/a> such as Wikidata) are a great way to shed some light on how Google might be working in improving the evaluation of search queries using neural nets. What is now called \u201cNeural Matching\u201d might most probably be just a sexy PR expression but, behind the recently announced capability of analyzing long documents and evaluating search queries, it is fair to expect that Google is using RNNs architectures, contextual word embeddings, and semantic similarity. As deep learning and AI, in general, becomes more accessible (<\/span><b><i>frameworks are open source<\/i><\/b><span style=\"font-weight: 400\"><\/span> and there is <b><i>a healthy open knowledge sharing<\/i><\/b><span style=\"font-weight: 400\"> in the ML\/DL community) it becomes evident that Google leads the industry with the amount of data they have access to and the computational resources they control.<\/span><\/p>\n\n<h4><span style=\"font-weight: 400\">Credits<\/span><\/h4>\n<p><span style=\"font-weight: 400;color: #808080\">This experiment would not have been possible without textgenrnn by <\/span><span style=\"color: #808080\"><a style=\"color: #808080\" href=\"https:\/\/minimaxir.com\/\"><span style=\"font-weight: 400\">Max Woolf<\/span><\/a><span style=\"font-weight: 400\"> and TensorFlow. I am also deeply thankful to all of our VIP clients engaging in our <\/span><\/span><span style=\"color: #808080\"><a style=\"color: #808080\" href=\"https:\/\/wordlift.io\/seo-management-service\/\"><span style=\"font-weight: 400\">SEO management services<\/span><\/a><span style=\"font-weight: 400\">, our terrific VIP team: Laura, Doreid, Nevine and everyone else constantly \u201c<\/span><\/span><span style=\"color: #808080\"><i><span style=\"font-weight: 400\">lifting<\/span><\/i><span style=\"font-weight: 400\">\u201d our startup, <a href=\"https:\/\/wordlift.io\/blog\/en\/entity\/teodora-petkova\/\">Theodora Petkova<\/a> for challenging my robotic mind ?and my beautiful family for sustaining my work.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most fascinating features of deep neural networks applied to NLP is that, provided with enough examples of human language, they can generate text and help us discover many of the subtle variations in meanings. In a recent blog post by Google research scientist Brian Strope and engineering director Ray Kurzweil we read: &hellip; <a href=\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\">Continued<\/a><\/p>\n","protected":false},"author":6,"featured_media":10611,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"wl_entities_gutenberg":"","_wlpage_enable":"","footnotes":""},"categories":[28,8],"tags":[],"wl_entity_type":[30],"coauthors":[],"class_list":["post-10603","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-world-summit-ai","category-seo","wl_entity_type-article"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to build a keyword suggestion tool using TensorFlow - WordLift Blog<\/title>\n<meta name=\"description\" content=\"How to learn about LSTM and build a SEO keyword suggestion tool with &quot;smart auto-complete&quot; using a recurrent neural network and TensorFlow ?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build a keyword suggestion tool using TensorFlow - WordLift Blog\" \/>\n<meta property=\"og:description\" content=\"How to learn about LSTM and build a SEO keyword suggestion tool with &quot;smart auto-complete&quot; using a recurrent neural network and TensorFlow ?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\" \/>\n<meta property=\"og:site_name\" content=\"WordLift Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-10T17:07:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-02T07:05:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3608\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Andrea Volpini\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrea Volpini\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\"},\"author\":{\"name\":\"Andrea Volpini\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/574352082cc71dab8d164410f1cabe0a\"},\"headline\":\"How to build a keyword suggestion tool using TensorFlow\",\"datePublished\":\"2019-04-10T17:07:08+00:00\",\"dateModified\":\"2021-03-02T07:05:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\"},\"wordCount\":1987,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\",\"articleSection\":[\"AI &amp; Machine Learning\",\"seo\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\",\"url\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\",\"name\":\"How to build a keyword suggestion tool using TensorFlow - WordLift Blog\",\"isPartOf\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\",\"datePublished\":\"2019-04-10T17:07:08+00:00\",\"dateModified\":\"2021-03-02T07:05:46+00:00\",\"description\":\"How to learn about LSTM and build a SEO keyword suggestion tool with \\\"smart auto-complete\\\" using a recurrent neural network and TensorFlow ?\",\"breadcrumb\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage\",\"url\":\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\",\"contentUrl\":\"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png\",\"width\":3608,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/wordlift.io\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build a keyword suggestion tool using TensorFlow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#website\",\"url\":\"https:\/\/wordlift.io\/blog\/en\/\",\"name\":\"WordLift Blog\",\"description\":\"AI-Powered SEO\",\"publisher\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wordlift.io\/blog\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#organization\",\"name\":\"WordLift\",\"url\":\"https:\/\/wordlift.io\/blog\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/mk0wordliftblog7j5te.kinstacdn.com\/wp-content\/uploads\/sites\/3\/2017\/04\/logo-1.png\",\"contentUrl\":\"https:\/\/mk0wordliftblog7j5te.kinstacdn.com\/wp-content\/uploads\/sites\/3\/2017\/04\/logo-1.png\",\"width\":152,\"height\":40,\"caption\":\"WordLift\"},\"image\":{\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/574352082cc71dab8d164410f1cabe0a\",\"name\":\"Andrea Volpini\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/image\/466a1652833e48ca11c81b363eba7c25\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6b9d3d311b50a8749201fe4b318907a8?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6b9d3d311b50a8749201fe4b318907a8?s=96&d=mm&r=pg\",\"caption\":\"Andrea Volpini\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to build a keyword suggestion tool using TensorFlow - WordLift Blog","description":"How to learn about LSTM and build a SEO keyword suggestion tool with \"smart auto-complete\" using a recurrent neural network and TensorFlow ?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/","og_locale":"en_US","og_type":"article","og_title":"How to build a keyword suggestion tool using TensorFlow - WordLift Blog","og_description":"How to learn about LSTM and build a SEO keyword suggestion tool with \"smart auto-complete\" using a recurrent neural network and TensorFlow ?","og_url":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/","og_site_name":"WordLift Blog","article_published_time":"2019-04-10T17:07:08+00:00","article_modified_time":"2021-03-02T07:05:46+00:00","og_image":[{"width":3608,"height":1200,"url":"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png","type":"image\/png"}],"author":"Andrea Volpini","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrea Volpini","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#article","isPartOf":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/"},"author":{"name":"Andrea Volpini","@id":"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/574352082cc71dab8d164410f1cabe0a"},"headline":"How to build a keyword suggestion tool using TensorFlow","datePublished":"2019-04-10T17:07:08+00:00","dateModified":"2021-03-02T07:05:46+00:00","mainEntityOfPage":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/"},"wordCount":1987,"commentCount":0,"publisher":{"@id":"https:\/\/wordlift.io\/blog\/en\/#organization"},"image":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage"},"thumbnailUrl":"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png","articleSection":["AI &amp; Machine Learning","seo"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/","url":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/","name":"How to build a keyword suggestion tool using TensorFlow - WordLift Blog","isPartOf":{"@id":"https:\/\/wordlift.io\/blog\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage"},"image":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage"},"thumbnailUrl":"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png","datePublished":"2019-04-10T17:07:08+00:00","dateModified":"2021-03-02T07:05:46+00:00","description":"How to learn about LSTM and build a SEO keyword suggestion tool with \"smart auto-complete\" using a recurrent neural network and TensorFlow ?","breadcrumb":{"@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#primaryimage","url":"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png","contentUrl":"https:\/\/wordlift.io\/blog\/en\/wp-content\/uploads\/sites\/3\/2019\/04\/image-20.png","width":3608,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/wordlift.io\/blog\/en\/keyword-suggestion-tool-tensorflow\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/wordlift.io\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"How to build a keyword suggestion tool using TensorFlow"}]},{"@type":"WebSite","@id":"https:\/\/wordlift.io\/blog\/en\/#website","url":"https:\/\/wordlift.io\/blog\/en\/","name":"WordLift Blog","description":"AI-Powered SEO","publisher":{"@id":"https:\/\/wordlift.io\/blog\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wordlift.io\/blog\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wordlift.io\/blog\/en\/#organization","name":"WordLift","url":"https:\/\/wordlift.io\/blog\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wordlift.io\/blog\/en\/#\/schema\/logo\/image\/","url":"https:\/\/mk0wordliftblog7j5te.kinstacdn.com\/wp-content\/uploads\/sites\/3\/2017\/04\/logo-1.png","contentUrl":"https:\/\/mk0wordliftblog7j5te.kinstacdn.com\/wp-content\/uploads\/sites\/3\/2017\/04\/logo-1.png","width":152,"height":40,"caption":"WordLift"},"image":{"@id":"https:\/\/wordlift.io\/blog\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/574352082cc71dab8d164410f1cabe0a","name":"Andrea Volpini","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wordlift.io\/blog\/en\/#\/schema\/person\/image\/466a1652833e48ca11c81b363eba7c25","url":"https:\/\/secure.gravatar.com\/avatar\/6b9d3d311b50a8749201fe4b318907a8?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6b9d3d311b50a8749201fe4b318907a8?s=96&d=mm&r=pg","caption":"Andrea Volpini"}}]}},"_wl_alt_label":[],"wl:entity_url":"http:\/\/data.wordlift.io\/wl0216\/post\/how_to_build_a_keyword_suggestion_tool_using_tensorflow","_links":{"self":[{"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/posts\/10603"}],"collection":[{"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/comments?post=10603"}],"version-history":[{"count":0,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/posts\/10603\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/media\/10611"}],"wp:attachment":[{"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/media?parent=10603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/categories?post=10603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/tags?post=10603"},{"taxonomy":"wl_entity_type","embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/wl_entity_type?post=10603"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/wordlift.io\/blog\/en\/wp-json\/wp\/v2\/coauthors?post=10603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}