If you want to use a free plan of Discovery, you'll need to build your own model. Follow this tutorial:
Although the above tutorial is intended to be a prerequisite for the code pattern, we have also saved an exported model that can be used if you have an Advanced Plan
instance of Discovery. This is expected to be especially useful if you've done the tutorial already, but want a quicker way to reproduce the results.
- You create a paid version of Watson Discovery which will enable you to import the model from the
tutorial. This approach is faster, and you will not have to annotate the insurance document yourself. To do this approach,
first ensure you have a Watson Discovery Advanced plan. This one requires a credit card.
- Click here to find Discovery in the IBM Cloud catalog.
Select a region
.Select a pricing plan
. Use theAdvanced
plan.- Set your
Service name
or use the generated one. - Click
Create
. - Once you create the service, and then click on the service from the cloud.ibm.com homepage, it should show
Plan Advanced
in the right hand side of the page, as shown below:
- Next, click on
Launch Watson Discovery
and then create a collection and add in thedata/discovery/sample-insurance.docx
file from your cloned repo as shown below:
- Once Watson is done processing the document, click on
Configure data
in the top-right corner of the screen, as shown below:
- Next, click on
Import model
and select theinsurance.sdumodel
file from thedata/discovery
directory in your cloned repo as shown below.
- Once the model is applied, you should see a green notification in the top-right corner of the screen.
-
Click on the
Manage fields
tab in the upper-left corner of your screen. -
On the left-hand side of the page, under
Identify fields to index
, turn off thefooter
field. -
Next, click on
split document on each occurrence of
, and selectsubtitle
so that we split the document by subtitle. -
Lastly, click on
Apply changes to collection
and add in the samesample-insurance.docx
file you uploaded at first. -
Once your upload is done, you will be taken to the overview page. Refresh your browser to see that Watson is working to split the documents. After Watson is done, we should have over 10 documents. This is because we have split the original document into multiple, smaller documents based on the subtitle. This makes retrieving the answer to a particular question a lot easier for Watson, and enables us to get more accurate enrichments as well, such as sentiment analysis.
-
One of the main benefits of Watson is its ability to answer questions from your document in natural language. Before we do this, let's configure Watson to answer us directly with the text it has analyzed from our insurance document.
-
Click on the magnifying glass icon in the sidebar on the left-hand side of the screen. Next click on
more-options
at the bottom of the screen. -
Next, under
Passages
selectNo
forInclude relevant passages
. -
Next, under
Documents
forfields to return
selecttext
. -
Lastly, for
Number of documents to return
select3
. -
Scroll back up to the top of hte page, and under
Search for documents
make sureUse natural language
is selected. Then ask Watson the following question:Does my insurance cover glass repairs?
. Once the answer comes back in the top-right corner,Summary
will be selected. Go ahead and click onJSON
. -
You should see that Watson will pull out the relevant text from the document that says the insurance company will pay for replacement or repair of the glass in your vehicle's windscreen, sunroof, or windows if the vehicle is lost or damaged.
-
Repeat the process for
Does my coverage include medical expenses?
andDoes my insurance cover damage to my vehicle
.
Below, you can see the web-application in action, querying Watson in natural language:
Ask the following questions:
- Does my insurance cover glass repairs?
- Does my coverage include medical expenses?
- Does my insurance cover damage to my vehicle
- Does my insurance coverage apply for injury to me?
- Does my insurance cover the cost of my personal belongings damaged in an accident?
- Does my coverage apply to legal costs?
- What happens if I get in an accident with an uninsured motorist?