use of edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager in project cogcomp-nlp by CogComp.
the class NerOntonotesTest method testOntonotesNer.
@Test
public void testOntonotesNer() {
TextAnnotationBuilder tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer());
Properties props = new Properties();
NERAnnotator nerOntonotes = NerAnnotatorManager.buildNerAnnotator(new ResourceManager(props), ViewNames.NER_ONTONOTES);
TextAnnotation taOnto = tab.createTextAnnotation("", "", TEST_INPUT);
try {
nerOntonotes.getView(taOnto);
} catch (AnnotatorException e) {
e.printStackTrace();
fail(e.getMessage());
}
View v = taOnto.getView(nerOntonotes.getViewName());
assertEquals(v.getConstituents().size(), 4);
}
use of edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager in project cogcomp-nlp by CogComp.
the class Main method processArgument.
/**
* The only argument is {@code <config_file_name>}. This method will capture the config file
* name, and initialize the system when it does.
*
* @throws IOException
* @see edu.illinois.cs.cogcomp.ner.AbstractMain#processArgument(java.lang.String[], int)
*/
@Override
protected int processArgument(String[] args, int current) throws Exception {
if (args[current].equals("-c"))
bracketedOutput = false;
else {
if (new File(args[current]).exists()) {
System.out.println("Loading properties from " + args[current]);
this.resourceManager = new ResourceManager(args[current]);
System.out.println("Completed loading properties.");
} else
throw new RuntimeException("The configuration file \"" + args[current] + "\" did not exist.");
}
return current++;
}
use of edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager in project cogcomp-nlp by CogComp.
the class TestPOS method main.
/**
* Implements the program described above.
*
* @param args The command line parameters.
**/
public static void main(String[] args) {
// Parse the command line
// if (args.length != 1) {
// logger.error("usage: java edu.illinois.cs.cogcomp.lbj.pos.TestPOS <text file>");
// System.exit(1);
// }
// String testingFile = args[0];
ResourceManager rm = new POSConfigurator().getDefaultConfig();
String testingFile = rm.getString("testData");
TestDiscrete.testDiscrete(new TestDiscrete(), new POSTagger(), new POSLabel(), new POSBracketToToken(testingFile), true, 0);
}
use of edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager in project cogcomp-nlp by CogComp.
the class TestPOSModels method main.
public static void main(String[] args) {
ResourceManager rm = new POSConfigurator().getDefaultConfig();
TestPOSModels test = new TestPOSModels(rm.getString("testData"));
test.testAccuracy();
}
use of edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager in project cogcomp-nlp by CogComp.
the class ChunkerBenchmark method main.
public static void main(String[] args) {
ResourceManager rm = new ChunkerConfigurator().getDefaultConfig();
String testFileName = rm.getString("testGoldPOSData");
String testNoPOSFileName = rm.getString("testNoPOSData");
System.out.println("\nWith Gold POS");
ChunkTester.chunkTester(testFileName);
System.out.println("\nWith NO POS");
ChunkTester.chunkTester(testNoPOSFileName);
}
Aggregations