Skip to content

Commit

Permalink
Enables new experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Oleynik committed Jul 29, 2017
1 parent 3417df3 commit 074ae82
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/at/medunigraz/imi/bst/trec/Experimenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public static void main(String[] args) {
final File boostKeywordsTemplate = new File(
RunnerDemo.class.getResource("/templates/boost-keywords.json").getFile());
final File relaxedTemplate = new File(RunnerDemo.class.getResource("/templates/relaxed.json").getFile());
final File simplifiedTemplate = new File(RunnerDemo.class.getResource("/templates/simplified.json").getFile());
final File englishTemplate = new File(RunnerDemo.class.getResource("/templates/english.json").getFile());
final File b0Template = new File(RunnerDemo.class.getResource("/templates/b0.json").getFile());
final File synonymTemplate = new File(RunnerDemo.class.getResource("/templates/synonym.json").getFile());
final Gene.Field[] expandTo = { Gene.Field.SYMBOL, Gene.Field.DESCRIPTION };

ExperimentsBuilder builder = new ExperimentsBuilder();
Expand All @@ -36,7 +38,13 @@ public static void main(String[] args) {
.withKeyword(String.valueOf(2)).withTemplate(relaxedTemplate).withWordRemoval();

builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(simplifiedTemplate).withWordRemoval();
.withTemplate(englishTemplate).withWordRemoval();

builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(b0Template).withWordRemoval();

builder.newExperiment().withGoldStandard(Experiment.GoldStandard.FINAL).withTarget(Experiment.Task.PUBMED)
.withTemplate(synonymTemplate).withWordRemoval();

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

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

0 comments on commit 074ae82

Please sign in to comment.