{"id":39531,"date":"2017-03-09T19:38:09","date_gmt":"2017-03-09T16:38:09","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=39531"},"modified":"2018-11-29T14:40:31","modified_gmt":"2018-11-29T11:40:31","slug":"optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/","title":{"rendered":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#Generating_expense_reports_with_machine_learning\" >Generating expense reports with machine learning<\/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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#Training_with_the_one-shot_attention_mechanism\" >Training with the one-shot attention mechanism<\/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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#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-4\" href=\"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#Further_reading\" >Further reading<\/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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#About_the_expert\" >About the expert<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Generating_expense_reports_with_machine_learning\"><\/span>Generating expense reports with machine learning<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Optical_character_recognition\" target=\"_blank\">Optical character recognition<\/a> (OCR) drives the conversion of typed, handwritten, or printed symbols into machine-encoded text. However, the OCR process brings the need to eliminate possible errors, while extracting only valuable data from ever-growing amount of it.<\/p>\n<p>At the recent <a href=\"https:\/\/www.meetup.com\/TensorFlow-Seattle\/events\/237017956\/\" target=\"_blank\">TensorFlow meetup<\/a>, the attendees learnt how employing the <a href=\"https:\/\/en.wikipedia.org\/wiki\/One-shot_learning\" target=\"_blank\">one-shot attention<\/a> mechanism for token extraction in <a href=\"https:\/\/keras.io\/\" target=\"_blank\">Keras<\/a> using TensorFlow as a back end can help out. In addition, the meetup discussed how to enable multilingual <a href=\"https:\/\/www.altoros.com\/blog\/enabling-multilingual-neural-machine-translation-with-tensorflow\/\">neural machine translation<\/a> with TensorFlow.<\/p>\n<div id=\"attachment_39633\" style=\"width: 160px\" class=\"wp-caption alignright\"><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/mike-stark-tensorflow.jpeg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-39633\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/mike-stark-tensorflow-150x150.jpeg\" alt=\"\" width=\"150\" height=\"150\" class=\"size-thumbnail wp-image-39633\" \/><\/a><p id=\"caption-attachment-39633\" class=\"wp-caption-text\"><small>Mike Stark<\/small><\/p><\/div>\n<p><a href=\"https:\/\/www.linkedin.com\/in\/drmstark\/\" target=\"_blank\">Mike Stark<\/a>, a data scientist at Concur, shared his experience of enabling an application to automatically generate expense reports from the photos of receipts. Relying on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Optical_character_recognition\" target=\"_blank\">optical character recognition<\/a>, the solution is able to convert images into reports, while employing machine learning techniques to extract important information from the OCR text. In contrast to regular expression matching, machine learning allows for automatically learning a large number of features and ongoing retraining as the amount of receipts grows.<\/p>\n<p>The valuable receipt data to be extracted includes:<\/p>\n<ul>\n<li>transaction amount<\/li>\n<li>transaction date<\/li>\n<li>currency<\/li>\n<li>vendor<\/li>\n<li>location<\/li>\n<\/ul>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v111.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v111.png\" alt=\"generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v111\" width=\"640\" class=\"aligncenter size-full wp-image-39533\" \/><\/a><\/center><\/p>\n<p>At the classification stage, the entire text of a receipt is split into words, which become features for a classifier. Then, candidate strings are extracted from the receipt by pattern matching. The text surrounding the strings becomes the features of the <a href=\"https:\/\/www.altoros.com\/blog\/using-logistic-and-softmax-regression-with-tensorflow\/\">regression<\/a> algorithm that predicts the likelihood of each string being the result.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Training_with_the_one-shot_attention_mechanism\"><\/span>Training with the one-shot attention mechanism<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here, <a href=\"https:\/\/www.altoros.com\/blog\/recurrent-neural-networks-classifying-diagnoses-with-long-short-term-memory\/\">recurrent neural networks<\/a> come into play. The text is fed into the neural network character by character and the network is triggered to generate either a classification or a sequence of characters.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/one-shot-attention-mechanism-reccurent-neural-networks-v112.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/11\/one-shot-attention-mechanism-reccurent-neural-networks-v112.png\" alt=\"one-shot-attention-mechanism-reccurent-neural-networks-v112\" width=\"640\" class=\"aligncenter size-full wp-image-39534\" \/><\/a><\/center><\/p>\n<p>As long as not all the information in the receipt is valuable (e.g., expense type or a phone number), one needs to enable token extraction. For that purpose, Mike applied the <a href=\"https:\/\/en.wikipedia.org\/wiki\/One-shot_learning\" target=\"_blank\">one-shot attention mechanism<\/a>, which is easy to train and is straightforwardly coded into Keras running on top of TensorFlow.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">class Concurrence(Layer):\r\n\r\n\r\ndef build(self, input_shape):\r\n    self.input_spec = &#x5B;InputSpec(shape=input_shape)]\r\n    self.input_dim = input_shape&#x5B;2]\r\n\r\n    self.W = self.add_weight((self.input_dim, 1),\r\n                              initializer=self.init,\r\n                              name='{}_W'.format(self.name),\r\n                              regularizer=self.W_regularizer)\r\n    super(Concurrence, self).build(input_shape)\r\n\r\ndef call(self, x, mask=None):\r\n    attention = K.softmax(K.squeeze(K.dot(x, self.W), 2))\r\n    return K.batch_dot(x, attention, (1, 1))<\/pre>\n<p>Here&#8217;s also a sample code of a model running on Keras.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">model = Sequential()\r\nmodel.add(Bidirectional(GRU(hidden_size, return_sequences=True), merge_mode='concat',\r\n                            input_shape=(None, input_size)))\r\n\r\nmodel.add(Concurrence())\r\nmodel.add(RepeatVector(max_out_seq_len + 1))\r\nmodel.add(GRU(hidden_size * 2, return_sequences=True))\r\nmodel.add(TimeDistributed(Dense(output_dim=output_size, activation=&quot;softmax&quot;)))\r\nmodel.compile(loss=&quot;categorical_crossentropy&quot;, optimizer=&quot;rms_prop&quot;)<\/pre>\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\/6wwmx9zwkx.jsonp\" async><\/script><script src=\"https:\/\/fast.wistia.com\/assets\/external\/E-v1.js\" async><\/script><\/p>\n<div class=\"wistia_embed wistia_async_6wwmx9zwkx\" style=\"height:360px;width:640px\">&nbsp;<\/div>\n<p><\/center><\/p>\n<p>Below, you can also check out the slides by Mike.<\/p>\n<p><center><iframe loading=\"lazy\" src=\"https:\/\/www.slideshare.net\/slideshow\/embed_code\/key\/pYnj6VjFO0RdlC\" width=\"427\" height=\"356\" 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=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/improving-facial-recognition-with-super-fine-attributes-and-tensorflow\/\">Improving Facial Recognition with Super-Fine Attributes and TensorFlow<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/analyzing-satellite-imagery-with-tensorflow-to-automate-insurance-underwriting\/\">Analyzing Satellite Imagery with TensorFlow to Automate Insurance Underwriting<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/using-long-short-term-memory-networks-and-tensorflow-for-image-captioning\/\">Using Long Short-Term Memory Networks and TensorFlow for Image Captioning<\/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><a href=\"https:\/\/www.linkedin.com\/in\/drmstark\/\" target=\"_blank\">Mike Stark<\/a> has been an academic astronomer for many years, concentrating on black holes and neutron stars observed via satellites. In 2015, he followed his growing interest in machine learning out of academia and into Concur. At Concur, as part of a data science group, Mike is working on machine learning solutions to various problems created by and\/or addressable with large volumes of data. He is particularly interested in the surprising power of recurrent neural networks. You can also check out Mike&#8217;s <a href=\"https:\/\/github.com\/drspiffy\" target=\"_blank\">GitHub profile<\/a>.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Generating expense reports with machine learning<\/p>\n<p>Optical character recognition (OCR) drives the conversion of typed, handwritten, or printed symbols into machine-encoded text. However, the OCR process brings the need to eliminate possible errors, while extracting only valuable data from ever-growing amount of it.<\/p>\n<p>At the recent TensorFlow meetup, the attendees learnt how [&#8230;]<\/p>\n","protected":false},"author":3,"featured_media":39540,"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,749],"class_list":["post-39531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-machine-learning","tag-tensorflow"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros<\/title>\n<meta name=\"description\" content=\"Straightforwardly coded into Keras on top TensorFlow, a one-shot mechanism enables token extraction to pluck out information of interest from a data source.\" \/>\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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros\" \/>\n<meta property=\"og:description\" content=\"Generating expense reports with machine learning Optical character recognition (OCR) drives the conversion of typed, handwritten, or printed symbols into machine-encoded text. However, the OCR process brings the need to eliminate possible errors, while extracting only valuable data from ever-growing amount of it. At the recent TensorFlow meetup, the attendees learnt how [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-09T16:38:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-29T11:40:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"356\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/\"},\"author\":{\"name\":\"Sophia Turol\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#\\\/schema\\\/person\\\/58194952af19fe7b2b830846e077a58e\"},\"headline\":\"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow\",\"datePublished\":\"2017-03-09T16:38:09+00:00\",\"dateModified\":\"2018-11-29T11:40:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/\"},\"wordCount\":624,\"commentCount\":5,\"image\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif\",\"keywords\":[\"Machine Learning\",\"TensorFlow\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/\",\"name\":\"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif\",\"datePublished\":\"2017-03-09T16:38:09+00:00\",\"dateModified\":\"2018-11-29T11:40:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/#\\\/schema\\\/person\\\/58194952af19fe7b2b830846e077a58e\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif\",\"contentUrl\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif\",\"width\":640,\"height\":356},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.altoros.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow\"}]},{\"@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\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/trello_card-96x96.jpg\",\"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":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros","description":"Straightforwardly coded into Keras on top TensorFlow, a one-shot mechanism enables token extraction to pluck out information of interest from a data source.","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\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/","og_locale":"en_US","og_type":"article","og_title":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros","og_description":"Generating expense reports with machine learning Optical character recognition (OCR) drives the conversion of typed, handwritten, or printed symbols into machine-encoded text. However, the OCR process brings the need to eliminate possible errors, while extracting only valuable data from ever-growing amount of it. At the recent TensorFlow meetup, the attendees learnt how [...]","og_url":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/","og_site_name":"Altoros","article_published_time":"2017-03-09T16:38:09+00:00","article_modified_time":"2018-11-29T11:40:31+00:00","og_image":[{"width":640,"height":356,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif","type":"image\/gif"}],"author":"Sophia Turol","twitter_misc":{"Written by":"Sophia Turol","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#article","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/"},"author":{"name":"Sophia Turol","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e"},"headline":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow","datePublished":"2017-03-09T16:38:09+00:00","dateModified":"2018-11-29T11:40:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/"},"wordCount":624,"commentCount":5,"image":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif","keywords":["Machine Learning","TensorFlow"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/","url":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/","name":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif","datePublished":"2017-03-09T16:38:09+00:00","dateModified":"2018-11-29T11:40:31+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/58194952af19fe7b2b830846e077a58e"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/03\/generating-expense-reports-with-one-shot-learning-tensorflow-and-keras-v26.gif","width":640,"height":356},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/optical-character-recognition-using-one-shot-learning-rnn-and-tensorflow\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Optical Character Recognition with One-Shot Learning, RNN, and TensorFlow"}]},{"@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\/wp-content\/uploads\/2019\/05\/trello_card-96x96.jpg","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\/39531","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=39531"}],"version-history":[{"count":10,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/39531\/revisions"}],"predecessor-version":[{"id":39655,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/39531\/revisions\/39655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/39540"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=39531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=39531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=39531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}