Skip to content
Snippets Groups Projects
Commit 82040ec2 authored by Christos Christodoulopoulos's avatar Christos Christodoulopoulos
Browse files

Fixed unit tests

Added OJAlgo as default solver and switched off the Curator
parent 025e7df1
No related branches found
No related tags found
1 merge request!11Windows support (+ minor refactoring)
Pipeline #
......@@ -4,10 +4,6 @@ import edu.illinois.cs.cogcomp.core.utilities.configuration.Configurator;
import edu.illinois.cs.cogcomp.core.utilities.configuration.Property;
import edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
/**
* A configuration helper to allow centralization of config options in dependencies with
* clear default settings (only values that override defaults need to be specified).
......@@ -19,8 +15,6 @@ import java.util.Properties;
* Created by mssammon on 12/21/15.
*/
public class SrlConfigurator extends Configurator {
public static final Property USE_CURATOR = new Property("UseCurator", FALSE);
public static final Property DEFAULT_PARSER = new Property("DefaultParser", "Stanford" );
......@@ -30,9 +24,13 @@ public class SrlConfigurator extends Configurator {
public static final Property NUM_FEX_THREADS = new Property("NumFeatExtThreads", "10" );
/**
* Training corpora directories
* The ILP solver to use for the joint inference
* Options are: Gurobi, OJAlgo
*/
public static final Property ILP_SOLVER = new Property("ILPSolver", "OJAlgo");
/**
* Training corpora directories
*/
//This is the directory of the merged (mrg) WSJ files
public static final Property PENNTB_HOME = new Property("PennTreebankHome", "/shared/corpora/corporaWeb/treebanks/eng/pennTreebank/treebank-3/parsed/mrg/wsj/" );
public static final Property PROPBANK_PARSER = new Property( "PropbankHome", "/shared/corpora/corporaWeb/treebanks/eng/propbank_1/data" );
......@@ -43,27 +41,21 @@ public class SrlConfigurator extends Configurator {
* The directory of the sentence and pre-extracted features database (~5G of space required)
* Not used during test/working with pre-trained models
*/
public static final Property CACHE_DIR = new Property( "CacheDirectory", "cache");
public static final Property MODEL_DIR = new Property( "ModelsDirectory", "models");
/**
* Directory to output gold and predicted files for manual comparison
*/
/**
* Directory to output gold and predicted files for manual comparison
*/
public static final Property OUTPUT_DIR = new Property( "OutputDirectory", "srl-out");
// public SrlConfigurator(URL url) throws IOException {
// getConfig( new ResourceManager( url.getFile() ) );
// }
@Override
public ResourceManager getDefaultConfig() {
Property[] properties = {USE_CURATOR, DEFAULT_PARSER, NUM_FEX_THREADS, PENNTB_HOME, PROPBANK_PARSER,
NOMBANK_HOME, CACHE_DIR, MODEL_DIR };
NOMBANK_HOME, CACHE_DIR, MODEL_DIR, OUTPUT_DIR, ILP_SOLVER};
return (new LearnerConfigurator().getConfig(new ResourceManager(generateProperties(properties))) );
}
}
......@@ -18,40 +18,6 @@ public class SemanticRoleLabelerTest extends TestCase {
public void setUp() throws Exception {
super.setUp();
/**
* the commented code below helps debug problems when gurobi libraries are not found.
* the first section dumps the classpath, to check for Gurobi jar.
* The second checks LD_LIBRARY_PATH, which is where the JVM looks for the JNI library.
*/
// System.err.println( "## CLASSPATH: " );
// ClassLoader cl = ClassLoader.getSystemClassLoader();
// URL[] urls = ((URLClassLoader)cl).getURLs();
//
// for(URL url: urls){
// System.out.println(url.getFile());
// }
//
// String pathToAdd = "/home/mssammon/lib/gurobi650/linux64/lib";
// final Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths");
// usrPathsField.setAccessible(true);
//
// //get array of paths
// final String[] paths = (String[])usrPathsField.get(null);
//
// //check if the path to add is already present
// for(String path : paths) {
// System.err.println( "## found usr path: " + path );
// if(path.equals(pathToAdd)) {
// break;
// }
// }
//
// //add the new path
// final String[] newPaths = Arrays.copyOf(paths, paths.length + 1);
// newPaths[newPaths.length-1] = pathToAdd;
// usrPathsField.set(null, newPaths);
rm = new ResourceManager( CONFIG );
}
......
#############################################
##
## Illinois SRL Configuration
##
#############################################
## Illinois SRL Configuration##
# Whether to use the Illinois Curator to get the required annotations for training/testing
# If set to false, Illinois NLP pipeline will be used
UseCurator = true
UseCurator = false
# The configuration of the Illinois NLP pipeline
PipelineConfig = config/pipeline.properties
# The parser used to extract constituents and syntactic features
# Options are: Charniak, Berkeley, Stanford
# NB: Only Stanford can be used in standalone mode.
DefaultParser = Stanford
WordNetConfig = jwnl_properties.xml
# The configuration for the Structured learner
LearnerConfig = config/learner.properties
# Num of threads for feat. ext.
NumFeatExtThreads = 10
# The ILP solver to use for the joint inference
# Options are: Gurobi, OJAlgo
ILPSolver = OJAlgo
### Training corpora directories ###
# This is the directory of the merged (mrg) WSJ files
PennTreebankHome = /shared/corpora/corporaWeb/treebanks/eng/pennTreebank/treebank-3/parsed/mrg/wsj/
......@@ -36,4 +36,4 @@ ModelsDirectory = models
# Directory to output gold and predicted files for manual comparison
# Comment out for no output
OutputDirectory = srl-out
OutputDirectory = srl-out
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment