Questions about creating stanford CoreNLP training models

前端 未结 2 1069
小蘑菇
小蘑菇 2021-01-16 12:00

I\'ve been working with Stanford\'s coreNLP to perform sentiment analysis on some data I have and I\'m working on creating a training model. I know we can create a training

2条回答
  •  不思量自难忘°
    2021-01-16 12:38

    Here is some sample code for evaluating a model

    // load a model
    SentimentModel model = SentimentModel.loadSerialized(modelPath);
    
    // load devTrees
    List devTrees;
    devTrees = SentimentUtils.readTreesWithGoldLabels(devPath);
    
    // evaluate on devTrees
    Evaluate eval = new Evaluate(model);
    eval.eval(devTrees);
    eval.printSummary();
    

    You can find what you need to import, etc... by looking at:

    edu/stanford/nlp/sentiment/SentimentTraining.java

提交回复
热议问题