Upload
truongnga
View
212
Download
0
Embed Size (px)
Citation preview
©2016IBMCorporation
Create Swift mobile apps with IBM Watson services
©2016IBMCorporation
Create a Watson sentiment analysis app with Swift
©2016IBMCorporation
• In this section, you’ll learn how to write a mobile app in Swift for iOS and add an IBM Watson cognitive service from Bluemix to that app. More specifically, you’ll learn how to:
– Create a Single View Application in Swift– Create a graphical user interface (GUI) for iOS – Add the IBM Watson iOS SDK to our project– Create a Watson service and get the key token for it– Run the app to access the Watson service and display the output on your
smartphone
Learning objectives
3
©2016IBMCorporation
• Before your start this section, you should install and configure the following prerequisites:
– A MacBook running OS X El Capitan– The Xcode 7.3 development environment or later– A Bluemix account
• Familiarize yourself with the Watson Developer Cloud iOS SDK, which you will use in the labs: https://github.com/watson-developer-cloud/ios-sdk/blob/master/README.md
Prerequisites
4
©2016IBMCorporation
• Watson AlchemyAPI cognitive service can: – Identify attitude, opinions, or feelings in the content that is being analyzed – Calculate overall sentiment in a document, sentiment for user-specified
targets, entity-level sentiment, quotation-level sentiment, directional-sentiment, and keyword-level sentiment
• The combination of these capabilities supports a variety of use cases ranging from social media monitoring to trend analysis.
• The app that you build in this section will help you determine the sentiment of a person’s textual input.
Sentiment analysis
5
©2016IBMCorporation
Mobile application layers
Watson Developer Cloud SDK for iOS
iOS app
Watson service: AlchemyAPIFunction: sentiment analysis
©2016IBMCorporation
Create an Watson photo recognition app with Swift
©2016IBMCorporation
• In this section, you’ll learn how to create a mobile image recognition app for iOS. The app can consume an image URL and provide information about what the image contains. This is a very popular type of mobile app.
• You'll learn how to:– Create a Single View Application in Swift– Create a graphical user interface (GUI) for iOS – Add the Bluemix IBM Watson iOS SDK to your project– Create a Watson Visual Recognition service instance and get the key token for it
• Run the app to access the Watson service and display the output on our smartphone
Learning objectives
8
©2016IBMCorporation
• Be sure that you complete the previous lab “Create a Watson sentiment analysis app with Swift.”
Prerequisites
9
©2016IBMCorporation
• The Watson Visual Recognition service can: – Understand the content of images or video frame, answering the question
“What is in this image?” – Create custom classifiers to develop smart applications– Help you understand the contents of an image
Visual recognition
10
©2016IBMCorporation
How the app works
• For this app, you submit an image, and the service returns scores for relevant classifiers representing things such as people, objects, events, and settings.
• Check out the Visual Recognition demo at http://visual-recognition-demo.mybluemix.net/
11
©2016IBMCorporation
Create a Watson text-to-speech app with Swift
©2016IBMCorporation
• In this section, you’ll learn how to write a mobile app in Swift for iOS and add the IBM Watson Text to Speech service from Bluemix.
• More specifically, you'll learn how to:– Create a Single View Application in Swift– Create a graphical user interface (GUI) for iOS – Add the IBM Watson iOS SDK to your project– Create the Watson Text to Speech service and get the key token for it
Learning objectives
13
©2016IBMCorporation
• Complete the previous labs:– “Create a Watson sentiment analysis app with Swift”– “Create an Watson photo recognition app with Swift “
Prerequisites
14
©2016IBMCorporation
• The Watson Text to Speech service is designed for streaming low-latency synthesis of audio from written text.
• The Watson Text to Speech service provides a REST API to synthesize speech audio from an input of plain text. After the text is analyzed in real-time, the audio is streamed back to the client.
• The service synthesizes natural-sounding speech from input text in a variety of languages and voices that speak with appropriate cadence and intonation.
• Multiple voices, both male and female, are available in these languages: – Brazilian Portuguese, English, French, German, Italian, Japanese, and Spanish.
• You can also control the pronunciation of specific words.
Watson Text to Speech service
15
©2016IBMCorporation
• Enter text on your smartphone and listen to the voice output.
• Check out the demo at https://www.ibm.com/watson/developercloud/text-to-speech.html.
How the app works
16