forked from bst-mug/trec-2017-precision-medicine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces Experimenter class to run experiments
- Loading branch information
Michel Oleynik
committed
Jul 14, 2017
1 parent
d96a205
commit e3bbd6c
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/main/java/at/medunigraz/imi/bst/trec/Experimenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package at.medunigraz.imi.bst.trec; | ||
|
||
import java.io.File; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import at.medunigraz.imi.bst.trec.experiment.Experiment; | ||
import at.medunigraz.imi.bst.trec.model.Gene; | ||
import at.medunigraz.imi.bst.trec.query.ElasticSearchQuery; | ||
import at.medunigraz.imi.bst.trec.query.GeneExpanderQueryDecorator; | ||
import at.medunigraz.imi.bst.trec.query.Query; | ||
import at.medunigraz.imi.bst.trec.query.TemplateQueryDecorator; | ||
import at.medunigraz.imi.bst.trec.query.WordRemovalQueryDecorator; | ||
|
||
public class Experimenter { | ||
public static void main(String[] args) { | ||
Set<Experiment> experiments = new HashSet<>(); | ||
|
||
final File pmTemplate = new File(Experimenter.class.getResource("/templates/must-match-gene.json").getFile()); | ||
|
||
Query baselineDecorator = new WordRemovalQueryDecorator( | ||
new TemplateQueryDecorator(pmTemplate, new ElasticSearchQuery("trec"))); | ||
Experiment base = Experiment.create().withId("topics2017-pmid").withDecorator(baselineDecorator); | ||
experiments.add(base); | ||
|
||
Gene.Field[] expandTo = { Gene.Field.SYMBOL, Gene.Field.DESCRIPTION }; | ||
Query geneDecorator = new WordRemovalQueryDecorator(new GeneExpanderQueryDecorator(expandTo, | ||
new TemplateQueryDecorator(pmTemplate, new ElasticSearchQuery("trec")))); | ||
experiments.add(Experiment.create(base).withDecorator(geneDecorator)); | ||
|
||
for (Experiment exp : experiments) { | ||
exp.start(); | ||
try { | ||
exp.join(); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
for (Experiment exp : experiments) { | ||
|
||
} | ||
} | ||
|
||
} |