Artificial intelligence is something that still seems very exotic. Despite this, more and more of us are aware that we use solutions based on AI ( Artificial Intelligence ) every day.
Take the phone out of your pocket. Turn on the camera application and point the lens at someone. The application will immediately recognize that there is a person in the camera's field of view. Maybe even show in the photo preview a rectangle surrounding the person's face. Although she probably met this person for the first time.
This is due to the achievements of many engineers and scientists from the last few decades. I will subjectively mention two of them. In 2001, Paul Viola and Michael Jones created the first model for recognizing objects in photos (mainly faces). In 2016, Yann LeCun created a mature version of a new type of neural network called CNN ( convolutional neural network ), thanks to which creating image recognition models requires significantly less computing power, which in turn has triggered a real 'eruption' of global creativity in the field of image recognition.
Image recognition algorithms are just the tip of the iceberg, we are now dealing with a real spring in the area of artificial intelligence development, even every month brings new and fascinating applications and discoveries. Where to follow this kind of revolution?
There are certainly many sources of knowledge on this subject. Subjectively, I will give two. The first is the OpenAI Foundation founded by Elon Musk, which regularly reports the results of its work in the field of robotics, Natural Language Processing, decision making and other areas of artificial intelligence. An interesting topic is, for example, the algorithm called GPT-2, which is alarmingly able to generate (or detect) the so-called fake-news. On the example of this algorithm, it is easy to explain the unprecedented proportion of fake news on social networks and the Internet. This case shows how much achievements in artificial intelligence are changing our world.
The second source of knowledge about AI is the IBM Research website, which informs about the revolution in this area in the field of artificial intelligence. At one time Kasparov's duel with the IBM computer called Big Blue was known. Now, from the pages of the news of the technological giant, we can learn about another computer competing with man in ... debates. Project Debater is able to listen to the argument of the adversary and find appropriate counterarguments in the discussion on virtually any topic. Fascinating? Or maybe scary? This is another example of how the area of artificial intelligence affects our lives.
It is certainly fascinating that many of the benefits of the world of artificial intelligence are available, for example, in the IBM Cloud . We don't have to be Yann LeCun immediately to enrich our applications and take advantage of convenient image recognition algorithms, natural language processing, or simple predictions. These types of services are easily accessible and easy to use.
Machine Learning models. Where to start?
In writing any application, including creating models based on artificial intelligence algorithms, I always see 3 basic stages.
The first, most pleasant stage for me is building. Building is arduous, but sometimes it can be combined with fun, testing new frameworks and entering a new theme (or old theme, but in a new way).
The second stage begins when we have built our child and want to connect with the existing application or some other way to expose the world.
The third stage, just the least interesting for me, but still important, is the control over the production operation of the application or a specific model.
A very pleasant discovery for me was the fact that IBM Cloud has a specific set of tools for each of these stages and allows you to bring pleasure from each of them.
Build
For the first stage of model building, Watson Studio is primarily intended for testing models in Jupyter notebooks, building ETL ( extract, transform, load ) flows, moderating streaming data, creating neural networks and much, much more.
Another tool included in the first stage of 'building and playing' is the chatbot building framework - Watson Assistant, described in this article in more detail.
Another area where we build solutions is a group of applications for creating NLP (Natural Language Processing) models, e.g. a search engine called Watson Discovery, or Watson Knowledge Studio - a framework for deeper understanding of the content of texts and documents, e.g. concepts, people, places, relationships between these things, etc.
Show your model to the world
In the case of the basic machine learning application , Watson Studio, issuing the model involves executing the deploy
command and thus creating an instance of your model. The instance created in this way should then be connected to the application using REST-type service methods.
In the case of displaying a ready chat in Watson Assistant, we have the option of using the ready front-end from the IBM Cloud (as in this example ) or creating your own interface for communication with the user.
Those interested will find sample scenarios in this tutorial .
Control your model in production
A very interesting application that allows you to control what is happening with the created model is Watson OpenScale .
To show you how important this application is, I will quote Georg Box's wonderful statistics:
All models are wrong, but some are useful (all models are wrong, but some are useful).
This saying, repeated by many statisticians, discovers, among others the fact that models are only some artificial approximation of the world around us. If we add to this the fact that the model created once is constant and our world is constantly changing, we have a complete picture of the situation.
For example, suppose we created a new model for granting loans at a bank, and then the bank significantly changed its customer profile. How will the current model change behavior? Will the model's results be reliable? Which components of the model affect the final result the most? Is the model fair (in the sense of skipping certain social groups such as women over 50 and favoring others, e.g. men aged 25-30)? Watson OpenScale helps answer all these questions.
Watson Studio
Named after the first IBM president , Thomas J. Watson, the environment today combines over 50 different technologies that can be used to create solutions in the field of:
- Machine learning
- Deep Learning
- Image analysis ( computer vision )
- Big data analysis
- Statistical analysis.
Watson Studio allows you to create separate projects for different solutions. They can contain components such as Jupyter notebooks (combining calculations with documentation) and data sets (on which we can operate).
Our own notebook, Jupyter
To realize how the Jupyter notebooks work, we will create one test and show you simple calculations and a graph.
Creating a notebook
After creating the project, click "New notebook" in the Notebooks section. We can create an empty one or load it from a ready file (which I have locally or by entering its URL)
Notebooks combine the documentation function with the code. Here is an example of a header and simple code executed in Python. After writing the code, we can run it by pressing shift-Enter.
Let's try to do something more complex. To do this, we load the external pyplot
and numpy
libraries and use the Python math
library to draw a chart. We have control over the appearance and data of the chart from the code.
Watson Services
Watson Services allow you to create profiled and predefined machine learning services to then expose them for use in our application. This is a different approach from the previous one - here we not only do research on data, but we can also "dress" them in a solution useful for our application (eg recognizing faces in photos). Services from Watson Services can also be used in our other projects and Jupyter notebooks.
Among the types of Watson Services we find, among others
- Content Analysis and Cognitive Search)
- Possibility to translate texts in natural language (Language Translator)
- Machine Learning
- Content classification (categorizing texts and images)
- Understanding of natural language (e.g. for conversion into commands that the application can understand)
- Text tone analyzer (can determine how a statement is marked - positive, negative or neutral)
- Change speech to text and vice versa
- Image recognition
- Watson Assistant, to which we previously devoted a separate text .
Example of use - a service provided externally
Each of the services created can be made available after adding the appropriate API key. Here's how to easily create a text tone analyzer, for example.
Then we add the key we have created a URL at which we can query our service. Here are two examples of calls (for words that associate positively and negatively, suggesting anger and joy).
Watson OpenScale
Once our AI-based solution is in a production environment, it's good to monitor its performance and scaling. That's what Watson Openscale is for. OpenScale tracks and measures the results of artificial intelligence models throughout its life cycle, supervises its work and modifies its properties depending on the business situation - regardless of where the model is created and operated.
Models can also be tested before sharing. OpenScale allows you to test how they will behave in conditions of increased demand for the service.
Watson OpenScale also allows you to detect irregularities in the operation of our AI, at a time when data from the model's training period changed significantly compared to the data on which the model works. It is possible to determine the components that most strongly affect the result. You can also check coefficient of Justice (ang. Fairness) model, eg. In the above-mentioned models of granting credit.
To sum up, the services hidden under the name Watson give the user a wide range of possibilities in creating various machine learning models, chatbot dialogs, image recognition models and natural language processing.
Each of the Watson services can be tested for free and without connecting a credit card and even more - as part of the free Lite plan it is possible to build many interesting applications.
Registration can be done by going to the account creation page and after a few minutes we can start working on the application using AI and machine learning.
* The material was created in cooperation with IBM.
Artificial Intelligence in the cloud is ready for use in your next application
Comments
Post a Comment