使用 ConceptMapper Annotator 时生成 Pear 文件
我有一个使用 ConceptMapper Annotator 的 UIMA 项目。我想知道如何设置以下内容:
如何指定
TokenizerDescriptionPath
?
我使用了宏$main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml
,但是当我尝试安装 pear 文件时,安装程序会抛出异常,抱怨文件$main_root/找不到描述符/conceptMapper/primitive/OffsetTokenizer.xml
如何设置
DictionaryFileName
的值(一个文件包含字典)?
在用于设置此资源的 GUI 窗口中,我已使用$main_root/data/dict/concepts.xml
(我的字典文件)填充 URL 值,但在安装时,安装程序会抛出异常抱怨 uima-pipelines 验证失败:org.apache.uima.resource.ResourceInitializationException:注释器类“org.apache.uima.conceptMapper.ConceptMapper”的初始化失败。 引起原因:org.apache.uima.resource.ResourceAccessException:资源/ConceptDetector/ConceptMapper/DictionaryFile 需要参数,但未指定任何参数。 在 org.apache.uima.resource.impl.ResourceManager_impl.getResource(ResourceManager_impl.java:221) 在 org.apache.uima.impl.UimaContext_ImplBase.getResourceObject(UimaContext_ImplBase.java:295) 在 org.apache.uima.analysis_engine.impl.AnnotatorContext_impl.getResourceObject(AnnotatorContext_impl.java:175) ... 33 更多
I have an UIMA project that uses the ConceptMapper Annotator. I would like to know how to set up the following:
How to specify the
TokenizerDescriptionPath
?
I have used the macro$main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml
, but when I was trying to install the pear file, the installer throws exceptions complaining that the file$main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml
could not be foundHow to set up the value for the
DictionaryFileName
(A file containing the dictionary)?
In the GUI window for setting up this resource, I've filled the URL value with$main_root/data/dict/concepts.xml
(my dictionary file) but at the installation time, the installer throws exceptions complaing that
Verification of uima-pipelines failed:org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.conceptMapper.ConceptMapper" failed.
Caused by: org.apache.uima.resource.ResourceAccessException: The Resource /ConceptDetector/ConceptMapper/DictionaryFile requires parameters, none were specified.
at org.apache.uima.resource.impl.ResourceManager_impl.getResource(ResourceManager_impl.java:221)
at org.apache.uima.impl.UimaContext_ImplBase.getResourceObject(UimaContext_ImplBase.java:295)
at org.apache.uima.analysis_engine.impl.AnnotatorContext_impl.getResourceObject(AnnotatorContext_impl.java:175)
... 33 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在使用概念映射器时也遇到了类似的问题。我解决 TokenizerDescriptorPath 问题的方法是首先创建一个 PEAR 文件,其中包含 OffsetTokenizer 作为其主要描述符和依赖类。然后您可以在本地安装此 pear 文件,然后将 TokenizerDescriptorPath 设置为:C:\path\to\your\pear\file\OffsetTokenizer_pear.xml。否则会出现 CLASSPATH 继承问题。一旦 CLASSPATH 位于 PEAR 文件中,它似乎就不会从 ConceptMapper 传递到 OffsetTokenizer。我在 GMANE 列表服务器上找到了一些很棒的信息。 user.uima.apache.org ConceptMapper Pear 文件线程
我已将
DictionaryFileName
设置为file:dict/testDict.xml
这似乎有效。为了避免在保存时出现问题,您可以将资源添加为源文件夹。将 ConceptMapper 导出到 PEAR 文件时,我在 CLASSPATH 中同时拥有 resources 和 bin 文件夹。此后,我扩展了概念映射器以拥有其他注释器,并且它正在管道中工作。全部可导出为通过验证步骤的 PEAR 文件。它也可以在导出之前在本地 Eclipse 中运行。
祝你好运
I had similar problems with the Concept Mapper. The way I solved the TokenizerDescriptorPath problem was to first create a PEAR file with the OffsetTokenizer as its main descriptor and the dependent classes. Then you can install this pear file locally and then set
TokenizerDescriptorPath
to:C:\path\to\your\pear\file\OffsetTokenizer_pear.xml
. Otherwise there appears to be a CLASSPATH inheritance problem. The CLASSPATH does not seem to be passed from the ConceptMapper to the OffsetTokenizer once it is in the PEAR file. I found some great information on the GMANE listserver. user.uima.apache.org ConceptMapper Pear File ThreadI have set
DictionaryFileName
tofile:dict/testDict.xml
and this seems to work. To avoid getting a problem at save time you can add resources as a source folder.When exporting the ConceptMapper to a PEAR file, I have both the resources and bin folder in the CLASSPATH. I have since expanded the Concept Mapper to have other annotators and it is working in a pipeline. It is all exportable to PEAR files which pass the verification step. It also works before export, locally in Eclipse.
Good Luck