Search in sources :

Example 1 with QuestionCoarseTyper

use of edu.illinois.cs.cogcomp.question_typer.lbjava.QuestionCoarseTyper in project cogcomp-nlp by CogComp.

the class QuestionTypeAnnotator method initialize.

@Override
public void initialize(ResourceManager rm) {
    System.out.println("loading . . . ");
    try {
        Datastore dsNoCredentials = new Datastore(new ResourceConfigurator().getDefaultConfig());
        File f = dsNoCredentials.getDirectory("org.cogcomp.question-typer", "question-typer-models", 1.0, false);
        this.modelsFolder = f.getPath() + "/question-typer-models/";
        System.out.println(modelsFolder + "QuestionFineTyper.lc");
    } catch (InvalidPortException | DatastoreException | InvalidEndpointException e) {
        e.printStackTrace();
    }
    fine = new QuestionFineTyper(modelsFolder + "QuestionFineTyper.lc", modelsFolder + "QuestionFineTyper.lex");
    coarse = new QuestionCoarseTyper(modelsFolder + "QuestionCoarseTyper.lc", modelsFolder + "QuestionCoarseTyper.lex");
}
Also used : Datastore(org.cogcomp.Datastore) QuestionFineTyper(edu.illinois.cs.cogcomp.question_typer.lbjava.QuestionFineTyper) ResourceConfigurator(edu.illinois.cs.cogcomp.core.resources.ResourceConfigurator) DatastoreException(org.cogcomp.DatastoreException) InvalidPortException(io.minio.errors.InvalidPortException) File(java.io.File) InvalidEndpointException(io.minio.errors.InvalidEndpointException) QuestionCoarseTyper(edu.illinois.cs.cogcomp.question_typer.lbjava.QuestionCoarseTyper)

Aggregations

ResourceConfigurator (edu.illinois.cs.cogcomp.core.resources.ResourceConfigurator)1 QuestionCoarseTyper (edu.illinois.cs.cogcomp.question_typer.lbjava.QuestionCoarseTyper)1 QuestionFineTyper (edu.illinois.cs.cogcomp.question_typer.lbjava.QuestionFineTyper)1 InvalidEndpointException (io.minio.errors.InvalidEndpointException)1 InvalidPortException (io.minio.errors.InvalidPortException)1 File (java.io.File)1 Datastore (org.cogcomp.Datastore)1 DatastoreException (org.cogcomp.DatastoreException)1