clulab / eidos

Machine reading system for World Modelers
Apache License 2.0
36 stars 24 forks source link

make easier to disable #1058

Closed BeckySharp closed 3 years ago

BeckySharp commented 3 years ago

Unless there's already a way...

kwalcock commented 3 years ago

There can be multiple ways to enable and disable things, but one runtime possibility had been accounted for. Code would look approximately like this:

  val eidosSystem = {
    val config = ConfigFactory.load(EidosSystem.defaultConfig)
    val componentOpts = new ComponentOpts(eidosSentenceClassifier = false)
    val components = new ComponentsBuilder(config, EidosSystem.PREFIX, componentOpts = componentOpts).build()

    new EidosSystem(components)
  }

It was so that each component didn't need to have its own enabled/disabled setting in the conf file, a setting that probably wouldn't work for other tests or configurations. Then we also don't need to edit the config in memory and don't need to reload the components each time. They can also be filtered from existing components, like

    val componentOpts = new ComponentOpts(eidosSentenceClassifier = false)
    val newEidosSystem = new EidosSystem(oldEidosSystem.components.filter(componentOpts))

Maybe that would help, maybe not.

BeckySharp commented 3 years ago

yeah, but the disadvantage of that is that it's in code, vs being able to set things up outside of code. I think just about everything else is disableable in the config right?

BeckySharp commented 3 years ago

also @kwalcock and @MihaiSurdeanu if you choose not to merge this, ping me so I change what I wrote in the wiki. (Though i vote for including it....) :)

kwalcock commented 3 years ago

I saw this but can't look at it yet :-(

BeckySharp commented 3 years ago

I saw this but can't look at it yet :-(

no worries! you work too much as it is!

kwalcock commented 3 years ago

@BeckySharp, you have convinced me, which is no easy feat :-) However, I'm going to move the functionality to SentenceClassifier because it should know how to enable/disable itself and not need to pass that responsibility to the tests. The PR will be ready shortly.