ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Finan, Sean" <Sean.Fi...@childrens.harvard.edu>
Subject Re: Getting error while running rest service [EXTERNAL]
Date Tue, 19 Mar 2019 17:11:39 GMT
Hi Raghav,

A few items:

ThreadedUmlsDictionaryLookupAnnotator is an old (~2012) annotator in the old (slow) dictionary
lookup module.  It is not meant to be used with the newer thread safe (Ts) pipelines.  Instead
of working in multiple concurrent pipelines, it works in a single pipeline, looking up terms
in the old umls, orangebook, and rxnorm dictionaries concurrently.   It provided an ever-so-slight
performance improvement over the standard lookup, but nothing near what the newer lookup-fast
will give you.  Something like ~20% vs. ~10000%

Given the rest of your pipeline, you want to use the ThreadSafeFastLookup in the dictionary-lookup-fast
module already specified in the TsDictionarySubPipe.piper

Also, the default POSTagger is not thread safe (as far as I know).  You should probably use
add concurrent.ThreadSafePosTagger

Perhaps the reason you are trying to use the old Threaded... is to use Lucene?  Instead of
doing that I would try to create a new annotator.  

Extend AbstractRareWordDictionary and override Collection<RareWordTerm> getRareWordHits(
final String rareWordText ) {}

Look at MemRareWordDictionary and you'll see how easy this is to do (one line of code).

You'll just need to hook into lucene.  You can look at BsvRareWordDictionary if you want to
see how a collection of terms is loaded upon initialization.  Or JdbcRareWordDictionary to
see how terms are looked up through a connection (~6 + 2 lines of code).

You may or may not need to create a custom "ConceptFactory".  As long as the cuis in your
lucene index are the same as those in the default dictionary you can use the default concept
factory.   If not, you can create one with lucene or a simple bar-separated value (pipe-delimited)
file.  But first get a simple lucene dictionary running.

Sean


________________________________________
From: Raghav Nyati <rnyati@foreseemed.com>
Sent: Tuesday, March 19, 2019 12:14 PM
To: dev@ctakes.apache.org
Subject: Re: Getting error while running rest service [EXTERNAL]

Hi Sean,

I’m using Default.piper file with TsDictionarySubPipe lookup.

// Commands and parameters to create a default plaintext document processing pipeline with
UMLS lookup

// set the thread count
threads 3

// Load a simple token processing pipeline from another pipeline file
load pipers/TsDefaultTokenizerPipeline

// Add non-core annotators
add ContextDependentTokenizerAnnotator
addDescription POSTagger

// Add Chunkers
load pipers/TsChunkerSubPipe

// Dictionary lookup
load pipers/TsDictionarySubPipe

// Add Cleartk Entity Attribute annotators
load pipers/TsAttributeCleartkSubPipe

And I’ve configured xml file in TsDictionarySubPipe as:

//  Commands and parameters to create a default dictionary lookup sub-pipeline.  This is not
a full pipeline.

// path to the xml file containing information for dictionary lookup configuration.
cli LookupXml=l
// umls credentials
cli umlsUser=user
cli umlsPass=pass

// dictionary lookup
add ThreadedUmlsDictionaryLookupAnnotator LookupXml=org/apache/ctakes/dictionary/lookup/LookupDesc.xml
Not sure if this is the right configuration for piper for Lucene dictionary lookup.

I do have running setup using Fast dictionary lookup. But I want to enable fuzzy search by
configuring Lucene index.

Any thoughts / suggestions / help on setting up Lucene index is appreciated.

Thanks,
Raghav




> On Mar 19, 2019, at 7:45 AM, Finan, Sean <Sean.Finan@childrens.harvard.edu> wrote:
>
> Hi Raghav,
>
> I think that your dictionary is not specified.  The (deeply embedded plus i18n) error
message is:
>
> "Missing name for Dictionary Name"
>
> from
>> Caused by: org.apache.uima.analysis_engine.annotator.AnnotatorContextException: EXCEPTION
MESSAGE LOCALIZATION FAILED: java.util.MissingResourceException: Can't find resource for bundle
java.util.PropertyResourceBundle, key Missing name for Dictionary Name
>
> There should be an xml-formatted dictionary lookup configuration file that specifies
the dictionary.   My guess is that the problem lies therein.
>
> Sean
>
>
> ________________________________________
> From: Raghav Nyati <rnyati@foreseemed.com>
> Sent: Monday, March 18, 2019 7:27 PM
> To: dev@ctakes.apache.org
> Subject: Getting error while running rest service [EXTERNAL]
>
> Hi -
>
> I’m new to CTAKES and trying to figure out the Lucene index on rest services. While
running docker file, I’m getting below error:
>
> 18 Mar 2019 23:22:11  INFO Chunker - Chunker model file: org/apache/ctakes/chunker/models/chunker-model.zip
> 18 Mar 2019 23:22:13  INFO ContextDependentTokenizerAnnotator - Finite state machines
loaded.
> 18 Mar 2019 23:22:13  INFO AbstractJCasTermAnnotator - Using dictionary lookup window
type: org.apache.ctakes.typesystem.type.textspan.Sentence
> 18 Mar 2019 23:22:13  INFO AbstractJCasTermAnnotator - Exclusion tagset loaded: CC CD
DT EX IN LS MD PDT POS PP PP$ PRP PRP$ RP TO VB VBD VBG VBN VBP VBZ WDT WP WPS WRB
> 18 Mar 2019 23:22:13  INFO AbstractJCasTermAnnotator - Using minimum term text span:
3
> 18 Mar 2019 23:22:13  INFO AbstractJCasTermAnnotator - Using Dictionary Descriptor: org/apache/ctakes/dictionary/lookup/LookupDesc.xml
> 18 Mar 2019 23:22:13  INFO DictionaryDescriptorParser - Parsing dictionary specifications:
> 18 Mar 2019 23:22:13 ERROR CtakesRestController - Error loading pipers
> 18 Mar 2019 23:22:13  WARN XmlWebApplicationContext - Exception encountered during context
initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'ctakesRestController': Invocation of init method failed; nested
exception is javax.servlet.ServletException: org.apache.uima.resource.ResourceInitializationException:
Initialization of annotator class "org.apache.ctakes.dictionary.lookup2.concurrent.ThreadSafeFastLookup"
failed.  (Descriptor: <unknown>)
> 18 Mar 2019 23:22:13 ERROR DispatcherServlet - Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'ctakesRestController': Invocation of init method failed; nested exception is javax.servlet.ServletException:
org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class
"org.apache.ctakes.dictionary.lookup2.concurrent.ThreadSafeFastLookup" failed.  (Descriptor:
<unknown>)
>        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:137)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
>        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
>        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
>        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
>        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
>        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
>        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
>        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
>        at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
>        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
>        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
>        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
>        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
>        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)
>        at javax.servlet.GenericServlet.init(GenericServlet.java:158)
>        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1123)
>        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1078)
>        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:971)
>        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4854)
>        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5170)
>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
>        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
>        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
>        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
>        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1850)
>        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
>        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
>        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
>        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1577)
>        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
>        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
>        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
>        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
>        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:929)
>        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
>        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
>        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
>        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
>        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423)
>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:928)
>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:638)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:498)
>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
> Caused by: javax.servlet.ServletException: org.apache.uima.resource.ResourceInitializationException:
Initialization of annotator class "org.apache.ctakes.dictionary.lookup2.concurrent.ThreadSafeFastLookup"
failed.  (Descriptor: <unknown>)
>        at org.apache.ctakes.rest.service.CtakesRestController$PipelineRunner.<init>(CtakesRestController.java:95)
>        at org.apache.ctakes.rest.service.CtakesRestController$PipelineRunner.<init>(CtakesRestController.java:82)
>        at org.apache.ctakes.rest.service.CtakesRestController.init(CtakesRestController.java:57)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:498)
>        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366)
>        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311)
>        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134)
>        ... 62 more
> Caused by: org.apache.uima.resource.ResourceInitializationException: Initialization of
annotator class "org.apache.ctakes.dictionary.lookup2.concurrent.ThreadSafeFastLookup" failed.
 (Descriptor: <unknown>)
>        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:252)
>        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:156)
>        at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
>        at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
>        at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269)
>        at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:387)
>        at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:254)
>        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:431)
>        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:185)
>        at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
>        at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
>        at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269)
>        at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:354)
>        at org.apache.ctakes.rest.service.CtakesRestController$PipelineRunner.<init>(CtakesRestController.java:91)
>        ... 71 more
> Caused by: org.apache.uima.resource.ResourceInitializationException: EXCEPTION MESSAGE
LOCALIZATION FAILED: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle,
key Missing name for Dictionary Name
>        at org.apache.ctakes.dictionary.lookup2.ae.AbstractJCasTermAnnotator.initialize(AbstractJCasTermAnnotator.java:140)
>        at org.apache.ctakes.core.concurrent.ThreadSafeWrapper.initialize(ThreadSafeWrapper.java:52)
>        at org.apache.ctakes.dictionary.lookup2.concurrent.ThreadSafeFastLookup.initialize(ThreadSafeFastLookup.java:38)
>        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:250)
>        ... 85 more
> Caused by: org.apache.uima.analysis_engine.annotator.AnnotatorContextException: EXCEPTION
MESSAGE LOCALIZATION FAILED: java.util.MissingResourceException: Can't find resource for bundle
java.util.PropertyResourceBundle, key Missing name for Dictionary Name
>        at org.apache.ctakes.dictionary.lookup2.dictionary.DictionaryDescriptorParser.getName(DictionaryDescriptorParser.java:293)
>        at org.apache.ctakes.dictionary.lookup2.dictionary.DictionaryDescriptorParser.parseDictionary(DictionaryDescriptorParser.java:177)
>        at org.apache.ctakes.dictionary.lookup2.dictionary.DictionaryDescriptorParser.parseDictionaries(DictionaryDescriptorParser.java:155)
>        at org.apache.ctakes.dictionary.lookup2.dictionary.DictionaryDescriptorParser.parseDescriptor(DictionaryDescriptorParser.java:127)
>        at org.apache.ctakes.dictionary.lookup2.ae.AbstractJCasTermAnnotator.initialize(AbstractJCasTermAnnotator.java:138)
>        ... 88 more
>
> Any help is greatly appreciated.
>
> Thanks,
>
> Raghav


Mime
View raw message