Sample of the Watson Retrieve and Rank Service
Learn how to use this cognitive service from Bluemix.
Join the DZone community and get the full member experience.Join For Free
i spent some time to understand the watson retrieve and rank service. below are some findings that might help people to learn about the power of this cognitive service that is available in ibm bluemix .
here is the description of the service from the watson developer cloud:
this service helps users find the most relevant information for their query by using a combination of search and machine learning algorithms to detect ‘signals’ in the data. built on top of apache solr, developers load their data into the service, train a machine learning model based on known relevant results, then leverage this model to provide improved results to their end users based on their question or query.
as for every watson service there is an online demo you can try. the demo uses a publically available data set, the cranfield collection, which is data about aerodynamics. the same query is invoked against apache solr and against the retrieve and rank service so that you can compare the quality of the results. since most people are not aerodynamics experts the sample also lists how domain experts have rated the results (right column). the left column shows how much higher or lower the retrieve and rank service ranks certain documents compared to solr.
in order to get started you can set up this demo yourself. essentially you need to create a solr cluster in the cloud, add your documents and create a ranker by providing a ‘ground truth’ file to generate the training data for the machine learning algorithm the ranker uses. in the ground truth file you define sample questions and for each question a list of documents and relevance information that are related to the question.
here are some key concepts that i learned:
- the retrieve and rank service is a search-based system. the ranker is run based on the results of the solr search. if solr doesn’t find anything, retrieve and rank won’t either.
- the key is to define a good ground truth file. as my colleagues told me several of our customers create this by running solr searches and subject matter experts determine what good results are and score them. this process is repeated over time to refine the model.
- in difference to the natural language classifier service, the retrieve and rank service does not utilize text from the ground truth file directly. for example the ranker does not detect synonyms. in order to handle synonyms you need to define them in the solr configuration.
- the ranker gets feature scores from the previous retrieve step which contains numbers only. the retrieve component invokes standard search queries and compares the input text with the fields defined in your schema and solr configuration. for each comparison you get multiple feature scores that are based on various text similarity algorithms. the ranker receives the feature scores and understands which feature values are dominant in the applied domain via machine learning. fortunately consumers of this service don’t have to understand (most of) this complexity.
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.