Skip to content

Commit

Permalink
Merge branch 'es5.4' of https://github.com/JULIELab/trec-pm into es5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
khituras committed Aug 5, 2019
2 parents 595a4e5 + 33ced70 commit cb7750a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public static void main(String[] args) throws IOException {
final Experiment jlpmcommon = new Experiment(GOLD_STANDARD,
LiteratureArticlesRetrievalRegistry.jlpmcommon(TrecConfig.SIZE));

final Experiment jlpmcommon2 = new Experiment(GOLD_STANDARD,
LiteratureArticlesRetrievalRegistry.jlpmcommon2(TrecConfig.SIZE));

final Experiment jlpmletor = new Experiment(GOLD_STANDARD,
LiteratureArticlesRetrievalRegistry.jlpmletor(TrecConfig.SIZE));
jlpmletor.setReRanker(new RankerFromPm1718());
Expand All @@ -42,7 +45,7 @@ public static void main(String[] args) throws IOException {
LiteratureArticlesRetrievalRegistry.jlpmtrboost(TrecConfig.SIZE));
jlpmtrboost.setReRanker(new TreatmentRanker());

Set<Experiment> experiments = new LinkedHashSet<>(Arrays.asList(jlpmcommon, jlpmletor,jlpmltrin, jlpmtrcommon, jlpmtrboost));
Set<Experiment> experiments = new LinkedHashSet<>(Arrays.asList(jlpmcommon, jlpmcommon2, jlpmletor,jlpmltrin, jlpmtrcommon, jlpmtrboost));
for (Experiment exp : experiments) {
exp.run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public final class LiteratureArticlesRetrievalRegistry {
LiteratureArticlesRetrievalRegistry.class.getResource("/templates/biomedical_articles/boost.json").getFile());
private static final File JULIE_COMMON_TEMPLATE = new File(
LiteratureArticlesRetrievalRegistry.class.getResource("/templates/biomedical_articles/jlpmcommon.json").getFile());
private static final File JULIE_COMMON2_TEMPLATE = new File(
LiteratureArticlesRetrievalRegistry.class.getResource("/templates/biomedical_articles/jlpmcommon2.json").getFile());
private static final File JULIE_BOOST_TEMPLATE = new File(
LiteratureArticlesRetrievalRegistry.class.getResource("/templates/biomedical_articles/jlpmboost.json").getFile());
private static final File SYNONYMS = new File(
Expand Down Expand Up @@ -74,6 +76,14 @@ public static TrecPmRetrieval jlpmcommon(int size) {
.withConditionalCancer();
}

public static TrecPmRetrieval jlpmcommon2(int size) {
return new TrecPmRetrieval(TrecConfig.ELASTIC_BA_INDEX, size).withExperimentName("jlpmcommon")
.withSubTemplate(JULIE_COMMON2_TEMPLATE)
.withWordRemoval().withGeneSynonym()
.withDiseasePreferredTerm().withDiseaseSynonym().withSynonymList(SYNONYMS)
.withConditionalCancer();
}

public static TrecPmRetrieval jlpmletor(int size) {
return new TrecPmRetrieval(TrecConfig.ELASTIC_BA_INDEX, size).withExperimentName("jlpmletor")
.withSubTemplate(JULIE_COMMON_TEMPLATE)
Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/templates/biomedical_articles/jlpmcommon2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"bool": {
"must": [
{{biomedical_articles/disease.json}},
{{biomedical_articles/gene.json}}
],
"should": [
{{biomedical_articles/extra.json}},
{{chemotherapyBoosters:biomedical_articles/conditional_chemotherapy.json}},
{{cancerBoosters:biomedical_articles/conditional_cancer.json}},
{{biomedical_articles/dna.json}},
{{biomedical_articles/positive_boosters.json}},
{{biomedical_articles/negative_boosters.json}},
{{biomedical_articles/exists_abstract.json}},
{{biomedical_articles/exists_filtered_treatment.json}}
],
"must_not": [
{{biomedical_articles/non_melanoma.json}}
]
}
}

0 comments on commit cb7750a

Please sign in to comment.