ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Rogstadius <Jakob.Rogstad...@who-umc.org>
Subject RE: Cannot resolve lookup descriptor files for UmlsDictionaryLookupAnnotator
Date Mon, 20 Jul 2015 08:40:07 GMT
Hi Sean,

Thanks for your response. I had to work on something else for a couple of days, but now I'm
back at it.

As you say, I get UmlsDictionaryLookupAnnotator to work when I manually copy the files from
the subversion repository to my local project. What I have now looks like this:
	project-name
	project-name/src/main/java/...
	project-name/data/...
	project-name/resources/...
	project-name/org/apache/ctakes/dictionary/lookup/... (this folder was copied from cTakes
svn and is where LookupDesc.xml and the others files are located)

However, this doesn't seem like the right approach at all. The other cTakes components that
I have tried using have all imported neatly as jars from Maven central, together with their
-res jars which contain the descriptor files and other resources that they reference. At no
point have I previously downloaded the source project from the SVN server, and everything
except the UMLS dictionary lookups have worked this way.

I am confused. You say that the -res jars are not supposed to contain these files, but then
what are they supposed to contain? As I mentioned below, the current -res jar for UmlsDictionaryLookupAnnotator
has no content, except for META-INF. And is this really the only way I can get the components
to work? What am I missing?

In case it matters, I instantiate the annotator as follows using uimaFit:
	AggregateBuilder aggregate = new AggregateBuilder();
	...
	aggregate.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
	...
	AnalysisEngine aggregateEngine = aggregate.createAggregate();
	...
	SimplePipeline.runPipeline(reader, aggregateEngine, writer, evaluator);

Best regards,
Jakob

-----Original Message-----
From: Finan, Sean [mailto:Sean.Finan@childrens.harvard.edu] 
Sent: den 10 juli 2015 18:29
To: dev@ctakes.apache.org
Subject: RE: Cannot resolve lookup descriptor files for UmlsDictionaryLookupAnnotator

Hi Jakob,

The -res jars aren't supposed to contain those files.  The files should be placed in the resources/
directory under the ctakes root parallel to lib/.

Can you take me through your checkout / installation and build / run steps?  A list of your
svn and maven commands might help me figure out what step is failing you.

Sean

-----Original Message-----
From: Jakob Rogstadius [mailto:Jakob.Rogstadius@who-umc.org] 
Sent: Friday, July 10, 2015 3:04 AM
To: dev@ctakes.apache.org
Subject: RE: Cannot resolve lookup descriptor files for UmlsDictionaryLookupAnnotator

Hi Sean,

Many thanks for your reply. Like you say, I see both the lookup descriptors and all other
resources in the projects on the svn server (https://urldefense.proofpoint.com/v2/url?u=https-3A__svn.apache.org_repos_asf_ctakes_trunk_&d=BQIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=Izx33vJrQxf37pZxy4Ha128D0yl2ak1hSbm4Jp9kX5E&s=jkiqjWJUTs0H_ntVqssGJ2R6yWWYlNTVbWR6snNFxAM&e=
). However, the -res jars that I get through maven are completely empty, except for their
META-INF folders. For other components, their -res jars do contain their resources as expected.
Could something have gone wrong while publishing recent versions of these two?

These are my relevant maven imports:

    <dependency>
      <groupId>org.apache.ctakes</groupId>
      <artifactId>ctakes-dictionary-lookup</artifactId>
      <version>3.2.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ctakes</groupId>
      <artifactId>ctakes-dictionary-lookup-res</artifactId>
      <version>3.2.2</version>
    </dependency>    <dependency>
      <groupId>org.apache.ctakes</groupId>
      <artifactId>ctakes-dictionary-lookup-fast</artifactId>
      <version>3.2.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ctakes</groupId>
      <artifactId>ctakes-dictionary-lookup-fast-res</artifactId>
      <version>3.2.2</version>
    </dependency>

Jar content:
https://urldefense.proofpoint.com/v2/url?u=http-3A__grepcode.com_snapshot_repo1.maven.org_maven2_org.apache.ctakes_ctakes-2Ddictionary-2Dlookup-2Dres_3.2.1_&d=BQIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=Izx33vJrQxf37pZxy4Ha128D0yl2ak1hSbm4Jp9kX5E&s=eQsXb82VZXQ5MK1KABI7mJVs-E0Plpn1vhujzs0OJUU&e=
 https://urldefense.proofpoint.com/v2/url?u=http-3A__grepcode.com_snapshot_repo1.maven.org_maven2_org.apache.ctakes_ctakes-2Ddictionary-2Dlookup-2Dfast-2Dres_3.2.1_&d=BQIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=Izx33vJrQxf37pZxy4Ha128D0yl2ak1hSbm4Jp9kX5E&s=LbTzcUINCxbwdk3A7ssDgs9MMavHuXKEOQN35OuBd0E&e=


Jakob

-----Original Message-----
From: Finan, Sean [mailto:Sean.Finan@childrens.harvard.edu] 
Sent: den 9 juli 2015 19:54
To: dev@ctakes.apache.org
Subject: RE: Cannot resolve lookup descriptor files for UmlsDictionaryLookupAnnotator

Hi Jakob,

Where those files exist really depends upon how you are trying to run.  They start in src/main/resources/
directories in their respective -res projects.

If you are running from an IDE, make sure that the -res modules have been added to your project,
and that the src/main/resources/ directories have been tagged as resource directories.  I'm
not an Eclipse expert either (I don't use it), but if it imports via maven it should be doing
that automatically, or maybe tagging them as source directories.

If you are running from a full build of the application, there should be a resources/ directory
in your root.  If that directory exists and contains the .xml files, either run the app from
the root directory or set $CTAKES_HOME to point to that root.

If you run with today's build you should see a listing of your classpath upon that error -
which may or may not help you find the problem.

Sean


-----Original Message-----
From: Jakob Rogstadius [mailto:Jakob.Rogstadius@who-umc.org] 
Sent: Thursday, July 09, 2015 8:43 AM
To: dev@ctakes.apache.org
Subject: Cannot resolve lookup descriptor files for UmlsDictionaryLookupAnnotator

Hi cTakes devs,

I am trying to use cTakes' UMLS Dictionary Lookup annotator (either the older one or the newer
fast one) through uimaFIT, and I am running into problems with resources that can't be found.
Please bear with me if my problem description omits any relevant details, as I don't have
much experience neither with cTakes, UIMA, Java, Maven nor Eclipse.

cTakes is imported into my Eclipse project through Maven, and I have a very basic pipeline
running with a few annotators from UIMA and cTakes, along with a few custom ones. I have specified
the UMLS login details in the arguments of the Eclipse runtime configuration, which works.
However, when I add either a UmlsDictionaryLookupAnnotator or its fast version, they fail
to resolve their respective lookup descriptor files. I have included a stack trace for the
first method, while the second method throws a null pointer exception on AbstractJCasTermAnnotator.initialize()
(line 129), due to the fileResource variable being null.

I have noticed that since cTakes version 3.1.1, the lookup descriptor file referenced in UmlsDictionaryLookupAnnotator.createAnnotatorDescription()
is no longer included in ctakes-dictionary-lookup-res-3.x.x.jar. I don't know if the same
change took place for the fast dictionary, but I can see that the xml file referenced in DictionaryLookupFactory.createUmlsDictionaryLookupDescription()
is not present in the ctakes-dictionary-lookup-fast-res-3.2.2.jar that I get through Maven.
Have these files moved, so that I now need to include something else? Am I doing something
else wrong?

Also, I have downloaded the UMLS dictionary resources from https://urldefense.proofpoint.com/v2/url?u=http-3A__ctakes.apache.org_downloads.cgi&d=BQIFAg&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=HSSKy6iWmdl_k4qE22gY7Kb6oTqcfm2ZxVdjOzcjPyc&s=JO8tKCrrsRQMpvAb1evFEHf21pc1SFE7AjXaQGZEyIg&e=
, but where do I place them for cTakes to be able to find them?

Stack trace for UmlsDictionaryLookupAnnotator.createAnnotatorDescription():

java.io.FileNotFoundException: No File exists at org/apache/ctakes/dictionary/lookup/LookupDesc_Db.xml
	at org.apache.ctakes.core.resource.FileLocator.getFullPath(FileLocator.java:162)
	at org.apache.ctakes.core.resource.FileLocator.locateFile(FileLocator.java:70)
	at org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.createAnnotatorDescription(UmlsDictionaryLookupAnnotator.java:118)
	at org.umc.research.social_media_adr_detection.pipelines.ExtractDrugAndAEMentions.main(ExtractDrugAndAEMentions.java:128)
Exception in thread "main" org.apache.uima.resource.ResourceInitializationException
	at org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.createAnnotatorDescription(UmlsDictionaryLookupAnnotator.java:156)
	at org.umc.research.social_media_adr_detection.pipelines.ExtractDrugAndAEMentions.main(ExtractDrugAndAEMentions.java:128)
Caused by: java.io.FileNotFoundException: No File exists at org/apache/ctakes/dictionary/lookup/LookupDesc_Db.xml
	at org.apache.ctakes.core.resource.FileLocator.getFullPath(FileLocator.java:162)
	at org.apache.ctakes.core.resource.FileLocator.locateFile(FileLocator.java:70)
	at org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.createAnnotatorDescription(UmlsDictionaryLookupAnnotator.java:118)
	... 1 more

Any pointers would be greatly appreciated.

Best regards,

Jakob Rogstadius
Research Engineer

Uppsala Monitoring Centre
WHO Collaborating Centre for International Drug Monitoring

Mime
View raw message