ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abramowitsch, Peter" <pabramowit...@hearst.com>
Subject Re: CTakes APIs
Date Tue, 28 Jun 2016 06:14:03 GMT
I created one in about 15 minutes using SparkJava.  Basically you look at
the code in the ClinicalPipeline package that gives you the workflow to
create a pipeline, assign incoming text to a newly created Jcas, and then
run the pipeline, finally calling a Json or XmlSerializer on the populated
CAS object.  

Exposing that as a webservice can be as little as this.

import static spark.Spark.post;
public static void main(String[] args) {
	spark.Spark.port(8080);
	Main n = new Main();
	try {
		n.createPipeline();
	} catch (UIMAException | IOException | SAXException | URISyntaxException
e) {
		e.printStackTrace();
	}
	post("/ctakeparse", (request, response) -> n.mymethod(request, response));
	}

Ok I admit there are a few more lines of code.  Maybe a couple of hundred.


Note that you can build the pipeline once (where a lot of heavy lifting
happens), and then use it repeatedly, just resetting the Jcas object
between invocations of the webservice.

- Peter



On 6/27/16, 10:53 PM, "Mattmann, Chris A (3980)"
<chris.a.mattmann@jpl.nasa.gov> wrote:

>Hi Vicky,
>
>
>
>We expose cTAKES as a REST API in Apache Tika, have a look at:
>
>
>
>https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.apache.org_tika_c
>TAKESParser&d=CwIGaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwu
>VF4uswNF8BK5Orm10&m=1SVXxf4S1egpSNODcQrYvhw8Abzzs1JKduk_Ffv2CCg&s=X-ui3HMW
>13oQkeJirW9tClgw4HxyQa36TaItq_IWqLs&e=
>
>
>
>Best of luck! Feel free to ask questions here and/or on the Apache
>
>Tika lists.
>
>
>
>Cheers,
>
>Chris
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Chris Mattmann, Ph.D.
>
>Chief Architect
>
>Instrument Software and Science Data Systems Section (398)
>
>NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
>
>Office: 168-519, Mailstop: 168-527
>
>Email: chris.a.mattmann@nasa.gov
>
>WWW:  
>https://urldefense.proofpoint.com/v2/url?u=http-3A__sunset.usc.edu_-7Ematt
>mann_&d=CwIGaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4usw
>NF8BK5Orm10&m=1SVXxf4S1egpSNODcQrYvhw8Abzzs1JKduk_Ffv2CCg&s=eT-uqWdrrKMxLl
>FhKD9wMeop_lAnmHJqfifncYEwVkw&e=
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Director, Information Retrieval and Data Science Group (IRDS)
>
>Adjunct Associate Professor, Computer Science Department
>
>University of Southern California, Los Angeles, CA 90089 USA
>
>WWW: 
>https://urldefense.proofpoint.com/v2/url?u=http-3A__irds.usc.edu_&d=CwIGaQ
>&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4uswNF8BK5Orm10&m=
>1SVXxf4S1egpSNODcQrYvhw8Abzzs1JKduk_Ffv2CCg&s=y6v1EvIP_vH-3Hb4wbGYGAADcDzc
>2p3q7TySHdgVb3Q&e=
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>On 6/27/16, 10:40 PM, "Vicky Chawda" <vicky.chawda@praxify.com> wrote:
>
>
>
>>Is there any API or REST interface is available for CTakes.?
>
>>Regards,
>
>>
>
>>*Vicky Chawda.*
>
>>*Software Engineer,*
>
>>*Praxify Technologies, Inc.*
>
>>Icon Tower, Main Road, Baner, Pune-411045.
>
>>[image: 
>>https://urldefense.proofpoint.com/v2/url?u=https-3A__www.praxify.com_&d=C
>>wIGaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4uswNF8BK5Or
>>m10&m=1SVXxf4S1egpSNODcQrYvhw8Abzzs1JKduk_Ffv2CCg&s=eCVrlCS5kIJUGEDilpPZk
>>x_INH0LdSz66xKRn1e4Oyc&e= ]
>><https://urldefense.proofpoint.com/v2/url?u=https-3A__www.praxify.com_&d=
>>CwIGaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4uswNF8BK5O
>>rm10&m=1SVXxf4S1egpSNODcQrYvhw8Abzzs1JKduk_Ffv2CCg&s=eCVrlCS5kIJUGEDilpPZ
>>kx_INH0LdSz66xKRn1e4Oyc&e= >
>


Mime
View raw message