forked from bst-mug/trec-pm
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding scripts and code for experiments.
- Loading branch information
Showing
65 changed files
with
999 additions
and
3,288 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
#!/bin/bash | ||
|
||
mvn compile | ||
# For the best_fields, the slop does not do anything, but a argument value is expected | ||
sbatch --exclude=h5,h6 scripts/runPmClassExperimentsLiterature.sh best_fields OR | ||
sbatch --exclude=h5,h6 scripts/runPmClassExperimentsLiterature.sh best_fields AND | ||
|
||
# Here, the boolean operator has no effect | ||
sbatch --exclude=h5,h6 scripts/runPmClassExperimentsLiterature.sh phrase OR |
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
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,9 @@ | ||
#!/bin/bash | ||
|
||
mvn compile | ||
# For the best_fields, the slop does not do anything, but a argument value is expected | ||
sbatch --exclude=h5,h6 scripts/runTermBoostExperimentsLiterature.sh best_fields OR | ||
sbatch --exclude=h5,h6 scripts/runTermBoostExperimentsLiterature.sh best_fields AND | ||
|
||
# Here, the boolean operator has no effect | ||
sbatch --exclude=h5,h6 scripts/runTermBoostExperimentsLiterature.sh phrase OR |
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,6 @@ | ||
#!/bin/bash | ||
#SBATCH --cpus-per-task 2 | ||
#SBATCH --mem 10G | ||
#SBATCH -J termboostexp | ||
|
||
mvn exec:java -Dexec.mainClass=at.medunigraz.imi.bst.trec.SigirPubmedExperimenterPmClass -Dexec.args="$1 $2" |
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
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,6 @@ | ||
#!/bin/bash | ||
#SBATCH --cpus-per-task 5 | ||
#SBATCH --mem 10G | ||
#SBATCH -J termboostexp | ||
|
||
mvn exec:java -Dexec.mainClass=at.medunigraz.imi.bst.trec.SigirPubmedTermBoostExperimenterDefaultBoosting -Dexec.args="$1 $2" |
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
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
77 changes: 77 additions & 0 deletions
77
src/main/java/at/medunigraz/imi/bst/trec/SigirPubmedExperimenterPmClass.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,77 @@ | ||
package at.medunigraz.imi.bst.trec; | ||
|
||
import at.medunigraz.imi.bst.trec.experiment.Experiment; | ||
|
||
import java.text.DecimalFormat; | ||
import java.util.*; | ||
import java.util.stream.IntStream; | ||
|
||
import static at.medunigraz.imi.bst.trec.SigirParameters.BEST_FIELDS; | ||
|
||
public class SigirPubmedExperimenterPmClass extends SuperSigirPubmedRecallExperimenter { | ||
public static void main(String[] args) { | ||
|
||
if (args.length != 2) { | ||
System.err.println("Parameters: <multi match mode> <match default operator>"); | ||
} | ||
|
||
String what = "pmclass"; | ||
|
||
final Experiment.GoldStandard goldStandard = Experiment.GoldStandard.OFFICIAL; | ||
final Experiment.Task target = Experiment.Task.PUBMED; | ||
final int year = 2017; | ||
|
||
|
||
|
||
|
||
Map<String, String> templateProperties = new HashMap<>(SigirParameters.LITERATURE_ES_DEFAULTS); | ||
|
||
String defaultMultiMatch = args[0]; | ||
templateProperties.put("dis_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("dis_syn_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("dis_hyper_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("gene_multi_match_type", defaultMultiMatch.equals("phrase") ? BEST_FIELDS : defaultMultiMatch); | ||
templateProperties.put("gene_syn_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("gene_desc_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("gene_hyper_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("cancer_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("dna_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("neg_boost_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("pos_boost_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("dis_prefterm_multi_match_type", defaultMultiMatch); | ||
templateProperties.put("dgi_multi_match_type", defaultMultiMatch); | ||
|
||
String defaultOperator = args[1]; | ||
templateProperties.put("dis_operator", defaultOperator); | ||
templateProperties.put("dis_prefterm_operator", defaultOperator); | ||
templateProperties.put("dis_syn_operator", defaultOperator); | ||
templateProperties.put("dis_hyper_operator", defaultOperator); | ||
templateProperties.put("gene_operator", "OR"); | ||
templateProperties.put("gene_syn_operator", defaultOperator); | ||
templateProperties.put("gene_hyper_operator", defaultOperator); | ||
templateProperties.put("gene_desc_operator", "OR"); | ||
templateProperties.put("cancer_operator", "OR"); | ||
templateProperties.put("dna_operator", "OR"); | ||
|
||
templateProperties.put("phrase_slop", "10"); | ||
|
||
|
||
final List<String> pmfields = Arrays.asList("pmclass2017lstm.keyword", | ||
"pmclass2017lstmatt.keyword", | ||
"pmclass2017lstmgru.keyword", | ||
"pmclass2018lstm.keyword", | ||
"pmclass2018lstmatt.keyword", | ||
"pmclass2018lstmgru.keyword", | ||
"pmclass2017.keyword", | ||
"pmclass2018.keyword"); | ||
pmfields.parallelStream().forEach(pmfield -> { | ||
Map<String, String> parameters = new HashMap<>(templateProperties); | ||
parameters.put("pm_class_field", pmfield); | ||
runPmClassifierExperiments(null, parameters, goldStandard, target, year, what, "--mmm:" + defaultMultiMatch + "-op:" + defaultOperator + "-pmf:" + pmfield); | ||
}); | ||
|
||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.