<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marc Templeton on Medium]]></title>
        <description><![CDATA[Stories by Marc Templeton on Medium]]></description>
        <link>https://medium.com/@marcte?source=rss-6a103481af4b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*PZKvajTxRhDjrxVMNJxaZg.png</url>
            <title>Stories by Marc Templeton on Medium</title>
            <link>https://medium.com/@marcte?source=rss-6a103481af4b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:48:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcte/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Solving NLP One Hug at a Time]]></title>
            <link>https://medium.com/kainos-applied-innovation/solving-nlp-one-hug-at-a-time-9dc97bad427d?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dc97bad427d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[hugging-face]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Mon, 22 Mar 2021 11:02:46 GMT</pubDate>
            <atom:updated>2023-03-27T19:28:19.124Z</atom:updated>
            <content:encoded><![CDATA[<p>A brief look into the change in the NLP landscape and a practical example of it with Hugging Face.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0mO4PdZaQKtbwWJW40FKQ.jpeg" /><figcaption>NLP word cloud. Source: <a href="https://www.blumeglobal.com/learning/natural-language-processing/">Blume Global</a></figcaption></figure><p>Creating a single, general-purpose application that can perform a number of natural language tasks such as questioning and answering, language translation, generative text and more, has been at the forefront of natural language processing (NLP) since its inception as far back as the 1950s!</p><blockquote>Recent developments suggest we are one step closer to realising that goal.</blockquote><h3>Index</h3><blockquote>Along Came A Transformer<em> </em><a href="#2d5a"><em>☍</em></a></blockquote><blockquote>Transformers: Stuck Like GLUE At The Top<em> </em><a href="#e45e"><em>☍</em></a></blockquote><blockquote>It’s Not Easy Being A Transformer<em> </em><a href="#afee"><em>☍</em></a></blockquote><blockquote>Does Bigger, Always Mean Better? <a href="#5d02"><em>☍</em></a></blockquote><blockquote>The Cast of Transformers <a href="#e0a9"><em>☍</em></a></blockquote><blockquote>Hugging Face<em> </em><a href="#0550"><em>☍</em></a></blockquote><blockquote>Fine-Tuning BERT for Contradiction Detection<em> </em><a href="#8e45"><em>☍</em></a></blockquote><blockquote>Who’s Transforming <a href="#d27b"><em>☍</em></a></blockquote><h3>Along Came A Transformer</h3><p><a href="#efaa">[Index]</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*JozNqZqISMrDILecPC3AIg.gif" /><figcaption>Transformation of a toy Optimus Prime. Source: <a href="https://brownboxreviews.wordpress.com/2015/02/11/review-transformers-generations-optimus-prime-combiner-wars/">BrownBox Reviews</a></figcaption></figure><p>The NLP field in the last few years has undergone a transform(er)-ation in both architecture and mindset. The architecture setup has evolved, moving away from popular recurrent-neural networks (<a href="https://searchenterpriseai.techtarget.com/definition/recurrent-neural-networks">RNNs</a>) such as long-short term memory (<a href="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">LSTM</a>) and into transformers — not the ones you’re thinking of! A key difference between these setups is the transformer’s ability to dynamically choose what to remember; a characteristic known as its ‘attention’ — check out Yannic Kilcher’s excellent video walkthrough to learn more!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiDulhoQ2pro%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiDulhoQ2pro&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiDulhoQ2pro%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8219452f400a63ace3780aae70b1bbc0/href">https://medium.com/media/8219452f400a63ace3780aae70b1bbc0/href</a></iframe><p>Furthermore, the discipline has taken a leaf out of <a href="https://www.analyticsvidhya.com/blog/2018/07/top-10-pretrained-models-get-started-deep-learning-part-1-computer-vision/">image recognition models</a> by producing pre-trained models; general language models. These general language models are <em>huuuggee</em> — like 33GB plus for <a href="https://heartbeat.fritz.ai/deep-learning-has-a-size-problem-ea601304cd8">NVIDA’s MegatronLM</a> — and capture the underlying structure of basic language which is then tailored to a specific use-case; a technique called <a href="https://machinelearningmastery.com/transfer-learning-for-deep-learning/">transfer learning</a>. Previously, this was not the case.</p><h3>Transformers: Stuck Like GLUE At The Top</h3><p><a href="#efaa">[Index]</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYWC15-K4jPdwnWJkAQQ8w.gif" /><figcaption>GLUE and SuperGLUE benchmark scores. Source: <a href="https://gluebenchmark.com/leaderboard">GLUE</a> and <a href="https://super.gluebenchmark.com/leaderboard">SuperGLUE</a></figcaption></figure><p>What does this mean in practise when you put it all together? Well… its success cannot be understated: the <a href="https://gluebenchmark.com/">General Language Understanding Evaluation (GLUE)</a> benchmarks are a series of NLP tasks from sentiment analysis to questioning and answering to sentence entailment, designed to test and rank, a model’s competence. These large, pre-trained transformer models came along and <em>demolished</em> the competition often creating state-of-the-art (SOTA) results. Clearly, a level-up in difficulty set of NLP tasks had to be created; step in <a href="https://super.gluebenchmark.com/">SuperGLUE</a>.</p><h3>It’s Not Easy Being A Transformer</h3><p><a href="#efaa">[Index]</a></p><p>There are a few disadvantages to large general language models for both those who create them and those who use them. I want to take each of these perspectives in-turn and talk about them in a bit of detail in these next 2 sections — if you’re not interested in the downfalls that transformer models bring and only want to see what they can churn out, skip forward to how <a href="#8e45">Kainos’ Innovation team utilised BERT</a>.</p><h3>Does Bigger, Always Mean Better?</h3><p><a href="#efaa">[Index]</a></p><p>Creating these models requires both: excessive computational power and a large data lake of text pieces. The latter of this comes with its own headaches to collect, parse, standardise and store hundreds of TBs of data. Computational power to train language models is a challenge; GPUs are matrix computation and job parallelism specialists — perfect for training machine learning models and speeding this process up n-fold. That being said, even using flagship GPU processors on efficient cloud networks still requires <em>maaanny</em> hours, e.g. NVIDA’s MegatronLM took <a href="https://heartbeat.fritz.ai/deep-learning-has-a-size-problem-ea601304cd8">512 V100 GPUs over 9 days to compute</a>!</p><p>It follows too, that utilising these enormous models in production — where storing and inferencing models incur cost — creates friction. For example, the popular model hosting platform Heruoku, has a <a href="https://devcenter.heroku.com/articles/slug-compiler#slug-size">500MB file size limit</a>.</p><p>One way of addressing this issue is to scale back the complexity of these models; negatively impacting performance. Finding the trade-off between model size and performance is just another drop in the water for machine learning engineers to ponder over. However, an interesting outcome from pre-training these models is, as you scale the complexity up, the returns continue to get better and better without plateauing, creating SOTA models on many NLP tasks — as described in the video below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_8yVOC4ciXc%3Fstart%3D139%26feature%3Doembed%26start%3D139&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_8yVOC4ciXc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_8yVOC4ciXc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce0c48282acb57a0e455253055580442/href">https://medium.com/media/ce0c48282acb57a0e455253055580442/href</a></iframe><p>However, this resembles an interesting and valuable point from the world of… mathematics proofs — bare with me! There are many different techniques within mathematics to proof things such as by <a href="https://www.mathsisfun.com/algebra/mathematical-induction.html">induction</a> or <a href="https://www.mathsisfun.com/numbers/euclid-square-root-2-irrational.html#:~:text=Proof%20by%20Contradiction,t%20always%20win%20at%20checkers.">contradiction</a> which involve various clever ways of thinking and manipulating the problem. Proof by <a href="http://zimmer.csufresno.edu/~larryc/proofs/proofs.exhaustion.html">exhaustion</a> doesn’t. It simply tests all finite test cases on the problem and concludes whether they all hold up. Whilst it is both: not a computationally refined way nor a beloved way in the mathematical community, it can produce results — a famous example is the <a href="https://nrich.maths.org/6291">four colour theorem</a> which was originally solved using this technique… buuutt has since been proven in a more mathematician friendly way. We have a similar situation here with these large general language models; computationally heavy to create and run but, rather differently, beloved by the community. Hold up. Let’s backtrack a few sentences there, I mentioned that this form of proof wasn’t held in high regards by mathematicians and that is for 1 simple reason:</p><blockquote>We don’t learn anything about the subject, we simply just throw raw computational power at it</blockquote><p>We’ve all heard the famous saying that if you gave infinite monkeys enough time they’d produce the works of William Shakespeare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*gGFw2TFg49UwAP73uA14GA.jpeg" /><figcaption>Infinite monkeys typing for an infinite amount of time would eventually type all of William Shakespeares’ plays. Source: <a href="https://www.creativitypost.com/article/the_infinite_monkey_theorem">The Creativity Post</a></figcaption></figure><p>This is an example of brute-force, by which the outcome, in this case a Shakespeare play, is the result of mashing keys at random; the output is correct but the mechanism for achieving it is sub-optimal. We do not learn <em>anything</em> around how Shakespeare glued together the words he did, from the perspective he did, with the emphasis he did. It was simply the output from huge overheads, as was the exhaustive proof of the 4 colour theorem and as is these NLP outputs by these colossal language models. We cannot abstract away the understanding if we do not know how all the moving pieces connect together — or perhaps we can… lets put a pin in that thought for now!</p><h3>The Cast of Transformers</h3><p><a href="#efaa">[Index]</a></p><p>There are no shortage of institutes and fully fledged companies investing time and resources into NLP and specifically into transformer models.</p><p>I took just 30 minutes to find institues and/or companies who have taken the idea of transformer models and ran with it; I found 10! From the likes of Microsoft, Google, Facebook, OpenAI, Nvidia and AI2 no less — find the full list <a href="#d27b">here</a>!</p><h3>A Lack of Standards</h3><p><a href="#efaa">[Index]</a></p><p>However, there is another problem that I want to hone in on, that is not just true for the recent developments in NLP but across the entire umbrella of artificial intelligence; a lack of standards. The end goal for this has enormous potential to break through and disrupt the digital industry from how we communicate with devices and each other on a daily basis to how creative written media is generated and a whole host <a href="https://pub.towardsai.net/crazy-gpt-3-use-cases-232c22142044">more</a>! It is no surprise that we see big companies racing against each other to be the early bird to reap the rewards. Although this new transformer architecture does produce SOTA results, it is still open to interpretation on how it is constructed. By which I mean, the corpus that it is trained on, for how long and how it is implemented. Lacking traditional software development standards means that incorporating them is wildly different for one to another — step forward Hugging Face!</p><h3>Hugging Face</h3><p><a href="#efaa">[Index]</a></p><p><a href="https://huggingface.co/">Hugging Face</a> is an NLP-specialist research and development group focused on transformer models, with its goal summed up on its website, “on a mission to solve NLP, one commit at a time.” But it is so much more than that.</p><p>We are striving to make machine learning models more explainable and accessible to users of all proficiencies by incorporating low-code and ‘bring your own data’ setups; reflected in these transformer models. These new, powerful models — even early in their lifecycle — can add significant value to business. Hugging Face understands this and so provides well documented, easy-to-implement wrappers to <a href="https://twitter.com/huggingface/status/1300462852986331136">over 3,000 open-source NLP models</a> in both PyTorch and TensorFlow 2.0 — popular machine learning libraries. This enables quick turn-arounds on research and development which has proved popular with… ahem, certain companies.</p><h3></h3><p>Apple, are you trying to bankrupt us?At ~500 MB per average model download, 90k hits (Apple&#39;s IP addresses are the 17. block) translate to ~45TB of downstream bandwidth... which starts being costly for us.Your new ML platform Overton (https://t.co/ZUnVXeMNzv) ⤵️ pic.twitter.com/JS7tnRfTjt</p><p>Hugging Face understand both the benefits that transformer models bring but they also see the environmental footprint left by training, deploying and inferencing these huge models.</p><blockquote>Let’s unpin that thought we had earlier on whether or not we can reduce the size of these models and retain their understanding whilst not knowing their inner workings, because Hugging Face has a solution.</blockquote><p>The boffins at Hugging Face have applied a technique — known as <a href="https://towardsdatascience.com/knowledge-distillation-simplified-dd4973dbc764">knowledge distillation</a> — to create smaller versions of models. This technique utilises a teacher-student architecture so the information is maintained with the student model. They have already used this on BERT and GPT2 models to create DistilBERT and DistilGPT2 respectively; reducing the size of the original BERT model by 40%, while retaining 97% of its understanding.</p><p>Hugging Face are also striving to implement common standards amongst NLP models by pushing for these models to have <a href="https://dl.acm.org/doi/10.1145/3287560.3287596">model cards</a>. Model cards are small write-ups which sit alongside disclosed models to provide clarity. Clarity in the stated domains models are to be used in, performance figures within these areas and evaluation across a variety of situations that the model is anticipated to be exposed to, e.g. an NLP model that is labelled to create newspaper headlines from short descriptions of stories must state what corpus information the model was trained on and in which language(s). Google have released their <a href="https://ai.googleblog.com/2020/07/introducing-model-card-toolkit-for.html">own version of a model card pipeline</a>.</p><h3>Fine-Tuning BERT for Contradiction Detection</h3><p><a href="#efaa">[Index]</a></p><p>The Applied Innovation team within Kainos wanted to experiment with transfer learning in NLP models to detect contradiction within short pieces of text. The idea was that this general contradiction detecting model could be utilised in a number of domains such as legal to flag up disagreements within service contracts.</p><p>The aim of the project was as follows:</p><blockquote>Could we adapt a pre-trained language model to determine whether 2 pieces of text contradict each other?</blockquote><p>The goals of the project were as follows:</p><blockquote><a href="#a81f"><strong>Step 1</strong></a>: Attain a dataset with labelled text fields: contradiction or not</blockquote><blockquote><a href="#729d"><strong>Step 2</strong></a>:Use Hugging Face’s library to get a mid-sized pre-trained language model</blockquote><blockquote><a href="#0b0e"><strong>Step 3</strong></a>: Run a training job on AWS to fine-tune the base model</blockquote><blockquote><a href="#7016"><strong>Step 4</strong></a>: Compare the performance of the base model against the fine-tuned model</blockquote><p><a href="#2cab"><strong>Step 1</strong></a>:<em> Attain contradiction dataset</em></p><p>I used the <a href="https://nlp.stanford.edu/projects/snli/">Stanford Natural Language Inference (SNLI) Corpus</a> which has over 570,000 human-written English sentence pairs manually labeled as <em>entailment</em>, <em>contradiction or neutral. </em>This boded well and only required a small amount of processing to create a dataset with equal records <em>contradiction</em> and <em>not contradiction</em>.</p><p><a href="#2cab"><strong>Step 2</strong></a>: <em>Download a mid-sized pre-trained general language model</em></p><p>I used the Hugging Face repository which — as before mentioned — contains over 3,000 transformer models. However, I was able to quickly whither the selection down to a handful of the more popular ones before settling on BERT.</p><p>I chose BERT for several reasons:</p><ul><li>It had options for cased and uncased models</li><li>It had various sized models — allowing me to reduce my ML footprint</li><li>It had decoupled tokeniser, config and vocab implementations</li><li>It allows for ‘heads’ to be switched out easily</li><li>It’s implementation was well-documented</li><li>It’s a fan favourite — and allows me to use pictures of BERT from now on!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3isrwbiUnY0lDW7t.jpeg" /><figcaption>The pre-trained general language model selected was BERT. Source: <a href="https://prakhartechviz.blogspot.com/2020/04/natural-language-generation-using-bert.html">TechViz</a></figcaption></figure><p>The first step involved using the Hugging Face transformers Python SDK to load in a pre-trained BERT model and tokenizer — a doddle when you have excellent <a href="https://huggingface.co/transformers/main_classes/model.html#transformers.PreTrainedModel.from_pretrained">documentation</a>.</p><p>I saved this locally to minimise bandwidth calls using <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch’s model save function and similarly their load function</a> to retrieve it again. However, since this POC was going to use AWS, the model components were also saved to S3.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bc0b83923080a0dd3d62f50f025061d/href">https://medium.com/media/0bc0b83923080a0dd3d62f50f025061d/href</a></iframe><p><a href="#2cab"><strong>Step 3</strong></a>: <em>Configure the model and run it on AWS as a SageMaker training job</em></p><p>Conscious of a point brought up by this blog around ML footprints, the training dataset was reduced to just 20,000 records (plenty to achieve the aim of this project).</p><p>Loading the vocab file from S3 and providing it to the decoupled tokenizer proved a problem:</p><blockquote>Currently, the implementation for loading a tokenizer using the class <a href="https://huggingface.co/transformers/model_doc/bert.html#berttokenizer">BERTTokenizer</a> only supports local file references, however parsing from an S3 bucket returns the object, i.e. the vocab, as a string.</blockquote><p>Inspecting the code, it was reasonable to change it to accommodate the string as shown in the code snippet below from line 193 in the tokenization_bert.py file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9c59623a776997d88c1456e1140e017/href">https://medium.com/media/a9c59623a776997d88c1456e1140e017/href</a></iframe><p>The project was containerised using Docker and pushed into an existing AWS ECR repository.</p><pre>docker tag &lt;IMG NAME&gt; &lt;ECR REPO URL&gt;</pre><pre>docker push &lt;ECR REPO URL&gt;</pre><p>To initiate a SageMaker training job a custom estimator had to be created and called.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9664c739ab8c9d943b0281ff0bf45ff/href">https://medium.com/media/a9664c739ab8c9d943b0281ff0bf45ff/href</a></iframe><blockquote>An instance with over 16GB of memory was required for the training job — as such an <a href="https://aws.amazon.com/sagemaker/pricing/">ml.m5.2xlarge</a> instance type was used.</blockquote><p>Running this instance took just over 1 hour for 2 epochs and achieved a minimum <strong>loss of 0.642</strong>.</p><p>The trained model components were saved to S3.</p><p><a href="##2cab"><strong>Step 4</strong></a>: <em>Compare the test accuracy of the base model against the fine-tuned one</em></p><p>Running the test dataset of 5,000 records against the pre-trained BERT model and the fine-tuned one resulted in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*mpdvCSjs-9krC5FX.gif" /><figcaption>The fine-tuned BERT model out performs the original. Source: <a href="https://giphy.com/gifs/things-sesame-didn-5iOVaF73aQe7S">Giphy</a></figcaption></figure><p>Pre-trained model accuracy: ⠀⠀⠀⠀⠀⠀<strong>50.94%</strong></p><p>Fine-tuned model accuracy: ⠀⠀⠀⠀⠀⠀<strong>56.14%</strong></p><p>Let’s not get too ahead of ourselves it’s a small margin at best, so why is that? Well, there are 2 main reasons:</p><ol><li>Training size — 20,000 records just isn’t that many, using more of our original 300,000 records could help.</li><li>Complex task — Detecting contradiction is far more than simply detecting negating words or identifying antonyms, it heavily relies on context which these models struggle to infer; recognised by <a href="https://nlp.stanford.edu/pubs/contradiction-acl08.pdf">Stanford researchers</a>.</li></ol><p>Whilst these numbers were not fantastic, the team gained value and experience from it by achieving the project’s aim of:</p><blockquote>Predicting whether 2 pieces of text contradicted each other using a pre-trained language model</blockquote><p>It also validated the use of Hugging Face as a quick development resource capable of producing POC standard results with minimal cost and time investment.</p><p>The Applied Innovation team identifies this chaotic and disparate development as a problem within the area of artificial intelligence and have researched topics such as how to open up the black boxes of machine learning models and the area of low-code/no-code applications.</p><p>If this blog has interested you — check out the <a href="https://medium.com/kainos-applied-innovation">Innovation team’s</a> publication below!</p><h3><strong>Who’s Transforming</strong></h3><p><a href="#efaa">[Index]</a></p><p><em>Microsoft:</em> Turing Natural Language Generator (<strong>T-NLG</strong>)</p><p><a href="https://www.microsoft.com/en-us/research/blog/turing-nlg-a-17-billion-parameter-language-model-by-microsoft/">Turing-NLG: A 17-billion-parameter language model by Microsoft - Microsoft Research</a></p><p><em>Google:</em> Bi-directional Encoder Representations from Transformers (<strong>BERT</strong>)</p><p><a href="https://ai.googleblog.com/2018/11/open-sourcing-bert-state-of-art-pre.html">Open Sourcing BERT: State-of-the-Art Pre-training for Natural Language Processing</a></p><p><em>OpenAI:</em> Generative Pre-Training (<strong>GPT-2</strong>)</p><p><a href="https://openai.com/blog/better-language-models/">Better language models and their implications</a></p><p><em>OpenAI:</em> Generative Pre-Training (<strong>GPT-3</strong>)</p><p><a href="https://blogs.microsoft.com/blog/2020/09/22/microsoft-teams-up-with-openai-to-exclusively-license-gpt-3-language-model/">Microsoft teams up with OpenAI to exclusively license GPT-3 language model - The Official Microsoft Blog</a></p><p><em>Facebook:</em> Robustly optimised BERT approach (<strong>RoBERTa</strong>)</p><p><a href="https://ai.facebook.com/blog/roberta-an-optimized-method-for-pretraining-self-supervised-nlp-systems/">RoBERTa: An optimized method for pretraining self-supervised NLP systems</a></p><p><em>Google and Carnegie Mellon University:</em> <strong>XLNet</strong></p><p><a href="https://www.borealisai.com/en/blog/understanding-xlnet/#:~:text=XLNet%20is%20the%20latest%20and,Natural%20Language%20Processing%20(NLP).&amp;text=XLNet%20is%20an%20auto%2Dregressive,the%20transformer%20architecture%20with%20recurrence.">Understanding XLNet</a></p><p><em>Google:</em> Text-to-Text Transfer Transformer (<strong>T5</strong>)</p><p><a href="http://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html">Exploring Transfer Learning with T5: the Text-To-Text Transfer Transformer</a></p><p><em>AI2:</em> Embeddings from Language Models (<strong>ELMo</strong>)</p><p><a href="https://allennlp.org/elmo">AllenNLP</a></p><p><em>Nvidia:</em> <strong>Megatron</strong></p><p><a href="https://nv-adlr.github.io/MegatronLM">MegatronLM: Training Billion+ Parameter Language Models Using GPU Model Parallelism</a></p><p><em>Google:</em> A Lite BERT (<strong>ALBERT</strong>)</p><p><a href="https://ai.googleblog.com/2019/12/albert-lite-bert-for-self-supervised.html">ALBERT: A Lite BERT for Self-Supervised Learning of Language Representations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dc97bad427d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/solving-nlp-one-hug-at-a-time-9dc97bad427d">Solving NLP One Hug at a Time</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kainos Sponsored Final Year Projects]]></title>
            <link>https://medium.com/kainos-applied-innovation/kainos-sponsored-final-year-projects-f291a6ded62a?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f291a6ded62a</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[university]]></category>
            <category><![CDATA[final-year-projects]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Wed, 23 Sep 2020 07:35:32 GMT</pubDate>
            <atom:updated>2020-09-23T07:35:32.354Z</atom:updated>
            <content:encoded><![CDATA[<h4>In collaboration with Queen’s University and Ulster University</h4><figure><img alt="A person writing on paper next to a laptop" src="https://cdn-images-1.medium.com/max/1024/1*Q5ps3MrKT7tNXtCsxua5eA.jpeg" /></figure><p>Supporting and developing young people is core to Kainos’ philosophy. A trait which is perfectly reflected in the various schemes ran internally like the <a href="https://www.kainos.com/careers/students">Kainos Academy</a>.</p><p><a href="https://www.kainos.com/kainos-announces-10million-investment-future-tech-talent">Kainos’ CEO, Brendan Mooney stated</a> that these programmes are to:</p><blockquote>“find talented young people and help them fulfil their potential, through world-class training and mentoring”.</blockquote><p>The <a href="https://medium.com/kainos-applied-innovation">Applied Innovation</a> team’s goal is to help Kainos look forward, identifying the next big opportunity and bringing technology to our customers faster. One of the ways we help Kainos do this is through the FYP scheme by generating and supporting creative and risky projects in areas of interest to the students, the team and Kainos. These projects incorporate emerging and innovative technology to highlight the value and subsequent positive impact when applied to business scenarios.</p><h3>Index</h3><blockquote>What Is The Final Year Project Scheme? <a href="#34e6">☍</a></blockquote><blockquote>The Students And Their Projects <a href="#a711">☍</a></blockquote><blockquote>Hear From Those Involved <a href="#9bbc">☍</a></blockquote><blockquote>Get Involved <a href="#f4fa">☍</a></blockquote><h3>What Is The Final Year Project Scheme?</h3><p>[<a href="#4afd">Index</a>]</p><p>The Final Year Project programme, often abbreviated to FYP, is a Kainos initiative which sponsors a final year university student of Queen’s University Belfast or Ulster University, completing computing degrees. Kainos equips each student with a mentor who provides technical assistance and guidance throughout the year.</p><blockquote>Despite the ongoing pandemic, this year’s scheme has been our most progressive yet!</blockquote><p><strong>Engagement</strong>. For the first time Kainos casted its net to include Ulster University as we continue to search for the best talent from both local universities.</p><p><strong>In-house support</strong>. Kainos supported each final year student by providing them with an industry professional in their project’s field who mentors them throughout the year. In addition to this, Kainos also supplied further expertise in business and engineering capabilities through dedicated teams which the students could make use of. These teams also provided workshops throughout the year to provide practical and personal support, from requirements modelling to source code management and presentation skills to cloud containerisation. Utilising internal personnel within Kainos not only provides them with the best know-how, but also increases their networking within the company.</p><p><strong>Pandemic challenge</strong>. This year, however, was not without difficulties. Due to the COVID-19 pandemic outbreak towards the end of the university year, students were unable to part-take in our yearly internal FYP showcase. This presented a previously never experienced challenge for our students, mentors and specialist teams. However, the Kainos staff and students showed tremendous adaptability and determination in completing their projects, making use of online tools such as virtual meetings and visualisation boards.</p><h3>The Students And Their Projects</h3><p>[<a href="#4afd">Index</a>]</p><p>This year saw a total of 6 projects completed by students from both Queen’s and Ulster universities. The projects made use of a range of exciting technologies including <a href="https://www.tobiipro.com/blog/what-is-eye-tracking/">eye-tracking</a>, <a href="https://www.sas.com/en_us/insights/analytics/what-is-natural-language-processing-nlp.html">natural language processing</a> and <a href="https://www.youtube.com/watch?v=4JNBDwd40is">image alteration detection</a>. The practical applications also spanned a diverse range from dynamically altering webpages for greater accessibility to preventing unconscious bias in the recruitment process.</p><h4>Grace Turkington: Personalised healthcare letters</h4><p><em>Machine Learning </em>/<em> Natural Language Processing</em></p><p>The healthcare industry is one that is at capacity with the Royal College of Physicians<strong> </strong>describing it in 2016 as, <a href="https://www.rcplondon.ac.uk/guidelines-policy/underfunded-underdoctored-overstretched-nhs-2016">“under-funded, under-doctored and overstretched”</a>. This has not changed, and in recent times with the pandemic, strain across all departments has only increased. According to the <a href="http://with GPs, nurses, therapists and other practice staff">NHS England</a> 1 in 20 healthcare appointments are missed every year, equating to over 15 million. One observed reason for this resides in the language and tone used in call-out letters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJ_nsEUrzfRxKI2M1_XOuQ.png" /></figure><p>Grace’s project looked at solving this problem of low conversion rates by using machine learning to detect personality types of patient letters according to the <a href="https://bmcpsychology.biomedcentral.com/articles/10.1186/s40359-020-00423-3">Big Five personality theory</a>. This can then be analysed for sentiment and structure to further understand the style of the letter to allow the professional to alter it to better suit the addressed person. This solution will help to support healthcare clinics to attain higher attendance rates for appointments, improving operations efficiency.</p><h4>Jonathan Hughes: Webpage accessibility</h4><p><em>Online Accessibility</em></p><p>Within the IT industry companies must abide by website accessibility guidelines such as the <a href="https://www.w3.org/WAI/standards-guidelines/wcag/">WCAG</a>. Guidelines like these aim to standardise websites’ characteristics to make them accessible for users with disabilities relating to visual, auditory and speech. There is a growing need to alter existing webpages to make them tailored for users, who are spending increasing amounts of time online; a recent report highlighted this number to be <a href="https://thenextweb.com/tech/2019/01/31/study-shows-were-spending-an-insane-amount-of-time-online/">over 6 hours a day</a>. Combining this with the fact that the number and variety of people joining the online world is increasing year-on-year; accessibility of websites needs to be as dynamic as those on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaWBL4WwrukOkQNbOhTKjQ.gif" /><figcaption>Source: <a href="https://ourworldindata.org/internet">https://ourworldindata.org/internet</a></figcaption></figure><p>Jonathan’s solution to this growing problem is a webpage agnostic tool that allows the user to customise web components. These alterations are stored for each user through profiles which allows for changes to be persisted onto all sites or specified for chosen pages. This paves the way for dynamic accessibility to be a common occurrence within web applications and browsers.</p><h4>Conn O’Neill: Automated cognitive behavioural therapy</h4><p><em>Machine Learning </em>/<em> Natural Language Processing</em></p><p>Mental health is a growing concern globally and within the UK, with <a href="https://www.england.nhs.uk/mental-health/">NHS England</a> recording that 1 in 4 adults experience mental health illness. This issue is increasing due to healthcare cuts, a lack of skilled workers and other factors such as pressures on social media. <a href="https://www.nhs.uk/conditions/cognitive-behavioural-therapy-cbt/">Cognitive behavioural theory</a> or CBT, is a field focused on contextualising thoughts and personal self-esteem into categories to identify effective thought changing exercises. These sessions are usually carried out in person and at a cost but as mentioned before, budget cuts and lack of workers means seeing someone in a timely manner is difficult. <a href="https://www.mbib.com/en-us/community-culture/tackling-the-taboo-of-therapy">Social taboos around therapy</a> discourage those from seeking help to receive it. Living in an ever-digital world however, means that more people are turning to online resources for support. Online charities such as <a href="http://www.samaritans.org/">Samaritans</a> and <a href="https://www.mind.org.uk/">Mind</a> have an online presence, but there has also been an increase in those asking for help through <a href="https://www.healthfulchat.org/mental-health-chat-rooms.html">chat rooms</a>, <a href="http://www.sane.org.uk/what_we_do/support/supportforum">online forums</a> and even some corners of <a href="https://www.theatlantic.com/technology/archive/2019/06/rise-facebook-blessings-groups/591307/">social media</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5TLKvW5DzGwMpoP7nhGgA.png" /></figure><p>Conn’s developed a platform that can provide early indicators of negative thoughts and promote positive thinking by analysing text inputs. The platform is capable of recognising <a href="https://www.harleytherapy.co.uk/cognitive-distortions-cbt.htm">10 common thinking distortions</a> each with their own thought changing exercises to promote healthier thinking. The interface is inviting and scalable which means it can provide some much needed support to overwhelmed mental health workers.</p><h4>Tiago Ramalho: Deepfake detection</h4><p><em>Deep Learning </em>/<em> Computer Vision</em></p><p>Kainos is a top provider for the conversion of documents from paper to digital; a multi-million dollar industry. However, this comes with its own challenges in regards to security and fraud detection. Fraudsters are adapting to this change of digitalisation by using photo alteration software to create inaccurate documents for exploitative and personal gain — at the company’s expense. One example of this is by replicating C-level signatures on confidential documents; an advanced technique of <a href="https://www.ncsc.gov.uk/guidance/whaling-how-it-works-and-what-your-organisation-can-do-about-it">whaling</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oy-EpBHvCcowlqwAx9XMNA.png" /></figure><p>Tiago’s project combated this threat by developing an image processing application to automatically detect altered images. The computer vision model can pinpoint the area(s) a photo has been manipulated and provide this to the user through a <a href="https://www.orbussoftware.com/resources/videos/business-architecture/what-is-a-heatmap/">heat map</a>, giving the user confidence of its decision. This application has many uses within the digital space: analysing documents for altercations heightens security within digital document exchanges, whilst checking uploaded images to social media can prevent ‘fake news’ and skewed reality from being spread.</p><h4>James Crone: Unconscious bias remover for recruitment</h4><p><em>Machine Learning </em>/<em> Natural Language Processing</em></p><p>Bias, whether unconscious or conscious, plays too much of a part in the recruitment process for businesses, one of the primary points this can effect is during CV review and selection. Businesses require the best talent for the variety of roles on offer but seeing a candidate’s suitability within the company is difficult.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*rNoS3ieQGM2_VZacQtQ3VA.png" /></figure><p>James has created an automated and scalable, cloud-based solution which is a drastic improvement on the time-consuming manual method many companies implore today. The solution uses natural language processing to anonymise candidate CVs, to ensure ethical decision-making; increasing applicants trust in the final outcome. The technique developed is a ‘one-size fits all’ solution for all resumés, whilst preserving individuality in format and layout. The impact of James’ project cannot be understated: this unbiased hiring process can lead to a more diverse, inclusive and performant work environment which benefits both the individuals and the business.</p><h4>Patrick McGranaghan: Webpage accessibility analysis</h4><p><em>Data Analytics</em> / <em>Eye-tracking </em>/<em> Online Accessibility</em></p><p><a href="https://www.forbes.com/sites/bernardmarr/2018/09/02/what-is-industry-4-0-heres-a-super-easy-explanation-for-anyone/#1b39a16e9788">Industry 4.0</a> is amongst us with developments in artificial intelligence, robotics and immersive reality. However, one colossal change revolves around human-computer interaction. Websites are the #1 interaction tool between a user and a business so understanding how users interact with them has large implications on the business’ <a href="https://www.paulolyslager.com/roi-of-user-experience/">return of investment</a>. Involving the user when developing and testing a website is invaluable. However, with improvements in eye-tracking quality and availability, usability testing is becoming less subjective as we can track a user’s eyes through the testing process; user research 2.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*vcOI9E16ap64I5UkbkXHYQ.gif" /></figure><p>Patrick’s contribution to this field is a website agnostic application that tracks and analyses users’ interactions online through their gaze. Using this, Patrick can draw out conclusions regarding user attention for website components; insights that would otherwise be unrecorded. This solution provides factual information which can support UX, or user experience, designers when creating sites.</p><h3>Hear From Those Involved</h3><p>[<a href="#4afd">Index</a>]</p><p>We asked those involved in this year’s programme how they found it, see what they had to say below!</p><blockquote>Why were you interested in this project?</blockquote><blockquote>“I saw the value of the [recruitment bias removal] project and its purpose […] I know the reputation of the company and its values, so I knew that my project would be well supported.”</blockquote><blockquote>— James (student)</blockquote><blockquote>How did you find Kainos’ involvement in the Final Year Project scheme?</blockquote><blockquote>“I found that Kainos were hands-off which I appreciated. Guidance and suggestions given were helpful, especially when I was writing the dissertation.”</blockquote><blockquote>— Jonathan (student)</blockquote><blockquote>What was the main benefit of your involvement for the students?</blockquote><blockquote>“Making a positive impact on the careers of junior engineers and helping them develop and improve their skills to enhance their careers.”</blockquote><blockquote>— Shaun (software engineer)</blockquote><h3>Get Involved</h3><p>[<a href="#4afd">Index</a>]</p><p>If this round-up blog excited you about the prospect of a Queen’s or Ulster University Kainos sponsored final year project or you want to hear more about the program or the projects mentioned here, get in contact with us at FYP@kainos.com — we’d love to hear from you!</p><p>Check out our video from last year’s students to see how they found the overall experience!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPov3j7uHl28%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPov3j7uHl28&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPov3j7uHl28%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/083162796fa09587700e0a1790200888/href">https://medium.com/media/083162796fa09587700e0a1790200888/href</a></iframe><p>As ever, we look forward to this year’s set of exciting, innovative projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f291a6ded62a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/kainos-sponsored-final-year-projects-f291a6ded62a">Kainos Sponsored Final Year Projects</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ServerlessDays: Belfast 2020]]></title>
            <link>https://medium.com/kainos-applied-innovation/serverlessdays-belfast-2020-25bf6ad4b4ab?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/25bf6ad4b4ab</guid>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 10:12:37 GMT</pubDate>
            <atom:updated>2020-03-27T10:12:37.272Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFnvVd0cKbsyrYVb_cITgA.jpeg" /></figure><h4>[server]less, is more</h4><p>Serverless refers to storing and running your code in the cloud via a provider, e.g. Amazon, Microsoft, Google, etc. Executing code in this manner is known as event-driven or the <a href="https://stackify.com/function-as-a-service-serverless-architecture/">function-as-a-service</a> (FaaS) paradigm. Allocating the hardware provisioning to someone else has the benefit of reducing overheads but more importantly, additional hardware can be spun-up — almost instantaneously — to meet demand. Serverless’ main overhead reduction is in its pricing model which states that you only pay for execution time, incurring no cost when the program is idle.</p><h4>ServerlessDays: Belfast 2020, what was it?</h4><p>This event was part of a series of <a href="https://serverlessdays.io/">ServerlessDays conferences</a> held worldwide to promote and grow a community of serverless adoptors! These conferences are organised and ran independently by eager, local engineers including Kainos’ very own Peter Farrell. Last Friday <a href="https://belfast.serverlessdays.io/">ServerlessDays: Belfast 2020</a> took its inaugural steps as the first in this series to take place on the isle of Ireland and boasted a sold-out crowd of 200 participates, 10 talks with an additional 4 lighting talks and 1 or 2 ‘Heros’ walking around!</p><p>The day was packed full of content but I’ve summarised the key points that I took away below.</p><p>Features, features and more features. The serverless journey has come on a long way over the past few years and this was no less highlighted than the opening talk from Danilo Poccia from Amazon who showcased the development AWS has made in releasing services to reduce complexity and concerns around latency, language support and learning new paradigms which stifle business progression and innovation.</p><p>Flexibility in the cloud. Martin Woodward from Microsoft demonstrated the seamless integration of Azure with traditional CI/CD techniques whilst Azure MVP Mark Allan talked how <a href="https://azure.microsoft.com/en-gb/services/kubernetes-service/">Kubernetes extensions</a> allow for applications to be written in containers but ran in the cloud. There was also a talk on how serverless platforms are making more use of edge computing to reduce latency.</p><p>Design and build like a piece of LEGO: iteratively. Sheen Brisals, LEGO’s Senior Software Engineer, gave an insight into how his team migrated from an entire legacy e-commerce system to a fully serverless setup in just 10-months. The key takeaway from this talk wasn’t the sheer mammoth accomplishment of the task but rather the approach taken by Sheen and his team; iterative development. Sheen highlighted how well suited iterative development on a serverless application was, primarily down to its decoupled nature meaning small increments of services could be brought into production as they were developed.</p><p>Serverless joke of the day:</p><p>Q: What do you get if you cross a serverless system with a non-serverless downstream dependency?</p><p>A: <a href="https://izismile.com/img/img12/20190517/gifs/psychological_tricks_that_should_be_in_everyones_arsenal_19.gif">ɯǝɥʎɐW</a></p><p>Serverless components provide excellent concurrency because their FaaS setup allows tens, if not hundreds, of requests to be handled at once, but how does this impact non-serverless downstream components? Well, dependencies such as non-scalable RDBs have a finite number of parallel connections which serverless can exceed resulting in lost messages. So, what is the solution? This was the pre-set and discussion around Jeremy Daly’s talk which highlighted design principals to bake resiliency in applications. Resiliency is a measure of how well a system performs after failing. Therefore, we accept the shortcomings of the downstream RDB and design <a href="https://docs.oracle.com/cd/B14099_19/caching.1012/b14046/cluster.htm">cache clusters</a>, <a href="https://martinfowler.com/bliki/CircuitBreaker.html">circuit breakers</a>, <a href="https://en.wikipedia.org/wiki/Dead_letter_queue">dead letter queues</a> and other design patterns using serverless services. Another huge talking point was the understanding and appreciation of when to use asynchronous and synchronous requests when you have slower downstream services; showing transparent with your users stating that the system is ‘thinking’ — realistically knocking repeatedly at the door of non-serverless components — will drastically improve their experience.</p><p>A change of minds, or a change of titles? To implement serverless successfully within a business it must be adopted <em>throughout</em>. One change of philosophy to do this is to think of traditional Software Engineers within serverless projects more as Architects.</p><p>You can’t escape good ole’ research. Whilst it is easy for businesses to think of serverless as a ‘silver bullet’ that will solve latency and performance issues, research into microservices is imperative. These services have limits and similar ones have subtle differences, understanding these and what that means for your product to uncover which is best suited for your particular use-case.</p><p>Speak the same language: business. One cause of poor software quality is down to a lack of domain knowledge when designing a product. A design pattern to resolve this is <a href="https://medium.com/@SkyscannerEng/lets-talk-domain-driven-design-d12e872c4611">Domain-Driven Design</a> (DDD) which Susanne Kaiser discussed. DDD looks at mapping business users, their needs and the services to achieve that into ‘cores’ which have different value to the product.</p><p>The event session was recorded and when it is uploaded I will update this post.</p><p>If you are interested in any of these topics and want to know more, check out the Applied Innovation publication below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25bf6ad4b4ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/serverlessdays-belfast-2020-25bf6ad4b4ab">ServerlessDays: Belfast 2020</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forecasting: it’s not just for the weather]]></title>
            <link>https://medium.com/kainos-applied-innovation/forecasting-its-not-just-for-the-weather-3f2a68e788b4?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f2a68e788b4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[big-data-analytics]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Mon, 03 Feb 2020 13:44:38 GMT</pubDate>
            <atom:updated>2020-02-03T16:13:02.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*f_g7P3nMb1d7XSYSmxRcww.png" /></figure><p>Businesses now live in a data-saturated environment — a data swamp if you will, but with fewer ogres — with millions of data points, capable of being extracted from data lakes or generated from IoT sensors daily. Data which solves problems and progresses business.</p><p>The Applied Innovation team understand this and research into products and services that aid in developing solutions more easily and quickly than ever before. One subset of this rich data swamp revolves around the change of data over time; the area of time-series which I talked about in my last post <a href="https://medium.com/@marcte/time-series-time-taken-seriously-f452a5496a87">here</a>, but that’s not the focus area of this. For this blog, I want to talk about a tool that creates time-series predictions: <a href="https://aws.amazon.com/forecast/">AWS Forecast</a>.</p><p>Amazon’s dedicated cloud-based time-series forecasting tool named appropriately, Forecast provides a cost-effective and intuitive solution to time-series forecasting.</p><p>Forecast has a number of impressive features. First, and foremost it supports FIVE algorithms; I’ll tell you how to exploit in a bit. It is also capable of modelling the most absurd time-series problems with data up-to 100 million records due to its custom domain setting. The forecast granularity can be as large as years or as precise as minutes and can incorporate countries’ holiday calendars to aid in making predictions more accurate, e.g. predicting clothing item sales which will increase during the festive periods.</p><p>Let me give you a 30-second, high-level tour of how Forecast works:</p><p>Firstly, you create a project in Forecast which it calls a <em>Dataset Group</em>. Data which is stored in an S3 bucket can be loaded into Forecast via a <em>Dataset Import Job</em> to create a <em>Dataset</em>. It is worth mentioning that you can supply additional datasets to aid in prediction accuracy. Next, we move onto the exciting part — the data model — which Forecast calls a <em>Predictor</em>. This is where the beauty of Forecast comes in by allowing you to select an option called, ‘AutoML’ which says to Forecast, “Hey! Why don’t you try all of your fancy algorithms on my data and when you’re done, give me back which performed best, I’m away for a cuppa.” Now, this is where it gets confusing (not by complexity, but by naming) because Forecast now generates future data points from the model in what it calls a <em>Forecast</em> (see, confusing) which you can query and filter until your heart’s content.</p><p>Well, that’s Forecast, in a nutshell, oh and all of this can be done through either: AWS’ shiny UI, API calls or the ever-popular AWS console (for those of you who can’t get enough of the terminal).</p><p>There are other cloud-based competitors in the market including <a href="https://azure.microsoft.com/en-gb/services/time-series-insights/">Microsoft’s Azure Time Series Insights</a> and <a href="https://www.sapanalytics.cloud/resources-your-guide-to-time-series-forecasting/">SAP’s Analytics Cloud</a>.</p><p>The benefits of Forecast are numerous. The fact that it is a fully-fledged AWS service means that you can incorporate all of your favourite existing AWS services into it, straight out of the box! However, by far the greatest benefit of Forecast is when you consider it as a utilitarian service; the ability to run a dataset through Forecast’s pipeline — with AutoML selected — allows for data to be loaded, analysed and evaluated for applicability within a few hours.</p><p>Unfortunately, Forecast is not without fault. It is extremely rigid in serving time-series data — which sounds like a good thing! However, if you come from an ML background then you may find it challenging to add other fields into Forecast with many pitfalls to catch you out. However, one of its main drawbacks is its inapplicability to analyse real-time data due to the static nature of its storage and import configuration — S3 buckets. This is a major blocker for Forecast with the rise of time-series usage being down to the IoT devices analytics, however, I remain hopeful that AWS’ very own time-series database, Timestream can rectify this when it is released.</p><p>If this blog has interested you and you want to know more check out the Applied Innovation team on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f2a68e788b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/forecasting-its-not-just-for-the-weather-3f2a68e788b4">Forecasting: it’s not just for the weather</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time-series, time taken seriously]]></title>
            <link>https://medium.com/kainos-applied-innovation/time-series-time-taken-seriously-f452a5496a87?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f452a5496a87</guid>
            <category><![CDATA[time-series-database]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Mon, 03 Feb 2020 13:36:55 GMT</pubDate>
            <atom:updated>2020-02-03T13:36:55.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*TziwIqMzaHHrkb9cXSqfQA.jpeg" /></figure><p>Time-series — as the name suggests — is recording points of data against time. This time can be as large as years or as precise as microseconds or nanoseconds. Using this data structure we can apply time-series analysis and time-series forecasting to it.</p><p>Analysis looks at how some metric changes over time and what trends or patterns emerge that we couldn’t see just by looking at the data — think back to GCSE maths when you looked at distance-time graphs to model the story of the tortoise and the hare. You were able to understand the movements of both the animals — this is time-analysis. Simple, yes, but time-analysis none the less.</p><p>Forecasting looks at using past data to predict a future times’ metric values. Taking that example of the tortoise and the hare, let’s just consider the hare. What if the distance to be covered was twice that of the original story, what time would we expect the hare to finish? Using time-series forecasting we could predict this.</p><p>It’s also worth mentioning the underlying data structure that enables this, time-series databases. These databases are designed to handle timestamp data with extreme precision, compress and auto aggregate data and perform optimised querying over large time ranges of time-series data.</p><p>All that being said, the best and most common uses of time-series analysis and forecasting is in FinTech, control charts and anomaly detection.</p><p>So, where can Kainos or the Applied Innovation team apply this technology? IoT device networks and other sensory technologies provide enormous data lakes of data.</p><p>Leveraging this continuous stream of data and feeding that into scalable and capable time-series data structures we can start to find insights that weren’t just difficult to spot at first, but impossible. Insights into people movement from on-street CCTV cameras or Wi-Fi connectivity can allow us to make better decisions for things such as footpath repairs or where to place items in a clothes store for most traction. Strange or unexpected actions could be flagged for source control commits or server performance using anomaly detection.</p><p>If this interests you, or technology as innovative, then discover the Applied Innovation team here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f452a5496a87" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/time-series-time-taken-seriously-f452a5496a87">Time-series, time taken seriously</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSeeR: I C What You Did There]]></title>
            <link>https://medium.com/kainos-applied-innovation/oseer-i-c-what-you-did-there-f0d739b9fd10?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0d739b9fd10</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[future]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[history]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 16:52:07 GMT</pubDate>
            <atom:updated>2019-11-04T14:18:20.888Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgrL-IR2Q3RDT6J_SKWk2g.jpeg" /><figcaption>Source: <a href="https://cdn.pixabay.com/photo/2016/02/19/10/12/writing-1209121_960_720.jpg">Pixaby</a></figcaption></figure><h4>Born from altruistic roots to a recent progression into unethical practices</h4><p>This blog takes you through OCR’s journey from humble beginnings as a Morse code converter, to a globally adopted ‘next-gen’ business tool, used to provide an innovative edge over competitors.</p><h3>Index</h3><blockquote>What’s An OCR?<a href="#67a4">☍</a></blockquote><blockquote>Who Do You Think You Are: OCR Edition<a href="#43f3">☍</a></blockquote><blockquote>Software Fights Back<a href="#05a0">☍</a></blockquote><blockquote>Benefits Of OCR <a href="#7fd5">☍</a></blockquote><blockquote>Accessibility <a href="#272f">☍</a></blockquote><blockquote>Challenges <a href="http://95c0/">☍</a></blockquote><blockquote>Who’s OCR’ing <a href="#8326">☍</a></blockquote><blockquote>OCR In The Wild <a href="#d3fe">☍</a></blockquote><blockquote>Bibliography <a href="#6342">☍</a></blockquote><h3>What‘s An OCR?</h3><p><a href="#9a27">[Index]</a></p><p>Optical Character Recognition or OCR is a piece of software that interprets blobs of colours and shapes in a digital image as text or not — think of it as the patient doing an optician’s eye chart test.</p><figure><img alt="Cartoon of a bird taking an eye chart exam." src="https://cdn-images-1.medium.com/max/500/1*HvvDEfIu7hPz-Nxo0PCQnQ.jpeg" /><figcaption>Eye chart cartoon. Source: <a href="https://www.pinterest.co.uk/pin/815010863790684692">Pinterest</a></figcaption></figure><h3>Who Do You Think You Are: OCR Edition</h3><p><a href="#9a27">[Index]</a></p><p>OCR can be traced back as far as 1809 when the first patents were handed out <em>around</em> OCR in research. However, its first physical entity comes around the time of the First World War, sprouting off telegraphy — its earliest ancestor if you like — when physicist Emanuel Goldberg invented a machine that could read characters and convert them into telegraph code. He later used pattern recognition embedded in a photoelectric cell to retrieve information from film where information at the time was stored.<a href="#6342">¹</a></p><figure><img alt="Morse code transmitting device." src="https://cdn-images-1.medium.com/max/701/1*buvQtWmJKbhXJQL6NLL7Hw.png" /><figcaption>Morse code is an example of telegraphy. Source: <a href="https://cdn.vox-cdn.com/thumbor/sGKdOxWHAHB2P0E2PuHyj3B4SIg=/106x0:993x591/1200x800/filters:focal(106x0:993x591)/cdn.vox-cdn.com/assets/930304/Screen_Shot_2012-02-02_at_3.33.28_PM.png">The Verge</a></figcaption></figure><p>Although this machine was revolutionary in its time, it repurposed existing hardware such as movie reels which worked in the short term but was less adequate as time progressed and information began to no longer be stored on film. Step forward inventor David Shepard who developed a Gismo, or rather <em>the Gismo</em> in 1951. This machine translated printed messages into a form understood by machines. Gismo only recognised simple, open fonts and as such Shepard invented a font that met these conditions. Can you guess which font Shepard invented? If you thought, “Comic Sans” then I encourage you to leave, but for the norms, it was the font used on credit cards today.<a href="#6342">³</a></p><p>These font limitations restricted early machines’ usability as they were only able to interpret select messages. However, in the 1970s, Ray Kurzwell invented omni-font OCR which was capable of processing printed documents in almost any font<a href="#6342">¹</a> — keep in mind the number of fonts available at this time were fewer than today, for example, Comic Sans was not developed for another 20 years — how lucky they were!</p><p>OCR today is widely adopted and used commercially in a host of sectors including medical, financial and commercial.</p><p>Continuing to look at the OCR ancestral family tree, we arrive at its closest cousin, Optical Mark Recognition or OMR. A similar recogniser of physical marks, OMR more simply looks for the presence, or lack of presence, of a mark made from pen ink, pencil graphite or alike. Due to its simplicity OMR predominantly uses hardware scanners to process documents and companies such as <a href="https://www.drs.co.uk/solutions/scanners/versatility-and-ease-of-use">DRS</a> specialise in making these. It’s worth noting that it is somewhat moving into the digital era due to the plethora of advantages outlined in this <a href="https://medium.com/@annywatson/omr-software-solution-vs-traditional-hardware-based-solution-c66d26adaf9c">blog</a>.</p><figure><img alt="OMR scanner device." src="https://cdn-images-1.medium.com/max/589/1*piWJKdpfZ8MVcalee3bc8Q.png" /><figcaption>OMR scanner. Source: <a href="https://www.skill.co.id/image/Opscan-4es.png">Skills ICT Solutions</a></figcaption></figure><p>OCR also recognises the presence of marks but then performs the added task of determining what alphanumeric character that smuggle is. This additional task is far more complex than simply determining whether something <em>is there</em> and as such OCR predominantly uses software. However, earlier adaptations were restricted to using hardware or, when early software was combined with hardware scanners, outperformed its hybrid counterparts as this 1996 <a href="https://www.ecmconnection.com/doc/optical-character-recognition-the-mature-tech-0001">article</a> describes.</p><h3>Software Fights Back</h3><p><a href="#9a27">[Index]</a></p><p>Today, however, software takes back its crown. <a href="https://medium.com/machine-learning-for-humans/why-machine-learning-matters-6164faf1df12#c5dd">Machine learning</a> (ML) is such a diverse area of computing that solves a wide spectrum of problems. One of these problems revolves around <a href="https://medium.com/readers-writers-digest/beginners-guide-to-computer-vision-23606224b720">computer vision</a> and a subset of that, OCR. There are a plethora of clever techniques used to solve this problem some of which are outlined in this <a href="https://towardsdatascience.com/a-gentle-introduction-to-ocr-ee1469a201aa#4dd0">blog</a> but the new and cool term is <a href="https://medium.com/@shridhar743/a-beginners-guide-to-deep-learning-5ee814cf7706">deep-learning</a>. Deep learning can be applied to OCR in what some are calling, ‘next-gen OCR’ like <a href="https://www.information-age.com/optical-character-recognition-tools-ocr-ai-123479324/">Tim</a> and <a href="https://www.forbes.com/sites/forbestechcouncil/2019/09/10/the-future-of-ocr-is-deep-learning/#2a417cf56a04">Abhinav</a>. A relatively new form of this is <a href="https://hackernoon.com/what-is-a-capsnet-or-capsule-network-2bfbe48769cc">CapNets</a>.</p><figure><img alt="Convolutional Neural Network (CNN) diagram." src="https://cdn-images-1.medium.com/max/1024/1*4OUonEDfZwCfR4Y-G-h1fw.jpeg" /><figcaption>Convolutional Neural Network (CNN) used in deep-learning image processing. Source: <a href="https://miro.medium.com/max/3288/1*uAeANQIOQPqWZnnuH-VEyw.jpeg">Towards Data Science</a></figcaption></figure><p>In addition to raw text extraction, text structure and content awareness pose additional <a href="#ec18">problems</a>. Deep-learning can again be applied to <em>understand</em> document’s structure. This combination of models working in harmony can create very powerful applications for text extraction, combine that with pipelines to automate monotonous tasks and you have a very useful business tool.</p><h3>Benefits Of OCR</h3><p><a href="#9a27">[Index]</a></p><p>OCR brings many advantages:</p><ul><li>Increased accuracy; <em>documents text are more accurate than those manually transcribed</em></li><li>Throughput; <em>using computers to transcribe documents rather than humans reduces variation in productivity and quality allowing for more accurate workload estimates to be made</em></li><li>Automation; <em>digital business models which receive and process data can incorporate OCR into pipelines relatively simply</em></li><li>Editable documents; <em>documents can be cropped, re-ordered and highlighted to suit users’ needs</em></li><li>Searchable documents; <em>documents can be stored in huge data warehouses to allow for searching, as you’d see for </em><a href="https://chroniclingamerica.loc.gov/"><em>historical texts</em></a></li><li>Accessibility; <em>documents can be made useable for screen readers</em></li></ul><h3>Accessibility</h3><p><a href="#9a27">[Index]</a></p><p>OCR’s initial purpose was to provide a service for disadvantaged users; visually impaired: partial to complete blindness or mentally impaired: dyslexia, autism, etc.</p><p>Around the same time of Mr. Goldberg’s telegraphy translation invention, scientist Edmund Edward Fournier d’Albe developed the <a href="https://en.wikipedia.org/wiki/Optophone">Optophone</a>. This was a device that transformed text into sound to allow deaf people to ‘read’.</p><figure><img alt="A man with a headset on using a Optophone." src="https://cdn-images-1.medium.com/max/800/1*aos-YNoxU0Rcz8Xxgf40lw.jpeg" /><figcaption>The Optophone in-use. Source: <a href="https://wellcomecollection.org/works/j2645fuw">Welcome Collection</a></figcaption></figure><p>In the United States of America alone, an estimated 7,675,600 can be categorised as being visually impaired.<a href="#6342">⁴</a> This means that they require use of specialist software known as <a href="https://www.nomensa.com/blog/2005/what-screen-reader">screen readers</a> to access websites and digital documents or PDFs. The problem with these is that they are not accessible to people with visual difficulties from the get-go. Accessibility has to be added after. To add this, PDFs requires OCR software to ‘read’ the document and produce hidden PDF tags which provide structure to the document for screen readers<a href="#6342">⁵</a>. These tags — which represent the individual elements on the page — are stored in a hierarchical tree.<a href="#6342">⁶</a> There are many different applications that enable these features including Read&amp;Write for Windows and Mac or Google Chrome’s Texthelp Snapverter which uses documents in Google Drive.<a href="#6342">⁷</a></p><blockquote><strong>WCAG 2.0 Guidelines:</strong></blockquote><blockquote>Guideline 1.4.5 “If the technologies being used can achieve the visual presentation, text is used to convey information rather than images of text except for the following: (Level AA)</blockquote><blockquote>Customizable: The image of text can be visually customized to the user’s requirements;</blockquote><blockquote>Essential: A particular presentation of text is essential to the information being conveyed.” (<a href="https://www.w3.org/">W3C</a>)</blockquote><p>This guideline<a href="#6342">⁸</a> states that text from an image should be editable by a user to suit their needs. OCR enables this by enabling software to perform a whole host of features including:</p><ul><li>Text highlighting</li><li>Text colour and font changing and resizing</li><li>Ability to use digital dictionaries, thesauruses and translators</li></ul><p>These features amongst others other can help in use-cases such as individuals with dyslexia as this <a href="https://www.understood.org/en/school-learning/assistive-technology/assistive-technologies-basics/how-does-optical-character-recognition-help-kids-with-reading-issues">article</a> explains.</p><h3>Challenges</h3><p><a href="#9a27">[Index]</a></p><p>The ability to detect text on a page can, of course, be influenced extensively by the quality of the page in which it is trying to be read. Creases, smudges and tears can make it more challenging for <em>us</em> to read information from a page and when this is fed into a computer system these difficulties can be amplified, not to mention the issues of blurs, flashes, rotations, etc added when you scan them.</p><p>The previous examples of OCR processing focussed only on raw text extraction, however for many documents the text present has no meaning without context. Think of your driving licence, it has fields against which your details are stored. This relationship between field and value is lost with brute-force OCR and as such the document type needs to be considered to derive value from it. This classification of document type requires a further form of ML.<a href="#6342">⁹</a> However, this has problems, many of which are outlined in this <a href="https://idm.net.au/article/0011231-limitations-using-ocr-file-classification">article</a>.</p><figure><img alt="Facebook news feed with different stories and messages. Advertisements and other options either side." src="https://cdn-images-1.medium.com/max/650/1*cfz7RltbhdXXyeW7M8pfcA.png" /><figcaption>An example of where brute-OCR would not be beneficial. Source: <a href="https://www.howtogeek.com/wp-content/uploads/2017/02/1webtool.png">How-To Geek</a></figcaption></figure><p>One stumbling block for translators, however, has always been handwriting. ML techniques have produced fantastic results on the MNIST dataset (single digit handwritten letters) with Convolution Neural Network (CNN) being notable. This <a href="https://towardsdatascience.com/https-medium-com-rachelwiles-have-we-solved-the-problem-of-handwriting-recognition-712e279f373b#3c68">blog</a> provides more details on this. However, thinking of handwriting as words, sentences and paragraphs this idea of modelling it as merely individual letters is naïve; developing a model capable of detecting handwriting in all forms, is extremely difficult.</p><p>The issues defined above highlight that attaining 100% accurate transcriptions is unreasonable and near impossible even with the advances in ML. However, there are online communities who scan, alter and upload corrected translation documents for others to use to online libraries. Libraries such as <a href="https://www.bookshare.org/cms/">Bookshare</a> and <a href="https://learningally.org/">Learning Ally</a> contain accessible documents and audio books.</p><h3>Who’s OCR’ing?</h3><p><a href="#9a27">[Index]</a></p><p>There are many different OCR services on offer today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*_GvUKTCCY2IbJJUD5eq8Og.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*_2nsdmjpH6VsGp1imcJJqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*FEUJAOu8GGezr4ZDHJHP_Q.png" /><figcaption>Selection of OCR services</figcaption></figure><p><a href="https://www.abbyy.com/en-gb/finereader/?gclid=EAIaIQobChMIvsKBlNCj5QIVV-DtCh2yoweOEAAYASAAEgJ_9PD_BwE">Abbyy’s FineReader</a> provides a hardcore OCR engine built on Azure’s architecture, ample features suited for business uses and a <a href="https://www.abbyy.com/en-gb/mobile/">mobile</a> equivalence. In addition to a desktop application, they also provide a <a href="https://www.ocrsdk.com/?gclid=EAIaIQobChMI0cWd9tOv5QIVxPhRCh1GKw-NEAAYASAAEgJhS_D_BwE">cloud solution</a> which is accessed through an SDK. The software performs well in this comparison <a href="https://source.opennews.org/articles/so-many-ocr-options/">article</a>, however, the service is costly at roughly 7 pence per page.</p><p>The offerings from <a href="https://azure.microsoft.com/en-gb/services/cognitive-services/computer-vision/">Microsoft</a>, <a href="https://cloud.google.com/vision/">Google</a> and <a href="https://aws.amazon.com/rekognition/">Amazon</a> rectify this expense barrier with cost-effective cloud-based solutions interacted with via SDKs and API calls, costing a fraction of a pence per transaction. These solutions also provide text location within an image in pixels and relationship between text, e.g. line, word, letter. Amazon’s <a href="https://aws.amazon.com/textract/">Textract</a> also provides relationships in forms and invoices between text field and value. The performance of these services differ significantly and if you’d like to these 3 titans go head-to-head-to-head in a performance showdown, then check out my other <a href="https://medium.com/@marcte/comparetheocr-com-e5df060e21a7">blog</a>!</p><p><a href="https://opensource.google/projects/tesseract">Tesseract</a> (from Google) and <a href="http://kraken.re/">Kraken</a> (a nice wrapper for <a href="https://github.com/tmbdev/ocropy">OCRopus</a>) provide some open-sauciness into the mix. These packages require more development to integrate them with a system. For an in-depth comparison analysis check out this <a href="https://medium.com/datadriveninvestor/review-for-tesseract-and-kraken-ocr-for-text-recognition-2e63c2adedd0">blog</a>.</p><h3>OCR In The Wild</h3><p><a href="#9a27">[Index]</a></p><p>Within the medical sector, OCR is used to transform patient documents and invoices to digital copies in order to comply with HIPAA protocols but also with the overall goal of being totally paperless. In addition, these digital documents can be shared with other personnel but they are also compatible to communicate with robotic process automation platforms.<a href="#6342">¹⁰</a></p><p>This GitHub repository provides a stripped down version of <a href="#43ae">Abbyy’s FineReader</a> to extract tabular data from documents.</p><p></p><p>Digitising historical paper documents allow for them to be searchable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ECH7RxCOkkB7lgp-pQy-Q.png" /><figcaption>Search result for historical data entries. Source: <a href="https://discovery.nationalarchives.gov.uk/">The National Archives</a></figcaption></figure><p></p><p>In 2011 approximately 1,700 ports globally installed OCR software to automate process and manage shipping containers’ conditions.</p><p></p><p>Circling back to <a href="#272f">accessibility</a>, OCR can be used to test mobile applications during their ever-decreasing release times, and subsequent user-acceptance testing phase.</p><p></p><p>OCR is also used to scan voucher codes, meter readings and hotel check-ins or festival ticket scanning.</p><figure><img alt="Smartphone held towards electric meter with clock reading displayed on phonescreen." src="https://cdn-images-1.medium.com/max/1024/1*h5ePEIPhHJy0wYFJfwCPbQ.jpeg" /><figcaption>OCR being used to ‘read’ electric meter. Source: <a href="https://anyline.com/wp-content/uploads/2017/10/Meter-Reading-Scanning-Best-Practice-Guide.jpg">Anyline</a></figcaption></figure><ul></ul><p>Licence plate recognition is one of the most widely adopted use of OCR, scanning millions of cars per month.</p><p>The criminal prevention department has jumped on board with utilising it but there is a concern with data retention policies and unethical data sharing.</p><ul></ul><p>This use extends into other sectors with fast-food restaurants looking to create custom menus for returning customers and keep card information for ‘leave your wallet at home’ payment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*SwLGwMXl3TbvplROeeOf0A.jpeg" /><figcaption>McDonald’s has teamed up with Dynamic Yield to bring ‘ultrapersonalisation’. Source: <a href="https://i2.wp.com/www.diegocoquillat.com/wp-content/uploads/2019/10/McDonalds-y-dynamic-yield.jpg">DiegoCoquillat.com</a></figcaption></figure><p></p><p>Mathematical and scientific equations and notation can be extracted using this GitHub repository.</p><p></p><p>For more OCR related software and literature, check out this <a href="https://github.com/kba/awesome-ocr">repository</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*t-bpFFR8ueFFLN1vzcqhfg.png" /></figure><p>If you’re interested in reading up on all things techy from virtual immersion to quantum computing check out the Applied Innovation team’s series of <a href="https://medium.com/kainos-applied-innovation">blogs</a>!</p><h3>Bibliography</h3><p><a href="#9a27">[Index]</a></p><ul></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0d739b9fd10" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/oseer-i-c-what-you-did-there-f0d739b9fd10">OSeeR: I C What You Did There</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CompareTheOCR.com*]]></title>
            <link>https://medium.com/kainos-applied-innovation/comparetheocr-com-e5df060e21a7?source=rss-6a103481af4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5df060e21a7</guid>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Marc Templeton]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 16:49:48 GMT</pubDate>
            <atom:updated>2019-11-04T14:18:37.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A computer monitor with an eye in a browser." src="https://cdn-images-1.medium.com/max/1024/1*DYtNICdrDBldHJ4YCo1N2Q.jpeg" /><figcaption>OCR a subset of computer vision. Source: <a href="https://pixabay.com/illustrations/surveillance-spying-computer-screen-3351758/">Pixabay</a></figcaption></figure><h4>*domain does not actually exist, it’s a tool (a bit like the author)</h4><p>OCR has many use-cases in a whole host of sectors, from healthcare to finance and its applicability is only growing due to the increasingly affordable and available access to these services. Many of the ‘tech-giants’ such as Microsoft, Google and Amazon provide access to their OCR services and in this blog, I dive head-first into these to answer one simple thing: <em>are they any good?</em></p><p>The tool in this blog is open-source and available on <a href="https://github.com/KainosSoftwareLtd/ocr-comparison-tool">Kainos’ GitHub</a>.</p><h3>Index</h3><blockquote>Challenges <a href="#67a4">☍</a></blockquote><blockquote>Tool <a href="#fdb3">☍</a></blockquote><blockquote>Results <a href="#7344">☍</a></blockquote><blockquote>All Results <a href="#9c25">☍</a></blockquote><blockquote>Conclusions <a href="#c1d0">☍</a></blockquote><blockquote>Future Considerations <a href="#6c9a">☍</a></blockquote><blockquote>Closing Remarks <a href="#7b33">☍</a></blockquote><h3>Challenges</h3><p><a href="#9068">[Index]</a></p><p>OCR’s <em>huuuuugeee</em> range of uses, across a plethora of business areas means that it comes with one colossal problem: 1 word, 7 letters… ‘variety’.</p><p>“What variety are you talking about?” I’m glad you w̶e̶r̶e̶ ̶f̶o̶r̶c̶i̶b̶l̶y̶ ̶m̶a̶d̶e̶ ̶t̶o̶ ̶a̶s̶k̶ asked. I’m talking about the variety in text, ranging from text stylistics to structure.</p><figure><img alt="A collection of the letter, “L” in a wide variety of fonts." src="https://cdn-images-1.medium.com/max/872/1*ehqL8izyAM0sB3_GP_Hyeg.png" /><figcaption>Font variations of the letter, “L”. Source: <a href="http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/">Chars74k dataset</a></figcaption></figure><p>Text stylistics modify texts’ visual appearances with the use of size, colour or through the use of fonts and shape. This can be taken one step further with basic augmentation such as italics, bold, underlines, strikethrough (not forgetting double strikethrough) or super and subscripting, all of which can be done using simple Microsoft Word! Throw some creative and artistic minds into the mix and simple text can be misshaped in every conceivable way. Textures and shadows can provide a sense of depth and feeling to the text, further distorting it from its original style.</p><p>Extracting raw text is fine in most cases, however, sometimes the relationship and structure of the text must be preserved to provide context and meaning. Layouts such as the columnar nature of published papers and tables require text to be extracted in blocks of related data items. This requires that the OCR software firstly, identifies this structured nature and then has the means to extract the relevant text and present it appropriately. Invoices and forms provide more complex examples of text relationships.</p><p>Throughout all of these text sources the use of symbols and icons pose a further problem of misinterpretation; being incorrectly identified as alphanumeric values.</p><p>The problems defined above have only considered digital text, when you think of handwriting, which is regarded by many to be unique with scientific studies supporting this idea such as that conducted by the <a href="https://www.wonderopolis.org/wonder/do-we-all-have-different-handwriting">State University of New York, Buffalo</a> which tested against 1,500 samples, it clearly adds an <em>obsceeeeene</em> amount of variety.</p><figure><img alt="A collection of logos which distort text by adding texture, depth and hidden meanings" src="https://cdn-images-1.medium.com/max/1004/1*3prLftr3qVFSNxhWYNGlKQ.png" /><figcaption>Text with texture, depth and hidden meanings. Source: <a href="https://1stwebdesigner.com/50-creative-type-based-logo-designs/">1stWebDesigner</a></figcaption></figure><p>The method of attaining these pieces of text adds problems too. Scanning in large documents with creases or stains reduces the quality of the individual lettering; obscuring them, changing their appearance or covering them up entirely. Whilst photographing text is not feasible for larger text pieces it is well suited for less dense pieces, such as receipts or movie posters. However, photography is just a minefield of flash spots, blurs and crop outs waiting to happen, impacting the quality of the output image.</p><figure><img alt="A mobile phone with a bank card being read using OCR." src="https://cdn-images-1.medium.com/max/285/1*glUUUIzawG79wlzpbFe_Fw.png" /><figcaption>OCR in-use with automatic bank card reading. Source: <a href="https://www.neoncrm.com/wp-content/uploads/2017/06/iphone-app-screenshot-credit-card-scan.png">NeonCRM</a></figcaption></figure><p>In short, this textual diversity, fluctuating quality of the captured text excerpts and need for structured understanding lead to reduced inaccurate in translations. But what are the consequences of this? Well, in a nutshell, the consequence of incorrect OCR translations depends exhaustively on the area in which they are applied. In banking, OCR is used with <a href="https://medium.com/swlh/applications-of-ocr-you-havent-thought-of-69a6a559874b">cheques</a>: reading the recipient and receiving bank account details, the value of the cheque and verifying the signature amongst other things. Clearly, any incorrect conversions here has a high impact on the company as it can attempt to charge an incorrect bank account if the account number is mislabelled or it can halt the system entirely by attempting to transfer, “1o0” (one-o-zero) rather than one hundred. OCR is also used to scan and store <a href="https://anyline.com/news/uses-of-ocr-improve-ux/">digital vouchers</a> for use in-store using a scannable code. An incorrect conversion here would likely result in an invalid voucher code and the user would be prompted to scan it again — no biggie!</p><p>These examples comprise of small text examinations but differ in consequence of misinterpretation and the effort to rectify erroneous entries by a human is minor.</p><p>Another prime example of OCR is with larger text documents to make digital backups of contracts or invoices or restoring <a href="https://docparser.com/blog/what-is-ocr/">historical text documents</a>. These exhibit a much higher chance of erroneous entry due to the sheer size and bulk of the text being read which also significantly increases the effort required to address these.</p><p>So, by now you must be thinking,</p><blockquote>“How can <em>one</em> model deal with such a wide variety of texts?”</blockquote><blockquote>Well, the answer is, “It can’t”.</blockquote><p>Computer models — by nature — focus rigorously on one specific task and these text detection models are no different. In fact, to deal with the varied text pieces suppliers of OCR services often use 2 models: one designed to handle larger blocks of text better, which we’ll call ‘<em>document</em>’ models and the other for use with natural scenes we’ll call ‘<em>image</em>’ models, applying the idea of the <a href="https://en.wikipedia.org/wiki/No_free_lunch_theorem">No Free Lunch Theorem</a> to this area.</p><h3><strong>Tool</strong></h3><p><a href="#9068">[Index]</a></p><p>OCR is a fantastic piece of technology on paper — <em>pun definitely intended</em> — with many benefits. The automation of data entry and subsequent increased productivity and reduction in personnel overhead reduces operating costs. Digitalising documents allow for backups to be easily made with significantly less storage space required and with heightened cyber-security applied. Making them digital also allows for them to be editable and made searchable. By far though, <em>the</em> key benefit of OCR is the increased accuracy in copying documents from hard-copies to digital-copies, compared to manually transcribing. It is this final point that motivated the development of this tool.</p><p>The fact that there isn’t a single OCR model that can transcribe all forms of text excerpts with the same level of accuracy means that it is imperative to know which model to use in certain situations to guarantee the greatest level of accuracy.</p><p>This tool provides this understanding of model performance through an easy to interpret and comparable metric in an automated manner.</p><p>The service, in addition to being fully automated, provides batch processing for multiple images and transcriptions but also provides the option to specify which models’ media type is used.</p><h3>Services Supported</h3><p>The services currently supported come from Microsoft, Google and Amazon; ¾ of <a href="https://gulfnews.com/business/markets/move-over-faang-maga-not-trumps-is-the-new-buzzword-1.2261334">MAGA</a>. These were selected due to their dominance in the tech industry making it likely that any user making use of OCR utilises one of these (if not, more) of these service providers. They are also cost-effective and come with SDK or API calls which do most of the heavy lifting.</p><figure><img alt="The 4 companies that make up MAGA’s logos (Microsoft, Apple, Google and Amazon)." src="https://cdn-images-1.medium.com/max/941/1*ILqCw40nx_ktY5ZRfTZK2g.png" /><figcaption>Microsoft, Apple, Google and Amazon (MAGA) companies. Source: <a href="https://www.ft.com/__origami/service/image/v2/images/raw/http%3A%2F%2Fcom.ft.imagepublish.upp-prod-eu.s3.amazonaws.com%2Fd1715e8c-91ab-11e8-9609-3d3b945e78cf?fit=scale-down&amp;source=next&amp;width=700">Financial Times</a></figcaption></figure><p><a href="https://azure.microsoft.com/en-gb/services/cognitive-services/computer-vision/">Microsoft</a> make use of an API call to its Computer Vision gateway service; for documents, the READ API is used whilst its OCR API is used for natural scene images. These models can read documents and images with a 40° rotation applied; the OCR model supports 25 languages which it auto-detects. It costs $0.0015 per transcription.</p><p><a href="https://cloud.google.com/vision/">Google</a> makes use of its Cloud Vision SDK which makes use of 2 annotation features to derive text from an image. In addition to being able to detect multiple languages, Google’s Vision can also detect multiple languages in the same image. It costs $0.0015 per transcription.</p><p>Amazon make use of a Boto3 gateway SDK which provides access to <a href="https://aws.amazon.com/textract/">Textract</a> for document text and <a href="https://aws.amazon.com/rekognition/">Rekognition</a> for live scene images. Textract costs $0.0015 per transcription whilst Rekognition costs $0.0001 per transcription.</p><h3>Evaluation Technique</h3><p>Evaluation of the performance on translations is key for determining the accuracy of the service. There are many metrics available to determine OCR performance, but the metric used in this tool is a hybrid; <a href="https://pdfs.semanticscholar.org/e790/5406434d0b84e6f8bbf59867654848e8dab0.pdf">CharacTER</a> utilises differences at both character and word level. This calculation also recognises words from the same stem words as the same, e.g. “codes” and “coded” which come from the stem word, “code”.</p><figure><img alt="Simplified calculation to generate CharacTER metric." src="https://cdn-images-1.medium.com/max/912/1*xU6aNcYGFBNBZ-XF93_-0g.png" /><figcaption>CharacTER’s calculation. Source: <a href="https://github.com/rwth-i6/CharacTER/blob/master/WMT2016_CharacTer.pdf">GitHub</a></figcaption></figure><h3><strong>Dataset</strong></h3><p>In an attempt to represent real-life uses of OCR, a number of datasets were sourced. These varied from website icons, scanned document text with different filters applied such as stains and crumpled lines, natural photos of house numbers and hand-drawn alphanumeric values.</p><p>These datasets were amalgamated together to produce an overall sample of 280 images to run through the tool.</p><h3>Transcribe</h3><p>The original transcriptions were stored in a properties CSV file against each image’s name. The textual content of the images was then copied to each services’ original transcript files. One-by-one each image was passed to the tool which sent it off to each OCR services’ models for each media type. The results were returned and any non-English were substituted for, “?” because non-English characters once parsed were displayed as their Unicode representation, e.g. “é” was encoded as, “u00E9”. The results were stored in the service’s results file which included the name of the service and media type as well as a timestamp. The timestamp was added to the file to ensure uniqueness and allow for past results to be stored.</p><h3>Metric</h3><p>The original transcript file and the corresponding result file were passed into the <a href="https://github.com/rwth-i6/CharacTER/blob/master/CharacTER.py">CharacTER script</a> which generates a score for each image translation. It then generates the average across all those transcribed.</p><p>CharacTER score is between 0.0–1.0 with zero being a perfect translation and one being an extremely poor translation or simply a failed one. Therefore we can think of this as an error rate for the transcribed text.</p><h3>Results</h3><p><a href="#9068">[Index]</a></p><p>The results below are split amongst the 3 services used and for both of their ‘document’ and ‘image’ model types.</p><p>The description of each transcription category are as follows:</p><blockquote>PERFECT TRANSCRIPTION — exact transcription match for an image with text</blockquote><blockquote>FAILED TRANSCRIPTION — service failing to detect text in an image with text</blockquote><blockquote>SUCCESSFUL NULL TRANSCRIPTION — exact transcription match for an image with no text</blockquote><blockquote>80% SUCCESSFUL TRANSCRIPTION — transcription that had a CharacTER score of 0.2 or below</blockquote><blockquote>20% SUCCESSFUL TRANSCRIPTION — transcription that had a CharacTER score of 0.8 or above</blockquote><blockquote>0% SUCCESSFUL TRANSCRIPTION — exact transcription mismatch for an image with text</blockquote><p><em>The thumbnails present in the tables below were hand-picked to provide an overview of the model’s performance. The full results </em><a href="#9c25"><em>follow</em></a><em>.</em></p><h3><strong>Amazon Document</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Amazon Textract." src="https://cdn-images-1.medium.com/max/894/1*HzmPSpu3dbFkg8pJRyCCMg.png" /><figcaption>Amazon document results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Amazon Textract." src="https://cdn-images-1.medium.com/max/1024/1*n4Vk-DgCVV-sV6Wzq9FYZw.png" /><figcaption>Amazon document threshold results</figcaption></figure><h3><strong>Amazon Image</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Amazon Rekognition." src="https://cdn-images-1.medium.com/max/874/1*Uss4BGVH1vj0tuOdyUdvvw.png" /><figcaption>Amazon image results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Amazon Rekognition." src="https://cdn-images-1.medium.com/max/1024/1*B047L6sBeoGcPXiKjbRD4Q.png" /><figcaption>Amazon image threshold results</figcaption></figure><h3><strong>Google Document</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Google Cloud Vision." src="https://cdn-images-1.medium.com/max/761/1*tBumUsUr8HOvl0smDidSJQ.png" /><figcaption>Google document results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Google Cloud Vision." src="https://cdn-images-1.medium.com/max/1024/1*-wQbtfmOh1D4NG8n9wEa0w.png" /><figcaption>Google document threshold results</figcaption></figure><h3><strong>Google Image</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Google Cloud Vision." src="https://cdn-images-1.medium.com/max/666/1*SghZFSyDfD1y57u5rVAyzw.png" /><figcaption>Google image results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Google Cloud Vision." src="https://cdn-images-1.medium.com/max/1024/1*8hqHXNZs6px13w3oEfNMGw.png" /><figcaption>Google image threshold results</figcaption></figure><h3><strong>Microsoft Document</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Microsoft Vision." src="https://cdn-images-1.medium.com/max/680/1*aNvISCzR1lotn2kyFvbedA.png" /><figcaption>Microsoft document results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Microsoft Vision." src="https://cdn-images-1.medium.com/max/1024/1*v1DXP13zOWjXMcP9DbftHw.png" /><figcaption>Microsoft document threshold results</figcaption></figure><h3><strong>Microsoft Image</strong></h3><figure><img alt="Examples of perfect, failed and successfully null transcriptions for Microsoft Vision." src="https://cdn-images-1.medium.com/max/658/1*oCTqNtt5UhaAGKMk1Oh4ww.png" /><figcaption>Microsoft image results</figcaption></figure><figure><img alt="Examples of threshold transcriptions for Microsoft Vision." src="https://cdn-images-1.medium.com/max/1024/1*mwc_7My1DE3j85B6xmPPxQ.png" /><figcaption>Microsoft image threshold results</figcaption></figure><h3><strong>All Results</strong></h3><p><a href="#9068">[Index]</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrlLM0HK7T16MrPh&amp;url=https%3A%2F%2Fairtable.com%2FshrlLM0HK7T16MrPh&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/17079da00085b8bdf208386041926809/href">https://medium.com/media/17079da00085b8bdf208386041926809/href</a></iframe><h3>Conclusions</h3><p><a href="#9068">[Index]</a></p><p>Amazon document produced the worst CharacTER score across the 280 images fed into it, returning a 85.7% error rate. This was primarily down to its inability to accurately transcribe images with text, funny enough. It only correctly predicted 9 images and all of these were null. The images which it could detect text on <em>always</em> resulted in complete and utter nonsense, e.g. the house number, “296” came back as, “D D” not even close! In its defence, none of the datasets used contained invoices, forms or any semi-structured images which this model specialises in.</p><p>Amazon image fared much better than its document counterpart (although that wasn’t difficult to), producing accurate results for many of the house numbers and single text fonts. It struggled with the longer text passages often transcribing much less text than was there, however for some of the smaller text pieces it detected excessive text, e.g. the car make, “RENAULT” was returned as, “RENAIULT”. Although it dealt with text fonts quite well, it was hit and miss when it came to handwritten pieces often not identifying any text. Blur and noise was difficult for this model to see through too.</p><p>Google document produced good results for longer text excerpts however, it struggled with single characters and house numbers. Especially the former, often not documenting any text.</p><p>Google image produced the best CharacTER average score of 42.9% error rate. It produced the best all-round results for both single letters and digits and longer passages of text, although other services produced better results for these, Google image was able to translate enough to produce moderate results.</p><p>Microsoft document produced a very mixed bag. It succeeded in transcribing some of the long text passages moderately well but struggled to produce any results for those with noise applied.</p><p>Microsoft image produced similar results to Amazon document with the inability for the service to detect text in images proving problematic; 79% of records were returned with no text and three quarters of these were incorrectly labelled as such, the most of any service. It performed better in successfully transcribing text from images but takes the ‘Surprise of the Day’ prize for its inability to detect <em>any text</em> in some of the longer text passages, despite it seeing (and doing a good job of translating) others and those of the same font, size and filter! It struggled with highly stylized fonts present in some of the natural pictures and completely failed with house numbers and single letters.</p><p>Below’s f-measure results provide a summary of service performance. Services which could both: detect text in an image and translate it with a 90%+ level of accuracy and recognise images with no text scored higher than those which struggled in one or both areas. Google image received the highest f-measure of 0.640 whilst Amazon document scored a dismal 0.090. The service provider’s average score is represented as the dotted line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*11ytFVkpTthZ8vMCF5odAw.png" /><figcaption>F-measure for services’ translations that were 90% accurate</figcaption></figure><p>All services struggled with letter cases, often flipping them. However, for many of these examples, the letter’s casing (uppercase or lowercase) can only be inferred by context. For example, lowercase “c” and uppercase “C” can only be differentiated by a matter of size compared to the rest of the letters in the word; leaving a 50:50 guess for the model. All services seemed to unanimously agree on the images which correctly had no text.</p><h3><strong>Limitations</strong></h3><p>The text extracted from some datasets was done so in a programmatic manner. This, on occasion, allowed for the extracted text to be unintuitive to read from Western’s left-to-right and top-to-bottom manner, e.g. the photo below was taken from a dataset whose text context was stored in XML data tags and when extracted read, “4B.522 4B.524 4B.526 4B528 ARE HERE YOU”. Penalising any model that returned the text in a more ‘human-read’ manner such as Google image which translated, “4B.528 4B.526 YOU ARE HERE 4B.524 4B.522” scoring a 42.5% error rate.</p><figure><img alt="An image of a section of floor-plan with room numbers and “YOU ARE HERE” indicator." src="https://cdn-images-1.medium.com/max/518/1*GLb53ZejtmgElHe2UWb2Ow.png" /><figcaption>A picture whose data content was extracted using a script. Source: <a href="https://rrc.cvc.uab.es/">Robust Reading Competition dataset</a></figcaption></figure><p>CharacTER’s in-built threshold reduces this penalty, but it is still an issue.</p><figure><img alt="Upper and lowercase “c” and “s”." src="https://cdn-images-1.medium.com/max/561/1*BpJ41ajO8teCFBYpTtEmmQ.png" /><figcaption>Case variations for the letters, “C” and “S”. Source: <a href="http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/">Chars74k dataset</a></figcaption></figure><p>The datasets used to determine the original transcripts presented consistency issues for the original transcriptions’ text. The casing of the single letters defined above was a problem for the services to differentiate, extra digits appeared in some of the house number images. Some icons with, remove “ — ” and add “+” were deemed to have text whilst others were not. Natural characters were sourced by cropping out individual letters from photos of posters, signs, etc. A small amount of these crops left in background text which was not accounted for but was later picked up by the OCR services, crippling its score. To rectify these issues the dataset could be cleaned to highlight these discrepancies whilst normalising the letter casing to a single case would remove these errors.</p><h3>Further Considerations</h3><p><a href="#9068">[Index]</a></p><p>The dataset could be further expanded on to include more real-life uses. Structured text extracts such as receipts and invoices along with longer handwritten pieces could be included.</p><p>Further augmentation could be applied to the images to more accurately mimic real-life examples such as page rotation and creases.</p><p>The inclusion of more metrics would further support analysing each model for more tailored uses cases, e.g. if case folding was ignored then this would suit OCR for use in mail sorting areas, however, it would not be suitable in voucher code scanning.</p><h3>Closing Remarks</h3><p><a href="#9068">[Index]</a></p><p>OCR use in real-life applications, such as licence plate recognition or bank cheque extraction, are <em>extreeeemely</em> successful because the computational models used in these scenarios are so well suited to their specific tasks. These general purpose services are never going to be as good as any purpose built model; horses for courses. That being said, however, they are more than suitable for small scale automated data insertion uses that can cope with a few hit and misses here and there.</p><p>This tool is open-source and available on <a href="https://github.com/KainosSoftwareLtd/ocr-comparison-tool">Kainos’ GitHub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*t-bpFFR8ueFFLN1vzcqhfg.png" /></figure><p>If you’re interested in this sort of technology — or any others for that matter — check out what the Applied Innovation team have been working on <a href="https://medium.com/kainos-applied-innovation">here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5df060e21a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kainos-applied-innovation/comparetheocr-com-e5df060e21a7">CompareTheOCR.com*</a> was originally published in <a href="https://medium.com/kainos-applied-innovation">Kainos Applied Innovation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>