You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by Gandhi Rajan Natarajan <Ga...@arisglobal.com> on 2017/10/14 07:51:51 UTC

Queries on custom annotators

Hi All,

We have wrote a custom annotation to identify the pharma company names, integrated it with cTAKES and it works fairly well with CVD. But when I tried integrating the same in my extended  web application that uses https://github.com/healthnlp/examples/tree/master/ctakes-temporal-demo  as base, I face few issues.


1)      We have defined certain mandatory parameter for the annotator. The JAVA code and XML config for passing the parameters is as follows:

public static final String PARAM_JDBC_DRIVER = "JdbcDriver";
public static final String PARAM_JDBC_URL = "JdbcUrl";
public static final String PARAM_JDBC_USER = "JdbcUser";
public static final String PARAM_JDBC_PASS = "JdbcPass";
@ConfigurationParameter(name = PARAM_JDBC_DRIVER, mandatory = false, description = "JDBC Driver")
private String jdbcDriver;

@ConfigurationParameter(name = PARAM_JDBC_URL, mandatory = false, description = "JDBC URL")
private String jdbcUrl;

@ConfigurationParameter(name = PARAM_JDBC_USER, mandatory = false, description = "JDBC User")
private String jdbcUser ;

@ConfigurationParameter(name = PARAM_JDBC_PASS, mandatory = false, description = "JDBC Pass")
private String jdbcPass;



<configurationParameters>
<configurationParameter>
        <name>JdbcDriver</name>
        <description>JdbcDriver</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUrl</name>
        <description>JdbcUrl</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUser</name>
        <description>JdbcUser</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcPass</name>
        <description>JdbcPass</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>
</configurationParameters>

<configurationParameterSettings>
      <nameValuePair>
        <name>JdbcDriver</name>
        <value>
          <string>com.mysql.jdbc.Driver</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUrl</name>
        <value>
          <string>jdbc:mysql://127.0.0.1:3306/umls?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUser</name>
        <value>
          <string>root</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcPass</name>
        <value>
          <string>admin123</string>
        </value>
      </nameValuePair>
</configurationParameterSettings>

If I change the mandate attribute from 'false' to 'true', while trying to use this annotator, I get an error stating that the mandatory parameter is not passed. I'm not sure what other configuration is required to make this work and pass mandatory values. Any help on this?


2)      Currently in the 'initialize' method of the annotator, I'm loading few metadata resources using the following code,


InputStream inputStream = annotCtx.getResourceAsStream(fileName);

But when this line is executed, it gives a following warning message in the console,

"13-Oct-2017 15:54:50.141 WARNING [localhost-startStop-1] org.apache.uima.impl.ChildUimaContext_impl.getResourceAsStream The unmanaged resource ORG.txt was accessed.This feature is deprecated, and support may be removed in future versions."

Could someone throw some light on how to resolve this warning and loaded the resource in a best way?

Regards,
Gandhi

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.

RE: Queries on custom annotators [EXTERNAL]

Posted by Gandhi Rajan Natarajan <Ga...@arisglobal.com>.
Will check it out Sean. Thanks for your prompt response as always.

Regards,
Gandhi


-----Original Message-----
From: Finan, Sean [mailto:Sean.Finan@childrens.harvard.edu]
Sent: Monday, October 16, 2017 8:25 PM
To: dev@ctakes.apache.org
Subject: RE: Queries on custom annotators [EXTERNAL]

Hi Gandhi,

For 1)  Just to be sure, you are running your pipeline using xml descriptor files?
For 2)  Consider using FileLocator.getAsStream(..).

Sean

-----Original Message-----
From: Gandhi Rajan Natarajan [mailto:Gandhi.Natarajan@arisglobal.com]
Sent: Saturday, October 14, 2017 3:52 AM
To: dev@ctakes.apache.org
Subject: Queries on custom annotators [EXTERNAL]

Hi All,

We have wrote a custom annotation to identify the pharma company names, integrated it with cTAKES and it works fairly well with CVD. But when I tried integrating the same in my extended  web application that uses 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=Zbg2DrUy1YNQ0FBNuKWzx8i2dSCVUWvyJ57O_iO6jKY&s=c3NWc2Ah1memb3jrupIa1tTA7IWwKooyllOwrQ8zlq8&e=  as base, I face few issues.


1)      We have defined certain mandatory parameter for the annotator. The JAVA code and XML config for passing the parameters is as follows:

public static final String PARAM_JDBC_DRIVER = "JdbcDriver"; public static final String PARAM_JDBC_URL = "JdbcUrl"; public static final String PARAM_JDBC_USER = "JdbcUser"; public static final String PARAM_JDBC_PASS = "JdbcPass"; @ConfigurationParameter(name = PARAM_JDBC_DRIVER, mandatory = false, description = "JDBC Driver") private String jdbcDriver;

@ConfigurationParameter(name = PARAM_JDBC_URL, mandatory = false, description = "JDBC URL") private String jdbcUrl;

@ConfigurationParameter(name = PARAM_JDBC_USER, mandatory = false, description = "JDBC User") private String jdbcUser ;

@ConfigurationParameter(name = PARAM_JDBC_PASS, mandatory = false, description = "JDBC Pass") private String jdbcPass;



<configurationParameters>
<configurationParameter>
        <name>JdbcDriver</name>
        <description>JdbcDriver</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUrl</name>
        <description>JdbcUrl</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUser</name>
        <description>JdbcUser</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcPass</name>
        <description>JdbcPass</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>
</configurationParameters>

<configurationParameterSettings>
      <nameValuePair>
        <name>JdbcDriver</name>
        <value>
          <string>com.mysql.jdbc.Driver</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUrl</name>
        <value>
          <string>jdbc:mysql://127.0.0.1:3306/umls?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUser</name>
        <value>
          <string>root</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcPass</name>
        <value>
          <string>admin123</string>
        </value>
      </nameValuePair>
</configurationParameterSettings>

If I change the mandate attribute from 'false' to 'true', while trying to use this annotator, I get an error stating that the mandatory parameter is not passed. I'm not sure what other configuration is required to make this work and pass mandatory values. Any help on this?


2)      Currently in the 'initialize' method of the annotator, I'm loading few metadata resources using the following code,


InputStream inputStream = annotCtx.getResourceAsStream(fileName);

But when this line is executed, it gives a following warning message in the console,

"13-Oct-2017 15:54:50.141 WARNING [localhost-startStop-1] org.apache.uima.impl.ChildUimaContext_impl.getResourceAsStream The unmanaged resource ORG.txt was accessed.This feature is deprecated, and support may be removed in future versions."

Could someone throw some light on how to resolve this warning and loaded the resource in a best way?

Regards,
Gandhi

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.

RE: Queries on custom annotators [EXTERNAL]

Posted by "Finan, Sean" <Se...@childrens.harvard.edu>.
Hi Gandhi,

For 1)  Just to be sure, you are running your pipeline using xml descriptor files?
For 2)  Consider using FileLocator.getAsStream(..).

Sean

-----Original Message-----
From: Gandhi Rajan Natarajan [mailto:Gandhi.Natarajan@arisglobal.com] 
Sent: Saturday, October 14, 2017 3:52 AM
To: dev@ctakes.apache.org
Subject: Queries on custom annotators [EXTERNAL]

Hi All,

We have wrote a custom annotation to identify the pharma company names, integrated it with cTAKES and it works fairly well with CVD. But when I tried integrating the same in my extended  web application that uses 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=Zbg2DrUy1YNQ0FBNuKWzx8i2dSCVUWvyJ57O_iO6jKY&s=c3NWc2Ah1memb3jrupIa1tTA7IWwKooyllOwrQ8zlq8&e=  as base, I face few issues.


1)      We have defined certain mandatory parameter for the annotator. The JAVA code and XML config for passing the parameters is as follows:

public static final String PARAM_JDBC_DRIVER = "JdbcDriver"; public static final String PARAM_JDBC_URL = "JdbcUrl"; public static final String PARAM_JDBC_USER = "JdbcUser"; public static final String PARAM_JDBC_PASS = "JdbcPass"; @ConfigurationParameter(name = PARAM_JDBC_DRIVER, mandatory = false, description = "JDBC Driver") private String jdbcDriver;

@ConfigurationParameter(name = PARAM_JDBC_URL, mandatory = false, description = "JDBC URL") private String jdbcUrl;

@ConfigurationParameter(name = PARAM_JDBC_USER, mandatory = false, description = "JDBC User") private String jdbcUser ;

@ConfigurationParameter(name = PARAM_JDBC_PASS, mandatory = false, description = "JDBC Pass") private String jdbcPass;



<configurationParameters>
<configurationParameter>
        <name>JdbcDriver</name>
        <description>JdbcDriver</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUrl</name>
        <description>JdbcUrl</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcUser</name>
        <description>JdbcUser</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>

<configurationParameter>
        <name>JdbcPass</name>
        <description>JdbcPass</description>
        <type>String</type>
        <multiValued>false</multiValued>
        <mandatory>false</mandatory>
      </configurationParameter>
</configurationParameters>

<configurationParameterSettings>
      <nameValuePair>
        <name>JdbcDriver</name>
        <value>
          <string>com.mysql.jdbc.Driver</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUrl</name>
        <value>
          <string>jdbc:mysql://127.0.0.1:3306/umls?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcUser</name>
        <value>
          <string>root</string>
        </value>
      </nameValuePair>

      <nameValuePair>
        <name>JdbcPass</name>
        <value>
          <string>admin123</string>
        </value>
      </nameValuePair>
</configurationParameterSettings>

If I change the mandate attribute from 'false' to 'true', while trying to use this annotator, I get an error stating that the mandatory parameter is not passed. I'm not sure what other configuration is required to make this work and pass mandatory values. Any help on this?


2)      Currently in the 'initialize' method of the annotator, I'm loading few metadata resources using the following code,


InputStream inputStream = annotCtx.getResourceAsStream(fileName);

But when this line is executed, it gives a following warning message in the console,

"13-Oct-2017 15:54:50.141 WARNING [localhost-startStop-1] org.apache.uima.impl.ChildUimaContext_impl.getResourceAsStream The unmanaged resource ORG.txt was accessed.This feature is deprecated, and support may be removed in future versions."

Could someone throw some light on how to resolve this warning and loaded the resource in a best way?

Regards,
Gandhi

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.