Search in sources :

Example 1 with FramesManager

use of edu.illinois.cs.cogcomp.edison.utilities.FramesManager in project cogcomp-nlp by CogComp.

the class PathLSTMHandler method initialize.

@Override
public void initialize(ResourceManager rm) {
    try {
        // TODO: move the end-point url to the resource configurator
        Datastore ds = new Datastore("http://smaug.cs.illinois.edu:8080");
        File lemmaModel = ds.getFile("org.cogcomp.mate-tools", "CoNLL2009-ST-English-ALL.anna.lemmatizer.model", 3.3, false);
        File parserModel = ds.getFile("org.cogcomp.mate-tools", "CoNLL2009-ST-English-ALL.anna.parser.model", 3.3, false);
        File posModel = ds.getFile("org.cogcomp.mate-tools", "CoNLL2009-ST-English-ALL.anna.postagger.model", 3.3, false);
        File pathLSTM = ds.getFile("uk.ac.ed.inf", "pathLSTM.model", 1.0, false);
        // SRL pipeline options (currently hard-coded)
        String[] args = new String[] { "eng", "-lemma", lemmaModel.getAbsolutePath(), "-parser", parserModel.getAbsolutePath(), "-tagger", posModel.getAbsolutePath(), "-srl", pathLSTM.getAbsolutePath(), "-reranker", "-externalNNs" };
        CompletePipelineCMDLineOptions options = new CompletePipelineCMDLineOptions();
        options.parseCmdLineArgs(args);
        try {
            SRLpipeline = CompletePipeline.getCompletePipeline(options);
        } catch (ClassNotFoundException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } catch (DatastoreException e) {
        e.printStackTrace();
    }
    try {
        this.propBankManager = new FramesManager(true);
        this.nomBankManager = new FramesManager(false);
    } catch (InvalidPortException | InvalidEndpointException | DatastoreException e) {
        e.printStackTrace();
    }
}
Also used : FramesManager(edu.illinois.cs.cogcomp.edison.utilities.FramesManager) IOException(java.io.IOException) DatastoreException(org.cogcomp.DatastoreException) InvalidPortException(io.minio.errors.InvalidPortException) InvalidEndpointException(io.minio.errors.InvalidEndpointException) CompletePipelineCMDLineOptions(se.lth.cs.srl.options.CompletePipelineCMDLineOptions) Datastore(org.cogcomp.Datastore) File(java.io.File)

Aggregations

FramesManager (edu.illinois.cs.cogcomp.edison.utilities.FramesManager)1 InvalidEndpointException (io.minio.errors.InvalidEndpointException)1 InvalidPortException (io.minio.errors.InvalidPortException)1 File (java.io.File)1 IOException (java.io.IOException)1 Datastore (org.cogcomp.Datastore)1 DatastoreException (org.cogcomp.DatastoreException)1 CompletePipelineCMDLineOptions (se.lth.cs.srl.options.CompletePipelineCMDLineOptions)1