Thanks for the detailed explanation Sean. We will have a look at the PiperFileReader and try to implement the rest module in similar lines.
Will keep you posted. Thanks again. Regards, Gandhi -----Original Message----- From: Finan, Sean [mailto:sean.fi...@childrens.harvard.edu] Sent: Wednesday, November 22, 2017 1:21 AM To: dev@ctakes.apache.org Subject: RE: Use of custom Dictionary Descriptor file [EXTERNAL] Hi Gandhi, You don't need to add that code. There is already a parameter named "LookupXml" that can be used. That being said, I just took a look at the code in github. To be honest, I would not use the DemoServlet class. It uses a hardcoded pipeline, complete with parameter values. Instead I would write a new one that utilizes the PiperFileReader in core. If you do that then you can start up a demo with any pipeline you want - there is no need to create new code for each different type of pipeline - e.g. default clinical vs. temporal. You can set any custom parameter values in the piper file. This is the gist: // Add a simple pre-defined existing pipeline from a file or resource PiperFileReader reader = new PiperFileReader( PIPER_FILE_PATH ); // Get a description of the pipeline created from the file PipelineBuilder builder = reader.getBuilder(); AnalysisEngineDescription pipeline = builder. getAnalysisEngineDesc(); // For each post, create a jcas object. Consider using a caspool instead. JCas jcas = JCasFactory.createJCas(); // Set the posted text and run the pipeline jcas.setDocumentText( TEXT ); SimplePipeline.runPipeline( jcas, pipeline ); There may be a better way to run than with the SimplePipeline, but the above should suffice. It would be cool if there was an option for response from the HtmlTextWriter, but I don't know how quick and easy that would be to implement. Sean -----Original Message----- From: Gandhi Rajan Natarajan [mailto:gandhi.natara...@arisglobal.com] Sent: Tuesday, November 21, 2017 1:36 PM To: dev@ctakes.apache.org Subject: RE: Use of custom Dictionary Descriptor file [EXTERNAL] Hi Sean and Sirisha, Thanks a lot for the response. I tried building and deploying the war from the following repo - https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_healthnlp_examples_tree_master_ctakes-2Dtemporal-2Ddemo&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=-7baoaqCVXKSRgEv043CJiX_gElMEnuOa7GOCy80Gw4&s=kiJMuwmqMs4szLaIFtTi_lAJVc2h5KK5VYAkmN6wJmU&e= On server start, it looks for sno_rx_16ab.xml. Not sure what configuration exactly you are asking for. Also as you said we are looking to set the parameter LookupXml dynamically in AbstractJCasTermAnnotator.java file's initialize method as follows: String _customDescriptorFilePath = System.getenv("CUSTOM_DESC_FILE_PATH"); if(_customDescriptorFilePath != null) { LOGGER.info( "Using custom descriptor file path: " + _customDescriptorFilePath ); _descriptorFilePath = _customDescriptorFilePath; } Is this approach fine? Regards, Gandhi -----Original Message----- From: Finan, Sean [mailto:sean.fi...@childrens.harvard.edu] Sent: Tuesday, November 21, 2017 9:32 PM To: dev@ctakes.apache.org Subject: RE: Use of custom Dictionary Descriptor file [EXTERNAL] Hi Gandhi, You don't need to have sno_rx_16ab* . I don't know exactly how you are configured, but if you have another dictionary that you want to use instead of the default sno_rx then you just need to create it and then point the custom config .xml. This can be done a couple of ways, but basically set the parameter LookupXml to point to your custom xml path. This needs to be done at startup. Once ctakes is running (i.e. as a service) you cannot change the dictionary. This is briefly explained at the bottom of the wiki page: https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_CTAKES_Dictionary-2BCreator-2BGUI&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=-7baoaqCVXKSRgEv043CJiX_gElMEnuOa7GOCy80Gw4&s=3NuvXMGraH4F2tk5TDjgza9ie9kIyCuhbyeku-Xu3hI&e= Sean -----Original Message----- From: Gandhi Rajan Natarajan [mailto:gandhi.natara...@arisglobal.com] Sent: Tuesday, November 21, 2017 10:44 AM To: dev@ctakes.apache.org Subject: RE: Use of custom Dictionary Descriptor file [EXTERNAL] Hi Sean, When we try to deploy cTAKES as web application, it always looks for sno_rx_16ab.xml by default on server start. So do you mean we should also have sno_rx_16ab.xml as well as custom xml file in the resources folder all the time? Regards, Gandhi -----Original Message----- From: Finan, Sean [mailto:sean.fi...@childrens.harvard.edu] Sent: Tuesday, November 21, 2017 8:42 PM To: dev@ctakes.apache.org Subject: RE: Use of custom Dictionary Descriptor file [EXTERNAL] Hi Sandeep, Adding a custom dictionary should never require code modification. The dictionary creator gui will create a custom dictionary and its .xml configuration file and place them in your ctakes resources/ directory. No code changes necessary. https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_CTAKES_Dictionary-2BCreator-2BGUI&d=DwIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=K-fWZaRAkXxJHPoz7nhE5U4rhYmrwSrGwMqji82GLVc&s=DIMsU-EWm6kc1X-08Z2GlrsKmug3xQCnPgtDAXp3o1s&e= If you search the ctakes devlist emails you should find some threads discussing custom dictionaries and bsv files. (bar separated value, aka pipe-delimited). For smaller custom dictionaries those can be created. The emails should include information on creating the .xml dictionary configuration files. Sean -----Original Message----- From: Sandeep Byatha Gururaja rao [mailto:sandeep...@arisglobal.com] Sent: Tuesday, November 21, 2017 9:40 AM To: dev@ctakes.apache.org Subject: Use of custom Dictionary Descriptor file [EXTERNAL] Hi, Is there currently any way to use a custom dictionary descriptor file without making changes to the code or by rebuilding the ctakes-dictionary-lookup-fast jar file. Regards, Sandeep This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender or system manager by email immediately if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited and against the law. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender or system manager by email immediately if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited and against the law. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender or system manager by email immediately if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited and against the law. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender or system manager by email immediately if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited and against the law.