Skip to content

Commit

Permalink
Changes default template to the one with boost keywords
Browse files Browse the repository at this point in the history
Also adds it to the Experimenter class.

This refs bst-mug#81.
  • Loading branch information
Michel Oleynik committed Jul 25, 2017
1 parent 7f4ffff commit 0c404ae
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/at/medunigraz/imi/bst/trec/Experimenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class Experimenter {
public static void main(String[] args) {
final File boostTemplate = new File(Experimenter.class.getResource("/templates/boost-extra.json").getFile());
final File geneTemplate = new File(Experimenter.class.getResource("/templates/must-match-gene.json").getFile());
final File boostKeywordsTemplate = new File(
RunnerDemo.class.getResource("/templates/boost-keywords.json").getFile());
final Gene.Field[] expandTo = { Gene.Field.SYMBOL, Gene.Field.DESCRIPTION };

ExperimentsBuilder builder = new ExperimentsBuilder();
Expand All @@ -19,10 +21,16 @@ public static void main(String[] args) {
.withTemplate(boostTemplate).withWordRemoval();
builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(boostTemplate).withGeneExpansion(expandTo).withWordRemoval();

builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(geneTemplate).withWordRemoval();
builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(geneTemplate).withGeneExpansion(expandTo).withWordRemoval();

builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(boostKeywordsTemplate).withWordRemoval();
builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(boostKeywordsTemplate).withGeneExpansion(expandTo).withWordRemoval();

Set<Experiment> experiments = builder.build();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/medunigraz/imi/bst/trec/RunnerDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class RunnerDemo {
public static void main(String[] args) {
final File pmTemplate = new File(RunnerDemo.class.getResource("/templates/boost-extra.json").getFile());
final File pmTemplate = new File(RunnerDemo.class.getResource("/templates/boost-keywords.json").getFile());

final File ctTemplate = new File(RunnerDemo.class.getResource("/templates/baseline-ct.json").getFile());

Expand Down
89 changes: 89 additions & 0 deletions src/main/resources/templates/boost-keywords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"bool": {
"must": [
{
"multi_match": {
"query": "{{disease}}",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields",
"boost": 1
}
},
{
"multi_match": {
"query": "{{gene}}",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
],
"should": [
{
"match": {
"_type": "extra"
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "cancer carcinoma tumor",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "gene genotype DNA base",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "therapy treatment prognosis prognostic survival patient targets study associated",
"fields": [
"title^2",
"abstract"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
}
]
}
}

0 comments on commit 0c404ae

Please sign in to comment.