<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mani</title>
    <description>The latest articles on DEV Community by Mani (@neomatrix369).</description>
    <link>https://dev.to/neomatrix369</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F117256%2F447a8f6d-4a0c-4008-9e60-8fe6554e1a57.jpeg</url>
      <title>DEV Community: Mani</title>
      <link>https://dev.to/neomatrix369</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neomatrix369"/>
    <language>en</language>
    <item>
      <title>AI Coding Tools (MCP-series)</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Tue, 07 Oct 2025 00:09:00 +0000</pubDate>
      <link>https://dev.to/neomatrix369/ai-coding-tools-mcp-series-171b</link>
      <guid>https://dev.to/neomatrix369/ai-coding-tools-mcp-series-171b</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;AI-assisted development, code assistants, and intelligent developer tools&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  About This Category
&lt;/h2&gt;

&lt;p&gt;Learn how to leverage AI-powered coding tools to boost your productivity as a developer. This category covers MCP (Model Context Protocol) setup, Claude command usage, platform comparisons, and other AI coding assistant topics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Posts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MCP (Model Context Protocol) Series
&lt;/h3&gt;

&lt;p&gt;This series covers everything you need to know about setting up and using MCP servers with Claude and other AI coding assistants.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftafazupezvoyf2gy50aa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftafazupezvoyf2gy50aa.png" alt=" " width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/blogs/ai-coding-tools/complete-mcp-server-setup-guide/post.md" rel="noopener noreferrer"&gt;The Complete MCP Server Setup Guide: Claude Desktop, Claude Code, and Cursor&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Published: October 2025 | Difficulty: Intermediate&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A comprehensive guide to setting up Model Context Protocol (MCP) servers across different Claude environments. Learn step-by-step configuration for Claude Desktop, Claude Code, and Cursor, with troubleshooting tips and best practices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Topics:&lt;/strong&gt; MCP Setup, Claude Desktop, Claude Code, Cursor, Configuration&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Reading Time:&lt;/strong&gt; ~20 minutes&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5eo6gm7dsc75x0follx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5eo6gm7dsc75x0follx.png" alt=" " width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/blogs/ai-coding-tools/claude-command-reference-card/post.md" rel="noopener noreferrer"&gt;The Claude Command Reference Card&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Published: October 2025 | Difficulty: Beginner&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Quick reference guide for Claude commands, shortcuts, and best practices. Essential for anyone using Claude Desktop, Claude Code, or Cursor to maximize productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Topics:&lt;/strong&gt; Commands, Shortcuts, Prompt Patterns, Workflows&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Reading Time:&lt;/strong&gt; ~10 minutes&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwfeg7omqc640i2dapv9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwfeg7omqc640i2dapv9.png" alt=" " width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/blogs/ai-coding-tools/mcp-setup-comparison-tables/post.md" rel="noopener noreferrer"&gt;MCP Setup Comparison Tables&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Published: October 2025 | Difficulty: Intermediate&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Side-by-side comparison of MCP server setup across Claude Desktop, Claude Code, and Cursor. Features detailed comparison tables, decision matrices, and migration guides.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Topics:&lt;/strong&gt; Platform Comparison, Feature Matrix, Migration, Use Cases&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Reading Time:&lt;/strong&gt; ~15 minutes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/blogs/ai-coding-tools/complete-mcp-server-setup-guide/resources-and-references.md" rel="noopener noreferrer"&gt;Resource References&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Topics Covered in This Category
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCP (Model Context Protocol)&lt;/strong&gt; - Setup, configuration, and best practices&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Environments&lt;/strong&gt; - Desktop, Code extension, and Cursor integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Pair Programming&lt;/strong&gt; - Using AI as a coding partner&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command Reference&lt;/strong&gt; - Quick lookup for commands and shortcuts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform Comparison&lt;/strong&gt; - Choosing the right tool for your workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  External Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/Programming-in-Python.md" rel="noopener noreferrer"&gt;Programming Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples" rel="noopener noreferrer"&gt;Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/julia-python-and-r.md" rel="noopener noreferrer"&gt;Tools &amp;amp; Libraries&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Disclaimer
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Important Notice:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content Accuracy:&lt;/strong&gt; The information, resources, and links provided in this repository are curated from various sources and are subject to change. While we strive to maintain accuracy and keep content up-to-date, we cannot guarantee that all information is current, correct, or complete at all times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Third-Party Content:&lt;/strong&gt; This repository contains references, links, and citations to external sources, articles, tools, libraries, and resources created by third parties. We do not own or claim ownership of this external content. All credit belongs to the original authors and creators.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No Warranty:&lt;/strong&gt; The content is provided "as is" without warranty of any kind, express or implied. We make no representations or warranties regarding the accuracy, reliability, or completeness of any information provided.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verification Recommended:&lt;/strong&gt; Users are strongly encouraged to verify information, test tools and code, and refer to official documentation before using any resources in production environments or critical applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rapidly Evolving Field:&lt;/strong&gt; AI, ML, and DL are rapidly evolving fields. Tools, best practices, and technologies mentioned here may become outdated. Always check for the latest versions and updates from official sources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No Professional Advice:&lt;/strong&gt; Nothing in this repository constitutes professional, legal, or technical advice. Users should consult with qualified professionals for specific guidance related to their use cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community Contributions:&lt;/strong&gt; This is a community-driven project. Content may be contributed by various individuals. If you find errors, outdated information, or have suggestions for improvements, please see our &lt;a href="//../CONTRIBUTING.md"&gt;Contributing Guidelines&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use at Your Own Risk:&lt;/strong&gt; By using this repository, you acknowledge and accept these disclaimers and agree to use the information and resources at your own discretion and risk.&lt;/p&gt;




</description>
      <category>ai</category>
      <category>productivity</category>
      <category>cursor</category>
      <category>claude</category>
    </item>
    <item>
      <title>Another Two Years In The Life Of AI, ML, DL And Java</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Fri, 25 Dec 2020 21:16:55 +0000</pubDate>
      <link>https://dev.to/neomatrix369/another-two-years-in-the-life-of-ai-ml-dl-and-java-1hkc</link>
      <guid>https://dev.to/neomatrix369/another-two-years-in-the-life-of-ai-ml-dl-and-java-1hkc</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;This is a reblog of the original post at &lt;a href="https://www.javaadvent.com/" rel="noopener noreferrer"&gt;Java Advent Calendar 2020&lt;/a&gt;, see &lt;a href="https://www.javaadvent.com/2020/12/another-two-years-in-the-life-of-ai-ml-dl-and-java.html" rel="noopener noreferrer"&gt;original post&lt;/a&gt;.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  A bit of a background
&lt;/h1&gt;

&lt;p&gt;Many of you know of my first post on this topic &lt;a href="https://dev.to/neomatrix369/two-years-in-the-life-of-ai-ml-dl-and-java--nni"&gt;&lt;strong&gt;&lt;em&gt;Two years in the life of AI, ML, DL and Java&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;that was back in 2018/2019 when I had just started with my journey which still continues but I have more to share in this update (and I hope you will like it). At that time we had a good number of resources and the divide between &lt;strong&gt;Java&lt;/strong&gt; and non-&lt;strong&gt;Java&lt;/strong&gt; related resources were not so to have discussions about — since then things have changed, let’s see what the landscape looks like. &lt;/p&gt;

&lt;p&gt;I’m hoping that I’m able to share richer aspects of my journey, views, opinions, observations and learnings this time around as compared to &lt;a href="https://dev.to/neomatrix369/two-years-in-the-life-of-ai-ml-dl-and-java--nni"&gt;my previous summary post&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I do admit that this is only a summary post and I intend to write more specific and focussed posts like the ones I did in 2019 (see the following section) — I have earmarked a couple of topics and I will flesh them out as soon as I’m happy with my selections.&lt;/p&gt;

&lt;h1&gt;
  
  
  2019: year of blogs
&lt;/h1&gt;

&lt;p&gt;Looking at my activities in 2019 towards 2020, I can say I was more focussed on writing blogs and creating a lot of hands-on solution which I shared via my projects on GitHub and blogs on Medium. Here is a list of all of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  August 2019: &lt;a href="https://medium.com/oracledevs/how-to-build-graal-enabled-jdk8-on-circleci-3e20ae07a5d3?sk=85ddf84d1c444a224f9ec12bdcb03034" rel="noopener noreferrer"&gt;&lt;strong&gt;How to build Graal-enabled JDK8 on CircleCI?&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  August 2019: &lt;a href="https://towardsdatascience.com/how-to-do-deep-learning-for-java-on-the-valohai-platform-eec8ba9f71d8?sk=6b81209d56de2b5bf45aa2b3367b0a1f" rel="noopener noreferrer"&gt;&lt;strong&gt;How to do Deep Learning for Java?&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  September 2019: &lt;a href="https://medium.com/oracledevs/running-your-jupyter-notebooks-on-the-cloud-ed970326649f?sk=d064432ccc14576f9156096b333d7647" rel="noopener noreferrer"&gt;&lt;strong&gt;Running your JuPyTeR notebooks on the cloud&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  October 2019: &lt;a href="https://medium.com/oracledevs/running-apache-zeppelin-on-oracle-cloud-infrastructure-b0aecc79597a?sk=d531a8cf4ca5b2d345e529805d676975" rel="noopener noreferrer"&gt;&lt;strong&gt;Running Apache Zeppelin on the cloud&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  November 2019: &lt;a href="https://towardsdatascience.com/applying-nlp-in-java-all-from-the-command-line-1225dd591e80?sk=4dabee3fbeaee3633c3065becca8e2a6" rel="noopener noreferrer"&gt;&lt;strong&gt;Applying NLP in Java, all from the command-line&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  November 2019: &lt;a href="https://towardsdatascience.com/exploring-nlp-concepts-using-apache-opennlp-4d59c3cac8?sk=a0495c3b93fa8a67b12747e6ac975db1" rel="noopener noreferrer"&gt;&lt;strong&gt;Exploring NLP concepts using Apache OpenNLP&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  December 2019: &lt;a href="https://towardsdatascience.com/exploring-nlp-concepts-using-apache-opennlp-inside-a-jupyter-notebook-e53489ba2bd8?sk=3f0925d458e73193a5fab445d2c14bdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Exploring NLP concepts using Apache OpenNLP inside a Java-enabled Jupyter notebook&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  2020: year of presentations
&lt;/h1&gt;

&lt;p&gt;Similarly in 2020, from a blogging point-of-view I didn’t write much, this officially my first proper post of the year  (with the exception of one in August 2020, which you will find below) — I was quite busy with preparing for talks and presentations and online meetings and discussions. I kicked off the year with my talk at the &lt;a href="https://www.grakncosmos.com/" rel="noopener noreferrer"&gt;Grakn Cosmos 2020&lt;/a&gt; conference in London, UK. So let me list them here so you can take a look at them in your own time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  February 2020: &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/data/04-grakn-cosmos-2020" rel="noopener noreferrer"&gt;Naturally, getting productive, my journey with Grakn and Graql&lt;/a&gt; at &lt;strong&gt;Grakn Cosmos 2020&lt;/strong&gt; conference&lt;/li&gt;
&lt;li&gt;  July 2020: &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/01-jonconf-2020" rel="noopener noreferrer"&gt;“nn”&lt;/a&gt; &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/01-jonconf-2020" rel="noopener noreferrer"&gt;things every Java Developer should know about AI/ML/DL&lt;/a&gt; at &lt;strong&gt;JOnConf 2020&lt;/strong&gt; conference&lt;/li&gt;
&lt;li&gt;  August 2020: &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/02-abhishektalks-2020" rel="noopener noreferrer"&gt;From backend development to machine learning&lt;/a&gt; on &lt;strong&gt;Abhishek Talks&lt;/strong&gt;&lt;strong&gt;(YouTube&lt;/strong&gt; &lt;strong&gt;channel)&lt;/strong&gt; meetup&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;August 2020:&lt;/em&gt; &lt;a href="https://medium.com/@neomatrix369/an-interview-by-neural-magic-machine-learning-engineer-spotlight-e9be4ea61f8?source=friends_link&amp;amp;sk=42b6b4dc15ebef567fe8341ba7c541ba" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;An Interview by Neural Magic: Machine Learning Engineer Spotlight&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;em&gt;(blog&lt;/em&gt; &lt;em&gt;post)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  October 2020: &lt;a href="https://github.com/neomatrix369/nlp_profiler/tree/master/presentations/01-nlp-zurich-2020" rel="noopener noreferrer"&gt;Profiling Text Data&lt;/a&gt; at the NLP Zurich meetup&lt;/li&gt;
&lt;li&gt;  October 2020: &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/03-makeitweek-2020" rel="noopener noreferrer"&gt;Tribuo: an introduction to a Java ML Library&lt;/a&gt; at &lt;strong&gt;MakeITWeek 2020&lt;/strong&gt; conference&lt;/li&gt;
&lt;li&gt;  October 2020: &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/04-gba-apac-tour-2020" rel="noopener noreferrer"&gt;“nn”&lt;/a&gt; &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/presentations/awesome-ai-ml-dl/04-gba-apac-tour-2020" rel="noopener noreferrer"&gt;things every Java Developer should know about AI/ML/DL&lt;/a&gt; at &lt;strong&gt;Oracle Groundbreakers Tour – APAC 2020&lt;/strong&gt; conference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find slides (and videos of some) of the above presentations under the links provided.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other achievements and activities this year
&lt;/h1&gt;

&lt;p&gt;As to my journey, I have also been involved a good part of this year learning by online AI/ML competitions, see &lt;a href="https://twitter.com/theNeomatrix369/status/1214601525856747520" rel="noopener noreferrer"&gt;this&lt;/a&gt; and &lt;a href="https://mobile.twitter.com/theNeomatrix369/status/1265411110473252866" rel="noopener noreferrer"&gt;this&lt;/a&gt; post shared to learn more. You can also find all of my &lt;a href="https://www.kaggle.com/neomatrix369/datasets" rel="noopener noreferrer"&gt;datasets&lt;/a&gt; and &lt;a href="https://www.kaggle.com/neomatrix369/notebooks" rel="noopener noreferrer"&gt;notebooks&lt;/a&gt; for further study. Also the launch of an &lt;strong&gt;Python&lt;/strong&gt;-based NLP Library called &lt;a href="https://github.com/neomatrix369/nlp_profiler" rel="noopener noreferrer"&gt;NLP Profiler&lt;/a&gt; was another important feat for me this year.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1q6vv6jnyr6sjitn3bg.png" width="654" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What’s happening in this space?
&lt;/h1&gt;

&lt;p&gt;There is a lot of hype happening in the space and as &lt;a href="https://twitter.com/suyashcjoshi" rel="noopener noreferrer"&gt;&lt;strong&gt;Suyash Joshi&lt;/strong&gt;&lt;/a&gt; rightly said during a conversation sometime back: &lt;em&gt;“It’s&lt;/em&gt; &lt;em&gt;easy to get sucked into hype and shiny new stuff I fell a lot for that and then get overwhelmed“.&lt;/em&gt; And I think you will agree with me that we can relate to this situation. Also many of the things we are seeing look nice, and shiny but may NOT be fully ready for the real-world yet, I did cover similar arguments in a&lt;a href="https://medium.com/@neomatrix369/an-interview-by-neural-magic-machine-learning-engineer-spotlight-e9be4ea61f8?source=friends_link&amp;amp;sk=42b6b4dc15ebef567fe8341ba7c541ba" rel="noopener noreferrer"&gt; &lt;em&gt;post in August&lt;/em&gt;&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
There are few entities who are openly claiming various things about the not-so-bright-sides of AI, they are things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;em&gt;the statistical methods used are from the last century and may not be suited to modern day data&lt;/em&gt;&lt;em&gt;(led&lt;/em&gt; &lt;em&gt;by&lt;/em&gt; &lt;a href="https://www.amazon.co.uk/s?k=nassim+taleb&amp;amp;dc&amp;amp;ref=a9_sc_1" rel="noopener noreferrer"&gt;&lt;em&gt;Nassim Taleb’&lt;/em&gt;&lt;/a&gt;&lt;em&gt;s school of thought)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;many modern-day open-source tools and industry methods to derive at solutions are broken or inadequate&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;we are not able to explain our predictions and findings&lt;/em&gt;&lt;em&gt;(blackbox&lt;/em&gt; &lt;em&gt;issue: explainability and interpretability)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;our AI solutions lack causality, intent and reasoning&lt;/em&gt; (similar to the previous point)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These come from individuals, groups and companies who are building their own solutions (mostly closed-source) as they have noticed the above drawbacks and doing things to overcome them but also making the rest of the world aware of it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where is Java on the map?
&lt;/h1&gt;

&lt;p&gt;Java has been contributing to the AI force since sometime now, all the way when there was a lot of talk during the Big Data buzz, which then transformed to the new buzz about AI, Machine Learning and Deep Learning. If we closely look at the categories and sub-categories of resources here:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://spark.apache.org/" rel="noopener noreferrer"&gt;Apache Spark&lt;/a&gt; &lt;a href="https://www.nvidia.com/en-us/deep-learning-ai/solutions/data-science/apache-spark-3/" rel="noopener noreferrer"&gt;&lt;em&gt;[1]&lt;/em&gt;&lt;/a&gt; &lt;em&gt;|&lt;/em&gt;&lt;a href="https://blogs.oracle.com/graalvm/apache-spark%e2%80%94lightning-fast-on-graalvm-enterprise" rel="noopener noreferrer"&gt;&lt;em&gt;[2]&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="http://hadoop.apache.org/" rel="noopener noreferrer"&gt;Apache Hadoop&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/eclipse/deeplearning4j" rel="noopener noreferrer"&gt;Deeplearning4J&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;  and many other such tools, libraries, frameworks, and products&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and now more recently&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/NVIDIA/grcuda" rel="noopener noreferrer"&gt;grCuda&lt;/a&gt; and &lt;a href="https://github.com/graalvm/graalpython" rel="noopener noreferrer"&gt;graalPython&lt;/a&gt; (from the folks at &lt;a href="https://labs.oracle.com/pls/apex/f?p=94065:INTRO::::::" rel="noopener noreferrer"&gt;Oracle Labs&lt;/a&gt; behind all the &lt;a href="http://graalvm.org" rel="noopener noreferrer"&gt;&lt;strong&gt;GraalVM&lt;/strong&gt;&lt;/a&gt; &lt;em&gt;magic&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.deepnetts.com/" rel="noopener noreferrer"&gt;DeepNetts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://tribuo.org/" rel="noopener noreferrer"&gt;Tribuo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and more under these resources&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/java-jvm.md" rel="noopener noreferrer"&gt;Java: AI/ML/DL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/natural-language-processing/java-jvm.md" rel="noopener noreferrer"&gt;NLP Java&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/java-jvm.md#tools--libraries-other-resources" rel="noopener noreferrer"&gt;Tools and libraries&lt;/a&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/java-jvm.md#tools--libraries-other-resources" rel="noopener noreferrer"&gt;(Java/JVM)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  some intriguing &lt;strong&gt;GitHub&lt;/strong&gt; resources: &lt;a href="https://github.com/search?q=java+ai&amp;amp;type=repositories" rel="noopener noreferrer"&gt;AI&lt;/a&gt; or &lt;a href="https://github.com/search?q=java+artificial+intelligence&amp;amp;type=repositories" rel="noopener noreferrer"&gt;Artificial Intelligence&lt;/a&gt; | &lt;a href="https://github.com/search?q=java+ML&amp;amp;type=repositories" rel="noopener noreferrer"&gt;ML&lt;/a&gt; or &lt;a href="https://github.com/search?q=java+Machine+Learning&amp;amp;type=repositories" rel="noopener noreferrer"&gt;Machine Learning&lt;/a&gt; | &lt;a href="https://github.com/search?q=java+DL&amp;amp;type=repositories" rel="noopener noreferrer"&gt;DL&lt;/a&gt; or &lt;a href="https://github.com/search?q=java+Deep+Learning&amp;amp;type=repositories" rel="noopener noreferrer"&gt;Deep Learning&lt;/a&gt; | &lt;a href="https://github.com/search?q=java+RL&amp;amp;type=repositories" rel="noopener noreferrer"&gt;RL&lt;/a&gt; or &lt;a href="https://github.com/search?q=java+reinforcement+learning&amp;amp;type=repositories" rel="noopener noreferrer"&gt;Reinforcement Learning&lt;/a&gt; | &lt;a href="https://github.com/search?q=java+NLP&amp;amp;type=repositories" rel="noopener noreferrer"&gt;NLP&lt;/a&gt; or &lt;a href="https://github.com/search?q=java+Natural+Language+Processing&amp;amp;type=repositories" rel="noopener noreferrer"&gt;Natural Language Processing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.nvidia.com/en-us/deep-learning-ai/solutions/data-science/apache-spark-3/" rel="noopener noreferrer"&gt;&lt;em&gt;[1] Nvidia and Apache Spark&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blogs.oracle.com/graalvm/apache-spark%e2%80%94lightning-fast-on-graalvm-enterprise" rel="noopener noreferrer"&gt;&lt;em&gt;[2] Oracle Labs and Apache Spark&lt;/em&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;You can already see various implementations using Java and other JVM languages — they have just not been noticed by us, unless we made an attempt to look for them. &lt;/p&gt;

&lt;p&gt;If you have been following the progress of &lt;a href="https://graalvm.org" rel="noopener noreferrer"&gt;GraalVM and Truffle&lt;/a&gt; (see &lt;a href="https://github.com/oracle/graal" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;) in this space boosting server-side, desktop and cloud-base systems in terms of performance, ergonomic footprint and language interop — then you will, just like me also see that &lt;strong&gt;Java&lt;/strong&gt;’s presence and position is growing from strength-to-strength in this space. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_0AEF83F51DD1F952F93345301E669383CE4B6DDE15013A5673D6B01EEE5B4D00_1606947855178_Screen%2BShot%2B2020-12-02%2Bat%2B22.23.42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_0AEF83F51DD1F952F93345301E669383CE4B6DDE15013A5673D6B01EEE5B4D00_1606947855178_Screen%2BShot%2B2020-12-02%2Bat%2B22.23.42.png" alt="grCuda" width="800" height="453"&gt;&lt;/a&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_0AEF83F51DD1F952F93345301E669383CE4B6DDE15013A5673D6B01EEE5B4D00_1606947855205_Screen%2BShot%2B2020-12-02%2Bat%2B22.23.50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_0AEF83F51DD1F952F93345301E669383CE4B6DDE15013A5673D6B01EEE5B4D00_1606947855205_Screen%2BShot%2B2020-12-02%2Bat%2B22.23.50.png" alt="graalPython" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(&lt;/em&gt;&lt;strong&gt;&lt;em&gt;grCuda&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;and&lt;/em&gt; &lt;strong&gt;&lt;em&gt;graalPython&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;are two such examples: see AI/ML/DL related resources on&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/awesome-graal" rel="noopener noreferrer"&gt;&lt;em&gt;Awesome Graal&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and also at the appendix sections of  the talk slides for more resources — see section above for talks)&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Some highlights in pictures
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.10.png" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.19.png" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.58.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.31.58.png" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.32.21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.32.21.png" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.32.48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.32.48.png" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.49.25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.49.25.png" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.51.00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.51.00.png" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.52.15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.52.15.png" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.55.09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.55.09.png" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.55.16-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fwww.javaadvent.com%2Fcontent%2Fuploads%2F2020%2F12%2FScreen-Shot-2020-12-02-at-22.55.16-2.png" width="372" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Recommended Resources
&lt;/h1&gt;

&lt;p&gt;If I had to go through many of the resources I have shared in this post so far, of all of them I would look at these topics (in no particular order and also not an exhaustive list, it’s still a lot of topics to learn and know about):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/maths-stats-probability.md#bayesian" rel="noopener noreferrer"&gt;Bayesian&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/Python-Performance.md" rel="noopener noreferrer"&gt;Performance in Python&lt;/a&gt; | &lt;a href="https://MadeWithML.com" rel="noopener noreferrer"&gt;Made With ML&lt;/a&gt; | &lt;a href="https://virgili0.github.io/Virgilio/" rel="noopener noreferrer"&gt;Virgilio&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/visualisation.md#visualisation" rel="noopener noreferrer"&gt;&lt;strong&gt;Visualisation&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://tvm.apache.org/docs/index.html" rel="noopener noreferrer"&gt;&lt;strong&gt;TVM: Compiler stack for CPUs, GPUs, etc…&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/data/README.md#hyperparameter-tuning" rel="noopener noreferrer"&gt;Hyperparameter tuning&lt;/a&gt; | &lt;a href="https://www.kaggle.com/neomatrix369/normalising-a-distribution" rel="noopener noreferrer"&gt;Normalising (and Standardising) a distribution&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/things-to-know.md" rel="noopener noreferrer"&gt;Things to Know&lt;/a&gt; | &lt;a href="https://github.com/NVIDIA/grcuda" rel="noopener noreferrer"&gt;&lt;strong&gt;grCuda&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://www.scailable.net/" rel="noopener noreferrer"&gt;&lt;strong&gt;Running compiled and optimised AI Models in the Cloud&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/cloud-devops-infra/about-neural-magic.md" rel="noopener noreferrer"&gt;Neural Magic: Model Pruning and Sparsification&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/tribuo#native-image-build-optional" rel="noopener noreferrer"&gt;&lt;strong&gt;Train and Infer models via a native-image&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/julia-python-and-r.md#genetic-algorithms" rel="noopener noreferrer"&gt;Genetic Algorithms by Eyal&lt;/a&gt; | &lt;a href="https://www.deepnetts.com/" rel="noopener noreferrer"&gt;DeepNetts: Deep Learning in Java by Zoran&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/natural-language-processing#natural-language-processing-nlp" rel="noopener noreferrer"&gt;&lt;strong&gt;NLP&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/natural-language-processing/java-jvm.md#javajvm" rel="noopener noreferrer"&gt;NLP with Java&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/README-details.md#graphs" rel="noopener noreferrer"&gt;Graphs&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/ML-on-code-programming-source-code.md" rel="noopener noreferrer"&gt;ML on Code/Program/Source Code&lt;/a&gt; | &lt;a href="https://tribuo.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Tribuo: A java-base ML library&lt;/strong&gt;&lt;/a&gt;|&lt;a href="https://github.com/neomatrix369/chatbot-conversations" rel="noopener noreferrer"&gt;Chatbots talking to each other&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/details/julia-python-and-r.md#testing" rel="noopener noreferrer"&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;My apologies as &lt;a href="https://www.lifewire.com/what-is-ymmv-2483722" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;YMMV&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; — I’m working on these topics and slowly gaining knowledge and experience and hence my urge to immediately share them with the rest of the community. I’ll admit few of these may be still &lt;em&gt;Work in Progress&lt;/em&gt; — but I hope we can all learn these together. I’ll share more as I make more progress with them during the course of the days, weeks and months into 2021. &lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusions
&lt;/h1&gt;

&lt;p&gt;We are in a heterogenous space and AI/ML/DL ideas and innovations from creation to deployment go through various forms and shapes and depending on the comfort-zones and end-use cases of the ideas and innovations get implemented using multitudes of technologies. It won’t be correct or fair to say only one technology is being used. &lt;/p&gt;

&lt;p&gt;We are seeing R&amp;amp;D, rapid prototyping, MVP, PoC and the likes are being done using languages like &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;R&lt;/strong&gt;, &lt;strong&gt;Matlab&lt;/strong&gt;, &lt;strong&gt;Julia&lt;/strong&gt; and the likes while when it comes to robust, reliable, scalable, production-ready solutions more serious contenders are chosen for encapsulating the original work. And &lt;strong&gt;Java&lt;/strong&gt; and other &lt;strong&gt;JVM&lt;/strong&gt; languages, and the likes that can provide such stability are often being considered both for desktop and cloud implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Wearing my Oracle Groundbreaker Ambassador hat&lt;/em&gt;&lt;/strong&gt;: I recommend taking advantage of the &lt;em&gt;&lt;strong&gt;&lt;a href="https://www.oracle.com/cloud/free/" rel="noopener noreferrer"&gt;Free cloud credits from Oracle&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; (also see &lt;em&gt;&lt;strong&gt;&lt;a href="https://dev.to/phocks/how-to-get-2x-oracle-cloud-servers-free-forever-4o22"&gt;this post&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; — &lt;em&gt;the VMs are super fast and easy to set-up (see my posts above).&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What next?
&lt;/h1&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1542169096-d626c9d082ab%3Fixid%3DMXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1000%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1542169096-d626c9d082ab%3Fixid%3DMXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1000%26q%3D80" width="1000" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The journey continues, the road may be long, but it’s full of learnings — that certainly helps us grow. Many times we learn at the turning points while the milestones keep changing. Let’s continue learning and improving ourselves.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Please do feedback if you are curious to explore deeper aspects of what you read above, as you may understand the topic is wide and deep and one post cannot do full justice to such rich topics (plus many of them are moving targets).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;This is a reblog of the original post at &lt;a href="https://www.javaadvent.com/" rel="noopener noreferrer"&gt;Java Advent Calendar 2020&lt;/a&gt;, see &lt;a href="https://www.javaadvent.com/2020/12/another-two-years-in-the-life-of-ai-ml-dl-and-java.html" rel="noopener noreferrer"&gt;original post&lt;/a&gt;.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>java</category>
    </item>
    <item>
      <title>An Interview by Neural Magic: Machine Learning Engineer Spotlight</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Sun, 01 Nov 2020 09:05:10 +0000</pubDate>
      <link>https://dev.to/neomatrix369/machine-learning-engineer-spotlight-mani-sarkar-371l</link>
      <guid>https://dev.to/neomatrix369/machine-learning-engineer-spotlight-mani-sarkar-371l</guid>
      <description>

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;em&gt;This is a reblog of the original post at &lt;a href="https://neuralmagic.com/blog/machine-learning-engineer-spotlight-mani-sarkar/" rel="noopener noreferrer"&gt;https://neuralmagic.com/blog/machine-learning-engineer-spotlight-mani-sarkar/&lt;/a&gt; by &lt;a href="https://neuralmagic.com/" rel="noopener noreferrer"&gt;Neural Magic&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/h3&gt;




&lt;p&gt;In our new blog series, we’re interviewing data scientists and machine learning engineers about their career paths, areas of interest and thoughts on the future of AI. We kick off this week with a 20-year veteran and jack-of-all-trades when it comes to machine learning and data science: &lt;a href="https://www.linkedin.com/in/mani-sarkar/?originalSubdomain=uk" rel="noopener noreferrer"&gt;Mani Sarkar&lt;/a&gt;. Mani is a strategic machine learning engineer based in London, UK, who believes in getting beyond the theoretical and applying AI to real-world problems.&lt;/p&gt;

&lt;p&gt;Below is our interview, lightly edited for clarity.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tell us more about how you got into machine learning.
&lt;/h4&gt;

&lt;p&gt;I started my career as a software developer, writing desktop, web-based applications and command-line tools. The best thing about being a developer is learning new things. I’ve always been interested in data, numbers and math. In the last few years, I got more serious about it.&lt;/p&gt;

&lt;p&gt;After 20 years working as a permanent employee, I decided to take charge of my career as a freelancer. I help companies develop proof-of-concept or minimum viable products to secure funding or go to market quickly. I focus on improving performance or the speed of the software development process. My motto is, “Strengthening teams and helping them accelerate!”&lt;/p&gt;

&lt;p&gt;There are really no boundaries to what I’m asked to do, so learning data science became a major priority for me. One client inspired me to delve into this subject more. The company wrote bots that could read and write computer code. The bot provides recommendations on how to improve your code as a developer. As someone who’s interested in software quality, it pushed me to pursue practical machine learning and data science projects.&lt;/p&gt;

&lt;h4&gt;
  
  
  What are you most excited about in the work you are doing these days? 
&lt;/h4&gt;

&lt;p&gt;I take a top-down approach to machine learning where I focus on the business problem, as opposed to many others who take a bottom-up approach. I can count on my fingers the entities taking a top-down approach. My philosophy of learning and implementing matches greatly with theirs. Creating programs, content, guides and everything else using this principle is very exciting. Machine learning is an ever-changing and hard-to-grasp field, so it is important to help business users contextualize technical projects.&lt;/p&gt;

&lt;p&gt;Autonomy and creativity is a great part of what I do. When I’m free to be creative, I’m able to get the best results for the end-user, the customer or even the community (when I’m working on open source projects).&lt;/p&gt;

&lt;h4&gt;
  
  
  What is the coolest machine learning problem you have worked toward solving?
&lt;/h4&gt;

&lt;p&gt;Natural language processing (NLP) is a widespread field with many new innovations and advancements. Despite that, at a very basic level, there are no comprehensive tools to analyze tabular text data. There are a lot of fragmented tools and utilities available, but many of them are not open-sourced or widely shared. So, we all end up building our own little solutions to analyze text datasets. Each one of us might do it differently and get a different response. &lt;/p&gt;

&lt;p&gt;While preparing for a talk last month, I wrote a simple utility called &lt;a href="https://www.kaggle.com/general/166954" rel="noopener noreferrer"&gt;NLP Profiler&lt;/a&gt; in under three hours, which is now going to be part of the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/better-nlp" rel="noopener noreferrer"&gt;Better NLP&lt;/a&gt; library.  When given a dataset and a column name with text data, &lt;a href="https://www.kaggle.com/general/166954" rel="noopener noreferrer"&gt;NLP Profiler&lt;/a&gt; will return either high-level insights about the text or low-level/granular statistical information about the same text. Think of it as using the pandas.describe() function or running &lt;em&gt;Pandas Profiling&lt;/em&gt; on your data frame, but for datasets containing text columns rather than columnar datasets (tabular or spreadsheet-like data where each column may be a different data type like string, numeric, date, etc. This includes most kinds of data commonly stored in a relational database or tab, or .csv files)&lt;/p&gt;

&lt;p&gt;I have used it on a few datasets and it has shown some interesting information. High-level information would include things like sentiment analysis, subjectivity/objectivity analysis, grammar or spelling quality check, etc. Low-level details could include the number of words in the sentence, the number of emojis in the text, etc. &lt;a href="https://www.kaggle.com/general/166954" rel="noopener noreferrer"&gt;NLP Profiler&lt;/a&gt; can do this analysis using a single line of code. Above all, it can be extended and shared openly with others. This opens a new world of machine learning on text data and can help any NLP engineer or practitioner.&lt;/p&gt;

&lt;h4&gt;
  
  
  How do you predict machine learning will evolve over the next decade?
&lt;/h4&gt;

&lt;p&gt;Automation will play a big role. Even though there will be big challenges – like privacy, ethics, bias, and more – there will be ways around it using a combination of automation and human intervention. Machine learning will evolve as a human-in-the-loop or AI will assist humans do everything from collecting data, to training models, to analyzing models.&lt;/p&gt;

&lt;p&gt;I predict that there are three different pathways that may occur in parallel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fully/partially AI-driven systems:&lt;/strong&gt;Many of these error-prone systems have been attempted, and I imagine there will be even more failures to learn from in the future.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI assisting humans:&lt;/strong&gt;Rather than AI taking people’s jobs,  AI will augment mundane tasks. This will create a cascade of new industries, just like the advent of PCs in the 80s and 90s created countless fulfilling careers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Humans doing tasks AI cannot do fully or partially:&lt;/strong&gt;AI still isn’t good at some tasks humans excel at, which will remain the case for some time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since NLP is an area in which I’m particularly interested, I imagine in the future we may see a smart dialogue system with memory and ability to detect context. We’ve already come a long way from the 1960s MIT NLP program, &lt;a href="https://en.wikipedia.org/wiki/ELIZA" rel="noopener noreferrer"&gt;ELIZA&lt;/a&gt;. I created a conversational chatbot demo and video based on the logic used to build ELIZA, which people can play with &lt;a href="https://github.com/neomatrix369/chatbot-conversations" rel="noopener noreferrer"&gt;on my Github&lt;/a&gt;. &lt;/p&gt;

&lt;h4&gt;
  
  
  What is the most interesting application of machine learning you have seen out there?
&lt;/h4&gt;

&lt;p&gt;I was recently at an online meetup where a small startup called PolyAI&lt;a href="https://www.facebook.com/nathan.benaich/videos/10100448047785480" rel="noopener noreferrer"&gt; gave a demo&lt;/a&gt; of an interactive chatbot app that would take a phone call and make a reservation from any caller. It was used to demonstrate how a person could book a restaurant table via the app. It was amazing to see how the chatbot picked up many of the nuances in the caller’s language or style of speaking (even the accent) that only experienced professionals could have responded to. The accuracy at which the information was delivered to the user was impressive. Even though the caller was a bit unfamiliar with the fact that they were talking to a chatbot and not a human, they could get their points across and were pleasantly surprised. &lt;/p&gt;

&lt;p&gt;Another demo I recently experienced was a technical open source application called &lt;a href="https://pycaret.org/" rel="noopener noreferrer"&gt;PyCaret&lt;/a&gt;, where the whole process of creating a machine learning model was automated or made available with only a few lines of code in Python. The tool made all kinds of analysis and generated metrics and logs that could be assessed to make further decisions. It even had a way to perform post-model creation analysis using SHAPLY.&lt;/p&gt;

&lt;h4&gt;
  
  
  What do you see as the biggest challenges in machine learning and AI right now?
&lt;/h4&gt;

&lt;p&gt;Ethics, and privacy are big challenges, which we are all aware of. However, we have not developed General AI yet (or if it’s available, we don’t see it in the mainstream) where these concerns would become more severe. &lt;/p&gt;

&lt;p&gt;Specialization in different domains is still a challenge. There’s still a lot of work to be done to master practical applications of AI. Smaller subsets of different domain expertise need to come together to become generally useful to the population.&lt;/p&gt;

&lt;p&gt;On the NLP front, machine understanding of various languages and dialects will continue to remain an issue, even though not for long. The accuracy of general NLP systems’ results still needs work before we can accept them in the mainstream for domestic or industrial use. That said, many industries have achieved success creating solutions for specific needs (under controlled environments).&lt;/p&gt;

&lt;p&gt;The other challenge will be the ability to weave society and these AI creations. With certain inventions and innovations, challenges lie in the lack of knowledge around these systems. Specific areas of concern could include algorithms for crime and law enforcement, or health and safety. Authenticity and the rise of “deep fakes” will continue to be a challenge for some time. &lt;/p&gt;

&lt;p&gt;Finally, energy consumption within data centers that specialize in AI/machine learning tasks are having negative consequences on the environment. That’s a global problem that needs to be solved.&lt;/p&gt;

&lt;h4&gt;
  
  
  If you could change one thing about the public perception of machine learning and AI, what would it be?
&lt;/h4&gt;

&lt;p&gt;The biggest perception to change is that AI is not here to take away our jobs or make lives difficult. When augmented with our skills and knowledge, it can assist us in our regular life and work processes. Contrary to what the entertainment industry might have you believe, AI can’t “think” like us independently. We haven’t reached that stage where we can say we have built an electronic or digital consciousness around us. We may think we are going to be able to build one in the distant future, but that’s a discussion for another time.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fneuralmagic.com%2Fwp-content%2Fuploads%2F2020%2F08%2FManiPhoto471x628-2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fneuralmagic.com%2Fwp-content%2Fuploads%2F2020%2F08%2FManiPhoto471x628-2.jpg" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;About Mani&lt;/h2&gt;

&lt;p&gt;Mani is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software, data, ML engineer.&lt;/p&gt;



&lt;p&gt;A Java Champion, JCP Member, OpenJDK contributor, thought leader in the LJC and other developer communities and involved with @adoptopenjdk, @graalvm and other F/OSS projects. Writes code, not just on the Java/JVM platform but in other programming languages, hence likes to call himself a polyglot developer. He sees himself working in the areas of core Java, JVM, JDK, Hotspot, Graal, GraalVM, Truffle, VMs, and Performance Tuning.&lt;/p&gt;

&lt;p&gt;An advocate of a number of agile and software craftsmanship practices and a regular at many talks, conferences (Devoxx, VoxxedDays) and hands-on-workshops – speaks, participates, organises and helps out at many of them. Expresses his thoughts often via blog posts (on his own blog site, DZone, Medium and other third-party sites), and microblogs (tweets).&lt;/p&gt;

&lt;p&gt;Learn more and connect with Mani &lt;a href="https://sessionize.com/mani-sarkar" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;em&gt;This is a reblog of the original post at &lt;a href="https://neuralmagic.com/blog/machine-learning-engineer-spotlight-mani-sarkar/" rel="noopener noreferrer"&gt;https://neuralmagic.com/blog/machine-learning-engineer-spotlight-mani-sarkar/&lt;/a&gt; by &lt;a href="https://neuralmagic.com/" rel="noopener noreferrer"&gt;Neural Magic&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/h3&gt;




</description>
      <category>nlp</category>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>career</category>
    </item>
    <item>
      <title>Exploring NLP concepts using Apache OpenNLP inside a Java-enabled Jupyter notebook</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Tue, 03 Dec 2019 13:03:28 +0000</pubDate>
      <link>https://dev.to/neomatrix369/exploring-nlp-concepts-using-apache-opennlp-inside-a-java-enabled-jupyter-notebook-320g</link>
      <guid>https://dev.to/neomatrix369/exploring-nlp-concepts-using-apache-opennlp-inside-a-java-enabled-jupyter-notebook-320g</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;I have been exploring and playing around with the &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt; library after a bit of convincing. For those who are not aware of it, it’s an &lt;a href="https://apache.org"&gt;Apache&lt;/a&gt; project,  supporters of F/OSS Java projects for the last two decades or so (see &lt;a href="https://en.wikipedia.org/wiki/The_Apache_Software_Foundation"&gt;Wikipedia&lt;/a&gt;). I found their command-line interface pretty simple to use and it is a great learning tool for learning and trying to understand &lt;a href="https://en.wikipedia.org/wiki/Natural_language_processing"&gt;Natural Language Processing (NLP)&lt;/a&gt;. Independent of this post, you can find &lt;a href="https://blog.valohai.com/nlp_with_dl4j_in_java_all_from_the_command-line"&gt;another perspective on exploring NLP concepts&lt;/a&gt; using &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt;, all of this directly from the realms of your command-prompt.&lt;/p&gt;

&lt;p&gt;I can say almost everyone in this space is also aware and familiar with &lt;a href="https://jupyter.org/"&gt;Jupyter Notebooks&lt;/a&gt; (in case you are not, have a look at this &lt;a href="https://www.youtube.com/watch?v=HW29067qVWk"&gt;video&lt;/a&gt; or &lt;a href="http://www.geomarvel.com/2019/09/03/getting-started-with-jupyter-notebooks/"&gt;[1]&lt;/a&gt; or &lt;a href="https://www.dataquest.io/blog/jupyter-notebook-tutorial/"&gt;[2]&lt;/a&gt;). Here onwards we will be doing the same things you have been doing with your own experiments from within the realms of the notebook.&lt;/p&gt;

&lt;h1&gt;
  
  
  Exploring NLP using Apache OpenNLP
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Command-line Interface
&lt;/h2&gt;

&lt;p&gt;I’ll refer you to &lt;a href="https://medium.com/@neomatrix369/exploring-nlp-concepts-using-apache-opennlp-4d59c3cac8?source=---------2------------------&amp;amp;gi=2aabe5762998"&gt;the post&lt;/a&gt; where we cover the command-line experience with &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt;, and it’s a great way to familiarise yourself with this NLP library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jupyter Notebook: Getting started
&lt;/h2&gt;

&lt;p&gt;Do the following before proceeding any further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        $ git clone git@github.com:neomatrix369/nlp-java-jvm-example.git
        or 
        $ git clone https://github.com/neomatrix369/nlp-java-jvm-example.git
        $ cd nlp-java-jvm-example
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;em&gt;And then&lt;/em&gt; &lt;em&gt;see&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#getting-started"&gt;&lt;em&gt;Getting started&lt;/em&gt;&lt;/a&gt; &lt;em&gt;section in the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#exploring-nlp-concepts-from-inside-a-java-based-jupyter-notebook"&gt;&lt;em&gt;Exploring NLP concepts from inside a Java-based Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;part of the README before proceeding further.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Also, we have chosen the JDK to be &lt;a href="https://graalvm.org"&gt;GraalVM&lt;/a&gt; by default, you can see this from these lines in the console messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;---snipped--&amp;gt;
    JDK_TO_USE=GRAALVM
    openjdk version "11.0.5" 2019-10-15
    OpenJDK Runtime Environment (build 11.0.5+10-jvmci-19.3-b05-LTS)
    OpenJDK 64-Bit GraalVM CE 19.3.0 (build 11.0.5+10-jvmci-19.3-b05-LTS, mixed mode, sharing)
    &amp;lt;---snipped--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;: a &lt;a href="https://hub.docker.com/r/neomatrix369/nlp-java"&gt;&lt;em&gt;docker image&lt;/em&gt;&lt;/a&gt;&lt;/em&gt; has been provided to be able to run a docker container that would contain all the tools you need. You can see the &lt;code&gt;*shared*&lt;/code&gt; folder has been created which is linked to the volume mounted into your container, mapping your the folder from the local machine. So anything created or downloaded into the shared folder will be available even after you exit your container!*&lt;/p&gt;

&lt;p&gt;Have a quick read of the main &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example#nlp-javajvm-"&gt;README&lt;/a&gt; file to get an idea of how to go about using the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/docker-runner.sh"&gt;docker-runner.sh shell script&lt;/a&gt;, and take a quick glance at the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example#usage"&gt;Usage section&lt;/a&gt; of the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/tree/master/images/java/opennlp#scripts-provided"&gt;scripts&lt;/a&gt; as well*&lt;em&gt;.&lt;/em&gt;* &lt;/p&gt;

&lt;h2&gt;
  
  
  Running the Jupyter notebook container
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;See&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#running-the-jupyter-notebook-container"&gt;&lt;em&gt;Running the Jupyter notebook container&lt;/em&gt;&lt;/a&gt; &lt;em&gt;section in the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#exploring-nlp-concepts-from-inside-a-java-based-jupyter-notebook"&gt;&lt;em&gt;Exploring NLP concepts from inside a Java-based Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;part of the README before proceeding further.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All you need to do is run this command after cloning the repo mentioned in the links above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ ./docker-runner.sh --notebookMode --runContainer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once you have the above running, the action will automatically open load the Jupyter notebook interface for you into a browser window. You will have a couple of Java notebooks to choose from (placed in the &lt;code&gt;shared/notebooks&lt;/code&gt; folder on your local machine):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fcS8DFc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1176/0%2A-7ioNONeUiWcWoyT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fcS8DFc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1176/0%2A-7ioNONeUiWcWoyT.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Apache OpenNLP in the container
&lt;/h2&gt;

&lt;p&gt;When inside the container in the notebook mode, you have two approaches to install &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From the command-line interface (optional)&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;See&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#from-the-command-line-interface"&gt;&lt;em&gt;From the command-line interface&lt;/em&gt;&lt;/a&gt; &lt;em&gt;sub-section under the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#installing-apache-opennlp-in-the-container"&gt;&lt;em&gt;Installing Apache OpenNLP in the container&lt;/em&gt;&lt;/a&gt; &lt;em&gt;section in the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#exploring-nlp-concepts-from-inside-a-java-based-jupyter-notebook"&gt;&lt;em&gt;Exploring NLP concepts from inside a Java-based Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;part of the README before proceeding further.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From inside the Jupyter notebook (recommended)&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;See&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#from-inside-the-jupyter-notebook"&gt;&lt;em&gt;From inside the Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;sub-section under the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#installing-apache-opennlp-in-the-container"&gt;&lt;em&gt;Installing Apache OpenNLP in the container&lt;/em&gt;&lt;/a&gt; &lt;em&gt;section in the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#exploring-nlp-concepts-from-inside-a-java-based-jupyter-notebook"&gt;&lt;em&gt;Exploring NLP concepts from inside a Java-based Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;part of the README before proceeding further.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Viewing and accessing the shared folder
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;See&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#viewing-and-accessing-the-shared-folder"&gt;&lt;em&gt;Viewing and accessing the shared folder&lt;/em&gt;&lt;/a&gt; &lt;em&gt;section in the&lt;/em&gt; &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/images/java/opennlp/README-exploring-nlp-java-jupyter-notebook.md#exploring-nlp-concepts-from-inside-a-java-based-jupyter-notebook"&gt;&lt;em&gt;Exploring NLP concepts from inside a Java-based Jupyter notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;part of the README before proceeding further.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This will also be covered in a small way via the Jupyter notebooks in the following section. You can see directory contents via the &lt;code&gt;%system&lt;/code&gt; &lt;a href="https://github.com/SpencerPark/IJava/blob/master/docs/magics.md"&gt;Java cell magic&lt;/a&gt; and then from the command prompt a similar files/folders layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performing NLP actions in a Jupyter notebook
&lt;/h2&gt;

&lt;p&gt;While you have the notebook server running you will see this launcher window with a list of notebooks and other supporting files show up as soon as the notebook server launches:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---lWLh-jO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1176/0%2ApYMZlFJkkCpW8diZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---lWLh-jO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1176/0%2ApYMZlFJkkCpW8diZ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each of the notebooks above have a purpose, &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/shared/notebooks/MyFirstJupyterNLPJavaNotebook.ipynb"&gt;MyFirstJupyterNLPJavaNotebook.ipynb&lt;/a&gt; shows how to write Java in a IPython notebook and perform NLP actions using Java code snippets that invoke the &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt; library functionalities (see &lt;a href="https://opennlp.apache.org/docs/1.9.1/apidocs/opennlp-tools/index.html"&gt;docs for more details on the classes and methods&lt;/a&gt; and also the &lt;a href="https://opennlp.apache.org/docs/1.9.1/apidocs/opennlp-tools/index.html"&gt;Java Docs for more details on the Java API usages&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;The other notebook &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/shared/notebooks/MyNextJupyterNLPJavaNotebook.ipynb"&gt;MyNextJupyterNLPJavaNotebook.ipynb&lt;/a&gt; runs the same Java code snippets on a remote cloud instance (with the help of the &lt;a href="https://docs.valohai.com/valohai-cli/index.html"&gt;Valohai CLI&lt;/a&gt; client) and returns the results in the cells, with just single commands. It’s fast and free to &lt;a href="https://app.valohai.com/accounts/signup/"&gt;create an account&lt;/a&gt; and use within the &lt;a href="https://valohai.com/pricing/"&gt;free-tier plan&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are able to examine the below Java API bindings to the &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt; library from inside both the Java-based notebooks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.langdetect.classifying.api"&gt;Language Detector API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.sentdetect.detection.api"&gt;Sentence Detection API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.tokenizer.api"&gt;Tokenizer API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.namefind.recognition.api"&gt;Name Finder API&lt;/a&gt; (including other examples)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.postagger.tagging.api"&gt;Parts of speech (POS) Tagger API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.parser.chunking.api"&gt;Chunking API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html#tools.parser.parsing.api"&gt;Parsing API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Exploring the above Apache OpenNLP Java APIs via the notebook directly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are able to do this from inside a notebook, running the &lt;a href="https://github.com/SpencerPark/IJava"&gt;IJava Jupyter interpreter&lt;/a&gt; which allows writing Java in a typical notebook. We will be exploring the above named Java APIs using small snippets of Java code and see the results appear in the notebook:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dq62-toy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/704/1%2AdElv_WFeEz94631_sgZbOg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dq62-toy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/704/1%2AdElv_WFeEz94631_sgZbOg.gif" alt="MyFirstJupyterNLPJavaNotebook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So go back to your browser and look for the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/shared/notebooks/MyFirstJupyterNLPJavaNotebook.ipynb"&gt;MyFirstJupyterNLPJavaNotebook.ipynb&lt;/a&gt; notebook and have a play with it, reading and executing each cell and observing the responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exploring the above Apache OpenNLP Java APIs via the notebook with the help of remote cloud services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are able to do this from inside a notebook,  running the &lt;a href="https://github.com/SpencerPark/IJava"&gt;IJava Jupyter interpreter&lt;/a&gt; which allows writing Java in a typical notebook. But in this notebook, we have taken it further and used the &lt;code&gt;%system&lt;/code&gt; &lt;a href="https://github.com/SpencerPark/IJava/blob/master/docs/magics.md"&gt;Java cell magic&lt;/a&gt; and the &lt;a href="https://docs.valohai.com/valohai-cli/index.html"&gt;Valohai CLI&lt;/a&gt; magic instead of running the Java code snippets in the various cells like the previous notebook. &lt;/p&gt;

&lt;p&gt;So that way the downloading of the models and processing of the text using the model does not happen on your local machine but one a more sophisticated remote server in the cloud. And you are able to control this process from inside the notebook cells. This is more relevant when the models and the datasets to process are large and your local instance(s) do not have the necessary resources to support long-standing NLP processes. I have seen NLP training and evaluations to take long to finish and hence high-spec resources are a must.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Dqv3pcq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/704/1%2A2nfxMdIlDICpGbvsVEJ6xg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Dqv3pcq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/704/1%2A2nfxMdIlDICpGbvsVEJ6xg.gif" alt="MyNextJupyterNLPJavaNotebook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And again go back to your browser and look for the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/shared/notebooks/MyNextJupyterNLPJavaNotebook.ipynb"&gt;MyNextJupyterNLPJavaNotebook.ipynb&lt;/a&gt; notebook and have a play with it, reading and executing each cell. All the necessary details are in there including links to the docs and supporting pages.&lt;/p&gt;

&lt;p&gt;To get a deeper understanding of how these two notebooks were put together and how they work operationally, please have a look at all &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/tree/master/shared/notebooks"&gt;the source files&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing the Jupyter notebook
&lt;/h2&gt;

&lt;p&gt;Make sure you have saved your notebook before you do this. Switch to the console window from where you ran the &lt;code&gt;docker-runner&lt;/code&gt; shell script. Pressing &lt;strong&gt;Ctrl-C&lt;/strong&gt; in the console running the Docker container gives you this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;---snipped---&amp;gt;
    [I 21:13:16.253 NotebookApp] Saving file at /MyFirstJupyterJavaNotebook.ipynb
    ^C[I 21:13:22.953 NotebookApp] interrupted
    Serving notebooks from local directory: /home/jovyan/work
    1 active kernel
    The Jupyter Notebook is running at:
    http://1e2b8182be38:8888/
    Shutdown this notebook server (y/[n])? y
    [C 21:14:05.035 NotebookApp] Shutdown confirmed
    [I 21:14:05.036 NotebookApp] Shutting down 1 kernel
    Nov 15, 2019 9:14:05 PM io.github.spencerpark.jupyter.channels.Loop shutdown
    INFO: Loop shutdown.
    &amp;lt;--snipped--&amp;gt;
    [I 21:14:05.441 NotebookApp] Kernel shutdown: 448d46f0-1bde-461b-be60-e248c6342f69
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This shuts down the container and you are back to your local machine command-prompt. Your notebook stays preserved in the &lt;code&gt;shares/notebooks&lt;/code&gt; folder on your local machine, provided you have been saving them as you kept changing them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other concepts, libraries and tools
&lt;/h1&gt;

&lt;p&gt;There are other &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example#libraries--frameworks-provided"&gt;Java/JVM based NLP libraries&lt;/a&gt; mentioned in the &lt;strong&gt;Resources&lt;/strong&gt; section below, for brevity we won’t cover them. The links provided will lead to further information for your own pursuit.&lt;/p&gt;

&lt;p&gt;Within the &lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt; tool itself we have only covered the command-line access part of it and not the Java Bindings. In addition, we haven’t gone through all the NLP concepts or features of the tool again for brevity have only covered a handful of them. But the &lt;a href="https://opennlp.apache.org/docs/"&gt;documentation&lt;/a&gt; and &lt;a href="https://github.com/apache/opennlp#useful-links"&gt;resources&lt;/a&gt; on the &lt;a href="https://github.com/apache/opennlp"&gt;GitHub repo&lt;/a&gt; should help in further exploration.&lt;/p&gt;

&lt;p&gt;You can also find out how to build the &lt;a href="https://hub.docker.com/r/neomatrix369/nlp-java"&gt;docker image&lt;/a&gt; for yourself, by examining the &lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example/blob/master/docker-runner.sh"&gt;docker-runner script&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Limitations
&lt;/h1&gt;

&lt;p&gt;Although the &lt;a href="https://github.com/SpencerPark/IJava/blob/master/docs/magics.md"&gt;Java cell magic&lt;/a&gt; does make a difference and helps run commands. Even though it’s a non-Python based notebook we could still run shell commands and execute Java code in our cells and do some decent NLP work in the Jupyter notebooks.&lt;/p&gt;

&lt;p&gt;If you had a python-based notebook, then &lt;a href="https://www.valohai.com"&gt;Valohai&lt;/a&gt;’s extension called &lt;a href="https://docs.valohai.com/jupyter/index.html"&gt;Jupyhai&lt;/a&gt; specially made for such purposes would suffice. Have a look at the &lt;strong&gt;Jupyhai&lt;/strong&gt; sub-section in the &lt;strong&gt;Resources&lt;/strong&gt; section of this post (at the end of the post).  In fact, we have been running all our actions in the Jupyhai notebook, although I have been calling it Jupyter Notebook, have a look at the icon on the toolbar in the middle part of the panel in the browser):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lm2MZaZ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1181/0%2A4Z6rClsE92z83a_g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lm2MZaZ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1181/0%2A4Z6rClsE92z83a_g.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i_UaYAEk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/413/0%2AsSWhveyrSxI8jL48.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i_UaYAEk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/413/0%2AsSWhveyrSxI8jL48.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This has been a very different experience than most of the other ways of exploring and learning, and you can see why the whole industry specifically speaking areas that cover Academia, Research, Data Science and Machine Learning have taken this approach like a storm. We still have limitations but with time even they will be overcome making our experience a smooth one.&lt;/p&gt;

&lt;p&gt;Seeing your results in the same page where your code sits is a lot assuring and gives us a short and quick feedback loop. Especially being able to see the visualisations and change them dynamically and get instant results can cut through the cruft for busy and eager students, scientists, mathematicians, engineers and analysts in every field not just Computing or Data Science or Machine Learning. &lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;h3&gt;
  
  
  IJava (Jupyter interpreter)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/SpencerPark/IJava"&gt;Github&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/SpencerPark/IJava/tree/master/docs"&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[%system](https://github.com/SpencerPark/IJava/pull/78)&lt;/code&gt; &lt;a href="https://github.com/SpencerPark/IJava/pull/78"&gt;Java cell magic implementation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/neomatrix369/nlp-java"&gt;Docker image with IJava + Jupyhai + other dependencies&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Jupyhai
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://get.valohai.com/jupyter-notebook-version-control"&gt;Version Control for Jupyter Notebooks&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blog.valohai.com/topic/jupyter-notebook"&gt;Blogs on Jupyter Notebooks&lt;/a&gt; 

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://blog.valohai.com/valohai-jupyter-notebook-extension"&gt;Valohai's Jupyter Notebook Extension&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/asynchronous-workflows-in-data-science"&gt;Asynchronous Workflows in Data Science&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/automatic-version-control-meets-jupyter-notebooks"&gt;Automatic Version Control Meets Jupyter Notebooks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/leveling-up-your-ml-code-from-notebook"&gt;Level Up Your Machine Learning Code from Notebook to Production&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/run-jupyter-notebook-any-cloud-provider"&gt;Run Jupyter Notebook On Any Cloud Provider&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/jupyter-extension-updates"&gt;Updates for Valohai Powered Notebooks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=IOv-yps387Q&amp;amp;list=PLMskd1Tlj2wZjKK15qNMjYeJZtapUK01h&amp;amp;index=5"&gt;Version control for Jupyter Notebooks (video)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.valohai.com/jupyter/index.html"&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Apache OpenNLP
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/nlp-java-jvm-example"&gt;nlp-java-jvm-example&lt;/a&gt; GitHub project &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://opennlp.apache.org/"&gt;Apache OpenNLP&lt;/a&gt; | &lt;a href="https://github.com/apache/opennlp"&gt;GitHub&lt;/a&gt; | &lt;a href="https://opennlp.apache.org/mailing-lists.html"&gt;Mailing list&lt;/a&gt; | &lt;a href="https://twitter.com/@apacheopennlp"&gt;@apacheopennlp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/"&gt;Documentation resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html"&gt;Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/apidocs/opennlp-tools/index.html"&gt;Apache OpenNLP Tools Javadoc&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Download

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/download.html"&gt;Apache OpenNLP Jar/binary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Model Zoo

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/models.html"&gt;Models page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mirrorservice.org/sites/ftp.apache.org/opennlp/models/langdetect/1.8.3/langdetect-183.bin"&gt;Language Detect model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://opennlp.sourceforge.net/models-1.5/"&gt;Older models to support the examples in the docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Legends to support the examples in the docs

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.apache.org/dist/opennlp/models/langdetect/1.8.3/README.txt"&gt;List of languages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html"&gt;Penn Treebank tag set&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Find more in the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples/nlp-java-jvm/images/java/opennlp/README.md#resources"&gt;Resources&lt;/a&gt; section in the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples/nlp-java-jvm/images/java/opennlp/README.md#apache-opennlp--"&gt;README&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other related posts
&lt;/h3&gt;

&lt;p&gt;- &lt;a href="https://medium.com/@neomatrix369/how-to-do-deep-learning-for-java-on-the-valohai-platform-eec8ba9f71d8?source=---------7------------------"&gt;How to do Deep Learning for Java?&lt;/a&gt;&lt;br&gt;
    - &lt;a href="https://medium.com/@neomatrix369/applying-nlp-in-java-all-from-the-command-line-1225dd591e80?source=---------4------------------"&gt;NLP with DL4J in Java, all from the command-line&lt;/a&gt;&lt;br&gt;
    - &lt;a href="https://medium.com/@neomatrix369/exploring-nlp-concepts-using-apache-opennlp-4d59c3cac8"&gt;Exploring NLP concepts using Apache OpenNLP&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>java</category>
      <category>graalvm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Exploring NLP concepts using Apache OpenNLP</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Thu, 21 Nov 2019 00:58:46 +0000</pubDate>
      <link>https://dev.to/neomatrix369/exploring-nlp-concepts-using-apache-opennlp-5g3o</link>
      <guid>https://dev.to/neomatrix369/exploring-nlp-concepts-using-apache-opennlp-5g3o</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;After looking at a lot of &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/natural-language-processing/java-jvm.md#javajvm" rel="noopener noreferrer"&gt;Java/JVM based NLP libraries&lt;/a&gt; listed on &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/" rel="noopener noreferrer"&gt;Awesome AI/ML/DL&lt;/a&gt; I decided to pick the &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; library. One of the reasons comes from the fact another developer (who had a look at it previously) recommended it. Besides, it’s an &lt;a href="https://apache.org" rel="noopener noreferrer"&gt;Apache&lt;/a&gt; project, they have been great supporters of F/OSS Java projects for the last two decades or so (see &lt;a href="https://en.wikipedia.org/wiki/The_Apache_Software_Foundation" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;). It also goes without saying that &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; is backed by the &lt;a href="https://www.apache.org/licenses/LICENSE-2.0.html" rel="noopener noreferrer"&gt;Apache 2.0 license&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In addition, this tweet from an NLP researcher added some more confidence to the matter:&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1101890668283215872-165" src="https://platform.twitter.com/embed/Tweet.html?id=1101890668283215872"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1101890668283215872-165');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1101890668283215872&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;I’ll like to say my personal experience has been similar with &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; so far and I echo the simplicity and user-friendly API and design. You will see as we explore it further, that being the case.&lt;/p&gt;

&lt;h1&gt;
  
  
  Exploring NLP using Apache OpenNLP
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Java bindings
&lt;/h2&gt;

&lt;p&gt;We won’t be covering the Java API to &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; tool in this post but you can find a number of examples in &lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html" rel="noopener noreferrer"&gt;their docs&lt;/a&gt;. A bit later you will also need some of the resources enlisted in the &lt;strong&gt;Resources&lt;/strong&gt; section at the bottom of this post in order to progress further.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command-line Interface
&lt;/h2&gt;

&lt;p&gt;I was drawn to the simplicity of the CLI available and it just worked out-of-the-box, for instances where a model was needed, and when it was provided. It would just work without additional configuration.&lt;/p&gt;

&lt;p&gt;To make it easier to use and also not have to remember all the CLI parameters it supports I have put together some &lt;a href="https://github.com/valohai/nlp-java-jvm-example#scripts-provided" rel="noopener noreferrer"&gt;shell scripts&lt;/a&gt;. Have a look at the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; to get more insight into what they are and how to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;You will need the following from this point forward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git client 2.x or higher (an account on GitHub to fork the repo)&lt;/li&gt;
&lt;li&gt;Java 8 or higher (suggest install &lt;a href="https://www.graalvm.org" rel="noopener noreferrer"&gt;GraalVM CE&lt;/a&gt; 19.x or higher)&lt;/li&gt;
&lt;li&gt;Docker CE 19.x or higher and check it is running before going further&lt;/li&gt;
&lt;li&gt;Ability to run &lt;a href="https://github.com/valohai/nlp-java-jvm-example#scripts-provided" rel="noopener noreferrer"&gt;shell scripts&lt;/a&gt; from the CLI&lt;/li&gt;
&lt;li&gt;Understand reading/writing shell scripts (optional)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note: At the time of the writing version 1.9.1 of&lt;/em&gt; &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;&lt;em&gt;Apache OpenNLP&lt;/em&gt;&lt;/a&gt; &lt;em&gt;was available.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We have put &lt;a href="https://github.com/valohai/nlp-java-jvm-example#scripts-provided" rel="noopener noreferrer"&gt;together scripts&lt;/a&gt; to make these steps easy for everyone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ git clone git@github.com:valohai/nlp-java-jvm-example.git
    or 
    $ git clone https://github.com/valohai/nlp-java-jvm-example.git
    $ cd nlp-java-jvm-example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will lead us to the folder with the following files in it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    LICENSE.txt      
    README.md        
    docker-runner.sh     &amp;lt;=== only this one concerns us at startup
    images
    shared               &amp;lt;=== created just when you run the container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: a&lt;/em&gt; &lt;a href="https://hub.docker.com/r/neomatrix369/nlp-java" rel="noopener noreferrer"&gt;&lt;em&gt;docker image&lt;/em&gt;&lt;/a&gt; &lt;em&gt;has been provided to be able to run a docker container that would contain all the tools you need to go further. You can see the&lt;/em&gt; &lt;code&gt;*shared*&lt;/code&gt; &lt;em&gt;folder has been created, which is a volume mounted into your container but it’s actually&lt;/em&gt; &lt;em&gt;a&lt;/em&gt; &lt;em&gt;directory created on your local machine and mapped to this volume. So anything created or downloaded there will be available even after you exit out of your container!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Have a quick read of the main &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; file to get an idea of how to go about using the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/docker-runner.sh" rel="noopener noreferrer"&gt;docker-runner.sh shell script&lt;/a&gt;, and take a quick glance at the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#usage" rel="noopener noreferrer"&gt;Usage section&lt;/a&gt; *&lt;em&gt;**as well&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;* Thereafter also take a look into the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README.md" rel="noopener noreferrer"&gt;Apache OpenNLP README&lt;/a&gt; file to see the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp#exploring-nlp-concepts" rel="noopener noreferrer"&gt;usages&lt;/a&gt; of the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp#scripts-provided" rel="noopener noreferrer"&gt;scripts&lt;/a&gt; provided there in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the NLP Java/JVM docker container
&lt;/h2&gt;

&lt;p&gt;At your local machine command prompt while at the root of the project, do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ ./docker-runner.sh --runContainer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a chance you get this first, before you get the prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Unable to find image 'neomatrix369/nlp-java:0.1' locally
    0.1: Pulling from neomatrix369/nlp-java
    f476d66f5408: ...
    .
    .
    .
    Digest: sha256:53b89b166d42ddfba808575731f0a7a02f06d7c47ee2bd3622e980540233dcff
    Status: Downloaded newer image for neomatrix369/nlp-java:0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then you will be presented with prompt inside the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Running container neomatrix369/nlp-java:0.1

    ++ pwd
    + time docker run --rm --interactive --tty --workdir /home/nlp-java --env JDK_TO_USE= --env JAVA_OPTS=&amp;lt;--snipped&amp;gt;
    nlp-java@cf9d493f0722:~$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container is packed with all the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp" rel="noopener noreferrer"&gt;Apache OpenNLP scripts/tools&lt;/a&gt; you need to get started with exploring various NLP solutions. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Apache OpenNLP inside the container
&lt;/h2&gt;

&lt;p&gt;Here is how we go further from here when you are inside the container, at the container command-prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ cd opennlp


    nlp-java@cf9d493f0722:~$ ./opennlp.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see the &lt;code&gt;apache-opennlp-1.9.1-bin.tar.gz&lt;/code&gt; artifact being downloaded and expanded into the &lt;code&gt;shared&lt;/code&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 10.6M  100 10.6M    0     0  4225k      0  0:00:02  0:00:02 --:--:-- 4225k
    apache-opennlp-1.9.1/
    apache-opennlp-1.9.1/NOTICE
    apache-opennlp-1.9.1/LICENSE
    apache-opennlp-1.9.1/README.html
    .
    .
    .
    apache-opennlp-1.9.1/lib/jackson-jaxrs-json-provider-2.8.4.jar
    apache-opennlp-1.9.1/lib/jackson-module-jaxb-annotations-2.8.4.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Viewing and accessing the shared folder
&lt;/h2&gt;

&lt;p&gt;Just as you run the container,  a shared folder is created, it may be empty in the beginning but as we go along we will find it fill up with different files and folders.&lt;/p&gt;

&lt;p&gt;It’s also where you will find the downloaded models and the &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; binary exploded into its own directory (by the name &lt;code&gt;apache-opennlp-1.9.1&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;You can access and see the contents of it from the command-prompt (outside the container) as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ### Open a new command prompt
    $ cd nlp-java-jvm-example
    $ cd images/java/opennlp
    $ ls ..
    Dockerfile       corenlp.sh       opennlp          reverb.sh        word2vec.sh
    cogcomp-nlp.sh   mallet.sh        openregex.sh     shared
    common.sh        nlp4j.sh         rdrposttagger.sh version.txt

    $ ls ../shared
    apache-opennlp-1.9.1   en-ner-date.bin        en-sent.bin
    en-chunker.bin         en-parser-chunking.bin langdetect-183.bin

    ### In your case the contents of the shared folder may vary but the way to get to the folder is above.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From inside the container this is what you see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ls 
    cogcomp-nlp.sh   corenlp.sh  nlp4j.sh  openregex.sh        reverb.sh  word2vec.sh
    common.sh        mallet.sh   opennlp   rdrposttagger.sh        shared

    nlp-java@cf9d493f0722:~$ ls shared
    MyFirstJavaNotebook.ipynb      en-ner-date.bin           en-pos-maxent.bin          
    langdetect-183.bin
    apache-opennlp-1.9.1           en-ner-time.bin           en-pos-perceptron.bin  
    notebooks
    en-chunker.bin                 en-parser-chunking.bin    en-token.bin

    ### In your case the contents of the shared folder may vary but the way to get to the folder is above.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Performing NLP actions inside the container
&lt;/h2&gt;

&lt;p&gt;The good thing is without ever leaving your current folder you can perform these NLP actions (check out the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp#exploring-nlp-concepts" rel="noopener noreferrer"&gt;Exploring NLP Concepts&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp#apache-opennlp--" rel="noopener noreferrer"&gt;README&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;Usage help of any of the scripts: at any point in time you can always query the scripts by calling them this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./[script-name.sh] --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./detectLanguage.sh --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;gives us this usage text as output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           Detecting language in a single-line text or article

           Usage: ./detectLanguage.sh --text [text]
                     --file [path/to/filename]
                     --help

           --text      plain text surrounded by quotes
           --file      name of the file containing text to pass as command arg
           --help      shows the script usage help text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Detecting language in a single-line text or article (see &lt;a href="https://www.apache.org/dist/opennlp/models/langdetect/1.8.3/README.txt" rel="noopener noreferrer"&gt;legend of language abbreviations&lt;/a&gt; used)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./detectLanguage.sh --text "This is an english sentence"

    eng This is an english sentence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-detecting-language.md" rel="noopener noreferrer"&gt;Detecting languages&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detecting sentences in a single line text or article.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./detectSentence.sh --text "This is an english sentence. And this is another sentence."


    This is an english sentence.
    And this is another sentence.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-detecting-sentences.md" rel="noopener noreferrer"&gt;Detecting sentences&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finding person name, organisation name, date, time, money, location, 
percentage information in a single line text or article.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./nameFinder.sh --method person  --text "My name is John"


    My name is &amp;lt;START:person&amp;gt; John &amp;lt;END&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-finding-names.md" rel="noopener noreferrer"&gt;Finding names&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output. There are a number of types of name finder examples in this section.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tokenize a line of text or an article into its smaller components (i.e. words, punctuation, numbers).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./tokenizer.sh --method simple --text "this-is-worth,tokenising.and,this,is,another,one"


    this - is - worth , tokenising . and , this , is , another , one
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-tokenise.md" rel="noopener noreferrer"&gt;Tokenise&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parse a line of text or an article and identify groups of words or phrases that go together (see &lt;a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html" rel="noopener noreferrer"&gt;Penn Treebank tag set&lt;/a&gt; for the legend of token types), also see &lt;a href="https://nlp.stanford.edu/software/lex-parser.shtml" rel="noopener noreferrer"&gt;https://nlp.stanford.edu/software/lex-parser.shtml&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./parser.sh --text "The quick brown fox jumps over the lazy dog ."


    (TOP (NP (NP (DT The) (JJ quick) (JJ brown) (NN fox) (NNS jumps)) (PP (IN over) (NP (DT the) (JJ lazy) (NN dog))) (. .)))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-parser.md" rel="noopener noreferrer"&gt;Parser&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tag parts of speech of each token in a line of text or an article (see &lt;a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html" rel="noopener noreferrer"&gt;Penn Treebank tag set&lt;/a&gt; for the legend of token types), also see &lt;a href="https://nlp.stanford.edu/software/tagger.shtml" rel="noopener noreferrer"&gt;https://nlp.stanford.edu/software/tagger.shtml&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./posTagger.sh --method maxent --text "This is a simple text to tag"


    This_DT is_VBZ a_DT simple_JJ text_NN to_TO tag_NN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-tag-parts-of-speech.md" rel="noopener noreferrer"&gt;Tag Parts of Speech&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text chunking by dividing a text or an article into syntactically correlated parts of words, like noun groups, verb groups. You apply this feature on the tagged parts of speech text or article. &lt;em&gt;Apply chunking on a text already tagged by PoS tagger&lt;/em&gt; (see &lt;a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html" rel="noopener noreferrer"&gt;Penn Treebank tag set&lt;/a&gt; for the legend of token types, also see &lt;a href="https://nlpforhackers.io/text-chunking/" rel="noopener noreferrer"&gt;https://nlpforhackers.io/text-chunking/&lt;/a&gt;).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@cf9d493f0722:~$ ./chunker.sh --text "This_DT is_VBZ a_DT simple_JJ text_NN to_TO tag_NN"


    \[NP This_DT \] [VP is_VBZ ] \[NP a_DT simple_JJ text_NN \] [PP to_TO ] [NP tag_NN]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README-chunking.md" rel="noopener noreferrer"&gt;Chunking&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example#nlp-javajvm-" rel="noopener noreferrer"&gt;README&lt;/a&gt; for more examples and detailed output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exiting from the  NLP Java/JVM docker container
&lt;/h2&gt;

&lt;p&gt;It is as simple as this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    nlp-java@f8562baf983d:~/opennlp$ exit
    exit
           67.41 real         0.06 user         0.05 sys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you are back to your local machine prompt.&lt;/p&gt;

&lt;h1&gt;
  
  
  Benchmarking
&lt;/h1&gt;

&lt;p&gt;One of the salient features of this tool is, it’s recording and reporting metrics of its actions at different execution points - time taken at micro and macro levels, here’s a sample output to illustrate this feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Loading Token Name Finder model ... done (1.200s)
    My name is &amp;lt;START:person&amp;gt; John &amp;lt;END&amp;gt;


    Average: 24.4 sent/s
    Total: 1 sent
    Runtime: 0.041s
    Execution time: 1.845 seconds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the above I have come across 5 metrics that are useful for me as a scientist or an analyst or even as an engineer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Took 1.200s to load the model into memory

    (Average) Processed at an average rate of 24.4 sentences per second
    (Total) Processed 1 sentence
    (Runtime) It took 0.040983606557377 (0.041 seconds) to process this 1 sentence
    (Execution time) The whole process ran for 1.845 seconds (startup, processing sentence(s) and shutdown)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Information like this is invaluable when it comes to making performance comparisons like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;between two or more models (load-time and run-time performance)&lt;/li&gt;
&lt;li&gt;between two or more environments or configurations&lt;/li&gt;
&lt;li&gt;between applications doing the same NLP, action put together using different tech stacks

&lt;ul&gt;
&lt;li&gt;also includes different languages&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;finding co-relations between different corpora of text data processed (quantitative and qualitative comparisons)&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Empirical example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://bit.ly/better-nlp-launch" rel="noopener noreferrer"&gt;&lt;em&gt;BetterNLP&lt;/em&gt;&lt;/a&gt; &lt;em&gt;library written in python is doing something similar, see&lt;/em&gt; &lt;a href="https://kaggle.com" rel="noopener noreferrer"&gt;&lt;em&gt;Kaggle&lt;/em&gt;&lt;/a&gt; &lt;em&gt;kernels:&lt;/em&gt; &lt;a href="https://www.kaggle.com/neomatrix369/better-nlp-class-notebook" rel="noopener noreferrer"&gt;&lt;em&gt;Better NLP Notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and&lt;/em&gt; &lt;a href="https://www.kaggle.com/neomatrix369/better-nlp-summarisers-notebook" rel="noopener noreferrer"&gt;&lt;em&gt;Better NLP Summarisers Notebook&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(search for&lt;/em&gt; &lt;em&gt;time_in_secs&lt;/em&gt; &lt;em&gt;inside both the notebooks to see the metrics reported).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fks0v2tkihh3l994ppfuy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fks0v2tkihh3l994ppfuy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fppch7gn9v6f8hu0oghb0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fppch7gn9v6f8hu0oghb0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Personally, it’s quite inspiring and also validates that this is a useful feature (or action) to offer to the end-user.&lt;/p&gt;
&lt;h1&gt;
  
  
  Other concepts, libraries and tools
&lt;/h1&gt;

&lt;p&gt;There are other &lt;a href="https://github.com/valohai/nlp-java-jvm-example#libraries--frameworks-provided" rel="noopener noreferrer"&gt;Java/JVM based NLP libraries&lt;/a&gt; mentioned in the &lt;strong&gt;Resources&lt;/strong&gt; section below, for brevity we won’t cover them. The links provided will lead to further information for your own pursuit.&lt;/p&gt;

&lt;p&gt;Within the &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; tool itself, we have only covered the command-line access part of it and not the Java Bindings. In addition, we haven’t gone through all the NLP concepts or features of the tool again for brevity have only covered a handful of them. But the &lt;a href="https://opennlp.apache.org/docs/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; and &lt;a href="https://github.com/apache/opennlp#useful-links" rel="noopener noreferrer"&gt;resources&lt;/a&gt; on the &lt;a href="https://github.com/apache/opennlp" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; should help in further exploration.&lt;/p&gt;

&lt;p&gt;You can also find out how to build the &lt;a href="https://hub.docker.com/r/neomatrix369/nlp-java" rel="noopener noreferrer"&gt;docker image&lt;/a&gt; for yourself, by examining the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/docker-runner.sh" rel="noopener noreferrer"&gt;docker-runner script&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbsrca9odbf87282z68to.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbsrca9odbf87282z68to.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After going through the above, we can conclude the following about the &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; tool by exploring its pros and cons:&lt;/p&gt;

&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s an easy to use API and understand&lt;/li&gt;
&lt;li&gt;Shallow learning curve and detailed documentation with lots of examples&lt;/li&gt;
&lt;li&gt;Covers a lot of NLP functionality, there’s more in the &lt;a href="https://opennlp.apache.org/docs/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; to explore than we did above&lt;/li&gt;
&lt;li&gt;Easy &lt;a href="https://github.com/valohai/nlp-java-jvm-example#scripts-provided" rel="noopener noreferrer"&gt;shell scripts&lt;/a&gt; and &lt;a href="https://github.com/valohai/nlp-java-jvm-example/tree/master/images/java/opennlp" rel="noopener noreferrer"&gt;Apache OpenNLP scripts&lt;/a&gt; have been provided to play with the tool&lt;/li&gt;
&lt;li&gt;Lots of resources available below to learn more about NLP (See the &lt;strong&gt;Resources&lt;/strong&gt; section below)&lt;/li&gt;
&lt;li&gt;Resources provided to quickly get started and explore the &lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; tool&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Looking at the &lt;a href="https://github.com/apache/opennlp" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; repo, it seems the development is slow or has been stagnated (last two commits have a wide gap i.e. May 2019 and Oct 15, 2019)&lt;/li&gt;
&lt;li&gt;A few models are missing when going through the examples in the &lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html" rel="noopener noreferrer"&gt;documentation (manual)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The current models provided may need further training as per your use case(s), see this tweet:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1193626559439134721-28" src="https://platform.twitter.com/embed/Tweet.html?id=1193626559439134721"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1193626559439134721-28');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1193626559439134721&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Apache OpenNLP
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/valohai/nlp-java-jvm-example" rel="noopener noreferrer"&gt;nlp-java-jvm-example&lt;/a&gt; GitHub project &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://opennlp.apache.org/" rel="noopener noreferrer"&gt;Apache OpenNLP&lt;/a&gt; | &lt;a href="https://github.com/apache/opennlp" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://opennlp.apache.org/mailing-lists.html" rel="noopener noreferrer"&gt;Mailing list&lt;/a&gt; | &lt;a href="https://twitter.com/@apacheopennlp" rel="noopener noreferrer"&gt;@apacheopennlp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/" rel="noopener noreferrer"&gt;Documentation resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/manual/opennlp.html" rel="noopener noreferrer"&gt;Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/docs/1.9.1/apidocs/opennlp-tools/index.html" rel="noopener noreferrer"&gt;Apache OpenNLP Tools Javadoc&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Download

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/download.html" rel="noopener noreferrer"&gt;Apache OpenNLP Jar/binary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Model Zoo

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opennlp.apache.org/models.html" rel="noopener noreferrer"&gt;Models page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mirrorservice.org/sites/ftp.apache.org/opennlp/models/langdetect/1.8.3/langdetect-183.bin" rel="noopener noreferrer"&gt;Language Detect model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://opennlp.sourceforge.net/models-1.5/" rel="noopener noreferrer"&gt;Older models to support the examples in the docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;Legends to support the examples in the docs

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.apache.org/dist/opennlp/models/langdetect/1.8.3/README.txt" rel="noopener noreferrer"&gt;List of languages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html" rel="noopener noreferrer"&gt;Penn Treebank tag set&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Find more in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README.md#resources" rel="noopener noreferrer"&gt;Resources&lt;/a&gt; section in the &lt;a href="https://github.com/valohai/nlp-java-jvm-example/blob/master/images/java/opennlp/README.md#apache-opennlp--" rel="noopener noreferrer"&gt;README&lt;/a&gt;
&lt;h2&gt;
  
  
  Other related posts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/nlp_with_dl4j_in_java_all_from_the_command-line?from=3oxenia9mtr6" rel="noopener noreferrer"&gt;How to do Deep Learning for Java on the Valohai Platform?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/nlp_with_dl4j_in_java_all_from_the_command-line?from=3oxenia9mtr6" rel="noopener noreferrer"&gt;NLP with DL4J in Java, all from the command-line&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369" rel="noopener noreferrer"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://blog.valohai.com/exploring-nlp-concepts-using-apache-opennlp-1?from=3oxenia9mtr6" rel="noopener noreferrer"&gt;https://blog.valohai.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>java</category>
      <category>graalvm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>NLP with DL4J in Java, all from the command-line </title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Fri, 01 Nov 2019 15:07:35 +0000</pubDate>
      <link>https://dev.to/neomatrix369/nlp-with-dl4j-in-java-all-from-the-command-line-495b</link>
      <guid>https://dev.to/neomatrix369/nlp-with-dl4j-in-java-all-from-the-command-line-495b</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;We are all aware of Machine Learning tools and cloud services that work via the browser and give us an interface we can use to perform our day-to-day data analysis, model training, and evaluation, and other tasks to various degrees of efficiencies.&lt;/p&gt;

&lt;p&gt;But what would you do if you want to do these tasks on or from your local machine or infrastructure available in your organisation? And, if these resources available do not meet the pre-requisites to do decent end-to-end Data Science or Machine Learning tasks. That’s when access to a cloud-provider agnostic deep learning management environments like &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; can help. And to add to this, we will be using the &lt;a href="https://valohai.com/pricing/"&gt;free-tier&lt;/a&gt; that is accessible to one and all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.valohai.com/accounts/signup/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YAyFstO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571927498550_Screen%2BShot%2B2019-10-22%2Bat%2B23.40.35.png" alt="(Create an account: https://app.valohai.com/accounts/signup/)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be performing the task of building a Java app, and then training and evaluating an NLP model using it, and we will do all of it from the command-line interface with less interaction with the available web interface — basically it will be an end-to-end process all the way to training, saving and evaluation of the NLP model. And we won’t need to worry much about setting up any environments, configuring or managing it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Purpose or Goals
&lt;/h1&gt;

&lt;p&gt;We will learn to do a bunch of things in this post covering various levels of abstractions (in no particular order):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how to build and run an NLP model on the local machine?

&lt;ul&gt;
&lt;li&gt;much fewer examples on NLP, mostly on classification or regression or computer vision (image, video, etc…)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;how to build and run an NLP model on the cloud?&lt;/li&gt;
&lt;li&gt;how to build NLP Java apps that run on the CPU or GPU?

&lt;ul&gt;
&lt;li&gt;most examples out there are non-Java based, much less Java-based ones&lt;/li&gt;
&lt;li&gt;most examples are CPU based, much less on GPUs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;how to perform the above depending on the absence/presence of resources i.e. GPU?&lt;/li&gt;
&lt;li&gt;how to build a CUDA docker container for Java?&lt;/li&gt;
&lt;li&gt;how to do all the above all from the command-line?

&lt;ul&gt;
&lt;li&gt;via individual commands&lt;/li&gt;
&lt;li&gt;via shell scripts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  What do we need and how?
&lt;/h1&gt;

&lt;p&gt;Here’s what we need to be able to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a Java app that builds and runs on any operating system

&lt;ul&gt;
&lt;li&gt;takes advantage of the GPU if available, otherwise uses the available CPU&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;CLI tools that allow connecting to remote cloud services&lt;/li&gt;
&lt;li&gt;shell scripts and code configuration to manage all of the above&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;em&gt;how&lt;/em&gt; part of this task is not hard once we have our goals and requirements clear, we will expand on this in the following sections.&lt;/p&gt;

&lt;h1&gt;
  
  
  NLP for Java, DL4J and Valohai
&lt;/h1&gt;

&lt;h2&gt;
  
  
  NLP for Java: DL4J
&lt;/h2&gt;

&lt;p&gt;We have all of the code and instructions needed to get started with this post, &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example"&gt;captured for you on github&lt;/a&gt;. Below are the steps you go through to get acquainted with the project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick startup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To quickly get started we need to do just these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open an account on &lt;a href="https://valohai.com"&gt;https://valohai.com&lt;/a&gt;, see &lt;a href="https://app.valohai.com/accounts/signup/"&gt;https://app.valohai.com/accounts/signup/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;install Valohai CLI&lt;/a&gt; on your local machine&lt;/li&gt;
&lt;li&gt;clone the repo &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/"&gt;https://github.com/valohai/dl4j-nlp-cuda-example/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ git clone https://github.com/valohai/dl4j-nlp-cuda-example/
    $ cd dl4j-nlp-cuda-example
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;create a &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; project using the &lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;Valohai CLI&lt;/a&gt; tool, and give it a name
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ vh project create
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;link your &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; project with the github repo &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/"&gt;https://github.com/valohai/dl4j-nlp-cuda-example/&lt;/a&gt; on the Repository tab of the Settings page (&lt;a href="https://app.valohai.com/p/%5Byour-user-id%5D/dl4j-nlp-cuda-example/settings/repository/"&gt;https://app.valohai.com/p/[your-user-id]/dl4j-nlp-cuda-example/settings/repository/&lt;/a&gt;)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ vh project open
    ### Go to the Settings page &amp;gt; Repository tab and update the git repo address with https://github.com/valohai/dl4j-nlp-cuda-example/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;update &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; project with the latest commits from the git repo
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ vh project fetch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now you’re ready to start using the power of performing Machine Learning tasks from the command-line.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/README.md#advanced-installation-and-setup"&gt;&lt;em&gt;Advanced installation and setup section in the README&lt;/em&gt;&lt;/a&gt; &lt;em&gt;to find out what we need to install and configure on your system to run the app and experiments on your local machine or inside a Docker container — this is not necessary for the purpose of this post at the moment but you can try it out at a later time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;About&lt;/strong&gt; &lt;a href="https://docs.valohai.com/valohai-yaml/index.html"&gt;&lt;strong&gt;valohai.yaml&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will have noticed we have a &lt;a href="https://docs.valohai.com/valohai-yaml/index.html"&gt;&lt;strong&gt;valohai.yaml&lt;/strong&gt;&lt;/a&gt; ****in the git repo and our &lt;a href="https://github.com/neomatrix369/dl4j-nlp-cuda-example/blob/master/valohai.yaml"&gt;valohai.yaml&lt;/a&gt; the file contains a number of steps that you can use, we have enlisted them by their names, which we will use when running our steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;build-cpu-gpu-uberjar:&lt;/strong&gt; build our uberjar (both CPU and GPU versions) on &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;train-cpu-linux:&lt;/strong&gt; run the NLP training using the CPU-version of uberjar on &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;train-gpu-linux:&lt;/strong&gt; run the NLP training using the GPU-version of uberjar on &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;evaluate-model-linux:&lt;/strong&gt; evaluate the trained NLP model from one of the above &lt;strong&gt;train-&lt;/strong&gt;* execution steps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;know-your-gpus:&lt;/strong&gt; run on any instance to gather GPU/Nvidia related details on that instance, we run the same script with the other steps above (both the build and run steps)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Building the Java app from command line&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Assuming you are all set up we will start by building the Java app on the &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; platform from the command prompt, which is as simple as running one of the two commands:&lt;/p&gt;

&lt;p&gt;$ vh exec run build-cpu-gpu-uberjar [--adhoc]&lt;/p&gt;

&lt;p&gt;### Run &lt;code&gt;vh exec run --help&lt;/code&gt; to find out more about this command&lt;/p&gt;

&lt;p&gt;And you will be prompted with the execution &lt;code&gt;counter&lt;/code&gt;, which is nothing by a number:&lt;/p&gt;

&lt;p&gt;&amp;lt;--snipped--&amp;gt;&lt;br&gt;
    😼  Success! Execution #1 created. See &lt;a href="https://app.valohai.com/p/valohai/dl4j-nlp-cuda-example/execution/016dfef8-3a72-22d4-3d9b-7f992e6ac94d/"&gt;https://app.valohai.com/p/valohai/dl4j-nlp-cuda-example/execution/016dfef8-3a72-22d4-3d9b-7f992e6ac94d/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;use&lt;/em&gt; &lt;code&gt;--adhoc&lt;/code&gt; &lt;em&gt;only if you have not setup your&lt;/em&gt; &lt;a href="https://valohai.com"&gt;&lt;em&gt;Valohai&lt;/em&gt;&lt;/a&gt; &lt;em&gt;project with a git repo or have unsaved commits and want to experiment before being sure of the configuration.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can watch your execution by:&lt;/p&gt;

&lt;p&gt;$ vh watch 1&lt;/p&gt;

&lt;p&gt;### the parameter 1 is the counter returned by the &lt;code&gt;vh exec run build-cpu-gpu-uberjar&lt;/code&gt; operation above, it is the index to refer to that execution run&lt;/p&gt;

&lt;p&gt;and you can see either we are waiting for an instance to be allocated or console messages move past the screen when the execution has kicked off. You can see the same via the web interface as well. &lt;em&gt;Note: instances are available based on how popular they are and also how much quota you have left on them, if they have been used recently they are more likely to be available next.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MD1e2ZTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571941040757_Screen%2BShot%2B2019-10-24%2Bat%2B19.16.50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MD1e2ZTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571941040757_Screen%2BShot%2B2019-10-24%2Bat%2B19.16.50.png" alt="Execution logs are seen in the console (exactly the same as in the web browser)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the step is completed, you can see it results in a few artifacts, called &lt;code&gt;outputs&lt;/code&gt; in the &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; terminology, we can see them by:&lt;/p&gt;

&lt;p&gt;$ vh outputs 1&lt;/p&gt;

&lt;p&gt;### Run &lt;code&gt;vh outputs --help&lt;/code&gt; to find out more about this command&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N6lu-nkU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571941385194_Screen%2BShot%2B2019-10-24%2Bat%2B19.22.38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N6lu-nkU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571941385194_Screen%2BShot%2B2019-10-24%2Bat%2B19.22.38.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will need the URLs that look like &lt;code&gt;datum://[….some sha like notation…]&lt;/code&gt;  for our next steps. You can see we have a log file that has captured the GPU related information about the running instance, you can download this file by:&lt;/p&gt;

&lt;p&gt;$ vh outputs --download . --filter *.logs 1&lt;/p&gt;

&lt;p&gt;### Run &lt;code&gt;vh outputs --help&lt;/code&gt; to find out more about this command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the NLP training process for CPU/GPU from the command-line&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will use the built artifacts namely the uberjars for the CPU and GPU backends to run our training process:&lt;/p&gt;

&lt;p&gt;### Running the CPU uberjar&lt;br&gt;
    $ vh exec run train-cpu-linux --cpu-linux-uberjar=datum://016dff00-43b7-b599-0e85-23a16749146e [--adhoc]&lt;/p&gt;

&lt;p&gt;### Running the GPU uberjar&lt;br&gt;
    $ vh exec run train-gpu-linux --gpu-linux-uberjar=datum://016dff00-2095-4df7-5d9e-02cb7cd009bb [--adhoc]&lt;/p&gt;

&lt;p&gt;### Note these datum:// link will vary in your case&lt;br&gt;
    ### Run &lt;code&gt;vh exec run train-cpu-linux --help&lt;/code&gt; to get more details on its usage&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;take a look at the&lt;/em&gt; &lt;a href="https://docs.valohai.com/valohai-cli/using-inputs.html"&gt;&lt;em&gt;Inputs with Valohai CLI&lt;/em&gt;&lt;/a&gt; &lt;em&gt;docs to see how to write commands like the above.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We can watch the process if we like but it can be lengthy so we can switch to another task.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VclamsBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571960121373_Screen%2BShot%2B2019-10-25%2Bat%2B00.35.02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VclamsBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571960121373_Screen%2BShot%2B2019-10-25%2Bat%2B00.35.02.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aCsUAFLg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571957675623_Screen%2BShot%2B2019-10-24%2Bat%2B23.54.04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aCsUAFLg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571957675623_Screen%2BShot%2B2019-10-24%2Bat%2B23.54.04.png" alt="Above graph is a result of the ValohaiMetadataCreator class"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above execution runs finish with saving the model into the &lt;code&gt;${VH_OUTPUTS}&lt;/code&gt; folder to enable it to be archived by &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt;. The model names get suffix to their names, to keep a track of how they were produced.&lt;/p&gt;

&lt;p&gt;At any point during our building, training or evaluation steps, we can stop an ongoing execution (queued or running) by just doing this:&lt;/p&gt;

&lt;p&gt;➜  dl4j-nlp-cuda-example git:(master) ✗ vh stop 3&lt;br&gt;
    (Resolved stop to execution stop.)&lt;br&gt;
    ⌛   Stopping #3...&lt;br&gt;
    =&amp;gt;   {"message":"Stop signal sent"}&lt;br&gt;
    😁  Success! Done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Downloading the saved model post successful training&lt;/strong&gt;&lt;br&gt;
We can query the &lt;code&gt;outputs&lt;/code&gt; of execution by its counter number and download it using:&lt;/p&gt;

&lt;p&gt;$ vh outputs 2&lt;br&gt;
    $ vh outputs --download . --filter Cnn*.pb  2&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_bGFeeTz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571955501671_Screen%2BShot%2B2019-10-24%2Bat%2B23.17.31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_bGFeeTz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571955501671_Screen%2BShot%2B2019-10-24%2Bat%2B23.17.31.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See how you to&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/docs/running-local-machine.md#run-the-app-on-your-local-machine"&gt;&lt;em&gt;can evaluate the downloaded model on your local machine&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, both the models created by the&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/docs/running-local-machine.md#evaluating"&gt;&lt;em&gt;CPU&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/docs/running-local-machine.md#evaluating-1"&gt;&lt;em&gt;GPU&lt;/em&gt;&lt;/a&gt; &lt;em&gt;based processes (respective uberjars). Just pass in the name of the downloaded model as a parameter to the&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/runUberJar.sh"&gt;&lt;em&gt;runner shell script&lt;/em&gt;&lt;/a&gt; &lt;em&gt;provided.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evaluating the saved NLP model from a previous training execution&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;### Running the CPU uberjar and evaluating the CPU-verion of the model&lt;br&gt;
    $ vh exec run evaluate-model-linux --uber-jar=datum://016dff00-43b7-b599-0e85-23a16749146e --model=datum://016dff2a-a0d4-3e63-d8da-6a61a96a7ba6 [--adhoc]&lt;/p&gt;

&lt;p&gt;### Running the GPU uberjar and evaluating the GPU-verion of the model&lt;br&gt;
    $ vh exec run evaluate-model-linux --uber-jar=datum://016dff00-2095-4df7-5d9e-02cb7cd009bb --model=datum://016dff2a-a0d4-3e63-d8da-6a61a96a7ba6 [--adhoc]&lt;/p&gt;

&lt;p&gt;### Note these datum:// link will vary in your case&lt;br&gt;
    ### Run &lt;code&gt;vh exec run train-cpu-linux --help&lt;/code&gt; to get more details on its usage&lt;/p&gt;

&lt;p&gt;And at the end of the model evaluation we get the below, model evaluation metrics and confusion matrix after running a test set on the model:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--14LMzHT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571961061273_Screen%2BShot%2B2019-10-25%2Bat%2B00.49.45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--14LMzHT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571961061273_Screen%2BShot%2B2019-10-25%2Bat%2B00.49.45.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;the&lt;/em&gt; &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/tree/master/src/main"&gt;&lt;em&gt;source code&lt;/em&gt;&lt;/a&gt; &lt;em&gt;contains ML and NLP-related explanations at various stages in the form of inline comments.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Capturing the environment information about Nvidia’s GPU and CUDA drivers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This step is unrelated to the whole process of building and running a Java app on the cloud and controlling and viewing it remotely using the client tool, although it is useful to be able to know on what kind of system we ran our training on, especially for the GPU aspect of the training:&lt;/p&gt;

&lt;p&gt;$ vh exec run know-your-gpus [--adhoc]&lt;/p&gt;

&lt;p&gt;### Run &lt;code&gt;vh exec run --help&lt;/code&gt; to get more details on its usage&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keeping track of your experiments&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While writing this post, I ran a number of experiments and to keep track of the successful versus failed experiments in an efficient manner, I was able to use &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt;’s version control facilities baked into its design by &lt;/li&gt;
&lt;li&gt;filtering for executions&lt;/li&gt;
&lt;li&gt;searching for specific execution by “token”&lt;/li&gt;
&lt;li&gt;re-running the successful and failed executions &lt;/li&gt;
&lt;li&gt;confirming that the executions were successful and a failure for the right reasons&lt;/li&gt;
&lt;li&gt;also, checkout &lt;a href="https://blog.valohai.com/blog-building-a-data-catalog-for-machine-learning"&gt;data-catalogs&lt;/a&gt; and &lt;a href="https://blog.valohai.com/automatic-data-provenance-for-your-ml-pipeline"&gt;data provenance&lt;/a&gt; on the &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; platform, below is an example of my project (look for the &lt;strong&gt;Trace&lt;/strong&gt; button):
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oVeFWUOC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571950223347_Screen%2BShot%2B2019-10-24%2Bat%2B21.49.09.png" alt=""&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JOowBMIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571950121688_Screen%2BShot%2B2019-10-24%2Bat%2B21.48.12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JOowBMIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_7A0C4B33BFFD6A1DF72DAEBE226854A031D5BC8749179526C46059EBF72005BC_1571950121688_Screen%2BShot%2B2019-10-24%2Bat%2B21.48.12.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparing the CPU and GPU based processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We could have discussed comparisons between the CPU and GPU based processes in terms of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;app-building performance&lt;/li&gt;
&lt;li&gt;model training speed &lt;/li&gt;
&lt;li&gt;model evaluation accuracy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But we won’t cover these topics in this post, although you have access to the metrics you need for it, in case you wish to investigate further.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Necessary configuration file(s) and shells scripts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All the necessary scripts can be found on the &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example"&gt;github repo&lt;/a&gt;, they can be found in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the root folder of the project&lt;/li&gt;
&lt;li&gt;docker folder&lt;/li&gt;
&lt;li&gt;resources-archive folder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please also have a look at the &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/README.md"&gt;README.md&lt;/a&gt; file for further details on their usages and other additional information that we haven’t mentioned in this post here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Valohai - Orchestration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If we have noticed all the above tasks actually was orchestrating the tasks via a few tools at different levels of abstractions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker to manage infrastructure and platform-level configuration and version control management&lt;/li&gt;
&lt;li&gt;java to be able to run our apps on any platform of choice&lt;/li&gt;
&lt;li&gt;shell scripts to be able to again run both building and execution commands in a platform-agnostic manner and also be able to make exceptions for the absence of resources i.e. GPU on MacOSX&lt;/li&gt;
&lt;li&gt;a client tool to connect with the remote cloud service i.e. &lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;Valohai CLI&lt;/a&gt;, and view, control executions and download the end-results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You are basically orchestrating your tasks from a single point making use of the tools and technologies available to do various Data and Machine Learning tasks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z17IE4MA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/660/0%2AR45wYWZ6SPo56jNh" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z17IE4MA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/660/0%2AR45wYWZ6SPo56jNh" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;We have seen that NLP is a resource-consuming task and having the right methods and tools in hands certainly helps. Once again the &lt;a href="https://deeplearning4j.org"&gt;DeepLearning4J&lt;/a&gt; library from &lt;a href="https://Skymind.ai"&gt;Skymind&lt;/a&gt; and the &lt;a href="https://valohai.com"&gt;Valohai&lt;/a&gt; platform have come to our service. Thanks to the creators of both platform. In addition, we can see the below benefits (and more) this post highlights.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;p&gt;We gain a bunch of things by doing the way we did the things above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;not have to worry about hardware and/or software configuration and version control management — &lt;a href="https://hub.docker.com/r/neomatrix369/dl4j-nlp-cuda"&gt;docker containers&lt;/a&gt; FTW&lt;/li&gt;
&lt;li&gt;able to run manual one-off building, training and evaluation tasks — &lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;Valohai CLI&lt;/a&gt; tool FTW&lt;/li&gt;
&lt;li&gt;automate regularly use tasks for your team to be able to run tasks on remote cloud infrastructure — &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/blob/master/valohai.yaml"&gt;infrastructure-as-code&lt;/a&gt; FTW&lt;/li&gt;
&lt;li&gt;overcome the limitations of an old or slow machine or a Mac with no access to the onboard GPU — &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example/tree/master/docker"&gt;CUDA-enabled docker image scripts&lt;/a&gt; FTW&lt;/li&gt;
&lt;li&gt;overcome situations when not enough resources are available on the local or server infrastructure, and still be able to run experiments requiring high-throughput and performant environments — a cloud-provider agnostic platform i.e &lt;a href="https://docs.valohai.com/valohai-cli/using-environments.html?highlight=environment"&gt;Valohai environments&lt;/a&gt; FTW&lt;/li&gt;
&lt;li&gt;run tasks and not have to wait for them to finish and be able to run multiple tasks — concurrently and in-parallel on remote resources in a cost-effective manner — a cloud-provider agnostic platform i.e &lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;Valohai CLI&lt;/a&gt; tool FTW&lt;/li&gt;
&lt;li&gt;remotely view, control both configuration and executions and even download the end-results after a successful execution — a cloud-provider agnostic platform i.e &lt;a href="https://docs.valohai.com/tutorials/quick-start-cli.html?highlight=cli"&gt;Valohai CLI&lt;/a&gt; tool FTW&lt;/li&gt;
&lt;li&gt;and many others you will spot yourself&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Suggestions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;using provided CUDA-enabled docker container:&lt;/strong&gt; highly recommend not to start installing Nvidia drivers or CUDA or cuDNN on your local machine (Linux or Windows-based) — shelve this for later experimentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;use provided shell scripts and configuration files:&lt;/strong&gt; try not to perform manual CLI command instead use shells scripts to automate repeated tasks, provided examples are a good starting point and take it further from there&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;try to learn as much:&lt;/strong&gt; about GPUs, CUDA, cuDNN from resources provided and look for more (see &lt;strong&gt;Resources&lt;/strong&gt; section at the bottom of the post)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;use version control and infrastructure-as-code systems:&lt;/strong&gt; git and the &lt;a href="https://docs.valohai.com/valohai-yaml/index.html"&gt;&lt;strong&gt;valohai.yaml&lt;/strong&gt;&lt;/a&gt; are great examples of this&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a software engineer, ML engineer, data scientist, I felt very productive and my time and resources were effectively used while doing all of the above, and above all I can share it with others and everyone can just reuse all of this work directly - just &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example"&gt;clone the repo&lt;/a&gt; and &lt;em&gt;off you go&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we didn’t cover and is potentially a great topic to talk about, is the&lt;/strong&gt; &lt;a href="https://docs.valohai.com/core-concepts/pipelines.html?highlight=pipeline"&gt;&lt;strong&gt;Valohai Pipelines&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;in some future post!&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example"&gt;dl4j-nlp-cuda-example&lt;/a&gt; project on GitHub&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hub.docker.com/r/neomatrix369/dl4j-nlp-cuda"&gt;CUDA enable docker container&lt;/a&gt; on &lt;a href="https://hub.docker.com"&gt;Docker Hub&lt;/a&gt; (use the latest tag: &lt;a href="https://hub.docker.com/layers/neomatrix369/dl4j-nlp-cuda/v0.5/images/sha256-fcfcc2dcdf00839d918a0c475c39733d777181abb1a3c34d8dea68339369b137"&gt;v0.5&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GPU, Nvidia, CUDA and cuDNN&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;See the &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example#resources"&gt;Resources section&lt;/a&gt; on the &lt;a href="https://github.com/valohai/dl4j-nlp-cuda-example"&gt;github repo&lt;/a&gt;, under &lt;strong&gt;GPU, Nvidia, CUDA and cuDNN&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/"&gt;Awesome AI/ML/DL resources&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/README-details.md#java"&gt;Java AI/ML/DL resources&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/README-details.md#deep-learning"&gt;Deep Learning and DL4J Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Awesome AI/ML/DL:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/natural-language-processing#natural-language-processing-nlp"&gt;NLP resources&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DL4J NLP resources&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-overview"&gt;Language processing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-config-gpu-cpu"&gt;ND4J backends for GPUs and CPUs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-vocabulary-cache"&gt;How the Vocab Cache Works&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-word2vec"&gt;Word2Vec, Doc2vec &amp;amp; GloVe: Neural Word Embeddings for Natural Language Processing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-doc2vec"&gt;Doc2Vec, or Paragraph Vectors, in Deeplearning4j&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-sentence-iterator"&gt;Sentence iterator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nlp-tokenization"&gt;What is Tokenization?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Examples

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/eclipse/deeplearning4j-examples/tree/master/dl4j-examples"&gt;https://github.com/eclipse/deeplearning4j-examples/tree/master/dl4j-examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/eclipse/deeplearning4j/tree/master/deeplearning4j/deeplearning4j-nlp-parent"&gt;https://github.com/eclipse/deeplearning4j/tree/master/deeplearning4j/deeplearning4j-nlp-parent&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Valohai resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.valohai.com/"&gt;valohai&lt;/a&gt; | &lt;a href="https://docs.valohai.com/"&gt;docs&lt;/a&gt; | &lt;a href="https://blogs.valohai.com/"&gt;blogs&lt;/a&gt; | &lt;a href="https://github.com/valohai"&gt;GitHub&lt;/a&gt; | &lt;a href="https://www.youtube.com/channel/UCiR8Fpv6jRNphaZ99PnIuFg/videos"&gt;Videos&lt;/a&gt; | &lt;a href="https://valohai.com/showcase/"&gt;Showcase&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/data/about-Valohai.md#valohai"&gt;About valohai&lt;/a&gt; | &lt;a href="http://community-slack.valohai.com/"&gt;Slack&lt;/a&gt; | &lt;a href="https://twitter.com/@valohaiai"&gt;@valohaiai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.valohai.com/search.html?q=%3Cany+topic%3E"&gt;Search for any topic in the Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Blog posts on how to use the Valohai CLI tool: &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-cli"&gt;[1]&lt;/a&gt; | &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-part-2"&gt;[2]&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.valohai.com/guides/build-docker-image.html"&gt;Custom Docker Images&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal"&gt;Awesome Graal&lt;/a&gt; |  &lt;a href="http://graalvm.org"&gt;graalvm.org&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other related posts&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.valohai.com/how-to-do-deep-learning-for-java-on-the-valohai-platform"&gt;How to do Deep Learning for Java on the Valohai Platform?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Blog posts on how to use the Valohai CLI tool: &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-cli"&gt;[1]&lt;/a&gt; | &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-part-2"&gt;[2]&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Originally published at &lt;a href="https://blog.valohai.com/nlp_with_dl4j_in_java_all_from_the_command-line?from=3oxenia9mtr6"&gt;https://blog.valohai.com&lt;/a&gt;.
&lt;/h3&gt;

</description>
      <category>nlp</category>
      <category>java</category>
      <category>graalvm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Running Apache Zeppelin on the cloud</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Thu, 17 Oct 2019 19:45:43 +0000</pubDate>
      <link>https://dev.to/neomatrix369/running-apache-zeppelin-on-the-cloud-30ke</link>
      <guid>https://dev.to/neomatrix369/running-apache-zeppelin-on-the-cloud-30ke</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iCoKj6m5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1571341116251_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iCoKj6m5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1571341116251_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post is going to be a composition of the practical parts of two posts, one written late last year and the other a couple of months ago respectively. The posts being &lt;a href="https://medium.com/@neomatrix369/apache-zeppelin-stairway-to-notes-haven-28ec413a185a?source=---------6------------------"&gt;Apache Zeppelin: stairway to notes* haven!&lt;/a&gt; (late Dec 2018) and &lt;a href="https://medium.com/@neomatrix369/running-your-jupyter-notebooks-on-the-cloud-ed970326649f?source=---------4------------------"&gt;Running your JuPyTer notebooks on Oracle Cloud Infrastructure&lt;/a&gt; (early September 2019). Although this time we are going to make &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; run on the &lt;a href="http://cloud.oracle.com/"&gt;Oracle Cloud Infrastructure&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will follow a similar structure like in the previous posts for ease of reading and understanding.&lt;/p&gt;

&lt;p&gt;Also for brevity, we will use the term &lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt; when referring to &lt;a href="http://cloud.oracle.com/"&gt;Oracle Cloud Infrastructure&lt;/a&gt; throughout the rest of the post. In some cases, I have hyperlinked and redirected the reader (with a bit of narration) with repeated steps in the post, and in some cases, I have expressed those steps literally in the post adapted to the current theme i.e. &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; on &lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please do not literally use information like DNS or IP addresses or any other details directly from the screenshots or text areas in this post and from the linked ones. These details may differ in your case so please try to follow the ideas and principles behind the process. You should use the details that show up on your console or browser interface when you are setting up at your end, as instructed in the post.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;OCI: get started quickly&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;So to get started we need to have an account on &lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt;, which is super simple to set up. I suggest reading the below sections from the post &lt;a href="https://medium.com/@neomatrix369/running-your-jupyter-notebooks-on-the-cloud-ed970326649f?source=---------4------------------"&gt;Running your JuPyTer notebooks on Oracle Cloud Infrastructure&lt;/a&gt; (provided screenshots to help navigate through the steps):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Signing up&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setup&lt;/strong&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qXu-lZ6l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570975946919_image.png" alt=""&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DJRy2SkW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570975927642_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DJRy2SkW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570975927642_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;****&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4n7R1FkL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570975969054_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4n7R1FkL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570975969054_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GxVnhd5D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570976008247_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GxVnhd5D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570976008247_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;****&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---FlbAV0---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570976025583_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---FlbAV0---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F624BCB7941668D432BA65A86E62FE616B454A753DB2E37C1831424457D6A796_1570976025583_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Actions to get on the cloud&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And we stop the moment we reach the end of the &lt;strong&gt;Actions to get on the cloud&lt;/strong&gt; section. But please ensure you install everything along the way to have to hand the tools you need for the rest of the post. Skip anything that appears &lt;em&gt;Jupyter notebooks&lt;/em&gt; related as we will be setting up &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; next.&lt;/p&gt;

&lt;p&gt;When we have finished the above we are at a good point, as we will have a VM instance accessible from both the browser as well as from the CLI. And we can then do further steps to install &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; and kick-off. Make a note of the &lt;strong&gt;Public IP Address&lt;/strong&gt; of the VM instance created above before proceeding, in my case it is &lt;strong&gt;132.145.60.249&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Zeppelin: get started quickly&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If you already know Zeppelin and feel at home with it, and are confident after skimming through the post: &lt;a href="https://medium.com/@neomatrix369/apache-zeppelin-stairway-to-notes-haven-28ec413a185a?source=---------6------------------"&gt;Apache Zeppelin: stairway to notes* haven!&lt;/a&gt; you can directly go to the next section in the post i.e &lt;strong&gt;Running Apache Zeppelin&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But to gain familiarity with &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; if you haven’t used it in the past, I suggest to slowly go through the post: &lt;a href="https://medium.com/@neomatrix369/apache-zeppelin-stairway-to-notes-haven-28ec413a185a?source=---------6------------------"&gt;Apache Zeppelin: stairway to notes* haven!&lt;/a&gt; and get it to work on your local machine. We will be doing further steps to make it work on the cloud i.e. &lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt;. Just for your information, when the post was written we used Apache Zeppelin 0.8.0, Spark 2.4.3 and ran it on top of GraalVM 1.0.0-rc10, as was bundled in the docker image &lt;a href="https://hub.docker.com/layers/neomatrix369/zeppelin/0.1/images/sha256-0fb412fe5ba7cf69e4cd681786b92cd87f3c73019850238609dce145b0786d51"&gt;neomatrix369/zeppelin:0.1&lt;/a&gt; since then things have moved on. For this post, we have decided to use more recent versions i.e. Apache Zeppelin 0.8.1, Spark 2.4.4 and GraalVM 19.2.0.1 and you can access this via the docker image &lt;a href="https://hub.docker.com/layers/neomatrix369/zeppelin/0.2/images/sha256-d9b7f16c514ddcfe01d758f84251b5b82b1e06ffc4bd58aeed4582545ea5a00f"&gt;neomatrix369/zeppelin:0.2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;I have steered away from Apache Zeppelin 0.8.0 and 0.8.2 for this post as it has introduced new things that cause regression in our workflow, for all intent and purpose of this post we can use Apache Zeppelin 0.8.1. Version 0.8.0 produces&lt;/em&gt; &lt;a href="https://github.com/apache/zeppelin/pull/3206"&gt;&lt;em&gt;this error&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(resolved in version 0.8.1) when we try to run a paragraph with Scala code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Also, if you have already noticed, the Zeppelin world call &lt;em&gt;notebooks&lt;/em&gt; as &lt;em&gt;notes&lt;/em&gt;, &lt;em&gt;cells&lt;/em&gt; as &lt;em&gt;paragraphs&lt;/em&gt; and so on.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Running Apache Zeppelin&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;We will be running &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; on the cloud directly now since we have had the experience of running it on the local machine already. For some of you, this might now be a no-brainer, as the steps are not many and its pretty simple to go about as we have already laid the ground for it. Just to be clear, the same instructions are applicable on a bare-metal or VM instance.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Logging into the VM instance&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You can then &lt;strong&gt;&lt;em&gt;ssh&lt;/em&gt;&lt;/strong&gt; into the box (see &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/accessinginstance.htm?Highlight=ssh"&gt;docs on connecting via ssh&lt;/a&gt;) and proceed with rest of the actions below:&lt;/p&gt;

&lt;p&gt;### Oracle Linux and CentOS images, user name: opc&lt;br&gt;
    ### the Ubuntu image, user name: ubuntu&lt;br&gt;
    $ ssh -i ~/.ssh/id_rsa &lt;a href="mailto:ubuntu@132.145.60.249"&gt;ubuntu@132.145.60.249&lt;/a&gt;&lt;br&gt;
    or&lt;br&gt;
    $ ssh &lt;a href="mailto:ubuntu@132.145.60.249"&gt;ubuntu@132.145.60.249&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and we get the next prompt, to which we answer ‘yes’:&lt;/p&gt;

&lt;p&gt;The authenticity of host '132.145.60.249 (132.145.60.249)' can't be established. &lt;br&gt;
    ECDSA key fingerprint is SHA256:USafjsySmPItXTdBOsQyiYbEdiFSa7Cs1so+9EnKC4M. &lt;br&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;/p&gt;

&lt;p&gt;which is followed by this console — a sign that you are now logged into the VM:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9lRB0tIb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/875/0%2A1EemxavLsIFzN8xH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9lRB0tIb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/875/0%2A1EemxavLsIFzN8xH.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Cloning the git repo&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Now that we are logged in and that we have all the scripts we need at &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin"&gt;https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin&lt;/a&gt;, we can clone it and run them.&lt;/p&gt;

&lt;p&gt;If you haven’t this yet, then please run the below commands:&lt;/p&gt;

&lt;p&gt;$ git clone &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/"&gt;https://github.com/neomatrix369/awesome-ai-ml-dl/&lt;/a&gt;&lt;br&gt;
    $ cd examples/apache-zeppelin&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installing Docker&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The Docker docs for installing Docker on Ubuntu can be found on &lt;a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/"&gt;the Docker site&lt;/a&gt;. A bash-script has also been provided to quicken the process, although the target OS here is Ubuntu 16.04 or higher:&lt;/p&gt;

&lt;p&gt;$ ./installDocker.sh&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;in case you choose another OS image during VM creation, you will have to install Docker manually with the docs from Docker or modify the above script to make it work for the target OS.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Building Apache Zeppelin Docker image (optional)&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Achtung! really sorry, this process can take longer, so please go away and make yourself and others coffee, read&lt;/strong&gt; &lt;a href="https://www.xkcd.com/"&gt;&lt;strong&gt;xkcd&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, watch a comedy and then come back in 15–20 mins or so (depending on your network bandwidth)!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hence we can choose to continue or skip to the next step and use an older version of the docker image.&lt;/p&gt;

&lt;p&gt;We can start by running the build script to build our &lt;a href="https://hub.docker.com/layers/neomatrix369/zeppelin/0.2/images/sha256-d9b7f16c514ddcfe01d758f84251b5b82b1e06ffc4bd58aeed4582545ea5a00f"&gt;latest Zeppelin Docker&lt;/a&gt; container:&lt;/p&gt;

&lt;p&gt;$ DOCKER_USER_NAME= IMAGE_VERSION=0.2 ./buildZeppelinDockerImage.sh&lt;/p&gt;

&lt;p&gt;and we see these messages flying by:&lt;/p&gt;

&lt;p&gt;Sending build context to Docker daemon  34.82kB&lt;br&gt;
    Step 1/21 : ARG ZEPPELIN_VERSION&lt;br&gt;
    Step 2/21 : FROM apache/zeppelin:${ZEPPELIN_VERSION}&lt;br&gt;
    ---&amp;gt; 353d7641c769&lt;br&gt;
    Step 3/21 : ARG SPARK_VERSION&lt;br&gt;
    ---&amp;gt; Using cache&lt;br&gt;
    ---&amp;gt; 2ca1b6703dd7&lt;br&gt;
    Step 4/21 : ENV SPARK_VERSION=${SPARK_VERSION:-2.4.3}&lt;br&gt;
    ---&amp;gt; Using cache&lt;br&gt;
    ---&amp;gt; f507d31d0aca&lt;br&gt;
    Step 5/21 : RUN echo "$LOG_TAG Download Spark binary" &amp;amp;&amp;amp;     wget -O /tmp/spark-${SPARK_VERSION}-bin-hadoop2.7.tgz &lt;a href="http://archive.apache.org/dist/spark/spark-%24%7BSPARK_VERSION%7D/spark-%24%7BSPARK_VERSION%7D-bin-hadoop2.7.tgz"&gt;http://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop2.7.tgz&lt;/a&gt;&lt;br&gt;
    ---&amp;gt; Running in c94542e7eb00&lt;br&gt;
    [ZEPPELIN_0.8.1]: Download Spark binary&lt;br&gt;
    --2019-10-13 19:55:16--  &lt;a href="http://archive.apache.org/dist/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz"&gt;http://archive.apache.org/dist/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz&lt;/a&gt;&lt;br&gt;
    Saving to: ‘/tmp/spark-2.4.4-bin-hadoop2.7.tgz’&lt;br&gt;
    [--snipped--]&lt;br&gt;
    213350K .......... .......... .......... .......... .......... 94% 51.4K 3m0s&lt;br&gt;
    213400K .......... .......... .......... .......... .......... 94% 88.1K 2m59s&lt;br&gt;
    213450K .......... .......... .......... .......... .......... 95% 58.7K 2m59s&lt;br&gt;
    213500K .......... .......... .......... .......... .......... 95% 45.5K 2m58s&lt;br&gt;
    213550K .......... .......... .......... .......... .......... 95% 4.40M 2m57s&lt;br&gt;
    213600K .......... .......... .......... .......... .......... 95% 83.8K 2m56s&lt;br&gt;
    213650K .......... .......... .......... .......... .......... 95% 91.9K 2m55s&lt;br&gt;
    213700K .......... .......... .......... .......... .......... 95% 67.2K 2m55s&lt;br&gt;
    213750K .......... .......... .......... .......... .......... 95%  166K 2m54s&lt;br&gt;
    213800K .......... .......... .......... .......... .......... 95% 79.8K 2m53s&lt;br&gt;
    [--snipped--]&lt;br&gt;
    Step 21/21 : CMD ["bin/zeppelin.sh"]&lt;br&gt;
    ---&amp;gt; Running in 843684f60302&lt;br&gt;
    Removing intermediate container 843684f60302&lt;br&gt;
    ---&amp;gt; 5833f13ff7c7&lt;br&gt;
    Successfully built 5833f13ff7c7&lt;br&gt;
    Successfully tagged neomatrix369/zeppelin:0.2&lt;/p&gt;

&lt;p&gt;You have noticed, we have a few changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;amendments made to Zeppelin-Dockerfile)&lt;/li&gt;
&lt;li&gt;the build and run scripts also looks different (buildZeppelinDockerImage.sh and runZeppelinDockerImage.sh)&lt;/li&gt;
&lt;li&gt;and we are also using to 0.2 see CLI usages in the post&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope all of this starts to make sense (I gave hints when we said things have moved on…).&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Pushing the Docker Image to Docker Hub (optional)&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Once we have a successfully built the docker image containing Apache Zeppelin from the above step we can easily upload the image from our local repository to the remote one via:&lt;/p&gt;

&lt;p&gt;$ DOCKER_USER_NAME= IMAGE_VERSION=0.2 ./push-apache-zeppelin-docker-image-to-hub.sh&lt;/p&gt;

&lt;p&gt;Although take note that it expects a couple of things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an account on Docker Hub (i.e. &lt;a href="https://hub.docker.com/u/neomatrix369"&gt;neomatrix369&lt;/a&gt;) — &lt;em&gt;of course, your own account&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;you are logged into your Docker Hub account locally&lt;/li&gt;
&lt;li&gt;you have set up the DOCKER_USER_NAME with your Docker hub account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Otherwise you will get error messages, hopefully, they will guide you through till you upload it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;in our case, we have access to the docker image on Docker hub, see&lt;/em&gt; &lt;a href="https://hub.docker.com/r/neomatrix369/zeppelin"&gt;&lt;em&gt;neomatrix369/zeppelin on Docker Hub&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Running Apache Zeppelin from the Docker Image&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;We will download the already created images hosted on Docker Hub:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version 0.1 (Apache Zeppelin 0.8.0, Spark 2.4.3, GraalVM 1.0.0-rc10) — older image&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;$ docker pull neomatrix369/zeppelin:0.1&lt;br&gt;
    $ ./runZeppelinDockerContainer.sh&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version 0.2 (Apache Zeppelin 0.8.1, Spark 2.4.4, GraalVM 19.2.0.1) — new image&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;$ docker pull neomatrix369/zeppelin:0.2&lt;br&gt;
    $ IMAGE_VERSION=0.2 ./runZeppelinDockerContainer.sh&lt;/p&gt;

&lt;p&gt;the above commands should result in the output:&lt;/p&gt;

&lt;p&gt;ubuntu@instance-20191014-0101:~/awesome-ai-ml-dl/examples/apache-zeppelin$ IMAGE_VERSION=0.2 ./runZeppelinDockerContainer.sh&lt;br&gt;
    Please wait till the log messages stop moving, it will be a sign that the service is ready! (about a minute or so)&lt;br&gt;
    Once the service is ready, go to &lt;a href="http://localhost:8080"&gt;http://localhost:8080&lt;/a&gt; to open the Apache Zeppelin homepage&lt;br&gt;
    Pid dir doesn't exist, create /zeppelin/run&lt;br&gt;
    OpenJDK GraalVM CE 19.0.0 warning: ignoring option MaxPermSize=512m; support was removed in 8.0&lt;br&gt;
    SLF4J: Class path contains multiple SLF4J bindings.&lt;br&gt;
    SLF4J: Found binding in [jar:file:/zeppelin/lib/interpreter/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]&lt;br&gt;
    SLF4J: Found binding in [jar:file:/zeppelin/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]&lt;br&gt;
    SLF4J: See &lt;a href="http://www.slf4j.org/codes.html#multiple_bindings"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/a&gt; for an explanation.&lt;br&gt;
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]&lt;br&gt;
    [---snipped---]&lt;br&gt;
    WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.zeppelin.rest.CredentialRestApi.getCredentials(java.lang.String) throws java.io.IOException,java.lang.IllegalArgumentException, should not consume any entity.&lt;br&gt;
    WARNING: The (sub)resource method createNote in org.apache.zeppelin.rest.NotebookRestApi contains empty path annotation.&lt;br&gt;
    WARNING: The (sub)resource method getNoteList in org.apache.zeppelin.rest.NotebookRestApi contains empty path annotation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Opening the Apache Zeppelin notes in your browser&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Go to the browser and try to open this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://132.145.60.249:8080"&gt;http://132.145.60.249:8080&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But this won’t work because we haven’t opened up the port 8080 from within our cloud network (via &lt;strong&gt;Ingress Rules,&lt;/strong&gt; read more about it &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm?Highlight=egress"&gt;here&lt;/a&gt;) to the outside world (public):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xD0zijnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2An8zo_AES9IwHJGOh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xD0zijnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2An8zo_AES9IwHJGOh.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We would need to add the above entry to the &lt;strong&gt;Ingress Rules&lt;/strong&gt; section, you can get to &lt;strong&gt;Ingress Rules&lt;/strong&gt; page via the navigation menu: &lt;strong&gt;Networking&lt;/strong&gt; &amp;gt; &lt;strong&gt;Virtual Cloud Networks&lt;/strong&gt; &amp;gt; &lt;strong&gt;Virtual Cloud Network Details&lt;/strong&gt; &lt;em&gt;(by clicking on a VCN entry)&lt;/em&gt; &amp;gt; &lt;strong&gt;Security Lists,&lt;/strong&gt; which brings you to the page with the &lt;strong&gt;Default Security Lists&lt;/strong&gt;. *&lt;strong&gt;*On clicking the Security List that corresponds to your **Virtual Cloud Network (VCN)&lt;/strong&gt; you will land on the above &lt;strong&gt;Ingress Rules&lt;/strong&gt; page.&lt;/p&gt;

&lt;p&gt;In case, you are still not able to find it, search for the term &lt;strong&gt;&lt;em&gt;security&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;using the search facility on any page in the Cloud Console (see the magnifying glass 🔍at the top of the page). This will show you all the **Default Security Lists&lt;/strong&gt; and clicking on it will bring you to the &lt;strong&gt;Ingress Rules&lt;/strong&gt; page above (you might have just one Security List entry). &lt;strong&gt;&lt;em&gt;Note: Ingress means traffic coming into the network/VM instance.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why port 8080, that’s because we set it up like that in the docker scripts, have a look at the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin#apache-zeppelin--"&gt;sources&lt;/a&gt; to find out why and how.&lt;/p&gt;

&lt;p&gt;Having done all of the above: voila! We see the &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; startup page in the browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y6-rmco---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AKgMaDrIt107dUpVb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y6-rmco---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AKgMaDrIt107dUpVb.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Using Apache Zeppelin notes&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Take a look at the section &lt;strong&gt;Importing a note&lt;/strong&gt; in &lt;a href="https://medium.com/@neomatrix369/apache-zeppelin-stairway-to-notes-haven-28ec413a185a?source=---------6------------------"&gt;Apache Zeppelin: stairway to notes* haven!&lt;/a&gt; this section onwards you can see how to import existing notes and execute them. Once we import and open a &lt;em&gt;note&lt;/em&gt;, and run it, it would look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n_nkuj_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1407/0%2AU8xjozZ3PYdvcTlt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n_nkuj_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1407/0%2AU8xjozZ3PYdvcTlt.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Importing this note also creates a &lt;em&gt;“notes.json”&lt;/em&gt; file in the &lt;em&gt;~/awesome-ai-ml-dl/examples/apache-zeppelin/notebook&lt;/em&gt; folder of the VM instance.&lt;/p&gt;

&lt;p&gt;Further examples can be found on &lt;a href="https://github.com/dylanmei/docker-zeppelin"&gt;https://github.com/dylanmei/docker-zeppelin&lt;/a&gt;, although these would need additional installation and configuration to the &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; build.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Create a custom image for reuse&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;As we have been able to successfully run &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; from inside a VM instance, we can save this image for future re-use or share with others. Before doing that, I would delete the &lt;strong&gt;&lt;em&gt;logs&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;notebook&lt;/em&gt;&lt;/strong&gt; folders from the &lt;em&gt;~/awesome-ai-ml-dl/examples/apache-zeppelin&lt;/em&gt; of the VM instance.&lt;/p&gt;

&lt;p&gt;Creating an image of the VM instance can be done via &lt;strong&gt;Compute&amp;gt; Instances &amp;gt; Instance Details&lt;/strong&gt; the navigation menu, and Create Custom Image from the Actions drop-down menu:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JPDpXjuT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AHUsKbtETaEfCds5P.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JPDpXjuT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AHUsKbtETaEfCds5P.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7q9eA3wL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/701/0%2AIjnhYApjwAmPsuvc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7q9eA3wL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/701/0%2AIjnhYApjwAmPsuvc.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;whilst in the process of creating a custom image, your original VM instance is shut-down. This can take under a couple of minutes to complete depending on the size of the original VM instance.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When successfully created, it becomes available among the list of Custom Images to choose from, the next time we go to create a new VM instance:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7y5o-oc3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AjTbBXaxX7we3N2RN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7y5o-oc3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1408/0%2AjTbBXaxX7we3N2RN.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Power-user&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If all of this was piece of cake for you or you have survived without much hassle, then try out all the deep-dive stuff mentioned in the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#jupyter"&gt;README page here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To be able to code in other JVM languages in the &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; environment all you need is additional extensions — it’s only a matter of installing and configuring. You can learn all about them &lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/manual/interpreters.html"&gt;here&lt;/a&gt;, you can see you can also code in Python on &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt;. Find out how you can write your &lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/development/writingzeppelininterpreter.html"&gt;own interpreters for Apache Zeppelin&lt;/a&gt;. Both the notebook and interpreters can be accessed via &lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/rest-api/rest-notebook.html"&gt;Notebook API&lt;/a&gt; and &lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/rest-api/rest-interpreter.html"&gt;Interpreter API&lt;/a&gt; respectively.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Signing off&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;[--snipped--]&lt;br&gt;
    Oct 14, 2019 1:02:40 AM org.glassfish.jersey.internal.Errors logErrors&lt;br&gt;
    WARNING: The following warnings have been detected: WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.zeppelin.rest.InterpreterRestApi.listInterpreter(java.lang.String), should not consume any entity.&lt;br&gt;
    WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.zeppelin.rest.CredentialRestApi.getCredentials(java.lang.String) throws java.io.IOException,java.lang.IllegalArgumentException, should not consume any entity.&lt;br&gt;
    WARNING: The (sub)resource method createNote in org.apache.zeppelin.rest.NotebookRestApi contains empty path annotation.&lt;br&gt;
    WARNING: The (sub)resource method getNoteList in org.apache.zeppelin.rest.NotebookRestApi contains empty path annotation.&lt;br&gt;
    &lt;sup&gt;C&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;In case, you have created a note, it gets saved in the sub-directory called (apache zeppelin directory), you can retrieve this using &lt;strong&gt;&lt;em&gt;scp&lt;/em&gt;&lt;/strong&gt; from your local machine (see &lt;a href="https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/"&gt;here&lt;/a&gt; on how to do that).&lt;/p&gt;

&lt;p&gt;Make sure you have &lt;strong&gt;&lt;em&gt;signed out of both&lt;/em&gt;&lt;/strong&gt; the &lt;a href="http://oracle.com/"&gt;oracle.com&lt;/a&gt; and &lt;a href="http://cloud.oracle.com/"&gt;cloud.oracle.com&lt;/a&gt; login sessions, it’s easy to forget one or the other. But before doing that please also have a look at the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/terminating_resources.htm"&gt;Cleaning up of resources&lt;/a&gt; page in the docs — you don’t want your instance running forever while you are not looking at it!&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XBvWcNaT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1100/0%2A0MJQb42w8rQfEZQ0" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XBvWcNaT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1100/0%2A0MJQb42w8rQfEZQ0" alt=""&gt;&lt;/a&gt; After doing this, it looks like a no brainer to run a notebook service i.e. &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; on a cloud provider like &lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt; (&lt;a href="http://cloud.oracle.com/"&gt;Oracle Cloud Infrastructure&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;In effect, if we summarise the conclusions of the two posts, &lt;a href="https://medium.com/@neomatrix369/apache-zeppelin-stairway-to-notes-haven-28ec413a185a?source=---------6------------------"&gt;Apache Zeppelin: stairway to notes* haven!&lt;/a&gt; and &lt;a href="https://medium.com/@neomatrix369/running-your-jupyter-notebooks-on-the-cloud-ed970326649f?source=---------4------------------"&gt;Running your JuPyTer notebooks on Oracle Cloud Infrastructure&lt;/a&gt; we will more or less say:&lt;/p&gt;

&lt;p&gt;Apache Zeppelin gives us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;similar flexibility as Jupyter notebooks, and allows extending functionality via configurations and extensions&lt;/li&gt;
&lt;li&gt;execution progress per paragraph (per cell) is always displayed (in real-time) unlike Jupyter notebooks&lt;/li&gt;
&lt;li&gt;lazy execution to help efficiency&lt;/li&gt;
&lt;li&gt;round-trip navigability between table data and visualisation in the cell (paragraph)&lt;/li&gt;
&lt;li&gt;execution may appear a bit slower than Jupyter notebooks at times&lt;/li&gt;
&lt;li&gt;but there are solutions to speed this up (for future posts to cover)&lt;/li&gt;
&lt;li&gt;all-in-all a great place for Java/JVM developers to feel at home and do ML experiments on the JVM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://cloud.oracle.com/"&gt;OCI&lt;/a&gt; gives us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an easy-to-use cloud environment&lt;/li&gt;
&lt;li&gt;quickly set up our environment to get to market with our apps and solutions we want to bring to market quick&lt;/li&gt;
&lt;li&gt;enables us to run &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; (natively or via Docker image)&lt;/li&gt;
&lt;li&gt;instances that can be shared publicly or privately depending on your network security settings&lt;/li&gt;
&lt;li&gt;provides ways to secure your infrastructure on the cloud (we didn’t cover it with much depth here), but please check out the docs on &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Security/Concepts/security.htm"&gt;Security on the OCI docs page&lt;/a&gt; to learn more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Please keep an eye on this space, and share your comments, feedback or any contributions which will help us all learn and grow to&lt;/em&gt;&lt;/strong&gt; &lt;a href="http://twitter.com/@theNeomatrix369"&gt;&lt;strong&gt;&lt;em&gt;@theNeomatrix369&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;,&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;you can find more about me via the&lt;/em&gt;&lt;/strong&gt; *&lt;strong&gt;&lt;em&gt;[&lt;/em&gt;&lt;/strong&gt;About me page*&lt;strong&gt;](&lt;a href="http://neomatrix369.worpress.com/aboutme"&gt;http://neomatrix369.worpress.com/aboutme&lt;/a&gt;)&lt;/strong&gt;&lt;em&gt;.&lt;/em&gt;**&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apache Zeppelin&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/docs/0.6.0/development/writingzeppelininterpreter.html"&gt;an interpreter for that thing has been provided&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/download.html"&gt;Download page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apache Zeppelin: &lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/install.html"&gt;Quick Start page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/explore_ui.html"&gt;Exploring Zeppelin UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://issues.apache.org/jira/browse/ZEPPELIN-3586"&gt;https://issues.apache.org/jira/browse/ZEPPELIN-3586&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/conker84/4ffc9a2f0125c808b4dfcf3b7d70b043#file-zeppelin-dockerfile"&gt;https://gist.github.com/conker84/4ffc9a2f0125c808b4dfcf3b7d70b043#file-zeppelin-dockerfile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin"&gt;https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/development/writingzeppelininterpreter.html"&gt;Write your own interpreters for Apache Zeppelin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/rest-api/rest-notebook.html"&gt;Notebook API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeppelin.apache.org/docs/0.5.6-incubating/rest-api/rest-interpreter.html"&gt;Interpreter API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Examples to try&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dylanmei/docker-zeppelin"&gt;https://github.com/dylanmei/docker-zeppelin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mmatloka/machine-learning-by-example-workshop"&gt;https://github.com/mmatloka/machine-learning-by-example-workshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/mmatloka/machine-learning-by-example-workshop/master/Workshop.json"&gt;https://raw.githubusercontent.com/mmatloka/machine-learning-by-example-workshop/master/Workshop.json&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Docker&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/signup"&gt;Docker Hub signup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/"&gt;Install Docker on Ubuntu 16.04 or higher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples/apache-zeppelin/buildZeppelinDockerImage.sh"&gt;Bash Script to build Docker container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.javaadvent.com/2018/12/apache-zeppelin-stairway-to-notes-haven.html"&gt;&lt;em&gt;https://github.com/dylanmei/docker-zeppelin&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;OCI/Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Concepts/baremetalintro.htm"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Reference/overviewworkflow.htm"&gt;Tutorial to setup a VM instance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliinstall.htm"&gt;Install CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm?Highlight=CLI"&gt;CLI docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/terminating_resources.htm"&gt;Cleaning up of resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/accessinginstance.htm?Highlight=ssh"&gt;Docs on connecting via ssh to OCI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;New Sign-in: &lt;a href="https://cloud.oracle.com/en_US/sign-in"&gt;https://cloud.oracle.com/en_US/sign-in&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Traditional Sign-in: &lt;a href="https://myaccount.cloud.oracle.com/"&gt;https://myaccount.cloud.oracle.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/contactingsupport.htm"&gt;Contact Support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/devtoolshome.htm?tocpath=Developer%20Tools%20%7C_____0"&gt;Developer Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/home.htm"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloudcustomerconnect.oracle.com/resources/9c8fa8f96f/summary"&gt;Oracle Cloud Community Forum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.oracle.com/en_US/cloud-compliance"&gt;Oracle Cloud Compliance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blogs.oracle.com/cloud-infrastructure/"&gt;Oracle Cloud Infrastructure Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm?Highlight=egress"&gt;Security Rules / Ingress Rules&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Security/Concepts/security.htm"&gt;OCI Security docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apachezeppelin</category>
      <category>java</category>
      <category>graalvm</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Running your JuPyTeR notebooks on the cloud</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Thu, 12 Sep 2019 20:55:57 +0000</pubDate>
      <link>https://dev.to/neomatrix369/running-your-jupyter-notebooks-on-the-cloud-36pf</link>
      <guid>https://dev.to/neomatrix369/running-your-jupyter-notebooks-on-the-cloud-36pf</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;On the back of my previous share on how to &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#jupyter" rel="noopener noreferrer"&gt;build and run a docker container with Jupyter&lt;/a&gt;, I’ll be taking this further on how we can make this run on a cloud platform.&lt;/p&gt;

&lt;p&gt;We’ll try to do this on &lt;a href="http://cloud.oracle.com/" rel="noopener noreferrer"&gt;Oracle Cloud Infrastructure (OCI)&lt;/a&gt;. In theory, we should be able to do everything in the blog on any VM or Baremetal instance. If you are new to Oracle Cloud, I would suggest getting familiar with the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Concepts/baremetalintro.htm" rel="noopener noreferrer"&gt;docs&lt;/a&gt; and &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Concepts/baremetalintro.htm" rel="noopener noreferrer"&gt;Getting Started&lt;/a&gt; sections of the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Concepts/baremetalintro.htm" rel="noopener noreferrer"&gt;docs&lt;/a&gt;. You will also find several informative links at the bottom of this post, in the &lt;strong&gt;Resources&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;I found the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Reference/overviewworkflow.htm" rel="noopener noreferrer"&gt;tutorial to setup a VM instance&lt;/a&gt; simple and useful — I recommend having a glance and following the steps. Take note of the pre-requisites before actually getting downing to creating a VM instance and &lt;strong&gt;&lt;em&gt;ssh&lt;/em&gt;&lt;/strong&gt;-ing into it — it will involve Creating Compartments, Subnets, Security Lists, among other things before you can create a VM.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Signing up&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You will have noticed you have to have an account to be able to get access to the Cloud Dashboard and proceed.&lt;/p&gt;

&lt;p&gt;You can sign up by going to &lt;a href="http://oracle.com/" rel="noopener noreferrer"&gt;oracle.com&lt;/a&gt; and also to &lt;a href="https://myservices.us.oraclecloud.com/mycloud/signup?sourceType=_ref_coc-asset-opcSignIn&amp;amp;language=en" rel="noopener noreferrer"&gt;cloud.oracle.com&lt;/a&gt; — recommend signing up via these portals. You might even be eligible for &lt;strong&gt;FREE&lt;/strong&gt; credits once you do that (enough to spend your weekend running your favourite instances).&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Setup&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Dashboard — sign-in&lt;/strong&gt;&lt;br&gt;
Once you are signed up, you sign-in via &lt;a href="https://cloud.oracle.com/sign-in" rel="noopener noreferrer"&gt;cloud.oracle.com/sign-in&lt;/a&gt; which will take you to a page like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AbmsehoRRIZ3BXe5F.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AbmsehoRRIZ3BXe5F.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the instructions as described in the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Reference/overviewworkflow.htm" rel="noopener noreferrer"&gt;tutorial to setup a VM instance&lt;/a&gt;and give your VM and other resources names (use initials as a prefix) you can identify easily. This will kick off the request to create the VM (if all your entries are valid) — and in less than 15 seconds you should have a VM ready to be used.&lt;/p&gt;

&lt;p&gt;Once the VM instance is created, make a note of the &lt;strong&gt;Public IP Address&lt;/strong&gt; of the instance. All running VMs can be found on by going to the &lt;strong&gt;Compute &amp;gt; Instance&lt;/strong&gt; on the navigation menu on the left:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1081%2F0%2Ag0NsbLE6B-oy_Pva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1081%2F0%2Ag0NsbLE6B-oy_Pva.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the running VM by clicking it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2AfSnyOupmBeemvNPVWMMFgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2AfSnyOupmBeemvNPVWMMFgw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;which will take you to the VM details page, where you can spot the &lt;strong&gt;Public IP Address&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2AoBRoXojahvyHq11qL3XIxQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2AoBRoXojahvyHq11qL3XIxQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: the Public IP Address will be different for every VM created, the above is temporary.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OCI can be accessed with a command-line tool called &lt;strong&gt;oci-cli&lt;/strong&gt; which can be &lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliinstall.htm" rel="noopener noreferrer"&gt;installed by following instructions&lt;/a&gt; mention in the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm?Highlight=CLI" rel="noopener noreferrer"&gt;CLI docs&lt;/a&gt;. Once installed the command to invoke it is called &lt;strong&gt;oci&lt;/strong&gt; and you can invoke it by doing the below:&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;strong&gt;Actions to get on the cloud&lt;/strong&gt;
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ oci --help
    Usage: oci [OPTIONS] COMMAND [ARGS]...
    Oracle Cloud Infrastructure command line interface, with support for
    Audit, Block Volume, Compute, Database, IAM, Load Balancing, 
Networking, DNS, File Storage, Email Delivery and Object Storage 
Services.
    Most commands must specify a service, followed by a resource type 
and then an action. For example, to list users (where $T contains the 
OCID of the current tenant):

    oci iam user list --compartment-id $T

    Output is in JSON format.

    For information on configuration, see
    https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm.

    Options:
    &amp;lt;-- snipped --&amp;gt;

    Commands:
    &amp;lt;-- snipped --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As such we won’t need the dashboard for the most part here onwards. We will also NOT be covering the use of the CLI tool in this post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logging into the VM instance&lt;/strong&gt;&lt;br&gt;
You can then &lt;strong&gt;&lt;em&gt;ssh&lt;/em&gt;&lt;/strong&gt; into the box (see &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/accessinginstance.htm?Highlight=ssh" rel="noopener noreferrer"&gt;docs on connecting via ssh&lt;/a&gt;) and proceed with rest of the actions below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="c"&gt;### Oracle Linux and CentOS images, user name: opc&lt;/span&gt;
    &lt;span class="c"&gt;### the Ubuntu image, user name: ubuntu&lt;/span&gt;
    &lt;span class="nv"&gt;$ &lt;/span&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/id_rsa ubuntu@132.145.78.136
    or
    &lt;span class="nv"&gt;$ &lt;/span&gt;ssh ubuntu@132.145.78.136
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Installing git&lt;/strong&gt;&lt;br&gt;
For this blog post, we selected the &lt;strong&gt;Canonical Ubuntu Linux&lt;/strong&gt; (&lt;em&gt;Canonical-Ubuntu-16.04–2019.08.14–0&lt;/em&gt;) as our OS image, which comes with &lt;strong&gt;&lt;em&gt;apt-get&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;git&lt;/em&gt;&lt;/strong&gt; installed so we don’t need to do anything there.&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;strong&gt;Running Jupyter Notebooks&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Cloning our repo&lt;/strong&gt;&lt;br&gt;
We can clone our repo and perform the rest of the steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/neomatrix369/awesome-ai-ml-dl
    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;awesome-ai-ml-dl/examples/JuPyteR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Installing Docker&lt;/strong&gt;&lt;br&gt;
The Docker docs for installing Docker on Ubuntu can be found on &lt;a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/" rel="noopener noreferrer"&gt;the Docker site&lt;/a&gt;. A bash-script has also been provided to quicken the process, although the target OS here is Ubuntu 16.04 or higher:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;build-docker-image
    &lt;span class="nv"&gt;$ &lt;/span&gt;./installDocker.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;in case you choose another OS image during VM creation, you will have to install Docker manually with the docs from Docker or modify the above script to make it work for the target OS.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building the Jupyter Docker Image&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;build-docker-image
    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./buildDockerImage.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;In this specific environment, we need to pass the&lt;/em&gt; &lt;strong&gt;&lt;em&gt;sudo&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;keyword before every docker command. You may not have to do that in your local environment or elsewhere.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the Jupyter notebook as a Docker container&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;back into the project root folder]
    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./runDockerContainer.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show you a console like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &amp;lt;&lt;span class="nt"&gt;---&lt;/span&gt; snipped &lt;span class="nt"&gt;---&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    OpenJDK Runtime Environment &lt;span class="o"&gt;(&lt;/span&gt;build 9.0.4+11&lt;span class="o"&gt;)&lt;/span&gt;
    OpenJDK 64-Bit Server VM &lt;span class="o"&gt;(&lt;/span&gt;build 9.0.4+11, mixed mode&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/jupyter/.local/bin:/opt/java/openjdk/bin:/usr/local/sbin:/usr
/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    ~~~ JDK9, Linux only: We are enabling JVMCI flags &lt;span class="o"&gt;(&lt;/span&gt;enabling Graal as 
Tier-2 compiler&lt;span class="o"&gt;)&lt;/span&gt; ~~~
    ~~~ Graal setting: please check docs &lt;span class="k"&gt;for &lt;/span&gt;higher versions of Java and 
&lt;span class="k"&gt;for &lt;/span&gt;other platforms ~~~
    &lt;span class="nv"&gt;JAVA_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-XX&lt;/span&gt;:+UnlockExperimentalVMOptions &lt;span class="nt"&gt;-XX&lt;/span&gt;:+EnableJVMCI 
&lt;span class="nt"&gt;-XX&lt;/span&gt;:+UseJVMCICompiler
    &lt;span class="nv"&gt;JAVA_TOOL_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-XX&lt;/span&gt;:+UnlockExperimentalVMOptions 
&lt;span class="nt"&gt;-XX&lt;/span&gt;:+UseCGroupMemoryLimitForHeap &lt;span class="nt"&gt;-XX&lt;/span&gt;:+UnlockExperimentalVMOptions 
&lt;span class="nt"&gt;-XX&lt;/span&gt;:+EnableJVMCI &lt;span class="nt"&gt;-XX&lt;/span&gt;:+UseJVMCICompiler
    Available kernels:
      python2    /home/jupyter/.local/share/jupyter/kernels/python2
      java       /usr/share/jupyter/kernels/java
    &lt;span class="o"&gt;[&lt;/span&gt;I 13:39:35.993 NotebookApp] Writing notebook server cookie secret 
to /home/jupyter/.local/share/jupyter/runtime/notebook_cookie_secret
    &lt;span class="o"&gt;[&lt;/span&gt;I 13:39:36.293 NotebookApp] Serving notebooks from &lt;span class="nb"&gt;local &lt;/span&gt;directory: 
/home/jupyter
    &lt;span class="o"&gt;[&lt;/span&gt;I 13:39:36.294 NotebookApp] The Jupyter Notebook is running at:
    &lt;span class="o"&gt;[&lt;/span&gt;I 13:39:36.295 NotebookApp] http://&lt;span class="o"&gt;(&lt;/span&gt;81dde8675279 or 
127.0.0.1&lt;span class="o"&gt;)&lt;/span&gt;:8888/?token&lt;span class="o"&gt;=&lt;/span&gt;bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48
    &lt;span class="o"&gt;[&lt;/span&gt;I 13:39:36.297 NotebookApp] Use Control-C to stop this server and 
shut down all kernels &lt;span class="o"&gt;(&lt;/span&gt;twice to skip confirmation&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;C 13:39:36.310 NotebookApp]
    To access the notebook, open this file &lt;span class="k"&gt;in &lt;/span&gt;a browser:
            file:///home/jupyter/.local/share/jupyter/runtime/nbserver-
28-open.html
        Or copy and &lt;span class="nb"&gt;paste &lt;/span&gt;one of these URLs:
            http://&lt;span class="o"&gt;(&lt;/span&gt;81dde8675279 or 127.0.0.1&lt;span class="o"&gt;)&lt;/span&gt;:8888/?
&lt;span class="nv"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make a note of the URL, and replace the &lt;em&gt;127.0.0.1&lt;/em&gt; with your &lt;strong&gt;Public IP Address&lt;/strong&gt; i.e. &lt;em&gt;132.145.78.136&lt;/em&gt;.&lt;br&gt;
You can also see from the above logs we are using Java 9 (built on the &lt;a href="http://adoptopenjdk.net/" rel="noopener noreferrer"&gt;AdoptOpenJDK&lt;/a&gt; farm) and enabling the &lt;a href="https://github.com/oracle/graal/blob/master/compiler/README.md" rel="noopener noreferrer"&gt;GraalVM compiler&lt;/a&gt; as HotSpot’s &lt;a href="http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html" rel="noopener noreferrer"&gt;C2 compiler&lt;/a&gt; (see &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples/JuPyteR/README.md#switches-to-enable-the-graalvm-compiler-in-java-9" rel="noopener noreferrer"&gt;Switches to enable the GraalVM compiler in Java 9&lt;/a&gt; to enabled the &lt;a href="https://github.com/oracle/graal/blob/master/compiler/README.md" rel="noopener noreferrer"&gt;GraalVM compiler&lt;/a&gt;). It’s also because the &lt;a href="https://github.com/SpencerPark/IJava" rel="noopener noreferrer"&gt;Java extension for Jupyter&lt;/a&gt;requires Java 9 or higher to work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Opening the Jupyter notebook in your browser&lt;/strong&gt;&lt;br&gt;
Go to the browser and try to open this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    http://132.145.78.136:8888/?token&lt;span class="o"&gt;=&lt;/span&gt;bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aargh! It does NOT work!&lt;br&gt;
That is because we haven’t opened up the port 8888 from within our cloud network (via &lt;strong&gt;Ingress Rules,&lt;/strong&gt; read more about it &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm?Highlight=egress" rel="noopener noreferrer"&gt;here&lt;/a&gt;) to the outside world (public):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1388%2F0%2A40xrtw73GvkKkIgK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1388%2F0%2A40xrtw73GvkKkIgK.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We would need to add the above entry to the &lt;strong&gt;Ingress Rules&lt;/strong&gt; section, you can get to &lt;strong&gt;Ingress Rules&lt;/strong&gt; page via the navigation menu: &lt;strong&gt;Networking&lt;/strong&gt; &amp;gt; &lt;strong&gt;Virtual Cloud Networks&lt;/strong&gt; &amp;gt; &lt;strong&gt;Virtual Cloud Network Details&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security Lists,&lt;/strong&gt; which brings you to the page with the &lt;strong&gt;Default Security Lists&lt;/strong&gt;. *&lt;strong&gt;*On clicking the Security List that corresponds to your **Virtual Cloud Network (VCN)&lt;/strong&gt; you will land on the above &lt;strong&gt;Ingress Rules&lt;/strong&gt; page.&lt;/p&gt;

&lt;p&gt;In case, you are still not able to find it, search for the term &lt;strong&gt;&lt;em&gt;security&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;using the search facility on any page in the Cloud Console (see the magnifying glass 🔍at the top of the page). This will show you all the **Default Security Lists&lt;/strong&gt; and clicking on it will bring you to the &lt;strong&gt;Ingress Rules&lt;/strong&gt; page above (you might have just one Security List entry). &lt;strong&gt;&lt;em&gt;Note: Ingress means traffic coming into the network/VM instance.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why port 8888, that’s because we set it up like that in the docker scripts, have a look at the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#jupyter" rel="noopener noreferrer"&gt;sources&lt;/a&gt; to find out why and how.&lt;/p&gt;

&lt;p&gt;Having done all of the above: voila! We see the Jupyter startup page in the browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F33%2F0%2AiMaX8fhr3Kd_Jdrp.png%3Fq%3D20" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F33%2F0%2AiMaX8fhr3Kd_Jdrp.png%3Fq%3D20"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AiMaX8fhr3Kd_Jdrp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AiMaX8fhr3Kd_Jdrp.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you can see a Java-based notebook is available to play with! Try out the below by creating a new Java notebook in the browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1274%2F0%2ArquvjgoX8Ra1QT0K.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1274%2F0%2ArquvjgoX8Ra1QT0K.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ligee/kotlin-jupyter/raw/master/samples/ScreenShotInJupyter.png" rel="noopener noreferrer"&gt;https://github.com/ligee/kotlin-jupyter/raw/master/samples/ScreenShotInJupyter.png&lt;/a&gt;&lt;br&gt;
You are free to create Python notebooks as well, not just Java ones — this is the beauty of Jupyter notebooks.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installing Jupyter on a bare-metal or VM environment&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;For brevity, we didn’t cover this aspect, but if you look at the scripts associated with building and running the Jupyter instance, you will see that the docker build scripts build and run the instance with the help of individual scripts that can be executed on its own in this order:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd build-docker-image
$ [install Java 9 SDK and set the PATH and JAVA_HOME]
$ ./install-jupyter-notebooks.sh
$ ./install-java-kernel.sh
$ ./runLocal.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you want to see how this would work, run the above scripts in the local environment of the instance, the rest of the instructions should work as expected.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Create custom image for reuse&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;As we have been able to successfully run Jupyter Notebook from inside a VM instance, we can save this image for future re-use or share with others. Creating an image of the VM instance can be done via &lt;strong&gt;Compute&amp;gt; Instances &amp;gt; Instance Details&lt;/strong&gt; the navigation menu, and Create Custom Image from the Actions drop-down menu:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2Am0c2CNpEQ4DBVE8mP6If4Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2Am0c2CNpEQ4DBVE8mP6If4Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F713%2F1%2AzhaCtQeh4_h4IICLqRKRyw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F713%2F1%2AzhaCtQeh4_h4IICLqRKRyw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;whilst in the process of creating a custom image, your original VM instance is shut-down. This can take under a couple of minutes to complete depending on the size of the original VM instance.&lt;/em&gt;&lt;br&gt;
When successfully created, it becomes available among the list of Custom Images to choose from, the next time we go to create a new VM instance:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2Awaim__0FsC1ApNoRnqwj8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F1%2Awaim__0FsC1ApNoRnqwj8w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Power-user&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If all of this was piece of cake for you or you have survived without much hassle, then try out all the deep-dive stuff mentioned in the &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#jupyter" rel="noopener noreferrer"&gt;README page here&lt;/a&gt;.&lt;br&gt;
To be able to code in other languages in the Jupyter environment all you need is a Jupyter extension — it’s only a matter of installing and configuring. You can learn all about this &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#get-started-manual-steps-via-cli" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Signing off&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AgRwXOOQ8q2TtHmnO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1408%2F0%2AgRwXOOQ8q2TtHmnO.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case you have created a notebook, it gets saved in the sub-directory called &lt;em&gt;jupyter/notebooks&lt;/em&gt;, you can retrieve this using &lt;strong&gt;&lt;em&gt;scp&lt;/em&gt;&lt;/strong&gt; from your local machine (see &lt;a href="https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/" rel="noopener noreferrer"&gt;here&lt;/a&gt; on how to do that).&lt;br&gt;
Make sure you have &lt;strong&gt;&lt;em&gt;signed out of both&lt;/em&gt;&lt;/strong&gt; the &lt;a href="http://oracle.com/" rel="noopener noreferrer"&gt;oracle.com&lt;/a&gt; and &lt;a href="http://cloud.oracle.com/" rel="noopener noreferrer"&gt;cloud.oracle.com&lt;/a&gt; login sessions, it’s easy to forget one or the other. But before doing that please also have a look at the &lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/terminating_resources.htm" rel="noopener noreferrer"&gt;Cleaning up of resources&lt;/a&gt;page in the docs — you don’t want your instance running forever while you are not looking at it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_E4A05684460F7D532506C16E09E20D37F6AFF25A9B5381BF1A442679901C1AD7_1568321451272_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropbox.com%2Fs_E4A05684460F7D532506C16E09E20D37F6AFF25A9B5381BF1A442679901C1AD7_1568321451272_image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;A good set of scripts (including Docker) and an easy-to-use cloud environment can help in many ways. In this case, enabling us to run a Jupyter notebook instance that can be shared publicly or privately depending on your network security settings.&lt;/p&gt;

&lt;p&gt;The Jupyter environment is flexible and allows extending functionality via configurations and extensions.&lt;/p&gt;

&lt;p&gt;We didn’t cover things like cloud security and partitioning of user instances — which is sort of out of scope for this post. Please look into this further, if they are important to you. Please do ensure it meets the necessary levels of security for your application or use-case. Check out the docs on &lt;a href="https://docs.cloud.oracle.com/iaas/Content/Security/Concepts/security.htm" rel="noopener noreferrer"&gt;Security on the OCI docs page&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;General&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/JuPyteR#jupyter" rel="noopener noreferrer"&gt;Build and run a docker container with Jupyter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal" rel="noopener noreferrer"&gt;Awesome Graal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl" rel="noopener noreferrer"&gt;Awesome AI-ML-DL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Docker&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/signup" rel="noopener noreferrer"&gt;Docker Hub signup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/" rel="noopener noreferrer"&gt;Install Docker on Ubuntu 16.04 or higher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/examples/JuPyteR/buildJuPyteRDockerImage.sh" rel="noopener noreferrer"&gt;Bash Script to build Docker container&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;OCI/Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Concepts/baremetalintro.htm" rel="noopener noreferrer"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Reference/overviewworkflow.htm" rel="noopener noreferrer"&gt;Tutorial to setup a VM instance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliinstall.htm" rel="noopener noreferrer"&gt;Install CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm?Highlight=CLI" rel="noopener noreferrer"&gt;CLI docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/terminating_resources.htm" rel="noopener noreferrer"&gt;Cleaning up of resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/accessinginstance.htm?Highlight=ssh" rel="noopener noreferrer"&gt;Docs on connecting via ssh to OCI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;New Sign-in: &lt;a href="https://cloud.oracle.com/en_US/sign-in" rel="noopener noreferrer"&gt;https://cloud.oracle.com/en_US/sign-in&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Traditional Sign-in: &lt;a href="https://myaccount.cloud.oracle.com/" rel="noopener noreferrer"&gt;https://myaccount.cloud.oracle.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/contactingsupport.htm" rel="noopener noreferrer"&gt;Contact Support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/devtoolshome.htm?tocpath=Developer%20Tools%20%7C_____0" rel="noopener noreferrer"&gt;Developer Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/home.htm" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloudcustomerconnect.oracle.com/resources/9c8fa8f96f/summary" rel="noopener noreferrer"&gt;Oracle Cloud Community Forum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.oracle.com/en_US/cloud-compliance" rel="noopener noreferrer"&gt;Oracle Cloud Compliance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blogs.oracle.com/cloud-infrastructure/" rel="noopener noreferrer"&gt;Oracle Cloud Infrastructure Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm?Highlight=egress" rel="noopener noreferrer"&gt;Security Rules / Ingress Rules&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.oracle.com/iaas/Content/Security/Concepts/security.htm" rel="noopener noreferrer"&gt;OCI Security docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369" rel="noopener noreferrer"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>jupyternotebooks</category>
      <category>java</category>
      <category>graalvm</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How to do Deep Learning for Java? </title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Sun, 08 Sep 2019 17:37:37 +0000</pubDate>
      <link>https://dev.to/neomatrix369/how-to-do-deep-learning-for-java-3f04</link>
      <guid>https://dev.to/neomatrix369/how-to-do-deep-learning-for-java-3f04</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Some time ago I came across this life-cycle management tool (or cloud service) called &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; and I was quite impressed by its user-interface and simplicity of design and layout. I had a good chat about the service at that time with one of the members of &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; and was given a demo. Previous to that I had written a simple pipeline using &lt;a href="https://www.gnu.org/software/parallel/"&gt;GNU Parallel&lt;/a&gt;, JavaScript, Python and Bash - and another one purely using &lt;a href="https://www.gnu.org/software/parallel/"&gt;GNU Parallel&lt;/a&gt;, and Bash. I also thought about replacing the moving parts with ready-to-use task/workflow management tools like Jenkins X, Jenkins Pipeline, Concourse or Airflow but due to various reasons, I did not proceed with the idea.&lt;/p&gt;

&lt;p&gt;Coming back to our original conversation, I noticed a lot of the examples and docs on &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; were based on Python and R and the respective frameworks and libraries. There was a lack of Java/JVM based examples or docs. So I took this opportunity to do something about that.&lt;/p&gt;

&lt;p&gt;I was encouraged by &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; to implement something using the famous Java library called &lt;a href="https://deeplearning4j.org/"&gt;&lt;strong&gt;DL4J&lt;/strong&gt;&lt;/a&gt; &lt;a href="https://deeplearning4j.org/"&gt;-&lt;/a&gt; &lt;a href="https://deeplearning4j.org/"&gt;&lt;strong&gt;Deep Learning for Java&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My initial experience with &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; already gave me a good impression after getting an understanding of its design, layout and workflow. That it was developer-friendly and the makers already took into consideration various facets of both developer and infrastructure workflows. In our worlds, the latter is mostly run by DevOps or SysOps teams and we know the nuances and pain-points attached to it. You can find out more about its features from the &lt;a href="https://valohai.com/features/"&gt;Features section&lt;/a&gt; of the site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Achtung!&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;Just to let you know that from here onwards the post will be a bit more technical and may contain code snippets and mention of deep learning/machine learning and infrastructure-related terminologies.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What do we need and how?
&lt;/h1&gt;

&lt;p&gt;For any machine learning or deep learning project or initiative, these days the two important components (from a high-level perspective) are code that will create and serve the model and infrastructure where this whole life-cycle will be executed.&lt;/p&gt;

&lt;p&gt;Of course, there are going to be steps and components needed before, during and after the above mentioned but to keep things simple let’s say we need code and infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
For code I have chosen a modified example using DL4J, it’s an &lt;a href="https://en.wikipedia.org/wiki/MNIST_database"&gt;MNist project&lt;/a&gt; with a training set of 60,000 images and test set of 10,000 images of hand-written digits. This dataset is available via the DL4J library (just like &lt;a href="https://keras.io/"&gt;Keras&lt;/a&gt; provides a stock of them). Look for the &lt;a href="https://github.com/eclipse/deeplearning4j/blob/master/deeplearning4j/deeplearning4j-data/deeplearning4j-datasets/src/main/java/org/deeplearning4j/datasets/iterator/impl/MnistDataSetIterator.java"&gt;&lt;strong&gt;MnistDataSetIterator&lt;/strong&gt;&lt;/a&gt; under &lt;a href="https://github.com/eclipse/deeplearning4j/blob/master/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/DataSetIterator.java"&gt;&lt;strong&gt;DatasetIterators&lt;/strong&gt;&lt;/a&gt; in the &lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-cheat-sheet"&gt;DL4J Cheatsheet&lt;/a&gt; for further details on this particular dataset.&lt;/p&gt;

&lt;p&gt;Have a look at the source code we will be using before getting started, the main Java class is called &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/src/main/java/org/deeplearning4j/feedforward/mnist/MLPMnistSingleLayerRunner.java"&gt;&lt;strong&gt;org.deeplearning4j.feedforward.mnist.MLPMnistSingleLayerRunner&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Infrastructure&lt;/strong&gt;&lt;br&gt;
As it is obvious by now, we have decided to try out the Java example using &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; as our infrastructure to run our experiments (training and evaluation of the model). &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; recognizes git repositories and directly hooks into them and allows Execution of our code, irrespective of platform or language - we will see how this works. This also means if you are a strong supporter of &lt;em&gt;GitOps&lt;/em&gt; or &lt;em&gt;Infrastructure-As-Code&lt;/em&gt; you will appreciate the workflow. &lt;/p&gt;

&lt;p&gt;For this we just need an account on &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt;, we can avail a &lt;a href="https://valohai.com/pricing/"&gt;Free-tier account&lt;/a&gt; and have access to several instances of various configurations when we &lt;a href="https://app.valohai.com/accounts/signup/"&gt;sign up&lt;/a&gt;. See Free-tier under &lt;a href="https://valohai.com/pricing/"&gt;Plans and Pricing&lt;/a&gt; and the comparison chart for more details. For what we would like to do, the Free-tier is more than enough for now.&lt;/p&gt;
&lt;h1&gt;
  
  
  Deep Learning for Java and Valohai
&lt;/h1&gt;

&lt;p&gt;As we agreed, we're going to use these two technologies to achieve our goal of training a single layer model and evaluating it, as well as seeing what the end-to-end experience is like on &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will bundle the necessary build and run-time dependencies into the Docker image and use it to build our Java app, train a model and evaluate it on the &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; platform via a simple &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/valohai.yaml"&gt;valohai.yaml&lt;/a&gt; file which is placed in the root folder of the project repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  Deep Learning for Java: DL4J
&lt;/h2&gt;

&lt;p&gt;The easy part is, we won’t need to do much here, just build the jar and download the dataset into the Docker container. We have a pre-built Docker image that contains all the dependencies needed to build a Java app. We have pushed this image into &lt;a href="https://hub.docker.com/"&gt;Docker Hub&lt;/a&gt;, you can find it by searching for &lt;a href="https://hub.docker.com/r/neomatrix369/dl4j-mnist-single-layer"&gt;dl4j-mnist-single-layer&lt;/a&gt; (we will be using a specific tag as defined in the YAML file). We have chosen to use &lt;a href="https://github.com/oracle/graal"&gt;GraalVM 19.1.1&lt;/a&gt; as our Java build and runtime for this project, and so it is embedded into the Docker image (see &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/Dockerfile"&gt;Dockerfile&lt;/a&gt; for the definition of the Docker image). To learn more about GraalVM check out the resources at the official site of &lt;a href="http://graalvm.org"&gt;graalvm.org&lt;/a&gt; and &lt;a href="https://github.com/neomatrix369/awesome-graal"&gt;Awesome Graal&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orchestration&lt;/strong&gt;&lt;br&gt;
When the uber jar is invoked from the command-line, we land into the &lt;code&gt;MLPMnistSingleLayerRunner&lt;/code&gt; class which directs us to the intended action depending on the parameters passed in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;MLPMnistSingleLayerRunner&lt;/span&gt; &lt;span class="n"&gt;mlpMnistRunner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MLPMnistSingleLayerRunner&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="nc"&gt;JCommander&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newBuilder&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addObject&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mlpMnistRunner&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parse&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;mlpMnistRunner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;execute&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The parameters passed into the uber jar are received by this class and handled by the &lt;code&gt;execute()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;We can create a model via the &lt;code&gt;--&lt;/code&gt;&lt;code&gt;action train&lt;/code&gt; parameter and evaluate the created model via the &lt;code&gt;--action evaluate&lt;/code&gt;  parameter respectively passed to the Java app (uber jar). &lt;/p&gt;

&lt;p&gt;The main parts of the Java app that does this work can be found in the two Java classes mentioned in the sections below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Train a model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can be invoked from the command-line via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    ./runMLPMnist.sh &lt;span class="nt"&gt;--action&lt;/span&gt; train &lt;span class="nt"&gt;--output-dir&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;VH_OUTPUTS_DIR&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;

    or

    java &lt;span class="nt"&gt;-Djava&lt;/span&gt;.library.path&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;             &lt;span class="se"&gt;\&lt;/span&gt;
         &lt;span class="nt"&gt;-jar&lt;/span&gt; target/MLPMnist-1.0.0-bin.jar &lt;span class="se"&gt;\&lt;/span&gt;
         &lt;span class="nt"&gt;--action&lt;/span&gt; train &lt;span class="nt"&gt;--output-dir&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;VH_OUTPUTS_DIR&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This creates the model (when successful, at the end of the Execution) by the name &lt;code&gt;mlpmnist-single-layer.pb&lt;/code&gt; in the folder specified by the &lt;code&gt;--output-dir&lt;/code&gt; passed in at the beginning of the Execution. From the perspective of &lt;a href="http://www.valohai.com"&gt;Valohai&lt;/a&gt;, it should be placed into the ${VH_OUTPUTS_DIR} which is what we do (see &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/valohai.yaml"&gt;valohai.yaml&lt;/a&gt; file).&lt;/p&gt;

&lt;p&gt;For source code, see class &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/src/main/java/org/deeplearning4j/feedforward/mnist/MLPMnistSingleLayerTrain.java"&gt;MLPMNistSingleLayerTrain.java&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evaluate a model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can be invoked from the command-line via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    ./runMLPMnist.sh &lt;span class="nt"&gt;--action&lt;/span&gt; evaluate &lt;span class="nt"&gt;--input-dir&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;VH_INPUTS_DIR&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/model

    or

    java &lt;span class="nt"&gt;-Djava&lt;/span&gt;.library.path&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;             &lt;span class="se"&gt;\&lt;/span&gt;
         &lt;span class="nt"&gt;-jar&lt;/span&gt; target/MLPMnist-1.0.0-bin.jar &lt;span class="se"&gt;\&lt;/span&gt;
         &lt;span class="nt"&gt;--action&lt;/span&gt; evaluate &lt;span class="nt"&gt;--input-dir&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;VH_INPUTS_DIR&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/model
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This expects a model (created by the training step) by the name &lt;code&gt;mlpmnist-single-layer.pb&lt;/code&gt; to be present in the folder specified by the &lt;code&gt;--input-dir&lt;/code&gt; passed in when the app has been called.&lt;/p&gt;

&lt;p&gt;For source code, see class &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/src/main/java/org/deeplearning4j/feedforward/mnist/MLPMnistSingleLayerEvaluate.java"&gt;MLPMNistSingleLayerEvaluate.java&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope this short illustration makes it clear how the Java app that trains and evaluates the model works in general.&lt;/p&gt;

&lt;p&gt;That’s all is needed of us, but feel free to play with the rest of the &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example"&gt;source&lt;/a&gt; (along with the &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/README.md"&gt;README.md&lt;/a&gt; and bash scripts) and satisfy your curiosity and understanding on how this is done! Further resources on how to go about with DL4J has been provided in the &lt;strong&gt;Resources&lt;/strong&gt; section at the end of the post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Valohai
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.valohai.com"&gt;Valohai&lt;/a&gt; as a platform allows us to loosely couple our runtime environment, our code, and our dataset, as you can see from the structure of the YAML file below. That way the different components can evolve independently without impeding or being dependent on one another. Hence our Docker container only has the build and runtime time components packed into it. At Execution time we build the uber jar in the Docker container, upload it to some internal or external storage, and then via another Execution step download the uber jar and dataset from storage (or another location) to run the training. This way the two execution steps are decoupled; we can e.g. build the jar once and run hundreds of training steps on the same jar. As the build and runtime environments should not change that often we can cache them and the code, dataset and model sources can be made dynamically available during Execution time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.valohai.com/valohai-yaml/index.html"&gt;&lt;strong&gt;valohai.yaml&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
The heart of integrating our Java project with the Valohai infrastructure is defining the steps of &lt;a href="https://docs.valohai.com/core-concepts/executions.html"&gt;Execution&lt;/a&gt; of the steps in the &lt;a href="https://docs.valohai.com/valohai-yaml/index.html"&gt;&lt;strong&gt;valohai.yaml&lt;/strong&gt;&lt;/a&gt; file placed in the root of your project folder. Our &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/valohai.yaml"&gt;valohai.yaml&lt;/a&gt; looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="s"&gt;---&lt;/span&gt;

    &lt;span class="s"&gt;- step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build-dl4j-mnist-single-layer-java-app&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;neomatrix369/dl4j-mnist-single-layer:v0.5&lt;/span&gt;
        &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cd ${VH_REPOSITORY_DIR}&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./buildUberJar.sh&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Copying the build jar file into ${VH_OUTPUTS_DIR}"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cp target/MLPMnist-1.0.0-bin.jar ${VH_OUTPUTS_DIR}/MLPMnist-1.0.0.jar&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ls -lash ${VH_OUTPUTS_DIR}&lt;/span&gt;
        &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aws-eu-west-1-g2-2xlarge&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run-dl4j-mnist-single-layer-train-model&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;neomatrix369/dl4j-mnist-single-layer:v0.5&lt;/span&gt;
        &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Unpack the MNist dataset into ${HOME} folder"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tar xvzf ${VH_INPUTS_DIR}/dataset/mlp-mnist-dataset.tgz -C ${HOME}&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cd ${VH_REPOSITORY_DIR}&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Copying the build jar file from ${VH_INPUTS_DIR} to current location"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cp ${VH_INPUTS_DIR}/dl4j-java-app/MLPMnist-1.0.0.jar .&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Run the DL4J app to train model based on the the MNist dataset"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./runMLPMnist.sh {parameters}&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dl4j-java-app&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DL4J Java app file (jar) generated in the previous step 'Build-dl4j-mnist-single-layer-java-app'&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dataset&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/neomatrix369/awesome-ai-ml-dl/releases/download/mnist-dataset-v0.1/mlp-mnist-dataset.tgz&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;MNist dataset needed to train the model&lt;/span&gt;
        &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--action&lt;/span&gt;
            &lt;span class="na"&gt;pass-as&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--action&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{v}'&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;train&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Action to perform i.e. train or evaluate&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--output-dir&lt;/span&gt;
            &lt;span class="na"&gt;pass-as&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--output-dir&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{v}'&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/valohai/outputs/&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Output directory where the model will be created, best to pick the Valohai output directory&lt;/span&gt;
        &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aws-eu-west-1-g2-2xlarge&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run-dl4j-mnist-single-layer-evaluate-model&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;neomatrix369/dl4j-mnist-single-layer:v0.5&lt;/span&gt;
        &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cd ${VH_REPOSITORY_DIR}&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Copying the build jar file from ${VH_INPUTS_DIR} to current location"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cp ${VH_INPUTS_DIR}/dl4j-java-app/MLPMnist-1.0.0.jar .&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;echo "~~~ Run the DL4J app to evaluate the trained MNist model"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./runMLPMnist.sh {parameters}&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dl4j-java-app&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DL4J Java app file (jar) generated in the previous step 'Build-dl4j-mnist-single-layer-java-app'&lt;/span&gt;    
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;model&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Model file generated in the previous step 'Run-dl4j-mnist-single-layer-train-model'&lt;/span&gt;
        &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--action&lt;/span&gt;
            &lt;span class="na"&gt;pass-as&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--action&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{v}'&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;evaluate&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Action to perform i.e. train or evaluate&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--input-dir&lt;/span&gt;
            &lt;span class="na"&gt;pass-as&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--input-dir&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{v}'&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/valohai/inputs/model&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Input directory where the model created by the previous step can be found created&lt;/span&gt;
        &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aws-eu-west-1-g2-2xlarge&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Explanation of the step&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Build-dl4j-mnist-single-layer-java-app&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
From the YAML file, we can see that we define this step by first using the Docker image and then run the build script to build the uber jar. Our docker image has the build environment dependencies setup (i.e. GraalVM JDK, Maven, etc…) to build a Java app. We do not specify any inputs or parameters as this is the build step. Once the build will be successful we want to copy the uber jar called &lt;code&gt;MLPMnist-1.0.0-bin.jar&lt;/code&gt;  (original name) to the &lt;code&gt;/valohai/outputs&lt;/code&gt; folder (represented by &lt;code&gt;${VH_OUTPUTS_DIR}&lt;/code&gt;). Everything within this folder automatically gets persisted within your project’s storage, e.g. an AWS S3 bucket. Finally, we define our job to run in the AWS environment. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;The Valohai free tier&lt;/em&gt; *do&lt;/strong&gt;es* &lt;em&gt;not have network access from inside the Docker container (this is disabled by default), please contact support to enable this option (I had to do the same), or else we cannot download our Maven and other dependencies during build time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Explanation of the step&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Run-dl4j-mnist-single-layer-train-model&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
The semantics of the definition is similar to the previous step except we specify two inputs one for the uber jar (&lt;code&gt;MLPMnist-1.0.0.jar&lt;/code&gt;) and the other for the dataset (to be unpacked into &lt;code&gt;${HOME}/.deeplearning4j&lt;/code&gt; folder).  We will be passing the two parameters &lt;code&gt;--action train&lt;/code&gt; and &lt;code&gt;--output-dir /valohai/outputs&lt;/code&gt;.  The model created from this step is collected into the &lt;code&gt;/valohai/outputs/model&lt;/code&gt; folder (represented by &lt;code&gt;${VH_OUTPUTS_DIR}/model&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: In the Input fields in the Execution tab&lt;/em&gt; &lt;em&gt;of the Valohai Web UI&lt;/em&gt;&lt;em&gt;, we can select the outputs from previous Executions by using the Execution number i.e.&lt;/em&gt; &lt;code&gt;*#1*&lt;/code&gt; &lt;em&gt;or&lt;/em&gt; &lt;code&gt;*#2*&lt;/code&gt; &lt;em&gt;, in addition to using datum:// or http:// URLs. Typing in the few letters of the name of the file also helps search through the whole list.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Explanation of the step&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Run-dl4j-mnist-single-layer-evaluate-model&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Again, this step is similar to the previous step, except that we will be passing in the two parameters &lt;code&gt;--action evaluate&lt;/code&gt; and &lt;code&gt;--input-dir /valohai/inputs/model&lt;/code&gt;. Also, we have again specified two  &lt;code&gt;inputs:&lt;/code&gt; sections defined in the YAML file called &lt;code&gt;dl4j-java-app&lt;/code&gt;  and  &lt;code&gt;model&lt;/code&gt; with no &lt;code&gt;default&lt;/code&gt;  set for both of them. This will allow us to select the uber jar and the model we wish to evaluate - that was created by the &lt;em&gt;step&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Run-dl4j-mnist-single-layer-train-model&lt;/em&gt;&lt;/strong&gt;, using the web interface. &lt;/p&gt;

&lt;p&gt;Hope this explains the steps in the above definition file but if you require further help, please do not hesitate to look at the &lt;a href="https://docs.valohai.com/index.html"&gt;docs&lt;/a&gt; and &lt;a href="https://docs.valohai.com/tutorials/index.html"&gt;tutorials&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.valohai.com/accounts/login/"&gt;&lt;strong&gt;valohai web interface&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we have an account, we can &lt;a href="https://app.valohai.com/accounts/login/"&gt;sign-in&lt;/a&gt; and continue with creating a project by the name &lt;code&gt;mlpmnist-single-layer&lt;/code&gt;  and link the git repo &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/"&gt;https://github.com/valohai/mlpmnist-dl4j-example/&lt;/a&gt; to the project and save the project,  have a quick look at the tutorials to see &lt;a href="https://docs.valohai.com/tutorials/index.html"&gt;how to create a project using the web interface&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Now you can execute a step and see how it pans out!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building the DL4J Java app step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to the &lt;strong&gt;Executions&lt;/strong&gt; tab in the web interface, either copy an existing or create a new execution using the &lt;strong&gt;[Create execution]&lt;/strong&gt; button, all the necessary default options will be populated, select Step &lt;strong&gt;&lt;em&gt;Build-dl4j-mnist-single-layer-java-app&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;For &lt;em&gt;Environment&lt;/em&gt; I would select &lt;em&gt;AWS eu-west-1 g2.2xlarge&lt;/em&gt; and click on the &lt;strong&gt;&lt;em&gt;[Create execution]&lt;/em&gt;&lt;/strong&gt; button at the bottom of the page, to see the Execution kick-off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RqqLquMW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1401/0%2A7t0fjo-_p-Doo09u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RqqLquMW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1401/0%2A7t0fjo-_p-Doo09u.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Training the model step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to the &lt;strong&gt;Execution&lt;/strong&gt; tab in the web interface, and do the same as the previous step and select Step &lt;strong&gt;&lt;em&gt;Run-dl4j-mnist-single-layer-train-model&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;.&lt;/em&gt; You will have to select the Java app (just type &lt;em&gt;jar&lt;/em&gt; in the field) built in the previous step, the dataset has already been pre-populated via the &lt;strong&gt;&lt;em&gt;valohai.yaml&lt;/em&gt;&lt;/strong&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I5MFSgkK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1342/0%2ACyy14Lb8JSfJZrdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I5MFSgkK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1342/0%2ACyy14Lb8JSfJZrdz.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;&lt;em&gt;[Create execution]&lt;/em&gt;&lt;/strong&gt; to kick off this step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---WYWWVJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1399/0%2AA8BZUz7_k5MG371Y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---WYWWVJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1399/0%2AA8BZUz7_k5MG371Y.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see the model summary fly by in the log console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [&amp;lt;--- snipped ---&amp;gt;]
    11:17:05 =========================================================================
    11:17:05 LayerName (LayerType) nIn,nOut TotalParams ParamsShape
    11:17:05 =========================================================================
    11:17:05 layer0 (DenseLayer) 784,1000 785000 W:{784,1000}, b:{1,1000}
    11:17:05 layer1 (OutputLayer) 1000,10 10010 W:{1000,10}, b:{1,10}
    11:17:05 -------------------------------------------------------------------------
    11:17:05  Total Parameters: 795010
    11:17:05  Trainable Parameters: 795010
    11:17:05  Frozen Parameters: 0
    11:17:05 =========================================================================
    [&amp;lt;--- snipped ---&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The models created can be found under the &lt;strong&gt;Outputs&lt;/strong&gt; sub-tab in the &lt;strong&gt;Executions&lt;/strong&gt; main tab, during and at the end of the Execution:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BOymwmlg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1398/0%2AMgtDO7qLplEnTAVS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BOymwmlg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1398/0%2AMgtDO7qLplEnTAVS.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might have noticed several artifacts in the &lt;strong&gt;Outputs&lt;/strong&gt; sub-tab. That’s because we save a checkpoint at the end of each epoch! Look out for these in the Execution logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [&amp;lt;--- snipped ---&amp;gt;]
    11:17:14 o.d.o.l.CheckpointListener - Model checkpoint saved: epoch 0, iteration 469, path: /valohai/outputs/checkpoint_0_MultiLayerNetwork.zip
    [&amp;lt;--- snipped ---&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The checkpoint zip contains the state of the model training at that point, saved in three of these files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    configuration.json
    coefficients.bin
    updaterState.bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Training the model &amp;gt; Metadata&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might have noticed these notations fly by in the Execution logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [&amp;lt;--- snipped ---&amp;gt;]
    11:17:05 {"epoch": 0, "iteration": 0, "score (loss function)": 2.410047}
    11:17:07 {"epoch": 0, "iteration": 100, "score (loss function)": 0.613774}
    11:17:09 {"epoch": 0, "iteration": 200, "score (loss function)": 0.528494}
    11:17:11 {"epoch": 0, "iteration": 300, "score (loss function)": 0.400291}
    11:17:13 {"epoch": 0, "iteration": 400, "score (loss function)": 0.357800}
    11:17:14 o.d.o.l.CheckpointListener - Model checkpoint saved: epoch 0, iteration 469, path: /valohai/outputs/checkpoint_0_MultiLayerNetwork.zip
    [&amp;lt;--- snipped ---&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;These notations trigger &lt;a href="https://www.valohai.com"&gt;Valohai&lt;/a&gt; to pick up these values (in JSON format) to be used to plot Execution metrics, which can be seen during and after the Execution under the &lt;strong&gt;Metadata&lt;/strong&gt; sub-tab in the &lt;strong&gt;Executions&lt;/strong&gt; main tab:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N-9Kry8G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1396/0%2ASwM_Lc3efuH7h_9P.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N-9Kry8G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1396/0%2ASwM_Lc3efuH7h_9P.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We were able to do this by hooking a listener class (called &lt;a href="https://github.com/valohai/mlpmnist-dl4j-example/blob/master/src/main/java/org/deeplearning4j/feedforward/mnist/ValohaiMetadataCreator.java"&gt;ValohaiMetadataCreator&lt;/a&gt;) into the model, such that during training attention is passed on to this listener class at the end of each iteration. In the case of this class, we print the &lt;strong&gt;&lt;em&gt;epoch count&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;iteration count&lt;/em&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;em&gt;the score (the loss function value),&lt;/em&gt;&lt;/strong&gt; here is a code snippet from the class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;iterationDone&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Model&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;iteration&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;epoch&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;printIterations&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;printIterations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iteration&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;printIterations&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;score&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                        &lt;span class="s"&gt;"{\"epoch\": %d, \"iteration\": %d, \"score (loss function)\": %f}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;epoch&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;iteration&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Evaluating the model step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the model has been successfully created via the previous step, we are ready to evaluate it. We create a new Execution just like we did previously but this time select the &lt;strong&gt;&lt;em&gt;Run-dl4j-mnist-single-layer-evaluate-model&lt;/em&gt;&lt;/strong&gt; step. We will need to select the Java app (&lt;strong&gt;&lt;em&gt;MLPMnist-1.0.0.jar&lt;/em&gt;&lt;/strong&gt;) again and the created model (&lt;strong&gt;&lt;em&gt;mlpmnist-single-layer.pb&lt;/em&gt;&lt;/strong&gt;) before kicking off the Execution (as shown below):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3BeJBPuk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1397/0%2AX9kILtQUEgZtY-91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3BeJBPuk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1397/0%2AX9kILtQUEgZtY-91.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting the desired model as input, click on the &lt;strong&gt;&lt;em&gt;[Create execution]&lt;/em&gt;&lt;/strong&gt; button. It is a quicker Execution step than the previous one and we will see the following output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YpXu4hRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1340/0%2Aazaua3UlAyVkPSPX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YpXu4hRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1340/0%2Aazaua3UlAyVkPSPX.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;Evaluation Metrics&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Confusion Matrix&lt;/em&gt;&lt;/strong&gt; post model analysis will be displayed in the console logs. &lt;/p&gt;

&lt;p&gt;We can see our training activity has resulted in the model that is near &lt;strong&gt;97%&lt;/strong&gt; accurate based on the test dataset. The confusion matrix helps point out the instances a digit has been incorrectly predicted as another digit. Maybe this is good feedback to the creator of the model and maintainer of the dataset to do some further investigations.&lt;/p&gt;

&lt;p&gt;The question remains (and is outside the scope of this post) — how good is the model when faced with &lt;strong&gt;&lt;em&gt;real-world data&lt;/em&gt;&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.valohai.com/valohai-cli/installation.html?highlight=cli"&gt;&lt;strong&gt;valohai CLI&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
It’s easy to install and get started with the CLI tool, see &lt;a href="https://docs.valohai.com/valohai-cli/installation.html?highlight=cli"&gt;Command-line Usage&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you haven’t yet cloned the git repository then here’s what to do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/valohai/mlpmnist-dl4j-example/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We then need to link our Valohai project created via the web interface in the above section to the project stored on our local machine (the one we just cloned).  Run the below commands to do that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;mlpmnist-dl4j-example
    &lt;span class="nv"&gt;$ &lt;/span&gt;vh project &lt;span class="nt"&gt;--help&lt;/span&gt;   &lt;span class="c"&gt;### to see all the project-specific options we have for Valohai&lt;/span&gt;
    &lt;span class="nv"&gt;$ &lt;/span&gt;vh project &lt;span class="nb"&gt;link&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You will be shown something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [  1] mlpmnist-single-layer
    ...
    Which project would you like to link with /path/to/mlpmnist-dl4j-example?
    Enter [n] to create a new project.:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Select 1 (or the selection appropriate for you) and you should see this message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    😁  Success! Linked /path/to/mlpmnist-dl4j-example to mlpmnist-single-layer.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The quickest way to know of all the CLI options with the CLI tool is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;vh &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;One more thing, before going any further ensure that your &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; project is in sync with the latest git project, by doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;vh project fetch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o-ej-MzR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1407/0%2A9b0OmE6SelZXsvZ6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o-ej-MzR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1407/0%2A9b0OmE6SelZXsvZ6.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(on the top right side in your web interface, shown with the two-arrows-pointing-to-each-other icon).&lt;/p&gt;

&lt;p&gt;Now we can execute the steps from the CLI with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;vh &lt;span class="nb"&gt;exec &lt;/span&gt;run Build-dl4j-mnist-single-layer-java-app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once the Execution is on, we can inspect and monitor it via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;vh &lt;span class="nb"&gt;exec &lt;/span&gt;info
    &lt;span class="nv"&gt;$ &lt;/span&gt;vh &lt;span class="nb"&gt;exec &lt;/span&gt;logs
    &lt;span class="nv"&gt;$ &lt;/span&gt;vh &lt;span class="nb"&gt;exec &lt;/span&gt;watch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We can also see the above updates via the web interface at the same time.&lt;/p&gt;

&lt;p&gt;Further resources on how to use &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; has been provided in the &lt;strong&gt;Resources&lt;/strong&gt; section at the end of the post, there are a couple of blog posts on how to use the CLI tool, see &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-cli"&gt;[1]&lt;/a&gt; | &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-part-2"&gt;[2]&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;As you have seen both &lt;a href="https://deeplearning4j.org"&gt;DL4J&lt;/a&gt; and &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt; individually or combined are fairly easy to get started with. Further, we can develop on the different components that make up our experiments i.e. build/runtime environment, code, and dataset and integrate them into an Execution in a loosely coupled manner.&lt;/p&gt;

&lt;p&gt;The template examples used in this post are a good way to get started to build more complex projects. That you can use either the web interface or the CLI to get your job done with &lt;a href="https://valohai.com/"&gt;Valohai&lt;/a&gt;! With the CLI you can also integrate it with your setup and scripts (or even with CRON or CI/CD jobs).&lt;/p&gt;

&lt;p&gt;Also, it’s clear that if I’m working on an AI/ML/DL related project I &lt;em&gt;don’t need to concern myself with creating and maintaining&lt;/em&gt; an end-to-end pipeline (which many others and I have had to do in the past) — thanks to the good work by the folks at &lt;a href="https://valohai.com/"&gt;&lt;strong&gt;Valohai&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks to both &lt;a href="http://skymind.com"&gt;&lt;strong&gt;Skymind&lt;/strong&gt;&lt;/a&gt; (the startup behind &lt;a href="https://deeplearning4j.org"&gt;DL4J&lt;/a&gt;, for creating, maintaining and keeping free) and &lt;a href="https://valohai.com/"&gt;&lt;strong&gt;Valohai&lt;/strong&gt;&lt;/a&gt; for making this tool and cloud-service available for both free and commercial use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please do let me know if this is helpful by dropping a line in the comments below or by tweeting at&lt;/strong&gt; &lt;a href="http://twitter.com/@theNeomatrix369"&gt;&lt;strong&gt;@theNeomatrix369&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, and I would also welcome feedback, see how you can&lt;/strong&gt; &lt;a href="https://neomatrix369.wordpress.com/about/"&gt;&lt;strong&gt;reach me&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, above all please check out the links mentioned above.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/valohai/mlpmnist-dl4j-example"&gt;mlpmnist-dl4j-examples project on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/"&gt;Awesome AI/ML/DL resources&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/README-details.md#java"&gt;Java AI/ML/DL resources&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/README-details.md#deep-learning"&gt;Deep Learning and DL4J Resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional DL4J resources&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Loss functions 

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/api/latest/org/nd4j/linalg/lossfunctions/ILossFunction.html"&gt;Loss function Interface by DL4J&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://heartbeat.fritz.ai/5-regression-loss-functions-all-machine-learners-should-know-4fb140e9d4b0"&gt;5 Regression Loss Functions All Machine Learners Should Know&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Evaluation

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://deeplearning4j.org/docs/latest/deeplearning4j-nn-evaluation"&gt;https://deeplearning4j.org/docs/latest/deeplearning4j-nn-evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Valohai resources&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.valohai.com/"&gt;valohai&lt;/a&gt; | &lt;a href="https://docs.valohai.com/"&gt;docs&lt;/a&gt; | &lt;a href="https://blogs.valohai.com/"&gt;blogs&lt;/a&gt; | &lt;a href="https://github.com/valohai"&gt;GitHub&lt;/a&gt; | &lt;a href="https://www.youtube.com/channel/UCiR8Fpv6jRNphaZ99PnIuFg"&gt;Videos&lt;/a&gt; | &lt;a href="https://valohai.com/showcase/"&gt;Showcase&lt;/a&gt; | &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/data/about-Valohai.md#valohai"&gt;About valohai&lt;/a&gt; | &lt;a href="http://community-slack.valohai.com/"&gt;Slack&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Blog posts on how to use the CLI tool: &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-cli"&gt;[1]&lt;/a&gt; | &lt;a href="https://blog.valohai.com/from-zero-to-hero-with-valohai-part-2"&gt;[2]&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-graal"&gt;Awesome Graal&lt;/a&gt; |  &lt;a href="http://graalvm.org"&gt;graalvm.org&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>java</category>
      <category>graalvm</category>
      <category>deeplearning</category>
    </item>
    <item>
      <title>How to build Graal-enabled JDK8 on CircleCI?</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Tue, 13 Aug 2019 18:27:25 +0000</pubDate>
      <link>https://dev.to/neomatrix369/how-to-build-graal-enabled-jdk8-on-circleci-14ed</link>
      <guid>https://dev.to/neomatrix369/how-to-build-graal-enabled-jdk8-on-circleci-14ed</guid>
      <description>&lt;p&gt;The &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; is a replacement to HotSpot’s server-side &lt;a href="https://dzone.com/articles/just-time-compiler-jit-hotspot" rel="noopener noreferrer"&gt;JIT compiler&lt;/a&gt; widely known as the &lt;a href="http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html" rel="noopener noreferrer"&gt;C2 compiler&lt;/a&gt;. It is written in Java with the goal of better performance (among other goals) as compared to the C2 compiler. New changes starting with Java 9 mean that we can now plug in our own hand-written C2 compiler into the JVM, thanks to &lt;a href="https://openjdk.java.net/jeps/243" rel="noopener noreferrer"&gt;JVMCI&lt;/a&gt;. The researchers and engineers at &lt;a href="https://labs.oracle.com/pls/apex/f?p=LABS:10::::::" rel="noopener noreferrer"&gt;Oracle Labs&lt;/a&gt; have created a variant of JDK8 with JVMCI enabled which can be used to build the [&lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;](&lt;a href="http://wikipedia.com/graal-compiler" rel="noopener noreferrer"&gt;http://wikipedia.com/graal-compiler&lt;/a&gt;). The &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; is open source and is &lt;a href="http://github.com/oracle/graal" rel="noopener noreferrer"&gt;available on GitHub&lt;/a&gt; (along with the &lt;a href="https://github.com/graalvm/graal-jvmci-8" rel="noopener noreferrer"&gt;HotSpot JVMCI sources&lt;/a&gt; needed to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;). This gives us the ability to fork/clone it and build our own version of the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;In this post, we are going to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; with JDK8 on CircleCI. The resulting artifacts are going to be: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JDK8 embedded with the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;, and&lt;/li&gt;
&lt;li&gt;a zip archive containing Graal &amp;amp; Truffle modules/components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: we are not covering how to build the whole of the GraalVM suite in this post, that can be done via another post. Although these scripts can be used to that, and there exists a&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369/awesome-graal/tree/build-graalvm-suite" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;branch which contains the rest of the steps&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use a CI tool to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;?
&lt;/h2&gt;

&lt;p&gt;Continuous integration (CI) and continuous deployment (CD) tools have many benefits. One of the greatest is the ability to check the health of the code-base. Seeing why your builds are failing provides you with an opportunity to make a fix faster. For this project, it is important that we are able to verify and validate the scripts required to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; for Linux and macOS, both locally and in a Docker container. A CI/CD tool lets us add automated tests to ensure that we get the desired outcome from our scripts when every PR is merged. In addition to ensuring that our new code does not introduce a breaking change, another great feature of CI/CD tools is that we can automate the creation of binaries and the automatic deployment of those binaries, making them available for open source distribution.&lt;/p&gt;

&lt;h1&gt;
  
  
  Let’s get started
&lt;/h1&gt;

&lt;p&gt;During the process of researching &lt;a href="http://circleci.com" rel="noopener noreferrer"&gt;CircleCI&lt;/a&gt; as a CI/CD solution to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;, I learned that we could run builds via two different approaches, namely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A CircleCI build with a standard Docker container (longer build time, longer config script)&lt;/li&gt;
&lt;li&gt;A CircleCI build with a pre-built, optimised Docker container (shorter build time, shorter config script)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will now go through the two approaches mentioned above and see the pros and cons of both of them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach 1: using a standard Docker container
&lt;/h1&gt;

&lt;p&gt;For this approach, CircleCI requires a docker image that is available in &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; or another public/private registry it has access to. We will have to install the necessary dependencies in this available environment in order for a successful build. We expect the build to run longer the first time and, depending on the levels of caching, it will speed up. &lt;/p&gt;

&lt;p&gt;To understand how this is done, we will be going through the CircleCI configuration file section-by-section (stored in &lt;code&gt;.circleci/circle.yml&lt;/code&gt;), see &lt;a href="https://github.com/neomatrix369/awesome-graal/blob/build-on-circleci/.circleci/config.yml" rel="noopener noreferrer"&gt;config.yml in .circleci&lt;/a&gt; for the full listing, see commit &lt;a href="https://github.com/neomatrix369/awesome-graal/commit/df28ee78be289a364dcdf3bdd626bd4a40460a28" rel="noopener noreferrer"&gt;df28ee7&lt;/a&gt; for the source changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explaining sections of the config file
&lt;/h2&gt;

&lt;p&gt;The below lines in the configuration file will ensure that our installed applications are cached (referring to the two specific directories) so that we don’t have to reinstall the dependencies each time a build occurs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    dependencies:
      cache_directories:
        - "vendor/apt"
        - "vendor/apt/archives"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be referring to the docker image by it’s full name (as available in &lt;a href="http://hub.docker.com" rel="noopener noreferrer"&gt;http://hub.docker.com&lt;/a&gt; under the account name used - &lt;em&gt;adoptopenjdk&lt;/em&gt;). In this case, it is a standard docker image containing JDK8 made available by the good folks behind the &lt;a href="http://ci.adoptopenjdk.net" rel="noopener noreferrer"&gt;Adopt OpenJDK build farm&lt;/a&gt;. In theory, we can use any image as long as it supports the build process. It will act as the base layer on which we will install the necessary dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        docker:
          - image: adoptopenjdk/openjdk8:jdk8u152-b16 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, in the pre-&lt;code&gt;Install Os dependencies&lt;/code&gt; step, we will restore the cache, if it already exists, this may look a bit odd, but for unique key labels, the below implementation is &lt;a href="https://circleci.com/docs/2.0/configuration-reference/#restore_cache" rel="noopener noreferrer"&gt;recommended by the docs&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - restore_cache:
              keys:
                - os-deps-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
                - os-deps-{{ arch }}-{{ .Branch }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the &lt;code&gt;Install Os dependencies&lt;/code&gt; step we run the respective shell script to install the dependencies needed. We have set this step to timeout if the operation takes longer than 2 minutes to complete (see &lt;a href="https://discuss.circleci.com/t/how-to-increase-timeout-for-command-in-circle-2-0/20254" rel="noopener noreferrer"&gt;docs for timeout&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Install Os dependencies
              command: ./build/x86_64/linux_macos/osDependencies.sh
              timeout: 2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in then post-&lt;code&gt;Install Os dependencies&lt;/code&gt; step, we save the results of the previous step - the layer from the above run step (the key name is formatted to ensure uniqueness, and the specific paths to save are included):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - save_cache:
              key: os-deps-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
              paths:
                - vendor/apt
                - vendor/apt/archives
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the pre-&lt;code&gt;Build and install make via script&lt;/code&gt; step, we restore the cache if one already exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - restore_cache:
              keys:
                - make-382-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
                - make-382-{{ arch }}-{{ .Branch }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the &lt;code&gt;Build and install make via script&lt;/code&gt; step we run the shell script to install a specific version of &lt;code&gt;make&lt;/code&gt; and it is set to timeout if step takes longer than 1 minute to finish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Build and install make via script
              command: ./build/x86_64/linux_macos/installMake.sh
              timeout: 1m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the post &lt;code&gt;Build and install make via script&lt;/code&gt; step, we save the results of the above action to the cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - save_cache:
              key: make-382-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
              paths:
                - /make-3.82/
                - /usr/bin/make
                - /usr/local/bin/make
                - /usr/share/man/man1/make.1.gz
                - /lib/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we define environment variables to update &lt;code&gt;JAVA_HOME&lt;/code&gt; and &lt;code&gt;PATH&lt;/code&gt; at runtime. Here the environment variables are &lt;code&gt;source&lt;/code&gt;d so that we remember them for the next subsequent steps till the end of the build process (please keep this in mind):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Define Environment Variables and update JAVA_HOME and PATH at Runtime
              command: |
                echo '....'     &amp;lt;== a number of echo-es displaying env variable values
                source ${BASH_ENV}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the step to &lt;code&gt;Display Hardware, Software, Runtime environment and dependency versions&lt;/code&gt;, as best practice we display environment-specific information and record it into the logs for posterity (also useful during debugging when things go wrong):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Display HW, SW, Runtime env. info and versions of dependencies
              command: ./build/x86_64/linux_macos/lib/displayDependencyVersion.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the step to &lt;code&gt;setup MX&lt;/code&gt; - this is an important from the point of view of the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; (&lt;a href="https://github.com/graalvm/mx" rel="noopener noreferrer"&gt;mx&lt;/a&gt; is a specialised build system created to facilitate compiling and building Graal/GraalVM and it’s components):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Setup MX
              command: ./build/x86_64/linux_macos/lib/setupMX.sh ${BASEDIR}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the important step to &lt;code&gt;Build JDK JVMCI&lt;/code&gt; (we build the JDK with JVMCI enabled here) and timeout, if the process takes longer than 15 minutes without any output or if the process takes longer than 20 minutes in total to finish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Build JDK JVMCI
              command: ./build/x86_64/linux_macos/lib/build_JDK_JVMCI.sh ${BASEDIR} ${MX}
              timeout: 20m
              no_output_timeout: 15m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the step &lt;code&gt;Run JDK JVMCI Tests&lt;/code&gt;, which runs tests as part of the sanity check after building the JDK JVMCI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Run JDK JVMCI Tests
              command: ./build/x86_64/linux_macos/lib/run_JDK_JVMCI_Tests.sh ${BASEDIR} ${MX}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the step  &lt;code&gt;Setting up environment and Build GraalVM Compiler&lt;/code&gt;, to set up the build environment with the necessary environment variables which will be used by the steps to follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Setting up environment and Build GraalVM Compiler
              command: |
                echo "&amp;gt;&amp;gt;&amp;gt;&amp;gt; Currently JAVA_HOME=${JAVA_HOME}"
                JDK8_JVMCI_HOME="$(cd ${BASEDIR}/graal-jvmci-8/ &amp;amp;&amp;amp; ${MX} --java-home ${JAVA_HOME} jdkhome)"
                echo "export JVMCI_VERSION_CHECK='ignore'" &amp;gt;&amp;gt; ${BASH_ENV}
                echo "export JAVA_HOME=${JDK8_JVMCI_HOME}" &amp;gt;&amp;gt; ${BASH_ENV}
                source ${BASH_ENV}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the step  &lt;code&gt;Build the [GraalVM Compiler](https://github.com/oracle/graal/tree/master/compiler) and embed it into the JDK (JDK8 with JVMCI enabled)&lt;/code&gt; which timeouts if the process takes longer than 7 minutes without any output or longer than 10 minutes in total to finish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Build the [GraalVM Compiler](https://github.com/oracle/graal/tree/master/compiler) and embed it into the JDK (JDK8 with JVMCI enabled)
              command: |
                echo "&amp;gt;&amp;gt;&amp;gt;&amp;gt; Using JDK8_JVMCI_HOME as JAVA_HOME (${JAVA_HOME})"
                ./build/x86_64/linux_macos/lib/buildGraalCompiler.sh ${BASEDIR} ${MX} ${BUILD_ARTIFACTS_DIR}
              timeout: 10m
              no_output_timeout: 7m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the simple sanity checks to verify the validity of the artifacts created once a build has been completed, just before archiving the artifacts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Sanity check artifacts
              command: |
                ./build/x86_64/linux_macos/lib/sanityCheckArtifacts.sh ${BASEDIR} ${JDK_GRAAL_FOLDER_NAME}
              timeout: 3m
              no_output_timeout: 2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we run the step  &lt;code&gt;Archiving artifacts&lt;/code&gt; (means compressing and copying final artifacts into a separate folder) which timeouts if the process takes longer than 2 minutes without any output or longer than 3 minutes in total to finish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Archiving artifacts
              command: |
                ./build/x86_64/linux_macos/lib/archivingArtifacts.sh ${BASEDIR} ${MX} ${JDK_GRAAL_FOLDER_NAME} ${BUILD_ARTIFACTS_DIR}
              timeout: 3m
              no_output_timeout: 2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For posterity and debugging purposes, we capture the generated logs from the various folders and archive them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - run:
              name: Collecting and archiving logs (debug and error logs)
              command: |
                ./build/x86_64/linux_macos/lib/archivingLogs.sh ${BASEDIR}
              timeout: 3m
              no_output_timeout: 2m
              when: always
          - store_artifacts:
              name: Uploading logs
              path: logs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we store the generated artifacts at a specified location - the below lines will make the location available on the CircleCI interface (we can download the artifacts from here):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          - store_artifacts:
              name: Uploading artifacts in jdk8-with-graal-local
              path: jdk8-with-graal-local/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Approach 2: using a pre-built optimised Docker container
&lt;/h1&gt;

&lt;p&gt;For approach 2, we will be using a pre-built docker container, that has been created and built locally with all necessary dependencies, the docker image saved and then pushed to a remote registry for e.g. &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;. And then we will be referencing this docker image in the CircleCI environment, via the configuration file. This saves us time and effort for running all the commands to install the necessary dependencies to create the necessary environment for this approach (see the details steps in Approach 1). &lt;/p&gt;

&lt;p&gt;We expect the build to run for a shorter time as compared to the previous build and this speedup is a result of the pre-built docker image (we will see in &lt;strong&gt;Steps to build the pre-built docker image&lt;/strong&gt;), to see how this is done). The additional speed benefit comes from the fact that CircleCI caches the docker image layers which in turn results in a quicker startup of the build environment.&lt;/p&gt;

&lt;p&gt;We will be going through the CircleCI configuration file section-by-section (stored in &lt;code&gt;.circleci/circle.yml&lt;/code&gt;) for this approach, see &lt;a href="https://github.com/neomatrix369/awesome-graal/blob/build-on-circleci-using-pre-built-docker-container/.circleci/config.yml" rel="noopener noreferrer"&gt;config.yml in .circleci&lt;/a&gt; for the full listing, see commit  &lt;a href="https://github.com/neomatrix369/awesome-graal/commit/e5916f1ffbc6ca0b8f5cd2ed71a6883e5a2de031" rel="noopener noreferrer"&gt;e5916f1&lt;/a&gt; for the source changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explaining sections of the config file
&lt;/h2&gt;

&lt;p&gt;Here again, we will be referring to the docker image by it’s full name. It is a pre-built docker image &lt;a href="https://hub.docker.com/r/neomatrix369/graalvm-suite-jdk8" rel="noopener noreferrer"&gt;neomatrix369/graalvm-suite-jdk8&lt;/a&gt; made available by &lt;a href="https://hub.docker.com/u/neomatrix369" rel="noopener noreferrer"&gt;neomatrix369&lt;/a&gt;. It was built and uploaded to &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; in advance before the CircleCI build was started. It contains the necessary dependencies for the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; to be built:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        docker:
          - image: neomatrix369/graal-jdk8:${IMAGE_VERSION:-python-2.7}
        steps:
          - checkout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All the sections below do the exact same tasks (and for the same purpose) as in Approach 1, see &lt;strong&gt;Explaining sections of the config file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Except, we have removed the below sections as they are no longer required for &lt;strong&gt;Approach 2:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    - restore_cache:
              keys:
                - os-deps-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
                - os-deps-{{ arch }}-{{ .Branch }}
          - run:
              name: Install Os dependencies
              command: ./build/x86_64/linux_macos/osDependencies.sh
              timeout: 2m
          - save_cache:
              key: os-deps-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
              paths:
                - vendor/apt
                - vendor/apt/archives
          - restore_cache:
              keys:
                - make-382-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
                - make-382-{{ arch }}-{{ .Branch }}
          - run:
              name: Build and install make via script
              command: ./build/x86_64/linux_macos/installMake.sh
              timeout: 1m
          - save_cache:
              key: make-382-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
              paths:
                - /make-3.82/
                - /usr/bin/make
                - /usr/local/bin/make
                - /usr/share/man/man1/make.1.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the following section, I will go through the steps show how to build the pre-built docker image. It will involve running the bash scripts - &lt;code&gt;./build/x86_64/linux_macos/osDependencies.sh&lt;/code&gt; and &lt;code&gt;./build/x86_64/linux_macos/installMake.sh&lt;/code&gt;  to install the necessary dependencies as part of building a docker image. And, finally pushing the image to &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; (can be pushed to any other remote registry of your choice).&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to build the pre-built docker image
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;build-docker-image.sh&lt;/code&gt;  (see bash script source) which depends on the presence of &lt;code&gt;Dockerfile&lt;/code&gt; (see docker script source). The &lt;code&gt;Dockerfile&lt;/code&gt; does all the necessary tasks of running the dependencies inside the container i.e. runs the bash scripts &lt;code&gt;./build/x86_64/linux_macos/osDependencies.sh&lt;/code&gt; and &lt;code&gt;./build/x86_64/linux_macos/installMake.sh&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ ./build-docker-image.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once the image has been built successfully, run &lt;code&gt;push-graal-docker-image-to-hub.sh&lt;/code&gt; after setting the  &lt;code&gt;USER_NAME&lt;/code&gt; and &lt;code&gt;IMAGE_NAME&lt;/code&gt; (see source code), otherwise it will use the default values as set in the bash script:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ USER_NAME="[your docker hub username]" IMAGE_NAME="[any image name]" \
        ./push-graal-docker-image-to-hub.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CircleCI config file statistics: Approach 1 versus Approach 2
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Areas of interest&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Approach 1&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Approach 2&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Config file (full source list)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal/blob/build-on-circleci/.circleci/config.yml" rel="noopener noreferrer"&gt;build-on-circleci&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal/blob/build-on-circleci-using-pre-built-docker-container/.circleci/config.yml" rel="noopener noreferrer"&gt;build-using-prebuilt-docker-image&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Commit point (sha)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal/commit/df28ee78be289a364dcdf3bdd626bd4a40460a28" rel="noopener noreferrer"&gt;df28ee7&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal/commit/e5916f1ffbc6ca0b8f5cd2ed71a6883e5a2de031" rel="noopener noreferrer"&gt;e5916f1&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lines of code (loc)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;110 lines&lt;/td&gt;
&lt;td&gt;85 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Source lines (sloc)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;110 sloc&lt;/td&gt;
&lt;td&gt;85 sloc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Steps (&lt;code&gt;steps:&lt;/code&gt; section)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Performance&lt;/strong&gt; &lt;strong&gt;(see Performance section)&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Some speedup due to caching, but &lt;strong&gt;slower than Approach 2&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Speed-up due to pre-built docker image, and also due to caching at different steps. &lt;strong&gt;Faster than Approach 1&lt;/strong&gt;&lt;br&gt;&lt;br&gt;&lt;em&gt;Ensure DLC layering is enabled (its a paid feature)&lt;/em&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  What not to do?
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Approach 1 issues&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;I came across things that wouldn’t work initially, but were later fixed with changes to the configuration file or the scripts:

&lt;ul&gt;
&lt;li&gt;please make sure the &lt;code&gt;.circleci/config.yml&lt;/code&gt; is always in the root directory of the folder&lt;/li&gt;
&lt;li&gt;when using the  &lt;code&gt;store_artifacts&lt;/code&gt; directive in the &lt;code&gt;.circleci/config.yml&lt;/code&gt; file setting set the value to a fixed folder name i.e. &lt;code&gt;jdk8-with-graal-local/&lt;/code&gt; - in our case, setting the &lt;code&gt;path&lt;/code&gt; to &lt;code&gt;${BASEDIR}/project/jdk8-with-graal&lt;/code&gt; didn’t create the resulting artifact once the build was finished hence the fixed path name suggestion.&lt;/li&gt;
&lt;li&gt;environment variables: when working with environment variables, keep in mind that each command runs in its own shell hence the values set to environment variables inside the shell execution environment isn’t visible outside, follow the method used in the context of this post. Set the environment variables such that all the commands can see its required value to avoid misbehaviours or unexpected results at the end of each step.&lt;/li&gt;
&lt;li&gt;caching: use the caching functionality after reading about it, for more details on &lt;strong&gt;CircleCI&lt;/strong&gt; caching refer to the &lt;a href="https://circleci.com/docs/2.0/caching/" rel="noopener noreferrer"&gt;caching docs&lt;/a&gt;. See how it has been implemented in the context of this post. This will help avoid confusions and also help make better use of the functionality provided by &lt;strong&gt;CircleCI&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Approach 2 issues&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Caching: check the docs when trying to use the &lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;Docker Layer Caching&lt;/a&gt; (DLC) option as it is a paid feature, once this is known the doubts about “why CircleCI keeps downloading all the layers during each build” will be clarified, for Docker Layer Caching details refer to &lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.  It can also clarify why in non-paid mode my build is still not as fast as I would like it to be.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;General note:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Light-weight instances: to avoid the pitfall of thinking we can run heavy-duty builds, check the documentation on the technical specifications of the instances. If we run the standard Linux commands to probe the technical specifications of the instance we may be misled by thinking that they are high specification machines. See the step that enlists the Hardware and Software details of the instance (see &lt;em&gt;Display HW, SW, Runtime env. info and versions of dependencies&lt;/em&gt;). The instances are actually Virtual Machines or Container like environments with resources like 2CPU/4096MB. This means we can’t run long-running or heavy-duty builds like building the GraalVM suite. Maybe there is another way to handle these kinds of builds, or maybe such builds need to be decomposed into smaller parts.&lt;/li&gt;
&lt;li&gt;Global environment variables: as each &lt;code&gt;run&lt;/code&gt; line in the &lt;code&gt;config.yml&lt;/code&gt;, runs in its own shell context, from within that context environment variables set by other executing contexts do not have access to these values. Hence in order to overcome this, we have adopted two methods:

&lt;ul&gt;
&lt;li&gt;pass as variables as parameters to calling bash/shell scripts to ensure scripts are able to access the values in the environment variables&lt;/li&gt;
&lt;li&gt;use the &lt;code&gt;source&lt;/code&gt; command as a run step to make environment variables accessible globally 
# End result and summary&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;We see the below screen (the last step i.e. Updating artifacts enlists where the artifacts have been copied) after a build has been successfully finished:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1546386222555_Screen%2BShot%2B2019-01-01%2Bat%2B23.43.04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1546386222555_Screen%2BShot%2B2019-01-01%2Bat%2B23.43.04.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The artifacts are now placed in the right folder for download. We are mainly concerned about the &lt;code&gt;jdk8-with-graal.tar.gz&lt;/code&gt; artifact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;Before writing this post, I ran multiple passes of both the approaches and jotted down the time taken to finish the builds, which can be seen below: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Approach 1:&lt;/strong&gt; standard CircleCI build (caching enabled)

&lt;ul&gt;
&lt;li&gt;13 mins 28 secs&lt;/li&gt;
&lt;li&gt;13 mins 59 secs&lt;/li&gt;
&lt;li&gt;14 mins 52 secs&lt;/li&gt;
&lt;li&gt;10 mins 38 secs&lt;/li&gt;
&lt;li&gt;10 mins 26 secs&lt;/li&gt;
&lt;li&gt;10 mins 23 secs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Approach 2:&lt;/strong&gt; using pre-built docker image (caching enabled, &lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;DLC&lt;/a&gt; feature unavailable)

&lt;ul&gt;
&lt;li&gt;13 mins 15 secs&lt;/li&gt;
&lt;li&gt;15 mins 16 secs&lt;/li&gt;
&lt;li&gt;15 mins 29 secs&lt;/li&gt;
&lt;li&gt;15 mins 58 secs&lt;/li&gt;
&lt;li&gt;10 mins 20 secs&lt;/li&gt;
&lt;li&gt;9 mins 49 secs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; **&lt;strong&gt;&lt;em&gt;Approach 2&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;should show better performance when using a paid tier, as&lt;/em&gt; &lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;&lt;em&gt;Docker Layer Caching&lt;/em&gt;&lt;/a&gt; &lt;em&gt;is available as part of this plan.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sanity check
&lt;/h2&gt;

&lt;p&gt;In order to be sure that by using both the above approaches we have actually built a valid JDK embedded with the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt;, we perform the following steps with the created artifact:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Firstly, download the &lt;code&gt;jdk8-with-graal.tar.gz&lt;/code&gt; artifact from under the &lt;strong&gt;Artifacts tab&lt;/strong&gt; on the CircleCI dashboard (needs sign-in):&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1546380812679_Screen%2BShot%2B2019-01-01%2Bat%2B22.13.06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1546380812679_Screen%2BShot%2B2019-01-01%2Bat%2B22.13.06.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then, unzip the &lt;code&gt;.tar.gz&lt;/code&gt; file and do the following:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    tar xvf jdk8-with-graal.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Thereafter, run the below command to check the JDK binary is valid:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    cd jdk8-with-graal
    ./bin/java -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;And finally, check if we get the below output:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    openjdk version "1.8.0-internal"
    OpenJDK Runtime Environment (build 1.8.0-internal-jenkins_2017_07_27_20_16-b00)
    OpenJDK 64-Bit Graal:compiler_ab426fd70e30026d6988d512d5afcd3cc29cd565:compiler_ab426fd70e30026d6988d512d5afcd3cc29cd565 (build 25.71-b01-internal-jvmci-0.46, mixed mode)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Similarly, to confirm if the JRE is valid and has the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; built-in, we do this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ./bin/jre/java -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;And check if we get a similar output as above:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    openjdk version "1.8.0-internal"
    OpenJDK Runtime Environment (build 1.8.0-internal-jenkins_2017_07_27_20_16-b00)
    OpenJDK 64-Bit Graal:compiler_ab426fd70e30026d6988d512d5afcd3cc29cd565:compiler_ab426fd70e30026d6988d512d5afcd3cc29cd565 (build 25.71-b01-internal-jvmci-0.46, mixed mode)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, we have successfully built JDK8 with the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; embedded in it and also bundled the Graal and Truffle components in an archive file, both of which are available for download via the CircleCI interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;you will notice that we do perform sanity checks of the binaries built just before we pack them into compressed archives, as part of the build steps (see bottom section of CircleCI the configuration files).&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Nice badges!
&lt;/h1&gt;

&lt;p&gt;We all like to show-off and also like to know the current status of our build jobs. A green-colour, build status icon is a nice indication of success, which looks like the below on a markdown README page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1547758905612_Screen%2BShot%2B2019-01-17%2Bat%2B21.00.44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_0E00A6756F5EBCD8DBF748743849C06E4748E4E6CE0A05E774A3437A1D05267C_1547758905612_Screen%2BShot%2B2019-01-17%2Bat%2B21.00.44.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can very easily embed both of these status badges displaying the build status of our project (branch-specific i.e. master or another branch you have created) built on CircleCI (see &lt;a href="https://circleci.com/docs/2.0/status-badges/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; on how to do that).&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusions
&lt;/h1&gt;

&lt;p&gt;We explored two approaches to build the &lt;a href="https://github.com/oracle/graal/tree/master/compiler" rel="noopener noreferrer"&gt;GraalVM Compiler&lt;/a&gt; using the CircleCI environment. They were good experiments to compare performance between the two approaches and also how we can do them with ease. We also saw a number of things &lt;em&gt;to avoid&lt;/em&gt; or &lt;em&gt;not to do&lt;/em&gt; and also saw how useful some of the CircleCI features are. The documentation and forums do good justice when trying to make a build work or if you get stuck with something.&lt;/p&gt;

&lt;p&gt;Once we know the CircleCI environment, it’s pretty easy to use and always gives us the exact same response (consistent behaviour) every time we run it. Its ephemeral nature means we are guaranteed a clean environment before each run and clean up after it finishes. We can also set up checks on build time for every step of the build, and abort a build if the time taken to finish a step surpasses the threshold time-period.&lt;/p&gt;

&lt;p&gt;The ability to use pre-built docker images coupled with &lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;Docker Layer Caching&lt;/a&gt; on CircleCI can be a major performance boost (saves us build time needed to reinstall any necessary dependencies at every build). Additional performance speedups are available on CircleCI, with caching of the build steps - this again saves build time by not having to re-run the same steps if they haven’t changed.&lt;/p&gt;

&lt;p&gt;There are a lot of useful features available on CircleCI with plenty of documentation and everyone on the community forum are helpful and questions are answered pretty much instantly.&lt;/p&gt;

&lt;p&gt;Next, let’s build the same and more on another build environment/build farm - hint, hint, are you think the same as me? &lt;a href="http://ci.adoptopenjdk.net" rel="noopener noreferrer"&gt;Adopt OpenJDK build farm&lt;/a&gt;? We can give it a try!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks and credits to &lt;a href="https://twitter.com/whyd0my3y3shurt?lang=en" rel="noopener noreferrer"&gt;Ron Powell&lt;/a&gt; from &lt;a href="http://circleci.com/" rel="noopener noreferrer"&gt;CircleCI&lt;/a&gt; and &lt;a href="https://twitter.com/shelajev" rel="noopener noreferrer"&gt;Oleg Šelajev&lt;/a&gt; from &lt;a href="https://labs.oracle.com/" rel="noopener noreferrer"&gt;Oracle Labs&lt;/a&gt; for proof-reading and giving constructive feedback.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please do let me know if this is helpful by dropping a line in the comments below or by tweeting at &lt;a href="http://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;@theNeomatrix369&lt;/a&gt;, and I would also welcome feedback, see how you can &lt;a href="https://neomatrix369.wordpress.com/about/" rel="noopener noreferrer"&gt;reach me&lt;/a&gt;, above all please check out the links mentioned above.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Useful resources
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Links to useful CircleCI docs

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://circleci.com/docs/2.0/getting-started/" rel="noopener noreferrer"&gt;About Getting started&lt;/a&gt; | &lt;a href="https://www.youtube.com/watch?v=otBELDgOo3o" rel="noopener noreferrer"&gt;Videos&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://circleci.com/docker/" rel="noopener noreferrer"&gt;About Docker&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://circleci.com/docs/2.0/docker-layer-caching/" rel="noopener noreferrer"&gt;Docker Layer Caching&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;a href="https://circleci.com/docs/2.0/caching/" rel="noopener noreferrer"&gt;About Caching&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://circleci.com/docs/2.0/ssh-access-jobs/" rel="noopener noreferrer"&gt;About Debugging via SSH&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://devhints.io/circle" rel="noopener noreferrer"&gt;CircleCI cheatsheet&lt;/a&gt; &lt;/li&gt;

&lt;li&gt;

&lt;a href="https://discuss.circleci.com/" rel="noopener noreferrer"&gt;CircleCI Community (Discussions)&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://discuss.circleci.com/c/community" rel="noopener noreferrer"&gt;Latest community topics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;CircleCI configuration and supporting files

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Approach 1:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369/awesome-graal/tree/build-on-circleci" rel="noopener noreferrer"&gt;https://github.com/neomatrix369/awesome-graal/tree/build-on-circleci&lt;/a&gt; &lt;a href="https://github.com/neomatrix369/awesome-graal/tree/build-on-circleci-inside-docker-container" rel="noopener noreferrer"&gt;&lt;/a&gt;(config file and other supporting files i.e. scripts, directory layout, etc…)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approach 2:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369/awesome-graal/tree/build-on-circleci-using-pre-built-docker-container" rel="noopener noreferrer"&gt;https://github.com/neomatrix369/awesome-graal/tree/build-on-circleci-using-pre-built-docker-container&lt;/a&gt; (config file and other supporting files i.e. scripts, directory layout, etc…)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;a href="https://github.com/neomatrix369/awesome-graal/tree/master/build/x86_64/linux_macos" rel="noopener noreferrer"&gt;Scripts to build Graal on Linux, macOS and inside the Docker container&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://medium.com/p/d33f0d96b78?source=user_profile---------8------------------" rel="noopener noreferrer"&gt;Truffle served in a Holy Graal: Graal and Truffle for polyglot language interpretation on the JVM&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://medium.com/p/6cc161e01442?source=user_profile---------7------------------" rel="noopener noreferrer"&gt;Learning to use Wholly GraalVM!&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://medium.com/p/1d2f8dacc3a7?source=user_profile---------6------------------" rel="noopener noreferrer"&gt;Building Wholly Graal with Truffle!&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369" rel="noopener noreferrer"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>graal</category>
      <category>graalvm</category>
      <category>java</category>
      <category>circleci</category>
    </item>
    <item>
      <title>Apache Zeppelin: stairway to notes* haven! </title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Thu, 03 Jan 2019 01:41:36 +0000</pubDate>
      <link>https://dev.to/neomatrix369/apache-zeppelin-stairway-to-notes-haven--46el</link>
      <guid>https://dev.to/neomatrix369/apache-zeppelin-stairway-to-notes-haven--46el</guid>
      <description>&lt;p&gt;*notes is for notebooks in Zeppelin lingo&lt;/p&gt;

&lt;p&gt;This post is a re-blog of my @JavaAdventCalendar post from &lt;a href="https://www.javaadvent.com/2018/12/apache-zeppelin-stairway-to-notes-haven.html"&gt;https://www.javaadvent.com/2018/12/apache-zeppelin-stairway-to-notes-haven.html&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Continuing from the previous post, &lt;a href="https://www.javaadvent.com/2018/12/two-years-in-the-life-of-ai-ml-dl-and-java.html"&gt;Two years in the life of AI, ML, DL and Java&lt;/a&gt;, where I had expressed my motivation. I mentioned our discussions, one of the discussions was, that you can write in languages like Python, R, Julia in JuPyteR notebooks. Most were not aware you can also write Java and Scala in addition to Python, SQL etc… with the help of &lt;a href="http://zeppelin.apache.org/"&gt;Apache Zeppelin&lt;/a&gt; notebooks. &lt;em&gt;And so I did commit to sharing something in those lines to broaden everyone’s awareness. Although it’s been some time since then I have managed to put together my thoughts into this post, showing how we can do similar operations using&lt;/em&gt; &lt;a href="https://zeppelin.apache.org/"&gt;&lt;em&gt;Apache Zeppelin&lt;/em&gt;&lt;/a&gt; &lt;em&gt;which supports both Java, and Scala.&lt;/em&gt; The project itself is written in Java and it’s open architecture means Zeppelin can support anything as long as &lt;a href="https://zeppelin.apache.org/docs/0.6.0/development/writingzeppelininterpreter.html"&gt;an interpreter for that thing has been provided&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  First things, first…
&lt;/h1&gt;

&lt;p&gt;In case, I have lost some of you, here’s what I meant by JuPyteR notebooks and writing notebooks in different languages, see &lt;a href="https://www.youtube.com/watch?v=Rc4JQWowG5I"&gt;https://www.youtube.com/watch?v=Rc4JQWowG5I&lt;/a&gt; and also have a look at the &lt;a href="https://github.com/jupyter/jupyter/wiki/Jupyter-kernels"&gt;list of kernels&lt;/a&gt; supported by JuPyteR notebook. But in this post, we are covering Apache Zeppelin, how to get it to work and how to use a couple of notes in the Zeppelin environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fun part…
&lt;/h2&gt;

&lt;p&gt;So let’s have a look at how we do it, by first downloading and installing Apache Zeppelin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download &amp;amp; Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;br&gt;
Go to the &lt;a href="https://zeppelin.apache.org/download.html"&gt;Download page&lt;/a&gt;, a number of options are available, two of the recommended options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download entire binary containing the interpreters&lt;/li&gt;
&lt;li&gt;Download a net installer which then downloads the interpreters (you can choose the ones you need or use &lt;code&gt;--all&lt;/code&gt; flag for all the &lt;a href="https://zeppelin.apache.org/docs/0.8.0/usage/interpreter/installation.html"&gt;interpreters&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In our case, I downloaded the &lt;strong&gt;net-install interpreter package&lt;/strong&gt; from the &lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/install.html#downloading-binary-package"&gt;download binary package section&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;br&gt;
 I unpacked the &lt;code&gt;.tgz&lt;/code&gt; archive and placed it in the &lt;code&gt;/opt/&lt;/code&gt; folder and ran:&lt;/p&gt;

&lt;p&gt;$ cd /opt/zeppelin-0.8.0-bin-netinst&lt;br&gt;
    $ ./bin/install-interpreter.sh --all&lt;/p&gt;

&lt;p&gt;For another type of archive or installation option, see the instructions on the &lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/install.html"&gt;Quick Start page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running&lt;/strong&gt;&lt;br&gt;
Depending on the type of binary downloaded, follow the instructions on the &lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/install.html#starting-apache-zeppelin"&gt;Quick Start page&lt;/a&gt;.&lt;br&gt;
Although in our case, I had to just run:&lt;/p&gt;

&lt;p&gt;$ cd /opt/zeppelin-0.8.0-bin-netinst&lt;br&gt;
    $ ./bin/zeppelin.sh&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Optional setting&lt;/em&gt;&lt;br&gt;
As I was curious what it was running Zeppelin under another JDK than the usual Oracle or OpenJDK JDK or JRE, I decided to try GraalVM JRE and so I switched &lt;code&gt;JAVA_HOME&lt;/code&gt; to point to &lt;code&gt;/path/to/GraalVM/jre&lt;/code&gt; on my machine. The GraalVM JDK comes bundled with the JRE which can be independently used just like any Java vendor’s JRE.&lt;/p&gt;

&lt;p&gt;When Zeppelin is run, these messages are shown (you can see the &lt;code&gt;JAVA_HOME&lt;/code&gt;settings have been picked up):&lt;/p&gt;

&lt;p&gt;Pid dir doesn't exist, create /opt/zeppelin-0.8.0-bin-netinst/run&lt;br&gt;
    GraalVM 1.0.0-rc7 warning: ignoring option MaxPermSize=512m; support was removed in 8.0&lt;br&gt;
    SLF4J: Class path contains multiple SLF4J bindings.&lt;br&gt;
    SLF4J: Found binding in [jar:file:/opt/zeppelin-0.8.0-bin-netinst/lib/interpreter/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]&lt;br&gt;
    SLF4J: Found binding in [jar:file:/opt/zeppelin-0.8.0-bin-netinst/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]&lt;br&gt;
    SLF4J: See &lt;a href="http://www.slf4j.org/codes.html#multiple_bindings"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/a&gt; for an explanation.&lt;br&gt;
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]&lt;br&gt;
    Dec 25, 2018 1:34:23 AM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime&lt;br&gt;
    WARNING: A provider org.apache.zeppelin.rest.NotebookRepoRestApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.apache.zeppelin.rest.NotebookRepoRestApi will be ignored.&lt;br&gt;
    Dec 25, 2018 1:34:23 AM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime&lt;br&gt;
    Dec 25, 2018 1:34:23 AM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime&lt;br&gt;
    [---- snipped ----]&lt;br&gt;
    WARNING: The (sub)resource method getNoteList in org.apache.zeppelin.rest.NotebookRestApi contains empty path annotation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running (continued)&lt;/strong&gt;&lt;br&gt;
Once all the above steps are completed and Zeppelin has successfully started, do the below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;a href="http://localhost:8080/#/"&gt;http://localhost:8080/#/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;And then look at the docs under &lt;a href="https://zeppelin.apache.org/docs/0.8.0/quickstart/explore_ui.html"&gt;Exploring Zeppelin UI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;And then the tutorial notebook at &lt;a href="http://localhost:8080/#/notebook/2A94M5J1Z"&gt;http://localhost:8080/#/notebook/2A94M5J1Z&lt;/a&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eSlGv0pD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093508680_image.png" alt=""&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Small experiment
&lt;/h1&gt;

&lt;p&gt;Just to look at some numbers, I decided to use the &lt;strong&gt;Zeppelin Tutorial/Basic Features (Spark) notebook&lt;/strong&gt; to check the difference in performance when run using GraalVM JDK/JRE and another JDK/JRE and here are the results:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;GraalVM JDK&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;./bin/zeppelin.sh&lt;/code&gt; 48.26s user 25.63s system 28% cpu 4:20.15 total (started and stopped the script manually)&lt;/li&gt;
&lt;li&gt;First paragraph&lt;/li&gt;
&lt;li&gt;Took 47 sec. Last updated by anonymous at December 25 2018, 2:18:36 AM.&lt;/li&gt;
&lt;li&gt;Each paragraph thereafter (columns from left to right):&lt;/li&gt;
&lt;li&gt;Took 44 sec. Last updated by anonymous at December 25 2018, 2:18:44 AM. (outdated)&lt;/li&gt;
&lt;li&gt;Took 10 sec. Last updated by anonymous at December 25 2018, 2:18:47 AM. (outdated)&lt;/li&gt;
&lt;li&gt;Took 6 sec. Last updated by anonymous at December 25 2018, 2:18:50 AM. (outdated)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Oracle JDK8&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;./bin/zeppelin.sh&lt;/code&gt; 37.64s user 25.73s system 29% cpu 3:38.49 total (started and stopped the script manually)&lt;/li&gt;
&lt;li&gt;First paragraph&lt;/li&gt;
&lt;li&gt;Took 54 sec. Last updated by anonymous at December 25 2018, 2:12:16 AM.&lt;/li&gt;
&lt;li&gt;Each paragraph thereafter (columns from left to right):&lt;/li&gt;
&lt;li&gt;Took 43 sec. Last updated by anonymous at December 25 2018, 2:12:24 AM. (outdated)&lt;/li&gt;
&lt;li&gt;Took 13 sec. Last updated by anonymous at December 25 2018, 2:12:29 AM. (outdated)&lt;/li&gt;
&lt;li&gt;Took 6 sec. Last updated by anonymous at December 25 2018, 2:12:31 AM. (outdated)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My observations are that the performance differences were marginal, although for different kinds of operation the results would vary between the two, hence more observations are needed. Best to stay put on GraalVM JRE unless otherwise indicated to see more such variations as we go along.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;paragraphs are code blocks in Zeppelin lingo, note is what a notebook is referred to as in the Zeppelin world. Hence the idea, a note has one or more paragraphs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are many other tutorials (sample) notes to play with, see on the home page under Zeppelin Tutorial (see screenshot):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2xqGh0C8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093536976_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2xqGh0C8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093536976_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Importing a note
&lt;/h1&gt;

&lt;p&gt;From the home page (&lt;a href="http://localhost:8080/#/"&gt;http://localhost:8080/#/&lt;/a&gt;, see below), we can select the hyperlinked text &lt;a href="https://www.javaadvent.com/2018/12/apache-zeppelin-stairway-to-notes-haven.html"&gt;Import Note&lt;/a&gt;, which allows us to import a note (Notebook in Zeppelin lingo) from disk or from a URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jvNK6S0D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093553202_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jvNK6S0D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093553202_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our case, I added the note from &lt;a href="https://github.com/mmatloka/machine-learning-by-example-workshop"&gt;https://github.com/mmatloka/machine-learning-by-example-workshop&lt;/a&gt; (ensure the link to the raw contents of the &lt;code&gt;json&lt;/code&gt; file is used i.e. &lt;a href="https://raw.githubusercontent.com/mmatloka/machine-learning-by-example-workshop/master/Workshop.json"&gt;https://raw.githubusercontent.com/mmatloka/machine-learning-by-example-workshop/master/Workshop.json&lt;/a&gt;) into Zeppelin, and tried running but got various errors when trying to run the first couple of paragraphs.&lt;/p&gt;

&lt;p&gt;Looking for answers as to why I was getting those errors, I came across a forum and then took upon the suggestion from someone on the forum where similar errors messages were reported. It was a workaround to fix issue &lt;a href="https://issues.apache.org/jira/browse/ZEPPELIN-3586"&gt;https://issues.apache.org/jira/browse/ZEPPELIN-3586&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  We failed the previous time, so let’s try again…
&lt;/h1&gt;

&lt;p&gt;One of the solutions was to make &lt;code&gt;SPARK_HOME&lt;/code&gt; point to a separate instance of Spark and not rely on the embedded &lt;code&gt;spark interpreter&lt;/code&gt; inside the Apache Zeppelin installation. As a workaround, a link to a Dockerfile gist was provided at &lt;a href="https://gist.github.com/conker84/4ffc9a2f0125c808b4dfcf3b7d70b043#file-zeppelin-dockerfile"&gt;https://gist.github.com/conker84/4ffc9a2f0125c808b4dfcf3b7d70b043#file-zeppelin-dockerfile&lt;/a&gt;. I extended the script to incorporate GraalVM JRE and added the necessary configuration for it to be visible to Zeppelin and Spark:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Zeppelin-Dockerfile&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;FROM apache/zeppelin:0.8.0&lt;br&gt;
    # Workaround to "fix" &lt;a href="https://issues.apache.org/jira/browse/ZEPPELIN-3586"&gt;https://issues.apache.org/jira/browse/ZEPPELIN-3586&lt;/a&gt;&lt;br&gt;
    RUN echo "$LOG_TAG Download Spark binary" &amp;amp;&amp;amp; \&lt;br&gt;
    wget -O /tmp/spark-2.3.1-bin-hadoop2.7.tgz &lt;a href="http://apache.panu.it/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz"&gt;http://apache.panu.it/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz&lt;/a&gt; &amp;amp;&amp;amp; \&lt;br&gt;
    tar -zxvf /tmp/spark-2.3.1-bin-hadoop2.7.tgz &amp;amp;&amp;amp; \&lt;br&gt;
    rm -rf /tmp/spark-2.3.1-bin-hadoop2.7.tgz &amp;amp;&amp;amp; \&lt;br&gt;
    mv spark-2.3.1-bin-hadoop2.7 /spark-2.3.1-bin-hadoop2.7&lt;br&gt;
    ENV SPARK_HOME=/spark-2.3.1-bin-hadoop2.7&lt;br&gt;
    ### My modified steps here on:&lt;br&gt;
    RUN rm -fr /usr/lib/jvm/java-1.8.0-openjdk-amd64 /usr/lib/jvm/java-8-openjdk-amd64&lt;br&gt;
    RUN wget &lt;a href="https://github.com/oracle/graal/releases/download/vm-1.0.0-rc10/graalvm-ce-1.0.0-rc10-linux-amd64.tar.gz"&gt;https://github.com/oracle/graal/releases/download/vm-1.0.0-rc10/graalvm-ce-1.0.0-rc10-linux-amd64.tar.gz&lt;/a&gt;&lt;br&gt;
    RUN tar xvzf graalvm-ce-1.0.0-rc10-linux-amd64.tar.gz&lt;br&gt;
    RUN mv graalvm-ce-1.0.0-rc10/jre /usr/lib/jvm/graalvm-ce-1.0.0-rc10&lt;br&gt;
    ENV JAVA_HOME=/usr/lib/jvm/graalvm-ce-1.0.0-rc10&lt;br&gt;
    ENV PATH=$JAVA_HOME/bin:$PATH&lt;br&gt;
    RUN java -version&lt;br&gt;
    RUN rm graalvm-ce-1.0.0-rc10-linux-amd64.tar.gz&lt;br&gt;
    RUN rm -fr graalvm-ce-1.0.0-rc10&lt;br&gt;
    CMD ["bin/zeppelin.sh"]&lt;/p&gt;

&lt;p&gt;And created two small bash scripts to help build the docker image and run the container from the image.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Build docker image&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;docker build -t zeppelin -f Zeppelin-Dockerfile .&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Run docker container&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;docker run --rm \&lt;br&gt;
                -it \&lt;br&gt;
                 -p 8080:8080 zeppelin&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the docker image is called &lt;code&gt;zeppelin:latest&lt;/code&gt;, and is about 4.45GB in size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The above scripts can be found at&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin"&gt;&lt;strong&gt;&lt;em&gt;https://github.com/neomatrix369/awesome-ai-ml-dl/tree/master/examples/apache-zeppelin&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;em&gt;, please feel free to improve them and create pull requests back into the repo.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In case, you don’t wish to do the above, you could try using&lt;/em&gt; &lt;a href="https://www.javaadvent.com/2018/12/apache-zeppelin-stairway-to-notes-haven.html"&gt;&lt;em&gt;https://github.com/dylanmei/docker-zeppelin&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. I’m Apache Zeppelin works out of the box using this container as well.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I wasn’t too keen with the above as the whole process took more than 45 mins, 35 mins of which went into downloading several MBs of Spark. Downloading the GraalVM JDK was a breeze, less than 5 minutes on my high-speed DSL connection.&lt;/p&gt;

&lt;p&gt;Applied the same steps above to load &lt;a href="https://github.com/mmatloka"&gt;&lt;strong&gt;Michal Matloka&lt;/strong&gt;&lt;/a&gt;’s Workshop notebook (&lt;code&gt;workshop.json&lt;/code&gt;) and ran the paragraphs in the notebook and it worked like a charm, without any errors, of course. Thanks, &lt;a href="https://github.com/mmatloka"&gt;&lt;strong&gt;Michal Matloka&lt;/strong&gt;&lt;/a&gt;, for providing with such an example to play with and learn multiple things in one go.&lt;/p&gt;

&lt;p&gt;From loading the dataset from a &lt;code&gt;.csv&lt;/code&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_QSSVh8u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093660044_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_QSSVh8u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093660044_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to produce the final outcome, via the parameter &lt;code&gt;avgMetrics&lt;/code&gt; – average cross-validation metrics for each &lt;code&gt;paramMap&lt;/code&gt; in &lt;code&gt;CrossValidator.estimatorParamMaps&lt;/code&gt;, in the respective order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bJE-VJnF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093674042_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bJE-VJnF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_896E57104EEE5E4786EAD1087489E79DE447D50D612C2CD2A4F73186F4191CBF_1546093674042_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A score of &lt;em&gt;53.18%&lt;/em&gt; — might still need a bit of tweaking and fine-tuning to achieve a higher score but that is a different discussion and tangents from our current topic on Zeppelin notes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Caveat
&lt;/h1&gt;

&lt;p&gt;Somehow Zeppelin does not like code layouts with such indentations:&lt;/p&gt;

&lt;p&gt;val indexToString = new IndexToString()&lt;br&gt;
    .setInputCol("prediction").setOutputCol("predictionLabel")&lt;br&gt;
    .setLabels(stringIndexer.labels)&lt;/p&gt;

&lt;p&gt;so when I removed the indentation to join the chain of function calls together:&lt;/p&gt;

&lt;p&gt;val indexToString = new IndexToString().setInputCol("prediction").setOutputCol("predictionLabel").setLabels(stringIndexer.labels)&lt;/p&gt;

&lt;p&gt;I was able to run the paragraphs fine. I had to do this to all the paragraphs to prevent any errors from Zeppelin. Or else you get messages of such nature across all the paragraphs:&lt;/p&gt;

&lt;p&gt;:1: error: illegal start of definition&lt;br&gt;
    .setInputCol("prediction").setOutputCol("predictionLabel")&lt;br&gt;
    ^&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Things I like about Zeppelin are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you have a clean and intuitive interface (must be Angular at work)&lt;/li&gt;
&lt;li&gt;you can write custom interpreters and expand the accepted list of languages&lt;/li&gt;
&lt;li&gt;write your own visualisers&lt;/li&gt;
&lt;li&gt;execution progress of every paragraph is displayed in real-time&lt;/li&gt;
&lt;li&gt;the execution time of every paragraph is computed and displayed in real-time&lt;/li&gt;
&lt;li&gt;wherever applicable a table of data can be visualised into a number of visuals and back to table of data — and all of this is done lazily (only executed when selected and keeps the results static)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although, execution can appear to be slower than JuPyteR notebooks. A number of bells-and-whistles available in IPython notebooks are absent which also means being an open-source project it leaves a lot of room for improvements via contributions — pick your favourite feature of choice for a pull request.&lt;/p&gt;

&lt;p&gt;All-in-all a great place for Java/JVM developers to feel at home and use Zeppelin to do their prototype, ML training and experimentation work for developers familiar with not just Python and R but also Java and Scala.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please keep an eye on this space, and share your comments, feedback or any contributions which will help us all learn and grow to&lt;/em&gt; &lt;a href="http://twitter.com/@theNeomatrix369"&gt;&lt;em&gt;@theNeomatrix369&lt;/em&gt;&lt;/a&gt;, &lt;em&gt;you can find more about me via the&lt;/em&gt; &lt;a href="http://neomatrix369.worpress.com/aboutme"&gt;&lt;em&gt;About me page&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apachezeppelin</category>
      <category>jupyter</category>
      <category>notebooks</category>
      <category>graalvm</category>
    </item>
    <item>
      <title>Two years in the life of AI, ML, DL and Java</title>
      <dc:creator>Mani</dc:creator>
      <pubDate>Thu, 03 Jan 2019 01:34:47 +0000</pubDate>
      <link>https://dev.to/neomatrix369/two-years-in-the-life-of-ai-ml-dl-and-java--nni</link>
      <guid>https://dev.to/neomatrix369/two-years-in-the-life-of-ai-ml-dl-and-java--nni</guid>
      <description>&lt;h2&gt;
  
  
  Citation
&lt;/h2&gt;

&lt;p&gt;All the images in the post are owned by the respective owners/creators/authors. &lt;em&gt;This post is a re-blog of my&lt;/em&gt; &lt;a href="https://www.javaadvent.com/" rel="noopener noreferrer"&gt;&lt;em&gt;@JavaAdventCalendar&lt;/em&gt;&lt;/a&gt; &lt;em&gt;post from&lt;/em&gt; &lt;a href="https://www.javaadvent.com/2018/12/two-years-in-the-life-of-ai-ml-dl-and-java.html" rel="noopener noreferrer"&gt;&lt;em&gt;https://www.javaadvent.com/2018/12/two-years-in-the-life-of-ai-ml-dl-and-java.html&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;AI, ML and DL are acronyms for &lt;a href="https://en.wikipedia.org/wiki/Artificial_intelligence" rel="noopener noreferrer"&gt;Artificial Intelligence&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Machine_learning" rel="noopener noreferrer"&gt;Machine Learning&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Deep_learning" rel="noopener noreferrer"&gt;Deep Learning.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545440249605_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545440249605_image.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now back to what I was going to write about. If you ask me, I’ll already admit that I have NOT even scraped the surface of these topics. What I share here is a glimpse of what’s out there and each one of you might have discovered many more aspects of these topics as part of your daily professional and personal pursuits.&lt;/p&gt;

&lt;p&gt;One of my motivations of putting this post and the links below together comes from the discussion we had during the &lt;a href="http://unconf.londonjavacommunity.co.uk/" rel="noopener noreferrer"&gt;LJC Unconference in November 2018&lt;/a&gt;, where &lt;a href="https://twitter.com/jeremiecharlet?lang=en" rel="noopener noreferrer"&gt;Jeremie&lt;/a&gt;, &lt;a href="https://www.meetup.com/Meet-a-Mentor-Community-London/members/3863286/" rel="noopener noreferrer"&gt;Michael Bateman&lt;/a&gt; and I along with a number of LJC JUG members gathered at a session discussing a similar topic. And the questions raised by some were in the lines of &lt;em&gt;where does Java stand in the world of AI-ML-DL. How do I do any of these things in Java? Which libraries and frameworks to use?&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  AI-ML-DL and Java and their outreach
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4giudtcwsruglkhdmyar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4giudtcwsruglkhdmyar.png" width="199" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another confession, I didn’t spend too much time trying to gather and categorise these topics, thanks to Twitter and the Internet for helping me find them and use them. I hope whatever content has been put together here quantifies to more than the answer to the above questions. And in case you feel further improvements can be made to the content, categorisation, layout, please feel free to contribute, you can start by visiting the &lt;a href="http://github.com/neomatrix369/awesome-ai-ml-dl" rel="noopener noreferrer"&gt;git repo and creating a pull request&lt;/a&gt;. Please watch, fork, start the repo to get updates of the changes to come. Here’s a number of resources shared in the last two years (circa), categorised as best I could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Business / General / Semi-technical&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.forbes.com/sites/oracle/2018/12/05/how-to-extract-business-value-from-data-science-its-all-about-the-teamwork/#6ad2f23a651c" rel="noopener noreferrer"&gt;Extract business value from DS&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1070610044926930944" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=Ytja2JuVMlw&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;Why Java and the JVM Will Dominate the Future of Machine Learning, AI, and Big Data&lt;/a&gt; (&lt;a href="https://twitter.com/DeepNetts/status/1060684337962762240" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://partners.wsj.com/oracle/machine-learning-made-more-accessible-during-businesses-learning-curve/" rel="noopener noreferrer"&gt;Machine Learning Made More Accessible During Businesses’ Learning Curve&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1075314544162074624" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;&lt;/a&gt;  - &lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;(more links)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Classifier / decision trees&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://ramok.tech/2017/09/26/email-spam-classifier-java-application-with-spark/" rel="noopener noreferrer"&gt;Email Spam Detector java Application with ApacheSpark&lt;/a&gt; (&lt;a href="https://twitter.com/Klevis_Ramo/status/913067204094103552" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dzone.com/guides/artificial-intelligence-automating-decision-making" rel="noopener noreferrer"&gt;Guide to Artificial Intelligence: Automating Decision-Making&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1029592519967830016" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Correlated Cross Occurrence&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://developer.ibm.com/dwblog/2017/mahout-spark-correlated-cross-occurences/" rel="noopener noreferrer"&gt;Multi-domain predictive AI or how to make one thing predict another&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/882222473886011393" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Deep learning&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.jfokus.se/jfokus17/preso/Deep-Learning-on-Java-tutorial.pdf" rel="noopener noreferrer"&gt;Deep learning with java&lt;/a&gt; (&lt;a href="https://twitter.com/juanantoniobm/status/832000819918733312" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=MXH_nn1dmsE" rel="noopener noreferrer"&gt;Free AI Training - Java-based deep-learning tools to analyze and train data, then send the resulting changes back to the server&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1071422649501409280" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Genetic Algorithms&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl/blob/master/jenetics.io" rel="noopener noreferrer"&gt;Jenetics is an advanced Genetic Algorithm, respectively an Evolutionary Algorithm, library written in java&lt;/a&gt; (&lt;a href="https://twitter.com/juanantoniobm/status/863871263118381056" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Java projects / technologies&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=cfxBrYud9KM&amp;amp;feature=youtu.be&amp;amp;t=231" rel="noopener noreferrer"&gt;Project Panama and fast MachineLearning computation&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1065266082557026304" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=6Q2TP-QO4SU" rel="noopener noreferrer"&gt;GraalVM + Machine Learning&lt;/a&gt; (&lt;a href="https://twitter.com/DevoxxUA/status/1074680378357616640" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blogs.oracle.com/startup/deploying-bespoke-ai-using-fn-project-kadlytics-by-miminal" rel="noopener noreferrer"&gt;Deploying Bespoke AI using fnproj - KADlytics by Miminal&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1034474482751221761" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Natural Language Processing (aka NLP)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.ibm.com/developerworks/library/cc-cognitive-natural-language-processing/index.html?social_post=963789367&amp;amp;fst=Discover" rel="noopener noreferrer"&gt;An introduction to natural language processing and a demo using opensource libraries&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/883174486459248646" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.meetup.com/AI-for-Enterprise-Virtual-User-Group/events/255622367/" rel="noopener noreferrer"&gt;Implementing NLP Attention Mechanisms with DeepLearning4J&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1058405126988161024" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stanfordnlp.github.io/CoreNLP/" rel="noopener noreferrer"&gt;How Stanford CoreNLP, a popular Java natural language tool can help you perform Natural Language Processing tasks&lt;/a&gt;(&lt;a href="https://twitter.com/java/status/945689918289924096" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=XrZ_Y4koV5A&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;FREE AI talk on Natural Language Processing NLP using Java with deeplearning4j&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1062035545394532352" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Neural Networks&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://towardsdatascience.com/neural-network-architectures-156e5bad51ba" rel="noopener noreferrer"&gt;Introduction to Neural Network Architectures&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/953492326877356032" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.csail.mit.edu/news/explained-neural-networks" rel="noopener noreferrer"&gt;Neural Networks explained by MIT&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/929216367361798144" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/coinmonks/implementing-an-artificial-neural-network-in-pure-java-no-external-dependencies-975749a38114" rel="noopener noreferrer"&gt;Implementing an Artificial Neural Network in Pure Java (No external dependencies)&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1031031249794609152" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;(&lt;/a&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#neural-networks" rel="noopener noreferrer"&gt;more links&lt;/a&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Recommendation systems / Collaborative Filtering (CF)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.baeldung.com/java-collaborative-filtering-recommendations" rel="noopener noreferrer"&gt;Tutorial on Collaborative Filtering (CF) in Java – a machine learning technique used by recommendation systems&lt;/a&gt;(&lt;a href="https://twitter.com/java/status/985150431549632513" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Tools &amp;amp; Libraries, Cheatsheets, Resources&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://skymind.ai/wiki/automl-automated-machine-learning-ai" rel="noopener noreferrer"&gt;Best AI tools and libraries&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1069459966740836352" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://becominghuman.ai/cheat-sheets-for-ai-neural-networks-machine-learning-deep-learning-big-data-678c51b4b463" rel="noopener noreferrer"&gt;Cheat Sheets for AI, Neural Networks, MachineLearning, Deep Learning &amp;amp; Big Data&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/1040928213466198016" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.baeldung.com/java-ai" rel="noopener noreferrer"&gt;Overview of AI Libraries in Java&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/931070584896741377" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;(&lt;/a&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#tools--libraries-cheatsheets-resources" rel="noopener noreferrer"&gt;more links&lt;/a&gt;&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#business--general--semi-technical" rel="noopener noreferrer"&gt;)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;How-to / Deploy / DevOps / Serverless&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.meetup.com/AI-for-Enterprise-Virtual-User-Group/events/254240417/" rel="noopener noreferrer"&gt;Learn how to deploy and manage machine learning models&lt;/a&gt; (&lt;a href="https://t.co/4lcwns0lgo" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.infoq.com/presentations/ai-data-extraction" rel="noopener noreferrer"&gt;How to prepare unstructured data for BI and data analytics AI and MachineLearning&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/869572617023488001" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Machine Learning Model Deployment Made Simple: [&lt;a href="https://oracle.github.io/graphpipe/#/" rel="noopener noreferrer"&gt;1&lt;/a&gt;] [&lt;a href="https://www.forbes.com/sites/oracle/2018/08/15/open-source-graphpipe-project-hints-at-next-wave-of-ai-expansion/#62a0c8c244ae" rel="noopener noreferrer"&gt;2&lt;/a&gt;] (&lt;a href="https://twitter.com/java/status/1038062329794052098" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomatrix369/awesome-ai-ml-dl#how-to--deploy--devops--serverless" rel="noopener noreferrer"&gt;(more links)&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Misc&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://blogs.oracle.com/bigdata/interactive-data-lake-queries-at-scale" rel="noopener noreferrer"&gt;Introduction to interactive Data Lake Queries&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/989047609259151360" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://towardsdatascience.com/a-simple-introduction-to-data-structures-part-one-linked-lists-efbb13e9ad33" rel="noopener noreferrer"&gt;A Simple Introduction To Data Structures&lt;/a&gt; (&lt;a href="https://twitter.com/java/status/883093461842382849" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Due to a large number of the links gathered, not all of them could be shown here and so I have created &lt;a href="http://github.com/neomatrix369/awesome-ai-ml-dl" rel="noopener noreferrer"&gt;a git repo and to host them on GitHub&lt;/a&gt;, where you will find the rest of the links. Once again pull requests are very welcome.&lt;/p&gt;

&lt;p&gt;From my several weeks to few months of intense experience I suggest if you want to get your hands dirty with &lt;a href="https://en.wikipedia.org/wiki/Artificial_intelligence" rel="noopener noreferrer"&gt;Artificial Intelligence&lt;/a&gt; and it’s off-springs [&lt;a href="https://en.wikipedia.org/wiki/Machine_learning" rel="noopener noreferrer"&gt;2&lt;/a&gt;][&lt;a href="https://en.wikipedia.org/wiki/Deep_learning" rel="noopener noreferrer"&gt;3&lt;/a&gt;], don’t shy away from it, just because it is not Java / JVM based. It’s best to start high-level with whatever you have and when you have understood the subject enough to try to apply them in the languages you are at home with, be that Java or any other JVM language you may know. I’m not claiming I know them, but merely sharing my mileage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545440901823_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545440901823_image.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the things we came up during our discussions was that AI, ML and DL have strong contributions from academia and they use tools and languages best known to them and sometimes most appropriate for the task in hand.&lt;/p&gt;

&lt;p&gt;Follow the community and the tools that drive the innovation and inspiration, to become better at the subject of choice. In this case, it applies to &lt;a href="https://en.wikipedia.org/wiki/Artificial_intelligence" rel="noopener noreferrer"&gt;Artificial Intelligence&lt;/a&gt; and its variants [&lt;a href="https://en.wikipedia.org/wiki/Machine_learning" rel="noopener noreferrer"&gt;2&lt;/a&gt;][&lt;a href="https://en.wikipedia.org/wiki/Deep_learning" rel="noopener noreferrer"&gt;3&lt;/a&gt;].&lt;/p&gt;

&lt;h1&gt;
  
  
  Quick shoutouts
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftywgruy3wmech8kq3u6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftywgruy3wmech8kq3u6p.png" width="128" height="231"&gt;&lt;/a&gt; Firstly, to &lt;a href="http://twitter.com/java" rel="noopener noreferrer"&gt;@java&lt;/a&gt; for sharing many AI, ML, DL related resources with the wider community. And also to organisations like &lt;a href="https://twitter.com/skymindio" rel="noopener noreferrer"&gt;@skymindio&lt;/a&gt; (&lt;a href="https://skymind.ai/" rel="noopener noreferrer"&gt;https://skymind.ai/&lt;/a&gt;) who are doing an awesome job in bridging the gap between the Java/JVM and AI/ML/DL worlds.&lt;/p&gt;

&lt;p&gt;Also, would like to thank the good folks (&lt;a href="https://twitter.com/hlrecworks" rel="noopener noreferrer"&gt;Helen&lt;/a&gt; and team) behind the ML Study group in London — supported by &lt;a href="http://twitter.com/RWmeetamentor" rel="noopener noreferrer"&gt;@RWmeetamentor&lt;/a&gt;, who have been working hard to bring everyone together to learn ML and related topics. They may have even very indirectly influenced me to write this post. &lt;em&gt;wink, wink&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;So to sum up, our discussion at the &lt;a href="http://unconf.londonjavacommunity.co.uk/" rel="noopener noreferrer"&gt;LJC Unconference 2018&lt;/a&gt;, we mentioned other languages like &lt;strong&gt;&lt;em&gt;Python, R, Julia, Matlab&lt;/em&gt;&lt;/strong&gt; and the likes, contribute more to AI, ML and DL than another programming language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545442687987_AI-ML-DL.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_99A6B7BF29C0506FDFCFF787852D9B1FB1990DE18F39F5A1E21435041E3E8B6E_1545442687987_AI-ML-DL.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.researchgate.net/profile/Han_Ping_Fung/post/What_is_the_difference_between_artificial_intelligence_AI_and_machine_learning_ML/attachment/5b0a62d34cde260d15e13377/AS%3A630805651009536%401527407195569/image/DL+vs+ML+vs+AI.jpg" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;br&gt;
I know it is not going to make me popular by saying this but my humble request to all developers would be that not to think or expect everything possible from a single programming language. Any language and in the context of this post, Java and other JVM languages are meant and written for a purpose and no doubt we can replicate efforts made in other languages in &lt;a href="https://en.wikipedia.org/wiki/List_of_JVM_languages" rel="noopener noreferrer"&gt;Java/JVM languages&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;But, at the end of the day, they should all be treated as tools and be used where appropriate.&lt;br&gt;
I hope the little shared in this post still will help inspire the Java / JVM community especially those who have strong interests in topics like &lt;a href="https://en.wikipedia.org/wiki/Artificial_intelligence" rel="noopener noreferrer"&gt;Artificial Intelligence&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Machine_learning" rel="noopener noreferrer"&gt;Machine Learning&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Deep_learning" rel="noopener noreferrer"&gt;Deep Learning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please keep an eye on this space, more good stuff coming and share your comments, feedback or any contributions which will help us all learn and grow to&lt;/em&gt;&lt;a href="http://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;&lt;em&gt;@theNeomatrix369&lt;/em&gt;&lt;/a&gt;, &lt;em&gt;you can find more about me via the&lt;/em&gt; &lt;a href="http://neomatrix369.worpress.com/aboutme" rel="noopener noreferrer"&gt;&lt;em&gt;About me page&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;Mani Sarkar is a passionate developer mainly in the Java/JVM space, currently strengthening teams and helping them accelerate when working with small teams and startups, as a freelance software engineer/data/ml engineer, &lt;a href="https://neomatrix369.wordpress.com/about" rel="noopener noreferrer"&gt;more….&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://twitter.com/@theNeomatrix369" rel="noopener noreferrer"&gt;@theNeomatrix369&lt;/a&gt; | &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/neomatrix369" rel="noopener noreferrer"&gt;@neomatrix369&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>dl</category>
      <category>java</category>
    </item>
  </channel>
</rss>
