1. Create your own Personality Insights service
- Using the code from both the Demo Servlet and the Demo Wrapper, attempt to create a Personality Insights service that accepts text
- If you get stuck, you can go back to the astopera Github page and look at the master branch of the cognitive showcase to see what I have done in my code
- Tips:
- Use a protected void doGet
- Import the packages from Demo Wrapper
- Create a new personality insights object
- Have it accept your username and password
- Allow it for you to enter a statement
- Have it determine the personality of the statement
- Print the results onto the webpage
2. Create a webpage where you can enter the statement
- Create a new file under web app (where index.jsp is) and give it a name ending with .jsp (i.e. pi.jsp)
- Go to http://crunchify.com/servlet-tutorial-getting-starting-with-jsp-servlet-example/ and scroll down to Step 2
- Copy and paste the code in Step 2 into the .jsp you just created
- See what is does by pushing it to your local servlet
- Go back into the code and modify it so you can enter in a statement that will use personality insights to determine its personality
- Go to the index.jsp and replace the name pidemo with the name of the .jsp file you just created
- Again, you can check out the master cognitive showcase to see how I did it
3. Attempt to do this for Question and Answer
- Tips
- Use code from the PIServlet and QADemo (which can be found in the master branch of the cognitive showcase on Github) to create the servlet
- Add the service to the index.jsp like how the personality insight service was added to it
4. Use Twitter Bootstrap to make website layout
- Using this tutorial as an example, create your own layout for your website. You can use much of the code that they provide you.
- http://www.sitepoint.com/building-responsive-websites-using-twitter-bootstrap/
5. You are now pretty much done! Tinker with the code until you get the services and the layout working the way you like and then push it to Bluemix like we do before. Congratulations on getting through all of this!
No comments:
Post a Comment