allenai / ike

Build tables of information by extracting facts from indexed text corpora via a simple and effective query language.
http://allenai.org/software/interactive-knowledge-extraction/
Apache License 2.0
56 stars 20 forks source link

Batch searcher #226

Open mmichelsonIF opened 8 years ago

mmichelsonIF commented 8 years ago

Hi all,

I created the following to allow IKE to be used a library inside of some other code we are using.

The idea is that you define a config file of patterns you want to look for (that you may have generated from IKE previously), and you put them in a config file such as:

ExtractionPatterns = {
  patterns = [
    {
      name = "ratios",
      pattern = "CD / CD"
    }
  ]
}

IndexWithContent = "RCTs"

(This is the example in myconfig.conf)

And then you can run this against your indexed corpus (identified by "IndexWithContent" in the config file) using:

sbt "run-main org.allenai.ike.IkeCommandlineRunner"

Or within your code as:

 val ikeLib = new IkeBatchAPI()
val extracts = ikeLib.extract(extractionConfig) // extractionConfig = your config file

There are certainly some issues (like some refactoring opportunities) that I tried to highlight with ToDos.