{"id":39142,"date":"2017-06-13T20:17:58","date_gmt":"2017-06-13T17:17:58","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=39142"},"modified":"2018-11-29T14:29:36","modified_gmt":"2018-11-29T11:29:36","slug":"building-a-chatbot-with-tensorflow-and-keras","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/","title":{"rendered":"Building a Chatbot with TensorFlow and Keras"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#The_challenges\" >The challenges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#Addressing_the_issues\" >Addressing the issues<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#Training_a_model_in_a_cloud\" >Training a model in a cloud<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#Want_details_Watch_the_video\" >Want details? Watch the video!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#Related_slides\" >Related slides<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#Related_reading\" >Related reading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#About_the_expert\" >About the expert<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"The_challenges\"><\/span>The challenges<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Digital assistants built with machine learning solutions are gaining their momentum. However, creating a chatbot is not that easy as it may seem. At the <a href=\"https:\/\/www.altoros.com\/blog\/tag\/tensorbeat\/\">TensorBeat 2017<\/a> conference, <a href=\"https:\/\/www.linkedin.com\/in\/avkashchauhan\/\" target=\"_blank\">Avkash Chauhan<\/a>, Vice President at H2O.ai, outlined major challenges while developing an answer bot using Keras on top of TensorFlow:<\/p>\n<ul>\n<li>Finding proper tags<\/li>\n<li>Finding and removing not-safe-for-work (NSFW) words<\/li>\n<li>Identifying sentiment in the question (positive or negative)<\/li>\n<li>Setting priority to find the answer (low, medium, high, and critical)<\/li>\n<li>Figuring out the gender of a questioner<\/li>\n<li>Rating a question<\/li>\n<li>Removing question duplicates<\/li>\n<\/ul>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow.jpg\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow.jpg\" alt=\"avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow\" width=\"640\" class=\"aligncenter size-full wp-image-39144\" \/><\/a><\/center><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Addressing_the_issues\"><\/span>Addressing the issues<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To address the need of finding proper tags, one may employ word embeddings (<a href=\"https:\/\/www.altoros.com\/blog\/text-prediction-with-tensorflow-and-long-short-term-memory-in-six-steps\/\">word2vec<\/a>). To find and remove not-safe-for-work words, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Brute-force_search\" target=\"_blank\">brute-force search<\/a> and <a href=\"https:\/\/pythonspot.com\/nltk-stop-words\/\" target=\"_blank\">the NLTK stop words<\/a> can be utilized.<\/p>\n<p>Sentiment in the question can be identified by enabling a binomial classification (two classes) paired with tree-based algorithms (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Gradient_boosting\" target=\"_blank\">gradient boosting<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Random_forest\" target=\"_blank\">random forest<\/a>, or <a href=\"https:\/\/docs.h2o.ai\/h2o\/latest-stable\/h2o-docs\/data-science\/drf.html\" target=\"_blank\">distributed random forest<\/a>) or a neural network. With that technique, one can also figure out whether a questioner is male or female.<\/p>\n<p>The above-mentioned algorithms coupled with multinomial classification (four classes) may help out to set priority while looking for an answer. Question rating is defined in the same fashion, but multinomial classification embodies N classes\u2014i.e., as much as needed\u2014to provide for 1\u20135 star rating.<\/p>\n<p>Finding best available answers involves three major steps:<\/p>\n<ol>\n<li>Look for the tags and keywords through <a href=\"https:\/\/www.altoros.com\/blog\/using-k-means-clustering-in-tensorflow\/\">clustering<\/a> and reduction<\/li>\n<li>Create tag and keywords weights for each question<\/li>\n<li>Match tags and keywords with their weights to find top probabilities<\/li>\n<\/ol>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-at-tensorbeat-2017.jpg\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-at-tensorbeat-2017.jpg\" alt=\"avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-at-tensorbeat-2017\" width=\"640\" class=\"aligncenter size-full wp-image-39145\" \/><\/a><\/center><\/p>\n<p>Moving onto the issue of duplicated questions, Avkash exemplified <a href=\"https:\/\/www.kaggle.com\/c\/quora-question-pairs\/data\" target=\"_blank\">the competition<\/a> initiated by Quora. Its goal was <a href=\"https:\/\/www.kaggle.com\/anokas\/data-analysis-xgboost-starter-0-35460-lb\" target=\"_blank\">to predict<\/a> which of the provided pairs of questions contain two questions with the same meaning.<\/p>\n<p>Then, Avkash demonstrated how to classify sentences to identify rating and sentiments using the following data sets:<\/p>\n<ul>\n<li>Real data available at Stack Overflow, Community, Quora, etc.<\/li>\n<li>Experimental data: 41 million reviews in the 1\u20135 star category <a href=\"https:\/\/www.yelp.com\/dataset\/challenge\" target=\"_blank\">available at Yelp<\/a><\/li>\n<li>Twitter sentiment (through searching or mining)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Training_a_model_in_a_cloud\"><\/span>Training a model in a cloud<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The technologies used in the course of training a model can be as follows:<\/p>\n<ul>\n<li>Keras on top of TensorFlow<\/li>\n<li>the NLTK stop words<\/li>\n<li><a href=\"https:\/\/github.com\/stanfordnlp\/GloVe\" target=\"_blank\">the GloVe algorithm<\/a> (pre-trained word2ves data sets\u2014400,000 words)<\/li>\n<li>Sentiment: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">make-sentiment-model.py<\/code> and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">PositiveNegative.ipynb<\/code><\/li>\n<li>Rating: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">make-5star-model.py<\/code> and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">5StarReviews.ipynb<\/code><\/li>\n<li>Prediction: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">PredictNow.py<\/code><\/li>\n<\/ul>\n<p>Apart from being fast, Keras supports both convolutional and recurrent neural networks, as well as their combination.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/building-an-answerbot-with-keras-and-tensorflow-v11.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/building-an-answerbot-with-keras-and-tensorflow-v11.png\" alt=\"building-an-answerbot-with-keras-and-tensorflow-v11\" width=\"640\" class=\"aligncenter size-full wp-image-39146\" \/><\/a><small>A sample production pipeline of creating a chatbot in the cloud (<a href=\"https:\/\/www.slideshare.net\/Avkashslide\/creating-answerbot-with-keras-and-tensorflow-tensorbeat\" rel=\"noopener\" target=\"_blank\">Image credit<\/a>)<\/small><\/center><\/p>\n<p>After the data preparation step, one has to create a data collection and remove stop words. Then, one moves on with tokenizing and uniforming this collection to deliver a final data set, which comprises sentences (<code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">sentences_per_record<\/code>, length) and labels (<code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">label_per_recordm<\/code>, length).<\/p>\n<p>On splitting a data set to train and validate, a predefined word vector is loaded to find match words from the collection and further create an embedding matrix. After delivering and configuring an embedding layer, the training of a model begins.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-tensorbeat-2017.jpg\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-tensorbeat-2017.jpg\" alt=\"avkash-chaunhan-building-an-answer-bot-with-keras-and-tensorflow-tensorbeat-2017\" width=\"640\" class=\"aligncenter size-full wp-image-39147\" \/><\/a><\/center><\/p>\n<p>In case you hit the same prediction, there are a few scenarios to help out:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\">Retrain a model.<\/li>\n<li style=\"margin-bottom: 6px;\">Rebalance a data set by either upsampling a less frequent class or downsampling a more frequent one.<\/li>\n<li style=\"margin-bottom: 6px;\">Adjust class weights by setting a higher class weight for a less frequent class. Thus, the network will focus on the downsampled class during the training process.<\/li>\n<li style=\"margin-bottom: 6px;\">Increase the time of training so that the network concentrates on less frequent classes.<\/li>\n<\/ul>\n<p>To enhance data processing, Avkash suggested using such models as <a href=\"https:\/\/radimrehurek.com\/gensim\/models\/doc2vec.html\" target=\"_blank\">doc2seq<\/a>, <a href=\"https:\/\/www.altoros.com\/blog\/the-magic-behind-google-translate-sequence-to-sequence-models-and-tensorflow\/\">sequence-to-sequence ones<\/a>, and <a href=\"https:\/\/multithreaded.stitchfix.com\/blog\/2016\/05\/27\/lda2vec\/\" target=\"_blank\">lda2vec<\/a>.<\/p>\n<p>You can find the source code of an answer bot demonstrated in <a href=\"https:\/\/github.com\/Avkash\/mldl\/tree\/master\/tensorbeat-answerbot\" target=\"_blank\">Avkash&#8217;s GitHub repo<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Want_details_Watch_the_video\"><\/span>Want details? Watch the video!<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><center><script src=\"https:\/\/fast.wistia.com\/embed\/medias\/f4duqgsgdm.jsonp\" async><\/script><script src=\"https:\/\/fast.wistia.com\/assets\/external\/E-v1.js\" async><\/script><\/p>\n<div class=\"wistia_embed wistia_async_f4duqgsgdm\" style=\"height:358px;width:640px\">&nbsp;<\/div>\n<p><\/center><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Related_slides\"><\/span>Related slides<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><center><iframe loading=\"lazy\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/kLHRbh2NIAqlcp\" width=\"595\" height=\"485\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen><\/iframe><\/center><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Related_reading\"><\/span>Related reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/machine-learning-for-automating-a-customer-service-chatbots-and-neural-networks\/\">Machine Learning for Automating a Customer Service: Chatbots and Neural Networks<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/building-a-keras-based-image-classifier-using-tensorflow-for-a-back-end\/\">Building a Keras-Based Image Classifier Using TensorFlow for a Back End<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/natural-language-processing-and-tensorflow-implementation-across-industries\/\">Natural Language Processing and TensorFlow Implementation Across Industries<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"About_the_expert\"><\/span>About the expert<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><small><em><a href=\"https:\/\/www.linkedin.com\/in\/avkashchauhan\/\" target=\"_blank\">Avkash Chauhan<\/a><\/em> is Vice President at H2O.ai. His responsibilities encompass working with the global enterprise customers to bring their machine and deep learning technical requirements to the engineering team and make sure these requirements are met within the delivered products. Prior to that, Avkash had his own startup, &#8220;Big Data Analytics for DevOps,&#8221; which was acquired in 28 months after launch. You can also check out <a href=\"https:\/\/github.com\/Avkash\" target=\"_blank\">his GitHub profile<\/a>.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The challenges<\/p>\n<p>Digital assistants built with machine learning solutions are gaining their momentum. However, creating a chatbot is not that easy as it may seem. At the TensorBeat 2017 conference, Avkash Chauhan, Vice President at H2O.ai, outlined major challenges while developing an answer bot using Keras on top of TensorFlow:<\/p>\n<p>Finding proper [&#8230;]<\/p>\n","protected":false},"author":3,"featured_media":39150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[748,916,749],"class_list":["post-39142","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-machine-learning","tag-tensorbeat","tag-tensorflow"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Building a Chatbot with TensorFlow and Keras | Altoros<\/title>\n<meta name=\"description\" content=\"This blog post overviews the challenges of building a chatbot, which tools help to resolve them, and tips on training a model and improving prediction results.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Chatbot with TensorFlow and Keras | Altoros\" \/>\n<meta property=\"og:description\" content=\"The challenges Digital assistants built with machine learning solutions are gaining their momentum. However, creating a chatbot is not that easy as it may seem. At the TensorBeat 2017 conference, Avkash Chauhan, Vice President at H2O.ai, outlined major challenges while developing an answer bot using Keras on top of TensorFlow: Finding proper [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-13T17:17:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-29T11:29:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"424\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Sophia Turol\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sophia Turol\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/\",\"name\":\"Building a Chatbot with TensorFlow and Keras | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif\",\"datePublished\":\"2017-06-13T17:17:58+00:00\",\"dateModified\":\"2018-11-29T11:29:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif\",\"width\":640,\"height\":424},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Chatbot with TensorFlow and Keras\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e\",\"name\":\"Sophia Turol\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/05\/trello_card-96x96.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/05\/trello_card-96x96.jpg\",\"caption\":\"Sophia Turol\"},\"description\":\"Sophia Turol is passionate about delivering well-structured articles that cater for picky technical audience. With 3+ years in technical writing and 5+ years in editorship, she enjoys collaboration with developers to create insightful, yet intelligible technical tutorials, overviews, and case studies. Sophie is enthusiastic about deep learning solutions\u2014TensorFlow in particular\u2014and PaaS systems, such as Cloud Foundry.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/sophie-turol\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building a Chatbot with TensorFlow and Keras | Altoros","description":"This blog post overviews the challenges of building a chatbot, which tools help to resolve them, and tips on training a model and improving prediction results.","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:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/","og_locale":"en_US","og_type":"article","og_title":"Building a Chatbot with TensorFlow and Keras | Altoros","og_description":"The challenges Digital assistants built with machine learning solutions are gaining their momentum. However, creating a chatbot is not that easy as it may seem. At the TensorBeat 2017 conference, Avkash Chauhan, Vice President at H2O.ai, outlined major challenges while developing an answer bot using Keras on top of TensorFlow: Finding proper [...]","og_url":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/","og_site_name":"Altoros","article_published_time":"2017-06-13T17:17:58+00:00","article_modified_time":"2018-11-29T11:29:36+00:00","og_image":[{"width":640,"height":424,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif","type":"image\/gif"}],"author":"Sophia Turol","twitter_misc":{"Written by":"Sophia Turol","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/","url":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/","name":"Building a Chatbot with TensorFlow and Keras | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif","datePublished":"2017-06-13T17:17:58+00:00","dateModified":"2018-11-29T11:29:36+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/creating-an-answering-chatbot-using-keras-and-tensorflow.gif","width":640,"height":424},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/building-a-chatbot-with-tensorflow-and-keras\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Building a Chatbot with TensorFlow and Keras"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e","name":"Sophia Turol","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/05\/trello_card-96x96.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/05\/trello_card-96x96.jpg","caption":"Sophia Turol"},"description":"Sophia Turol is passionate about delivering well-structured articles that cater for picky technical audience. With 3+ years in technical writing and 5+ years in editorship, she enjoys collaboration with developers to create insightful, yet intelligible technical tutorials, overviews, and case studies. Sophie is enthusiastic about deep learning solutions\u2014TensorFlow in particular\u2014and PaaS systems, such as Cloud Foundry.","url":"https:\/\/www.altoros.com\/blog\/author\/sophie-turol\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/39142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=39142"}],"version-history":[{"count":7,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/39142\/revisions"}],"predecessor-version":[{"id":39647,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/39142\/revisions\/39647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/39150"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=39142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=39142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=39142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}