Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] [SUSPICIOUS]

2017-12-15 Thread Matthew Vita
I should note that my main work item at the moment is getting the
Dictionary GUI tool to write straight to MySQL to make this (and other
solutions) more streamlined. I have read over the code and understand it
pretty well. Just fighting to load in the MySQL driver despite what I
thought was the right approach (
https://github.com/GoTeamEpsilon/ctakes-rest-service/issues/2#issuecomment-351921458).
Going to spend some time on it over the weekend :).

I'm very grateful for Gandhi and you all.

cTAKES + REST = many possibilities as we enter into the new year!

Thanks,

Matthew Vita
www.matthewvita.com

On Fri, Dec 15, 2017 at 9:56 PM, Matthew Vita 
wrote:

> > could be wrapped in a docker container that would be really powerful,
>
> ​I am on it!​
>
>
> Thanks,
>
> Matthew Vita
> www.matthewvita.com
>
> On Fri, Dec 15, 2017 at 6:46 AM, Miller, Timothy <
> timothy.mil...@childrens.harvard.edu> wrote:
>
>> Great, that's very helpful.
>>
>> I'll be happy to help with extracting the information needed from the
>> CAS the easy way. Sean, am I remembering right that there was an API
>> started for that somewhere? Or maybe that was part of DeepPhe?
>>
>> Tim
>>
>>
>> On Fri, 2017-12-15 at 03:52 +, Gandhi Rajan Natarajan wrote:
>> > Hi Tim,
>> >
>> > Thanks for taking time out and having a look at this. As you
>> > mentioned, the dictionary descriptor file contains details specific
>> > to my setup which needs to be changes to 127.0.0.1 by default. Will
>> > make the change accordingly.
>> >
>> > The only reason we went ahead with the approach of parsing XML to
>> > JSON is due to our lack of in-depth knowledge in cTAKES
>> > implementations. If I could get some guidance on how to get the
>> > required JSON details directly from type systems, will be happy to
>> > implement the same as it will be a huge performance gain.
>> >
>> > Also as you said we have two directories names ctakes-web-rest and
>> > ctakes-rest-service. Ctakes-rest-service directory is no longer
>> > active and its obsolete. We are just maintaining it for some
>> > reference for the time being. We will knock it off soon.
>> >
>> > Thanks again for the detailed feedback.
>> >
>> > Regards,
>> > Gandhi
>> >
>> >
>> > -Original Message-
>> > From: Miller, Timothy [mailto:timothy.mil...@childrens.harvard.edu]
>> > Sent: Friday, December 15, 2017 1:25 AM
>> > To: dev@ctakes.apache.org
>> > Subject: Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS]
>> > [SUSPICIOUS]
>> >
>> > I looked at this today. Looks like a great start!
>> >
>> > I was able to get as far as deploying to tomcat, seeing the web form,
>> > and submitting, but didn't get correct feedback because I don't have
>> > a mysql dictionary set up, which the default descriptor points at. I
>> > didn't see any instructions for building that and didn't have time to
>> > figure that out.
>> >
>> > I think I mentioned in a different thread that if this whole thing
>> > could be wrapped in a docker container that would be really powerful,
>> > but if not, there are a few things that are obvious to you as
>> > developers but would make it easier for novices (like me) to deploy.
>> >
>> > * download tomcat bin and start with bin/startup.sh (check at
>> > localhost:8080)
>> > * run mvn install on my ctakes installation to populate jar files in
>> > the .m2 directory that were missing
>> > * run mvn package inside the ctakes-web-rest subdirectory
>> > * copy the .war file into the webapps directory in my tomcat
>> > installation.
>> > * While I couldn't get the dictionary to work pointing to mysql, I
>> > noticed that the dictionary descriptor file has a hardcoded IP
>> > address when maybe it should be 127.0.0.1?
>> >
>> > One other thing I noticed in the code is that in sending back JSON it
>> > looks like you're turning the JCas into xml and then parsing it
>> > yourself. It should be easier just to access typesystem objects
>> > directly. Sean may have some API code laying around to simplify that
>> > as well.
>> >
>> > To iterate over signs/symptoms, for example, you would do:
>> >
>> > for(SignSymptomMention ss : JCasUtil.select(jcas,
>> > SignSymptomMention.class)){
>> >   int begin = ss.getBegin(); // begin offset
>> >   int end = ss.getEnd(): // end offset ...
>> > }
>> >
>> > Using the typesystem directly may help you to speed up that code or
>> > make it easier to read. But maybe there is a reason to write it to
>> > xml that I'm not aware of.
>> >
>> > Finally, I see there are two sub-directories with similar names,
>> > ctakes-rest-service and ctakes-web-rest. If they are duplicates can
>> > you delete the old one?
>> >
>> > I'll keep poking around, but hopefully this is helpful feedback for
>> > you guys. Thanks again for getting this off the ground!
>> >
>> > Tim
>> >
>> >
>> >
>> >
>> > On Thu, 2017-12-07 at 14:16 +, Miller, Timothy wrote:
>> > >
>> > > I am really interested in this too, just waiting until I have a few
>> > > free hours to 

Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] [SUSPICIOUS]

2017-12-15 Thread Matthew Vita
> could be wrapped in a docker container that would be really powerful,

​I am on it!​


Thanks,

Matthew Vita
www.matthewvita.com

On Fri, Dec 15, 2017 at 6:46 AM, Miller, Timothy <
timothy.mil...@childrens.harvard.edu> wrote:

> Great, that's very helpful.
>
> I'll be happy to help with extracting the information needed from the
> CAS the easy way. Sean, am I remembering right that there was an API
> started for that somewhere? Or maybe that was part of DeepPhe?
>
> Tim
>
>
> On Fri, 2017-12-15 at 03:52 +, Gandhi Rajan Natarajan wrote:
> > Hi Tim,
> >
> > Thanks for taking time out and having a look at this. As you
> > mentioned, the dictionary descriptor file contains details specific
> > to my setup which needs to be changes to 127.0.0.1 by default. Will
> > make the change accordingly.
> >
> > The only reason we went ahead with the approach of parsing XML to
> > JSON is due to our lack of in-depth knowledge in cTAKES
> > implementations. If I could get some guidance on how to get the
> > required JSON details directly from type systems, will be happy to
> > implement the same as it will be a huge performance gain.
> >
> > Also as you said we have two directories names ctakes-web-rest and
> > ctakes-rest-service. Ctakes-rest-service directory is no longer
> > active and its obsolete. We are just maintaining it for some
> > reference for the time being. We will knock it off soon.
> >
> > Thanks again for the detailed feedback.
> >
> > Regards,
> > Gandhi
> >
> >
> > -Original Message-
> > From: Miller, Timothy [mailto:timothy.mil...@childrens.harvard.edu]
> > Sent: Friday, December 15, 2017 1:25 AM
> > To: dev@ctakes.apache.org
> > Subject: Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS]
> > [SUSPICIOUS]
> >
> > I looked at this today. Looks like a great start!
> >
> > I was able to get as far as deploying to tomcat, seeing the web form,
> > and submitting, but didn't get correct feedback because I don't have
> > a mysql dictionary set up, which the default descriptor points at. I
> > didn't see any instructions for building that and didn't have time to
> > figure that out.
> >
> > I think I mentioned in a different thread that if this whole thing
> > could be wrapped in a docker container that would be really powerful,
> > but if not, there are a few things that are obvious to you as
> > developers but would make it easier for novices (like me) to deploy.
> >
> > * download tomcat bin and start with bin/startup.sh (check at
> > localhost:8080)
> > * run mvn install on my ctakes installation to populate jar files in
> > the .m2 directory that were missing
> > * run mvn package inside the ctakes-web-rest subdirectory
> > * copy the .war file into the webapps directory in my tomcat
> > installation.
> > * While I couldn't get the dictionary to work pointing to mysql, I
> > noticed that the dictionary descriptor file has a hardcoded IP
> > address when maybe it should be 127.0.0.1?
> >
> > One other thing I noticed in the code is that in sending back JSON it
> > looks like you're turning the JCas into xml and then parsing it
> > yourself. It should be easier just to access typesystem objects
> > directly. Sean may have some API code laying around to simplify that
> > as well.
> >
> > To iterate over signs/symptoms, for example, you would do:
> >
> > for(SignSymptomMention ss : JCasUtil.select(jcas,
> > SignSymptomMention.class)){
> >   int begin = ss.getBegin(); // begin offset
> >   int end = ss.getEnd(): // end offset ...
> > }
> >
> > Using the typesystem directly may help you to speed up that code or
> > make it easier to read. But maybe there is a reason to write it to
> > xml that I'm not aware of.
> >
> > Finally, I see there are two sub-directories with similar names,
> > ctakes-rest-service and ctakes-web-rest. If they are duplicates can
> > you delete the old one?
> >
> > I'll keep poking around, but hopefully this is helpful feedback for
> > you guys. Thanks again for getting this off the ground!
> >
> > Tim
> >
> >
> >
> >
> > On Thu, 2017-12-07 at 14:16 +, Miller, Timothy wrote:
> > >
> > > I am really interested in this too, just waiting until I have a few
> > > free hours to look around. Don't want you to think it's not of
> > > interest.
> > > Tim
> > >
> > >
> > > On Tue, 2017-12-05 at 19:18 +, Finan, Sean wrote:
> > > >
> > > >
> > > > Hi all,
> > > >
> > > > I am trying to clear a backlog at work.  I will most likely not
> > > > be
> > > > able to do anything with ctakes for another week.  Hopefully some
> > > > rest expert out there can prove their worth by testing ...
> > > >
> > > > Sean
> > > >
> > > > -Original Message-
> > > > From: Matthew Vita [mailto:matthewvit...@gmail.com]
> > > > Sent: Tuesday, December 05, 2017 1:58 PM
> > > > To: dev@ctakes.apache.org
> > > > Subject: Re: cTAKES as REST service [EXTERNAL]
> > > >
> > > >
> > > > Hi Gandhi, Sean, Tim, Alex, James,
> > > >
> > > > I'm still getting back into the swing of things after my 

RE: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] [SUSPICIOUS] [SUSPICIOUS]

2017-12-15 Thread Finan, Sean
Hi Tim,

There is code scattered all throughout ctakes to handle various easy ways, 
starting or stopping at different levels of information - I think that you may 
have actually created some of the best of it (ctakes to anafora maybe?).

I started working on a document bundle created from discovered mentions, 
placing relations (including coref) in arrays of object references.  This is 
different than the DeepPhe approach which uses a coalescence of ctakes types to 
represent a single concept.  It would be nice to (at some point) migrate that 
into ctakes, perhaps after the next DeepPhe release.

It should be able to produce both json and xml output.  I will place it in 
sandbox (later) for you and Gandhi and anybody else that wants to take a look.

Sean 

-Original Message-
From: Miller, Timothy [mailto:timothy.mil...@childrens.harvard.edu] 
Sent: Friday, December 15, 2017 9:47 AM
To: dev@ctakes.apache.org
Subject: Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] [SUSPICIOUS] 
[SUSPICIOUS]

Great, that's very helpful.

I'll be happy to help with extracting the information needed from the CAS the 
easy way. Sean, am I remembering right that there was an API started for that 
somewhere? Or maybe that was part of DeepPhe?

Tim


On Fri, 2017-12-15 at 03:52 +, Gandhi Rajan Natarajan wrote:
> Hi Tim,
> 
> Thanks for taking time out and having a look at this. As you 
> mentioned, the dictionary descriptor file contains details specific to 
> my setup which needs to be changes to 127.0.0.1 by default. Will make 
> the change accordingly.
> 
> The only reason we went ahead with the approach of parsing XML to JSON 
> is due to our lack of in-depth knowledge in cTAKES implementations. If 
> I could get some guidance on how to get the required JSON details 
> directly from type systems, will be happy to implement the same as it 
> will be a huge performance gain.
> 
> Also as you said we have two directories names ctakes-web-rest and 
> ctakes-rest-service. Ctakes-rest-service directory is no longer active 
> and its obsolete. We are just maintaining it for some reference for 
> the time being. We will knock it off soon.
> 
> Thanks again for the detailed feedback.
> 
> Regards,
> Gandhi
> 
> 
> -Original Message-
> From: Miller, Timothy [mailto:timothy.mil...@childrens.harvard.edu]
> Sent: Friday, December 15, 2017 1:25 AM
> To: dev@ctakes.apache.org
> Subject: Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] 
> [SUSPICIOUS]
> 
> I looked at this today. Looks like a great start!
> 
> I was able to get as far as deploying to tomcat, seeing the web form, 
> and submitting, but didn't get correct feedback because I don't have a 
> mysql dictionary set up, which the default descriptor points at. I 
> didn't see any instructions for building that and didn't have time to 
> figure that out.
> 
> I think I mentioned in a different thread that if this whole thing 
> could be wrapped in a docker container that would be really powerful, 
> but if not, there are a few things that are obvious to you as 
> developers but would make it easier for novices (like me) to deploy.
> 
> * download tomcat bin and start with bin/startup.sh (check at
> localhost:8080)
> * run mvn install on my ctakes installation to populate jar files in 
> the .m2 directory that were missing
> * run mvn package inside the ctakes-web-rest subdirectory
> * copy the .war file into the webapps directory in my tomcat 
> installation.
> * While I couldn't get the dictionary to work pointing to mysql, I 
> noticed that the dictionary descriptor file has a hardcoded IP address 
> when maybe it should be 127.0.0.1?
> 
> One other thing I noticed in the code is that in sending back JSON it 
> looks like you're turning the JCas into xml and then parsing it 
> yourself. It should be easier just to access typesystem objects 
> directly. Sean may have some API code laying around to simplify that 
> as well.
> 
> To iterate over signs/symptoms, for example, you would do:
> 
> for(SignSymptomMention ss : JCasUtil.select(jcas, 
> SignSymptomMention.class)){
>   int begin = ss.getBegin(); // begin offset
>   int end = ss.getEnd(): // end offset ...
> }
> 
> Using the typesystem directly may help you to speed up that code or 
> make it easier to read. But maybe there is a reason to write it to xml 
> that I'm not aware of.
> 
> Finally, I see there are two sub-directories with similar names, 
> ctakes-rest-service and ctakes-web-rest. If they are duplicates can 
> you delete the old one?
> 
> I'll keep poking around, but hopefully this is helpful feedback for 
> you guys. Thanks again for getting this off the ground!
> 
> Tim
> 
> 
> 
> 
> On Thu, 2017-12-07 at 14:16 +, Miller, Timothy wrote:
> > 
> > I am really interested in this too, just waiting until I have a few 
> > free hours to look around. Don't want you to think it's not of 
> > interest.
> > Tim
> > 
> > 
> > On Tue, 2017-12-05 at 19:18 +, Finan, Sean wrote:
> > > 
> > > 
> 

Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS] [SUSPICIOUS]

2017-12-15 Thread Miller, Timothy
Great, that's very helpful.

I'll be happy to help with extracting the information needed from the
CAS the easy way. Sean, am I remembering right that there was an API
started for that somewhere? Or maybe that was part of DeepPhe?

Tim


On Fri, 2017-12-15 at 03:52 +, Gandhi Rajan Natarajan wrote:
> Hi Tim,
> 
> Thanks for taking time out and having a look at this. As you
> mentioned, the dictionary descriptor file contains details specific
> to my setup which needs to be changes to 127.0.0.1 by default. Will
> make the change accordingly.
> 
> The only reason we went ahead with the approach of parsing XML to
> JSON is due to our lack of in-depth knowledge in cTAKES
> implementations. If I could get some guidance on how to get the
> required JSON details directly from type systems, will be happy to
> implement the same as it will be a huge performance gain.
> 
> Also as you said we have two directories names ctakes-web-rest and
> ctakes-rest-service. Ctakes-rest-service directory is no longer
> active and its obsolete. We are just maintaining it for some
> reference for the time being. We will knock it off soon.
> 
> Thanks again for the detailed feedback.
> 
> Regards,
> Gandhi
> 
> 
> -Original Message-
> From: Miller, Timothy [mailto:timothy.mil...@childrens.harvard.edu]
> Sent: Friday, December 15, 2017 1:25 AM
> To: dev@ctakes.apache.org
> Subject: Re: cTAKES as REST service [EXTERNAL] [SUSPICIOUS]
> [SUSPICIOUS]
> 
> I looked at this today. Looks like a great start!
> 
> I was able to get as far as deploying to tomcat, seeing the web form,
> and submitting, but didn't get correct feedback because I don't have
> a mysql dictionary set up, which the default descriptor points at. I
> didn't see any instructions for building that and didn't have time to
> figure that out.
> 
> I think I mentioned in a different thread that if this whole thing
> could be wrapped in a docker container that would be really powerful,
> but if not, there are a few things that are obvious to you as
> developers but would make it easier for novices (like me) to deploy.
> 
> * download tomcat bin and start with bin/startup.sh (check at
> localhost:8080)
> * run mvn install on my ctakes installation to populate jar files in
> the .m2 directory that were missing
> * run mvn package inside the ctakes-web-rest subdirectory
> * copy the .war file into the webapps directory in my tomcat
> installation.
> * While I couldn't get the dictionary to work pointing to mysql, I
> noticed that the dictionary descriptor file has a hardcoded IP
> address when maybe it should be 127.0.0.1?
> 
> One other thing I noticed in the code is that in sending back JSON it
> looks like you're turning the JCas into xml and then parsing it
> yourself. It should be easier just to access typesystem objects
> directly. Sean may have some API code laying around to simplify that
> as well.
> 
> To iterate over signs/symptoms, for example, you would do:
> 
> for(SignSymptomMention ss : JCasUtil.select(jcas,
> SignSymptomMention.class)){
>   int begin = ss.getBegin(); // begin offset
>   int end = ss.getEnd(): // end offset ...
> }
> 
> Using the typesystem directly may help you to speed up that code or
> make it easier to read. But maybe there is a reason to write it to
> xml that I'm not aware of.
> 
> Finally, I see there are two sub-directories with similar names,
> ctakes-rest-service and ctakes-web-rest. If they are duplicates can
> you delete the old one?
> 
> I'll keep poking around, but hopefully this is helpful feedback for
> you guys. Thanks again for getting this off the ground!
> 
> Tim
> 
> 
> 
> 
> On Thu, 2017-12-07 at 14:16 +, Miller, Timothy wrote:
> > 
> > I am really interested in this too, just waiting until I have a few
> > free hours to look around. Don't want you to think it's not of
> > interest.
> > Tim
> > 
> > 
> > On Tue, 2017-12-05 at 19:18 +, Finan, Sean wrote:
> > > 
> > > 
> > > Hi all,
> > > 
> > > I am trying to clear a backlog at work.  I will most likely not
> > > be
> > > able to do anything with ctakes for another week.  Hopefully some
> > > rest expert out there can prove their worth by testing ...
> > > 
> > > Sean
> > > 
> > > -Original Message-
> > > From: Matthew Vita [mailto:matthewvit...@gmail.com]
> > > Sent: Tuesday, December 05, 2017 1:58 PM
> > > To: dev@ctakes.apache.org
> > > Subject: Re: cTAKES as REST service [EXTERNAL]
> > > 
> > > 
> > > Hi Gandhi, Sean, Tim, Alex, James,
> > > 
> > > I'm still getting back into the swing of things after my trip
> > > (I'm
> > > on business traveling at the moment, here in the states). I will
> > > be
> > > jumping right back into cTAKES REST development next week
> > > personally
> > > and with a new team mate from the open source team.
> > > 
> > > I'm so sorry for my silence/lack of updates!!! Very excited to
> > > see
> > > what Gandhi's updates are looking like and enriching the JSON
> > > response payload.
> > > 
> > > Thanks,
> > > 
> >