Simple Sample of the Watson Document Conversion Service
A sample demo of the Watson Document Conversion service on Bluemix to convert documents into HTMl, plain text, or JSON.
Join the DZone community and get the full member experience.
Join For Freewith the watson document conversion service on bluemix pdf, word and html documents can be converted into html, plain text or json. the converted documents can be used as input to other watson services like concept insights and retrieve and rank .
in my concept insights sample i’ve used the service to convert the downloaded html files into json. from the json the title and body fields were extracted and uploaded to the concept insights service. check out the python script convert.py file to see how to invoke the service via curl for multiple files. here is the key part.
curl_cmd = 'curl -k -s %s -u %s -f "config={\\"conversion_target\\":\\"answer_units\\"}" -f "file=@%s" "%s"' % (verbose, doccnv_creds, htmlfilename, doccnv_cnvurl)
process = subprocess.popen(shlex.split(curl_cmd), stdout=subprocess.pipe)
output = process.communicate()[0]
check out the api explorer for samples how to invoke the service from the command line and from java, node and python. there are also various customization options.
here is a sample of the online demo .
the post simple sample of the watson document conversion service appeared first on niklas heidloff .
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments