<?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 Anthony Mele on Medium]]></title>
        <description><![CDATA[Stories by Anthony Mele on Medium]]></description>
        <link>https://medium.com/@tmele54?source=rss-e72c82c5ce3c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CCsH2lhqj0UT1yPN-m9Tbw.jpeg</url>
            <title>Stories by Anthony Mele on Medium</title>
            <link>https://medium.com/@tmele54?source=rss-e72c82c5ce3c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 16:59:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tmele54/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[Hipster Modeling Venue]]></title>
            <link>https://tmele54.medium.com/hipster-modeling-venue-4e8a42112fb7?source=rss-e72c82c5ce3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e8a42112fb7</guid>
            <category><![CDATA[hipster]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Anthony Mele]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 01:35:04 GMT</pubDate>
            <atom:updated>2022-10-30T01:35:04.537Z</atom:updated>
            <content:encoded><![CDATA[<p>Using python to replace a manually curated, travel startup venue verification process by modeling “The Hipster”. Fun Experiences with Machine Learning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*bJb1vKeTrg5yy_eBOOtf-A.jpeg" /></figure><p>Once upon a time I worked in Seattle at a travel startup that helped their users plan an itinerary full of cool edgy venues like gastro pubs and modern-day speakeasies. The curation process was a simple selection done by two people by manually scanning Yelp and Google business profiles of and deciding if they were of good quality, reasonable prices, unique and interesting menus etc.</p><h3>Targeted Data Science by Process Mapping</h3><p>The first step was to speak with my builder (people picking venues) and chart out what they do, what their goals were and most of all, how they do it. The individual people and their distinct opinions had become the style of venues supported most by the company. There was plenty of data to work with as the pair had already labeled a full city of samples. With the process charted and an solid understanding of their workflow we set out to build a model that would not replace the builders but make them managers of the data stream to detail the classifiers accuracy and build more robust training data.</p><h3>Natural Language Processing</h3><p>The Data Science task was straight forward, build a binary classifier that could decide if a venue was good or bad. The venue descriptions, titles comments etc were cleansed and modeled with features that did a fair job of classifying good and bad venues. By going back into the data, we immediately found that good venues often had a certain style and energy about them. They were hipster places. By inspection it was clear what changes in feature engineer would improve the system dramatically. I needed a way to figure out how rare a word was in the human language.</p><p>Venues:</p><ul><li>Smith: A <strong>taxidermy </strong>turned <strong>gastropub</strong></li><li><strong>Oddfellows </strong>Cafe &amp; Bar: A cafe serving <strong>Caffe Vita espresso, fresh pressed</strong> juices, sandwiches, grain salads, and baked goods.</li><li><strong>Dromedary</strong> <strong>Urban Tiki Bar</strong>:<strong> Tiki-inspired</strong> cocktails,<strong> board games</strong> &amp; <strong>inventive pub grub</strong> are the draw at this <strong>rustic-chic tavern</strong>.</li></ul><p>Comments:</p><ul><li>“Pub meets <strong>chalet </strong>at this Phinney Ridge landmark. Score the six-person table directly in front of the<strong> lodge-appropriate hearth</strong> and get acquainted with the beer list”</li><li>“Perfect place for <strong>hipster goods</strong> from<strong> Poler sleeping bags </strong>and fancy <strong>iPhone cases</strong>, you’ll find gifts for yourself or your friends.”</li></ul><p>Between the venue names, descriptions, comments and more you can begin to see some trends common to hipster venues. Modeling was done in two ways, one was to build a grammar of hipster language and providing a score of 1–10 to represent it’s strength, the other way was using Microsoft’s NGram API. Within Microsoft NGram are features to display the rarity of a word, by including rare words and boosting their feature representation, the modeling was very successful with +95% accuracy.</p><p>It comes down to the fact that hipsters expressing their individuality will ultimate choose to use more obscure language. Identifying and Modeling for rare words is plenty to model “The Hipster”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e8a42112fb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Information Extraction with Deep Learning]]></title>
            <link>https://tmele54.medium.com/improving-information-extraction-with-deep-learning-d1e04a1d592a?source=rss-e72c82c5ce3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1e04a1d592a</guid>
            <category><![CDATA[novel]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[information-extraction]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Anthony Mele]]></dc:creator>
            <pubDate>Mon, 02 May 2022 10:18:57 GMT</pubDate>
            <atom:updated>2022-05-02T10:18:57.484Z</atom:updated>
            <content:encoded><![CDATA[<p>“Data is the new oil” — Clive Humby</p><h3>Introduction to Information Extraction</h3><p>Data is everywhere, we have identified it’s existence and so we only need to extract it. Data Extraction or Information extraction (IE) is the automated retrieval of data/information related to a specific domain from a specific medium. In today’s world, the most prevalent use cases of information extraction are in the Natural Language Processing (NLP) space. However, we can extract data from images, audio, even DNA, but there are significant challenges in doing so. These challenges are usually very unique to the medium that the data is trapped in and so solutions are just as unique.</p><p>When approaching an IE task, the information can be un-structed, semi-structured or structed and may or may not be machine-readable. We will look at IE from the point of view that having a machine-readable text based dataset is an extreme luxury using real examples that I have seen in Data Science consulting and freelancing.</p><h3>Introduction to Deep Learning</h3><p>A subset of Machine Learning, Deep Learning is the use of neural networks with enormous training datasets and highly customized architectures and methodologies to solve extremely challenging problems in classification, generation and prediction. Some types of Deep Learning include Convolutional Neural Networks (CNNs), Long Short Term Memory Networks (LSTMs), Generative Adversarial Networks (GANs), Restricted Boltzmann Machines (RBMs) and Multilayer Perceptron’s (MLPs). We can conclude (other than Data Science has no shortage of acronyms) that the amount of data used and the complexity of Deep Learning algorithms that they have the power to solve challenges in an unnerving fashion.</p><h3>A single Information Extraction Use Case</h3><p>In the following sections, we will look at the use of multiple Deep Learning techniques with novel uses for a single dataset. We will ignore the specifics of the dataset but will reveal it’s composition and the objective of this use case. Let’s call our dataset, SPDFs (scanned PDFs) provided by a major logistics company. SPDFs contain customer trucking and shipping information for millions of deliveries over a 30 year period (starting in the late 1970’s) with virtually no information provided about the data. These SPDFs were manually scanned in, one at a time, by hundreds of employees of an overseas data entry company.</p><h3>Structuring the Extraction Process</h3><p>We have a random collection of SPDFs for which we have no descriptive data so we can think of these as a single folder with file names SPDF-1.pdf through SPDF-10000000.pdf. Visually inspecting the files shows that they have different structural formats and so fields of data are located in different locations in both the single page and multipage documents and some documents have fields that others do not. What we want to have in the end is a database containing all the fields, structured so that the client can perform any number of statistical measures or analyses to support their business. Where do we begin?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*et0q_-HNEIsVOv1F.gif" /><figcaption>Fig 1. — Example of Scanned PDF Document, slight CC Rotation</figcaption></figure><p>We have scanned PDFs (SPDFs) so we definitely will need a robust Optical Character Recognition (OCR) solution. Probably, we will need to become experts in Regular Expressions and Natural Language Processing. Also, we have to find good ways to move these data around AWS for our work to remain profitable. However, it turns out the most impactful skill we needed was an expertise in Deep Learning.</p><p>The first step we chose to focus on was discovering how many unique SPDF single-page formats we had to work with. We split our documents between single-page and multi-page files and got started.</p><h3>Clustering SPDFs with Transfer Learning</h3><p>At this point we can ignore the quality of the text, where it is located in the document and what it’s values are, for now we want to identify templates. A template is a SPDF with no words on the page, only the vertical and horizontal lines which are unique to every type of form. If we attempt to cluster documents that contain text, the text (noise in this case) will make it much more challenging for the clustering algorithm to find strong and reliable groupings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Dx3j2fRYNKFhyGyRiJZ69Q.png" /><figcaption>Fig. 2 — Scanned PDF Templates</figcaption></figure><p>We begin by storing the SPDFs as .tiff images as they require less storage space. A TIFF file is <strong>a graphics container that stores raster images in the Tagged Image File Format (TIFF). </strong>Taking a single image, we then open the image with OpenCV (Open Computer Vision is a package that provides real-time computer vision tools). Next we will perform the following sequence. Blur the image to the extent that the letters in words bleed into one another, perform blob analysis and identify regions where the text blobs exist, finally subtract the text blob regions from the original image. The resultant image will only contain the horizontal and vertical lines associated with the SPDF template.</p><p>These cleansed templates lack the required features for a clustering algorithm to group. Here we take these templates and run them through VGG16 to created a feature dense vector representing each image. Finally, these vectors are clustered using KMeans. There is little rhyme or reason to using KMeans, only that we decided to start with something well established and KMeans worked with over 98% accuracy. Observing the level of accuracy, the complexity of the original data and the simplicity of the clustering algorithm tells us that our data preprocessing was spot-on. The SPDFs fit to their respective groups with ease and we now have templates that have reliable positioning of fields.</p><h3>Increasing Resolution With Generative Adversarial Networks</h3><h4>Generative Adversarial Networks</h4><p>Generative Adversarial Networks have been in use since June of 2014 and since their inception the number of use cases has increased dramatically. Generative Adversarial Networks or GAN’s, take advantage of two Neural Networks (Generator &amp; Discriminator) to generate fake information based on real information. We can think of the generated data as having the same statistical make-up of the real images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_j9S4YICy3Ts_UuoNbvhuA.png" /><figcaption>Fig 3. — Generalized example of Generative Adversarial Network</figcaption></figure><p>The above figure starts with samples of <strong><em>Real Data </em></strong>which have been carefully chosen to support a specific use case. Then, random <strong><em>Noise</em></strong> is created and fed to the Generator creating Fake Data. The Real Data and Fake Data are both given to the Discriminator which decides if the generated fake samples appear real enough to be classified as real. It can take hundreds of thousands of samples of Real Data and up to a hundred hours of training before the generator is able to achieve this goal. However, once fully trained, a GAN can create information that otherwise wouldn’t exist.</p><p><a href="https://jonathan-hui.medium.com/gan-super-resolution-gan-srgan-b471da7270ec"><em>Super Resolution GAN</em> (SRGAN)</a>, is a type of GAN that can increase the resolution of images. It turns out many of the documents in our SPDF collection have a resolution too low for OCR to properly extract text without a large number of errors. To train our SRGAN, we used a higher resolution image and reduced it’s resolution as input into to the generator. Now our fake images that the generator is guessing are essentially up-sampled to “super” resolution. Our discriminator compares generated super resolution image text to the original high-resolution image text. The optimization function then applies it’s learned change to both the generator and the discriminator and after some time we had images that our OCR code would translate into text with limited errors. Actually, after running spell checking and some digit to letter conversation heuristics, we had perfect translation.</p><h3>Finding Address Blocks with Object Detection</h3><p>Object detection is a well known Deep Learning task that has been shown to have higher accuracy than human labeling. With object detection, we can automatically identify things, such as a cat, a car or a person, in images and video feeds. The use of these algorithms has been used in a myriad of applications and industries for everything from tagging images to helping drones navigate urban landscapes.</p><p>Now, even though we have our SPDFs clustered into groups and we can count on page elements being in predetermined locations it is still advantageous to identify certain elements and extract them in a specific way. We found that our OCR’d text would occasionally have address blocks in random positions, in most cases stamped askew to the page orientation, by a person upon receipt of a delivery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*grI-mK4_hx1-83zg4-42NA.png" /><figcaption>Fig 4. — Skewed Address Stamped Block Example</figcaption></figure><p>In order to capture these with low to no errors, we used a prebuilt object detection algorithm and retrained it using snips of address blocks. This <a href="https://medium.com/analytics-vidhya/how-to-retrain-an-object-detection-model-with-a-custom-training-set-c827aa3eb796">article</a> does a great job explaining how one can retrain a robust generalized object detection algorithm for a specific detection task. This methodology was so successful that we used it many other applications to extract ‘un-extractable” information from complex mediums.</p><h3>Conclusion</h3><p>Above we reviewed multiple Deep Learning methods with custom applications to help extract information from a complex medium of Scanned PDFs (SPDFs). We found many more approaches not discussed here and a number of them were strong enough to become their own product and capabilities. If you found this article interesting and or insightful, we ask you to please follow this author and subscribe to their writing.</p><p>Please <a href="https://tmele54.medium.com/?source=about_page-------------------------------------">Follow me</a>, <a href="https://tmele54.medium.com/subscribe?source=about_page-------------------------------------">Subscribe</a>, and become a <a href="https://tmele54.medium.com/membership?source=about_page-------------------------------------">Member</a> to get notified about more projects and new cases for Deep Learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1e04a1d592a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React.js ‘Championship Chess’ from Scratch — Part One]]></title>
            <link>https://tmele54.medium.com/react-js-championship-chess-from-scratch-part-one-3bcc5038396b?source=rss-e72c82c5ce3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bcc5038396b</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[chess]]></category>
            <dc:creator><![CDATA[Anthony Mele]]></dc:creator>
            <pubDate>Mon, 18 Apr 2022 21:41:28 GMT</pubDate>
            <atom:updated>2022-04-19T04:35:38.176Z</atom:updated>
            <content:encoded><![CDATA[<h3>React.js ‘Championship Chess’ from Scratch — Part One</h3><p>“One Pawn at a Time”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*oBtFsTmABLa5TcwC09zqvg.png" /><figcaption>Figure 1. Screenshot of Application — <a href="https://github.com/TMele54/Chess">https://github.com/TMele54/Chess</a></figcaption></figure><h3>Overview:</h3><p>People who know me say I am only good at two things, writing React and chewing bubble gum… By the time you’ve finished reading this article, you should have learned some cool development ideas / strategies to build applications in React.js. This article is the first in a series of tutorials that will explore Application / Product Development and as we progress further we will branch into other Data Science disciplines with topics like Deep &amp; Transfer Learning, Augmented Reality and Quantum Computing.</p><p><em>Follow Me</em> here and <em>Subscribe </em>to this channel to continue learning and developing your Data Science background.</p><h3>Project Details:</h3><p>This <a href="https://github.com/TMele54/Chess">project</a> is a React.js Web Application that has been built from scratch using JavaScript, HTML and CSS. To run this project on your computer, simply clone the repo in the link above, install the node module libraries and start the development server. You can access the application via localhost on port 3000</p><p><strong>Setup</strong></p><pre>## In Command Prompt</pre><pre># Clone Repo<br>git clone <a href="https://github.com/TMele54/Chess">https://github.com/TMele54/Chess</a></pre><pre># Open Directory <br>cd chess</pre><pre># Install node modules<br>npm install</pre><pre># Start the project<br>npm start</pre><p>You’ll notice in the image above (Figure 1.)that there are three game modes — Simulation, One Player and Multi Player. Simulation and One Player both make use of a chess API that will either play itself (Simulation) or play the single user in One Player. Multiplayer requires a peer connection through a website so for now, since we’re looking at how the app itself was built with React.js we will focus on Simulation Game Mode. In future posts we’ll turn our focus to Single Player and Multi Player Game Modes.</p><h3>Project Layout:</h3><p>Building a chess app requires some customizations to be made but for the most part, React.js was very well suited to manage the states of pieces on a board and orchestrate a ‘game’. Below we see a conventional React project setup:</p><blockquote>node_modules — contains the libraries declared in the package.json</blockquote><blockquote>public — holds our static assets, like PNGs of the chessmen</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*h6uDxMwhRSrPKTLRJNRETA.png" /><figcaption>Static Asset — Black King — bk.PNG</figcaption></figure><blockquote>src — holds our JavaScript or TypeScript component modules of the application</blockquote><blockquote>App.js — the entry point for our class and functional components to render in the browser</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Lwgj3TCy5zPUK4NvWwJlg.png" /></figure><p>In the src/components folder are two files, Game.js and Boardgame.js and we can see in App.js that the class being called is &lt;Game /&gt; from Game.js. We can think of these two files in the following way. Boardgame.js is focused on the boardgame and it’s rules, making moves, choosing Game Modes and all the things that make it a boardgame. Game.js focuses on this particular game, the setup of pieces, the assertion of rank and file positions, creation of chessmen pieces from PNGs etc. Let’s explore methods in each file to understand how we built a chess app.</p><h3>Game.js:</h3><p>From the top down, Game.js is a fairly simple React.js Class Component with a single setup function initBoardMap() that is called in the render part of this components lifecycle. In initBoardMap, we set the simulation rate (timeout to make a move for the API), the number / size / locations of squares on the chessboard, and two arrays called RANK and FILE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4wAP13X1VkpsDT5CzerTA.png" /><figcaption>Game.js 50,000 foot view</figcaption></figure><p>In chess, Rank and File are used to mark the position of a piece on the board. For ex. when you start a new game, the King of the White players side will be on tile <strong><em>e1.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*b4Lzjws6QyDRcsEoGKKWkg.png" /><figcaption>Position of the White Player’s king — e1 in top left corner of tile</figcaption></figure><p>We use the two array’s representing Rank and File to construct a matrix of pieces and their positions which are accessed via a React State.</p><pre>// Transformation functions, RANK &amp; FILE become a chess board<br>const transpose = a =&gt; a[0].map((_, c) =&gt; a.map(r =&gt; r[c]));<br>const mapp = FILE.flatMap(d =&gt; RANK.map(v =&gt; d + v))<br>const chessboard = new <strong><em>Array</em></strong>(<strong><em>Math</em></strong>.ceil(mapp.length / n)).fill().map(_ =&gt; mapp.splice(0, n))<br>const field = chessboard[0].map((_, colIndex) =&gt; chessboard.map(row =&gt; row[colIndex]));<br>const columns = transpose(field)</pre><p>States in React are used for practically everything and we’re using them here in the following manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCJN4u8WHwA6BKsC4yLEQA.png" /><figcaption>Construction of initial chessmen attributes</figcaption></figure><p>Here we see three arrays of objects which contain the white player pieces, the black player pieces and the chessmen which represents both groups. Each chess piece is represented here as an object. The black king looks like this: Player is b, id is b15, the picture of the king is ‘bk.svg’, it’s position is e8 (row 8, column e) and it’s name or piece type is a king.</p><pre>{&quot;player&quot;: &quot;b&quot;, &quot;id&quot;: &quot;b15&quot;, &quot;svg&quot;: &quot;bk.svg&quot;, &quot;pos&quot;: &quot;e8&quot;, &quot;name&quot;: &quot;king&quot;}</pre><p>This is a typical way to handle something of this nature in a user interface and we will see that locating the piece programmatically by it’s Rank and File will be very useful for integrating with a chess API which speaks that language. However, there are also empty tiles on the board which we need to represent as well, and so we will use the constant emptySquare with all null values.</p><pre>const emptySquare = { player: null, id: null, svg: null, pos: null, name: null }</pre><p>Using the Rank and File Array’s in combination with the Chessmen we’re able to construct the input’s to the board game.</p><pre>// Generate the Initial Position Map of the Board<br>columns.forEach((rows,i)=&gt;{<br>    rows.forEach((cell, j)=&gt;{<br>        const piece = chessmen.filter(d =&gt;  d.pos === cell )[0]<br>        const cellColor = i % 2 !== 0 ? j % 2 !== 0 ? colorB :colorA : j % 2 !== 0 ? colorA :colorB<br>        if (piece === undefined){<br>            let merged = {...{&quot;cell&quot;: cell, &quot;cellFill&quot;: cellColor, &quot;iX&quot;: Left+squareSize*i, &quot;iY&quot;: Top+squareSize*j, &quot;bX&quot;: Left+squareSize*i, &quot;bY&quot;: Top+squareSize*j}, ...emptySquare};<br>            positions.push(merged)<br>        }<br>        else{<br>            let merged = {...{&quot;cell&quot;: cell, &quot;cellFill&quot;: cellColor, &quot;iX&quot;: Left+squareSize*i, &quot;iY&quot;: Top+squareSize*j, &quot;bX&quot;: Left+squareSize*i, &quot;bY&quot;: Top+squareSize*j}, ...piece};<br>            positions.push(merged)<br>        }<br><br>    })<br>})</pre><p>In the loops above we basically are looping over our columns and rows from the Rank and File Matrix and applying board colors and the existence of pieces to the Tile they start the game with. The complete set of outputs from initBoardMap are passed to the &lt;Chessset /&gt; component which bring us to Boardgame.js</p><pre>return {<br>    simulationRate,<br>    n,<br>    RANK,<br>    FILE,<br>    squareSize,<br>    chessmenSize,<br>    Top,<br>    Bottom,<br>    Left,<br>    Right,<br>    boardHeight,<br>    boardWidth,<br>    colorA,<br>    colorB,<br>    positions<br>}</pre><h3>BoardGame.js:</h3><p>BoardGame.js is a bit more complicated then Game.js for several reasons. The first major distinction is the fact that it is a functional component whereas Game.js is a class component. We’re using the functional component because we have a great use case to leverage React Hooks. I think of Hooks the same as a class component’s state but more focused on a particular aspect of the user interface. In our case, we’re using a Hook to manage the state of the Chessmen from Game.js; line 134 using the useState function takes in the positions of all pieces (<em>this.props.positions</em>) and has two outputs. BoardMap and updateBoardMap are the state variable and the change function of the state variable respectively. Next, let’s look at how the board and session are constructed so that we can explore how to Simulate a game between Chess Champions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmFWr22pz9TvMFVnajq_dA.png" /></figure><p>When the ChessSet functional component is rendered, several build functions are run and the move engine is enabled. To begin, the board function constructs and returns two separate layers which are the board itself and then the chess pieces. The board layer contains the light and dark brown squares with their Rank and File positions labeled. The chessmen layer contains SVG‘s (Scalable Vector Graphics) of the pieces like a pawn or king. Next, the chess engine is applied and several listeners begin evaluating state changes in the position of the chess pieces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*TAyXjLmaJ9yTyvdVcqLgHw.png" /><figcaption>Move Engine listener types with iconic chess ‘Checkmate!’ phrase expanded</figcaption></figure><p>With the board and chessmen layers drawn the stage has been set to Simulate a game.</p><h3>Simulation:</h3><p>Simulating a chess game is pretty cool since it allows us to observe a really strong match that chess players can learn from. The chess.js API knows the initial positions of pieces when a game starts and it keeps tabs on changes as the game progresses. Every turn, we ask the API for a list of possible moves and then we use a random number generator to select one of those moves from an array. At the end of the turn we again ask the API to simulate the turn and voila, the game executes from start to finish animating the chessmen along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8DfsfYo4RMnUu-ZoGxjOw.png" /></figure><p>Please <a href="https://tmele54.medium.com/?source=about_page-------------------------------------">Follow me</a>, <a href="https://tmele54.medium.com/subscribe?source=about_page-------------------------------------">Subscribe</a>, and become a <a href="https://tmele54.medium.com/membership?source=about_page-------------------------------------">Member</a> to get notifications when Parts Two and Three are released.</p><h3>About the Author:</h3><p>Tony has deep experience working in the Data Sciences for roughly ten years across Banking, Startups, Pharma and Consulting industries with exposure to clients / projects across a myriad of additional industries.</p><p>He is very interested in Natural Language Processing, Computer Vision, Deep Learning, and Advanced Visualization/Product Development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bcc5038396b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>