使用 ConceptMapper Annotator 时生成 Pear 文件

发布于 2024-12-15 15:38:40 字数 1137 浏览 0 评论 0原文

我有一个使用 ConceptMapper Annotator 的 UIMA 项目。我想知道如何设置以下内容:

  1. 如何指定TokenizerDescriptionPath
    我使用了宏 $main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml,但是当我尝试安装 pear 文件时,安装程​​序会抛出异常,抱怨文件 $main_root/找不到描述符/conceptMapper/primitive/OffsetTokenizer.xml

  2. 如何设置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:

  1. 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 found

  2. How 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抚笙 2024-12-22 15:38:40
  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 文件线程

  2. 我已将 DictionaryFileName 设置为 file:dict/testDict.xml 这似乎有效。为了避免在保存时出现问题,您可以将资源添加为源文件夹。

将 ConceptMapper 导出到 PEAR 文件时,我在 CLASSPATH 中同时拥有 resources 和 bin 文件夹。此后,我扩展了概念映射器以拥有其他注释器,并且它正在管道中工作。全部可导出为通过验证步骤的 PEAR 文件。它也可以在导出之前在本地 Eclipse 中运行。

祝你好运

  1. 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 Thread

  2. I have set DictionaryFileName to file: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文