Customizing the Sentiment Demo UI
In this optional tutorial part, you learn how to customize the Sentiment Demo UI.
If you want to customize the Sentiment Demo UI, you would follow three main steps:
- Create the new project from the existing UI code.
- Modify the code in your next project as required to customize the UI.
- Deploy the modified UI.
Create the project
-
Navigate to the
Code Samples
and locateSentiment Demo UI
. -
Click
Preview code
and thenEdit code
. -
Ensure that the
sentiment
input box containssentiment
.This topic will be subscribed to and will contain the sentiment scores from the sentiment analysis service, you'll deploy this in a later part of this tutorial.
-
Ensure that the
messages
input containsmessages
.- This topic will contain all the chat messages.
- The UI will subscribe to this topic, to display new messages, as well as publishing to the topic when a user sends a message using the 'send' button in the UI.
- Later, the sentiment analysis service will also subscribe to messages on this topic to produce sentiment scores.
-
Click
Save as project
.The code for this Angular UI is now saved to your workspace.
You have created the project and you can now modifiy the code as required.
Modify the code
At this stage if you want to customize the code you can do so. You can also deploy what you have and customize it later by repeating the steps in the following section.
Deploy your modified code
-
Click the
+tag
button at the top of any code file. -
Enter
v1
and press Enter. -
Click
Deploy
near the top right corner. -
In the deployment dialog, select your tag, for example,
v1
under theVersion Tag
.This is the tag you just created.
-
Click
Service
inDeployment Settings
.This ensures the service runs continuously.
-
Click the toggle in
Public Access
.This enables access from anywhere on the internet.
-
Click
Deploy
.- The UI will stream data from the
sentiment
andmessages
topics as well as send messages to themessages
topic. - The
sentiment
topic will be used later for sentiment analysis.
- The UI will stream data from the
In this tutorial you've learned how you can modify the Sentiment Demo UI.