lum-ai / odinson

Odinson is a powerful and highly optimized open-source framework for rule-based information extraction. Odinson couples a simple, yet powerful pattern language that can operate over multiple representations of text, with a runtime system that operates in near real time.
https://lum.ai/odinson/docs/
Apache License 2.0
65 stars 23 forks source link

CluProcessor vs. BioCluProcessor #368

Open amirj opened 2 years ago

amirj commented 2 years ago

BioCluProcessor mentioned here as an option for odinson.extra.processorType; could you please provide more information about what's the difference between FastNLPProcessor, CluProcessor, and BioCluProcessor please?

In addition, choosing BioCluProcessor as processorType leads to the following error while CluProcessor works well:

$ sbt "extra/runMain ai.lum.odinson.extra.AnnotateText"              
[info] welcome to sbt 1.6.0-RC1 (Homebrew Java 1.8.0_312)
[info] loading settings for project odinson-build from plugins.sbt ...
[info] loading project definition from /Users/amir/codes/odinson/project
[info] loading settings for project core from build.sbt ...
[info] loading settings for project extra from build.sbt ...
[info] loading settings for project odinson from build.sbt,version.sbt ...
[info] set current project to odinson (in build file:/Users/amir/codes/odinson/)
[warn] there's a key that's not used by any other settings/tasks:
[warn]  
[warn] * ThisBuild / publishMavenStyle
[warn]   +- /Users/amir/codes/odinson/build.sbt:101
[warn]  
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] compiling 1 Scala source to /Users/amir/codes/odinson/core/target/scala-2.12/classes ...
[info] running (fork) ai.lum.odinson.extra.AnnotateText 
[info] 10:08:35,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[info] 10:08:35,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[info] 10:08:35,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/amir/codes/odinson/target/bg-jobs/sbt_203557ba/target/27a539a2/7b9cd5c6/odinson-core_2.12-0.6.1-SNAPSHOT.jar!/logback.xml]
[info] 10:08:35,168 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@1725dc0f - URL [jar:file:/Users/amir/codes/odinson/target/bg-jobs/sbt_203557ba/target/27a539a2/7b9cd5c6/odinson-core_2.12-0.6.1-SNAPSHOT.jar!/logback.xml] is not of type file
[info] 10:08:35,223 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[info] 10:08:35,224 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[info] 10:08:35,227 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[info] 10:08:35,250 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
[info] 10:08:35,250 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
[info] 10:08:35,250 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
[info] 10:08:35,250 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [ai.lum.odinson] to DEBUG
[info] 10:08:35,250 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [ai.lum.odinson] to false
[info] 10:08:35,250 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ai.lum.odinson]
[info] 10:08:35,250 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
[info] 10:08:35,251 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[info] 10:08:35,251 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[info] 10:08:35,251 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@3911c2a7 - Registering current configuration as safe fallback point
[error] Exception in thread "main" scala.MatchError: BioCluProcessor (of class java.lang.String)
[error]     at ai.lum.odinson.extra.utils.ProcessorsUtils$.getProcessor(ProcessorsUtils.scala:36)
[error]     at ai.lum.odinson.extra.AnnotateText$.delayedEndpoint$ai$lum$odinson$extra$AnnotateText$1(AnnotateText.scala:49)
[error]     at ai.lum.odinson.extra.AnnotateText$delayedInit$body.apply(AnnotateText.scala:17)
[error]     at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]     at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]     at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]     at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]     at scala.collection.immutable.List.foreach(List.scala:392)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at ai.lum.odinson.extra.AnnotateText$.main(AnnotateText.scala:17)
[error]     at ai.lum.odinson.extra.AnnotateText.main(AnnotateText.scala)
[error] Nonzero exit code returned from runner: 1
[error] (extra / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 14 s, completed 20-Jan-2022 10:08:35
kwalcock commented 2 years ago

I see in the code that only FastNLPProcessor and CluProcessor are in the list. Some information about the various processors can be found at https://github.com/clulab/processors/wiki/A-Taxonomy-of-Processors.

Crispae commented 1 year ago

I am curious, about integration of BioCluProcessor in the the odinson, can you guide a bit about that?