Re: Analysis Engine Process Exception while querying ctakes Service frequently

2019-03-06 Thread satyananda sahu
@RequestMapping(value = "/analyze", method = RequestMethod.POST)
   @ResponseBody
   public Map> getAnalyzedJSON(@RequestBody String
analysisText) throws ServletException, IOException {
   Map> resultMap = null;
   if (analysisText != null && analysisText.trim().length() > 0) {
   JCas jcas = pool.getJCas(-1);
   try {
   jcas.setDocumentText(analysisText);
   engine. .process(jcas);



   resultMap = formatResults(jcas);
//check this might help you
  *jcas.reset();*


   } catch (Exception e) {
   e.printStackTrace();
   throw new ServletException(e);
   } finally {
pool.releaseJCas(jcas); //Releasing JCas
   }
   }
return resultMap;
   }

check this link:
https://uima.apache.org/d/uimaj-current/apidocs/org/apache/uima/analysis_engine/AnalysisEngine.html


On Wed, Mar 6, 2019 at 3:14 PM Zakir Saifi  wrote:

> Hi @Satyananda Sahu
> Could you elaborate about how r*esetting the annotators and process
> engine*?.
> I currently releasing the JCas pool after each rest call and in case of an
> exception, I am also releasing the JCas.
>
> Here is my code. Post construct work only for the First time. Then the
> subsequent Rest calls process JCas and release after the use.
>
> @PostConstruct
> public void init() throws ServletException {
> LOGGER.info("Initializing analysis engine and jcas pool");
> try {
> final File inputFile= FileLocator.getFile(PIPER_FILE_PATH);
> PiperFileReader reader  = new
> PiperFileReader(inputFile.getAbsolutePath());
> PipelineBuilder builder = reader.getBuilder();
> AnalysisEngineDescription analysisEngineDesc =
> builder.getAnalysisEngineDesc();
> engine =
> UIMAFramework.produceAnalysisEngine(analysisEngineDesc);
> pool = new JCasPool(300, engine);
> } catch (Exception e) {
> e.printStackTrace();
> throw new ServletException(e);
> }
> }
>
> @RequestMapping(value = "/analyze", method = RequestMethod.POST)
>@ResponseBody
>public Map> getAnalyzedJSON(@RequestBody String
> analysisText) throws ServletException, IOException {
>Map> resultMap = null;
>if (analysisText != null && analysisText.trim().length() > 0) {
>JCas jcas = pool.getJCas(-1);
>try {
>jcas.setDocumentText(analysisText);
>engine. .process(jcas);
>resultMap = formatResults(jcas);
>} catch (Exception e) {
>e.printStackTrace();
>throw new ServletException(e);
>    } finally {
> pool.releaseJCas(jcas); //Releasing JCas
>}
>}
> return resultMap;
>}
>
>
>
> On Wed, Mar 6, 2019 at 12:42 PM satyananda sahu 
> wrote:
>
> > Reset the annotators and process engine for each call and it should work
> > for you.
> >
> > Thanks,
> > Satya
> >
> > On Tue, Mar 5, 2019 at 3:12 PM Zakir Saifi  wrote:
> >
> > > Hi all,
> > >
> > > I using Ctakes Rest Service(a Rest Server based on Apache Ctakes) for
> > > benchmarking using *Apache Jmeter*. As I have to use it as Rest Server
> to
> > > processing many clinical Text
> > >
> > > My Configuration for BenchMarking are as follows:
> > > I am creating 10 users(threads) each with Ramp up period (*10s*). *That
> > > means 1 user is created after every 1 second. *
> > > I have loop count of *5* (Number of iteration)
> > > There is a time delay of *500ms* between each subsequent Request ( To
> > > simulate requests as in real-time scenarios, real-users give delays
> > between
> > > doing different actions.)
> > > I am also changing the *data* with each request by using data from CSV
> > > file.
> > >
> > > I am getting following exceptions for most* of the requests* that comes
> > to
> > > Ctakes Rest Sever
> > >
> > > Exception1
> > > org.apache.uima.analysis_engine.s: Annotator processing failed.
> > > at
> > >
> > >
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
> > > at
> > >
> > >
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
> > > at
> > >
> > >
> >
> org

Re: Analysis Engine Process Exception while querying ctakes Service frequently

2019-03-06 Thread satyananda sahu
@RequestMapping(value = "/analyze", method = RequestMethod.POST)
   @ResponseBody
   public Map> getAnalyzedJSON(@RequestBody String
analysisText) throws ServletException, IOException {
   Map> resultMap = null;
   if (analysisText != null && analysisText.trim().length() > 0) {
   JCas jcas = pool.getJCas(-1);
   try {
   jcas.setDocumentText(analysisText);
   engine. .process(jcas);

//check this might help you
  *jcas.reset();*



   resultMap = formatResults(jcas);
   } catch (Exception e) {
   e.printStackTrace();
   throw new ServletException(e);
   } finally {
pool.releaseJCas(jcas); //Releasing JCas
   }
   }
return resultMap;
   }

check this link:
https://uima.apache.org/d/uimaj-current/apidocs/org/apache/uima/analysis_engine/AnalysisEngine.html

On Wed, Mar 6, 2019 at 3:14 PM Zakir Saifi  wrote:

> Hi @Satyananda Sahu
> Could you elaborate about how r*esetting the annotators and process
> engine*?.
> I currently releasing the JCas pool after each rest call and in case of an
> exception, I am also releasing the JCas.
>
> Here is my code. Post construct work only for the First time. Then the
> subsequent Rest calls process JCas and release after the use.
>
> @PostConstruct
> public void init() throws ServletException {
> LOGGER.info("Initializing analysis engine and jcas pool");
> try {
> final File inputFile= FileLocator.getFile(PIPER_FILE_PATH);
> PiperFileReader reader  = new
> PiperFileReader(inputFile.getAbsolutePath());
> PipelineBuilder builder = reader.getBuilder();
> AnalysisEngineDescription analysisEngineDesc =
> builder.getAnalysisEngineDesc();
> engine =
> UIMAFramework.produceAnalysisEngine(analysisEngineDesc);
> pool = new JCasPool(300, engine);
> } catch (Exception e) {
> e.printStackTrace();
> throw new ServletException(e);
> }
> }
>
> @RequestMapping(value = "/analyze", method = RequestMethod.POST)
>@ResponseBody
>public Map> getAnalyzedJSON(@RequestBody String
> analysisText) throws ServletException, IOException {
>Map> resultMap = null;
>if (analysisText != null && analysisText.trim().length() > 0) {
>JCas jcas = pool.getJCas(-1);
>try {
>jcas.setDocumentText(analysisText);
>engine. .process(jcas);
>resultMap = formatResults(jcas);
>} catch (Exception e) {
>e.printStackTrace();
>throw new ServletException(e);
>    } finally {
> pool.releaseJCas(jcas); //Releasing JCas
>}
>}
> return resultMap;
>}
>
>
>
> On Wed, Mar 6, 2019 at 12:42 PM satyananda sahu 
> wrote:
>
> > Reset the annotators and process engine for each call and it should work
> > for you.
> >
> > Thanks,
> > Satya
> >
> > On Tue, Mar 5, 2019 at 3:12 PM Zakir Saifi  wrote:
> >
> > > Hi all,
> > >
> > > I using Ctakes Rest Service(a Rest Server based on Apache Ctakes) for
> > > benchmarking using *Apache Jmeter*. As I have to use it as Rest Server
> to
> > > processing many clinical Text
> > >
> > > My Configuration for BenchMarking are as follows:
> > > I am creating 10 users(threads) each with Ramp up period (*10s*). *That
> > > means 1 user is created after every 1 second. *
> > > I have loop count of *5* (Number of iteration)
> > > There is a time delay of *500ms* between each subsequent Request ( To
> > > simulate requests as in real-time scenarios, real-users give delays
> > between
> > > doing different actions.)
> > > I am also changing the *data* with each request by using data from CSV
> > > file.
> > >
> > > I am getting following exceptions for most* of the requests* that comes
> > to
> > > Ctakes Rest Sever
> > >
> > > Exception1
> > > org.apache.uima.analysis_engine.s: Annotator processing failed.
> > > at
> > >
> > >
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
> > > at
> > >
> > >
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
> > > at
> > >
> > >
> >
> org

Re: Analysis Engine Process Exception while querying ctakes Service frequently

2019-03-05 Thread satyananda sahu
Reset the annotators and process engine for each call and it should work
for you.

Thanks,
Satya

On Tue, Mar 5, 2019 at 3:12 PM Zakir Saifi  wrote:

> Hi all,
>
> I using Ctakes Rest Service(a Rest Server based on Apache Ctakes) for
> benchmarking using *Apache Jmeter*. As I have to use it as Rest Server to
> processing many clinical Text
>
> My Configuration for BenchMarking are as follows:
> I am creating 10 users(threads) each with Ramp up period (*10s*). *That
> means 1 user is created after every 1 second. *
> I have loop count of *5* (Number of iteration)
> There is a time delay of *500ms* between each subsequent Request ( To
> simulate requests as in real-time scenarios, real-users give delays between
> doing different actions.)
> I am also changing the *data* with each request by using data from CSV
> file.
>
> I am getting following exceptions for most* of the requests* that comes to
> Ctakes Rest Sever
>
> Exception1
> org.apache.uima.analysis_engine.s: Annotator processing failed.
> at
>
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
> at
>
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
> at
>
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:567)
> at
>
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.(ASB_impl.java:409)
> at
>
> org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)
> at
>
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)
> at
>
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
> at
>
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:280)
> at
>
> org.apache.ctakes.rest.service.CtakesRestController.getAnalyzedJSON(CtakesRestController.java:95)
> at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
>
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
> at
>
> org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
> at
>
> org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
> at
>
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
> at
>
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
> at
>
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
> at
>
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
> at
>
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
> at
>
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
> at
>
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
> at
>
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
> at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
> at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
> at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
> at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
> at
>
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
> at
>
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
> at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
> at
> 

Re: Cannot authenticate license on REST API TRACKING:000308016 [EXTERNAL]

2018-07-19 Thread satyananda sahu
Hi Ritika,

You can try logging in to https://uts.nlm.nih.gov/home.html using your
userid and password, if it works then your userid and password is valid for
umls.


Thanks,
Satya



On Thu, Jul 19, 2018 at 4:59 PM, Jain, Ritika 
wrote:

> I have configured the password in both the places - xml and as
> environmental variable.
> Another thing to notice is that if I hit the API that ctakes is using to
> valiate the user using postman ( web debugger) I still get a false --
>
> POST https://uts-ws.nlm.nih.gov/restful/isValidUMLSUser
>
> BODY: licenseCode=NLM-3495749
> user=ritikajain
> password=XX
>
>
> and I still a false.
>
> You can also try hitting the API with a vaild UMLS license with postman,
> and hopefully it should give a false
>
> Ritika
>
>
>
> -Original Message-
> From: Miller, Timothy 
> Sent: Thursday, July 19, 2018 4:55 PM
> To: dev@ctakes.apache.org
> Subject: Re: Cannot authenticate license on REST API TRACKING:000308016
> [EXTERNAL]
>
> Are you providing your password via the xml descriptor file or an
> environment variable? The only thing I can think of is that there might be
> some misformatting in the xml, like an extra trailing space/newline in the
> field where one of the username/password goes.
> Tim
>
> 
> From: Jain, Ritika 
> Sent: Thursday, July 19, 2018 7:15 AM
> To: dev@ctakes.apache.org
> Subject: RE: Cannot authenticate license on REST API TRACKING:000308016
> [EXTERNAL]
>
> Hi Sean
>
> See this reply from UMLS support
>
>
> That endpoint (documented here:https://emea01.safelinks.
> protection.outlook.com/?url=https%3A%2F%2Furldefense.
> proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__emea01.safelinks.
> protection.outlook.com_-3Furl-3Dhttps-253A-252F-
> 252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-
> 253Dhttps-2D3A-5F-5Futs.nlm.nih.gov-5Fhelp-5Flicense-
> 5Fvalidateumlsuserhelp.html-2526d-253DDwIFAg-2526c-253DqS4goWBT7poplM69zy-
> 5F3xhKwEW14JZMSdioCoppxeFU-2526r-253Dfs67GvlGZstTpyIisCYNYmQCP6
> r0bcpKGd4f7d4gTao-2526m-253DfQiwb4h2SxUTGfMyinBlOo9wdb
> QdJuM3zugwflzf1F8-2526s-253DuO0nsPPev-2DybnYKedCLy-
> 5F4HwS1GZsf7u-2D8H5w2UOyek-2526e-26amp-3Bdata-3D02-257C01-257C-
> 257C032497f07be34e9a6b3908d5ecd6787f-257C1a407a2d76754d178692b3ac28
> 5306e4-257C0-257C0-257C636675328259370278-26amp-3Bsdata-
> 3DkRL2rxurzA6WxsuiSYm9zRwvVeaMAys3dXFcbR1y-252BZc-253D-
> 26amp-3Breserved-3D0-3D%26d%3DDwIFAg%26c%3DqS4goWBT7poplM69zy_
> 3xhKwEW14JZMSdioCoppxeFU%26r%3Dfs67GvlGZstTpyIisCYNYmQCP6r0
> bcpKGd4f7d4gTao%26m%3DGqHa003bWO-wQ-O5I0ufpc_LJHggfChk83dWdrndMS4%26s%3D-
> bDdjhQcUbADrAh24ci4iuJtNAILeTUJ7wYnpPORBQU%26edata=02%7C01%7C%
> 7C2cb58d890ef94c7aa76408d5ece0669d%7C1a407a2d76754d178692b3ac2853
> 06e4%7C0%7C0%7C636675370907437611sdata=MAlPCxcpI%2F5QX92datNpg%
> 2BfZjSyb9IBRl%2FE7q9mevzw%3Dreserved=0=
> )
> is not meant for end users, so it will not work with your license code and
> username.
>
>
> The ctakes CVD uses the same end point ( also, pointed out in the logs I
> shared).
>
> Regards,
> Ritika
>
> -Original Message-
> From: Finan, Sean 
> Sent: Thursday, July 19, 2018 4:39 PM
> To: dev@ctakes.apache.org
> Subject: Re: Cannot authenticate license on REST API TRACKING:000308016
> [EXTERNAL]
>
> Hi Ritika,
>
> I am glad that adding your proxy information got you one step closer to a
> working configuration.  However, I cannot say why your password isn't being
> properly validated.  If you can reach the umls server and your credentials
> are correct then the umls server should reply positively and ctakes should
> let the pipeline continue.
>
> Does anybody else on the devlist have any ideas?
>
> Sean
> 
> From: Jain, Ritika 
> Sent: Thursday, July 19, 2018 5:06 AM
> To: dev@ctakes.apache.org
> Subject: RE: Cannot authenticate license on REST API TRACKING:000308016
> [EXTERNAL]
>
> I can get it working adding proxy parameters in the java command, now I do
> not get the connection timeout, but a different error that the user is not
> valid. If you follow the email chain below, the support person from UMLS
> says that my user is a valid user and the account user to validate the user
> is not for end point users.
>
> Can you help me with this?
>
>
>
> 14:29:06,054 DEBUG [DataBinder] DataBinder requires binding of required
> fields []
> 14:29:06,060 TRACE [TypeConverterDelegate] Converting String to [class
> java.lang.String] using property editor [org.apache.uima.fit.internal.
> propertyeditors.GetAsTextStringEditor@39c6fd02]
> 14:29:06,067 TRACE [TypeConverterDelegate] Converting String to [class
> java.lang.String] using property editor [org.apache.uima.fit.internal.
> propertyeditors.GetAsTextStringEditor@39c6fd02]
> 14:29:06,072 INFO  [Chunker] Chunker model file: org/apache/ctakes/chunker/
> models/chunker-model.zip
> 14:29:07,745 DEBUG [DataBinder] DataBinder requires binding of required
> fields []
> 14:29:07,746 INFO  [TokenizerAnnotatorPTB] Initializing
> 

Re: non Medical entity extraction

2018-01-02 Thread satyananda sahu
Hi Abhilash,  Create a custom annotator for extracting non medical data and add 
it to the cTAKES flow. This should do the work for you.

Thanks,
Satya

On 2017-12-21 14:56,  wrote: 
> Hi All,> 
> 
> Is there an option currently available with CTAKES for extracting patient 
> name, age etc. from Medical records and lab reports?> 
> 
> Thanks,> 
> Abilash Mathew> 
> This e-mail and any files transmitted with it are for the sole use of the 
> intended recipient(s) and may contain confidential and privileged 
> information. If you are not the intended recipient(s), please reply to the 
> sender and destroy all copies of the original message. Any unauthorized 
> review, use, disclosure, dissemination, forwarding, printing or copying of 
> this email, and/or any action taken in reliance on the contents of this 
> e-mail is strictly prohibited and may be unlawful. Where permitted by 
> applicable law, this e-mail and other e-mail communications sent to and from 
> Cognizant e-mail addresses may be monitored.> 
> 

identifying core semantic analysis engine of cTAKES

2017-12-20 Thread satyananda sahu
Hi Team,


I need some clarification on the process flow of ctakes. Below are my
understanding let me know if I am correct.

1. cTAKES uses the UMLS concept as it is for annotating the words from
clinical text.
2. Based on TUI semantic group, cTAKES has also created semantic group to
hold the set of annotate words.
3. Each CUI is associated with a TUI, CUI are also linked to snomed and
rxnorm code. CUI is an UMLS concept id.
3. cTAKES semantic analysis is based on TUI group.


Now when I am processing a clinical text, it annotates the word as well as
it gives me all the snomed code associated to the concept.

someone from team could please help me to identify the place where all this
are happenings


Thanks,
Satya


Re: Need help to identify the nlp processing part of cTAKES [EXTERNAL]

2017-12-18 Thread satyananda sahu
Hi Sean,

I have an use case, where I need to integrate my concepts with snomed
concept and it is bit different from normal UMLS concept. I have my own sql
scripts for CUI Terms and concept where concepts are mapped to CUI.

Currently, cTAKES dictionary consists of CUI_TERMS, PERF_TERM, RX_NORM, TUI
that is UMLS concepts. I am trying to customize it for a generic use where
I can plug and play with different dictionaries and there relationship and
get the medical terms annotated.

Could you please guide me in this.


Thanks,
Satya


On Mon, Dec 18, 2017 at 7:57 PM, Finan, Sean <
sean.fi...@childrens.harvard.edu> wrote:

> Hi Satya,
>
> Could you please let us know what steps you have already taken to create
> and integrate the custom dictionary?
>
> Thanks,
> Sean
>
> https://cwiki.apache.org/confluence/display/CTAKES/Dictionary+Creator+GUI
>
>
>
> -Original Message-
> From: satyananda sahu [mailto:satyananda...@gmail.com]
> Sent: Monday, December 18, 2017 4:21 AM
> To: dev@ctakes.apache.org
> Subject: Need help to identify the nlp processing part of cTAKES [EXTERNAL]
>
> Hi Team,
>
> Currently I am working on cTAKES to see if I can customize the dictionary
> part. I need help from dev team to help me to identify the nlp processing
> part of ctake and dictionary integration part of it.
>
>
> If I am trying to integrate the custom dictionary my words are not getting
> annotated.
>
>
> Thanks,
> Satya
>


Need help to identify the nlp processing part of cTAKES

2017-12-18 Thread satyananda sahu
Hi Team,

Currently I am working on cTAKES to see if I can customize the dictionary
part. I need help from dev team to help me to identify the nlp processing
part of ctake and dictionary integration part of it.


If I am trying to integrate the custom dictionary my words are not getting
annotated.


Thanks,
Satya