Java 在ApacheOpenNLP中创建培训模型

Java 在ApacheOpenNLP中创建培训模型,java,opennlp,Java,Opennlp,在我的txt文件中,我声明了需要在文本中查找的单词。看起来是这样的: <START:anesthesia> Keine Anästhesie <END> <START:anesthesia> Lokalanästhesie <END> <START:anesthesia> Regional-Anästhesie <END> <START:anesthesia> Allgemeine Anästhesie &

在我的txt文件中,我声明了需要在文本中查找的单词。看起来是这样的:

<START:anesthesia> Keine Anästhesie <END>

<START:anesthesia> Lokalanästhesie <END>

<START:anesthesia> Regional-Anästhesie <END>

<START:anesthesia> Allgemeine Anästhesie <END>

<START:anesthesia> Monitorized anesthetic care <END>

<START:releaseType> geheilt <END>

<START:releaseType> gebessert <END>

<START:releaseType> nicht gebessert <END>

<START:releaseType> uverändert <END>

<START:releaseType> verschlechtert <END>

<START:releaseType> nicht beurteilbar <END>

<START:releaseType> exiutus intraoperativ <END>

<START:releaseType> exitus postoperativ <END>

<START:releaseType> exitus ohne Zusammenhang mit OP <END>

<START:releaseType> Austritt <END>

<START:releaseType> Verlegung <END>
// testing the model and printing the types it found in the input sentence
    TokenNameFinder entityFinder = new NameFinderME(entityModel);

    String[] testSentence = { "Helge", "Schneider" , "bekommt" , "eine" , "allgemeine", "Anästesie"};

    System.out.println("Finding types in the test sentence..");
    Span[] entities = entityFinder.find(testSentence);
    System.out.println(entities.toString());
    
    for (Span entity : entities) {
        String foundEntity = "";
        for (int i = entity.getStart(); i < entity.getEnd(); i++) {
            foundEntity += testSentence[i] + " ";
        }
        System.out.println(entity.getType() + " : " + foundEntity + "\t [probability=" + entity.getProb() + "]");
    }
之后,我对模型进行如下测试:

<START:anesthesia> Keine Anästhesie <END>

<START:anesthesia> Lokalanästhesie <END>

<START:anesthesia> Regional-Anästhesie <END>

<START:anesthesia> Allgemeine Anästhesie <END>

<START:anesthesia> Monitorized anesthetic care <END>

<START:releaseType> geheilt <END>

<START:releaseType> gebessert <END>

<START:releaseType> nicht gebessert <END>

<START:releaseType> uverändert <END>

<START:releaseType> verschlechtert <END>

<START:releaseType> nicht beurteilbar <END>

<START:releaseType> exiutus intraoperativ <END>

<START:releaseType> exitus postoperativ <END>

<START:releaseType> exitus ohne Zusammenhang mit OP <END>

<START:releaseType> Austritt <END>

<START:releaseType> Verlegung <END>
// testing the model and printing the types it found in the input sentence
    TokenNameFinder entityFinder = new NameFinderME(entityModel);

    String[] testSentence = { "Helge", "Schneider" , "bekommt" , "eine" , "allgemeine", "Anästesie"};

    System.out.println("Finding types in the test sentence..");
    Span[] entities = entityFinder.find(testSentence);
    System.out.println(entities.toString());
    
    for (Span entity : entities) {
        String foundEntity = "";
        for (int i = entity.getStart(); i < entity.getEnd(); i++) {
            foundEntity += testSentence[i] + " ";
        }
        System.out.println(entity.getType() + " : " + foundEntity + "\t [probability=" + entity.getProb() + "]");
    }
//测试模型并打印在输入语句中找到的类型
TokenNameFinder entityFinder=新的NameFinderME(entityModel);
String[]test句子={“Helge”、“Schneider”、“bekommt”、“eine”、“allgemine”、“Anästesie”};
System.out.println(“在测试语句中查找类型…”);
Span[]entities=entityFinder.find(test句子);
System.out.println(entities.toString());
用于(跨度图元:图元){
字符串foundEntity=“”;
对于(int i=entity.getStart();i
结果我得到了

麻醉:Helge Schneider[概率=0.17882..] 释放类型:所有释放类型[概率=0.158…]

但在我的txt文件中,我没有声明“Helge Schneider”这个词组合为麻醉,而“Allgemine anässtesie”是麻醉,而不是释放类型。我需要看什么来训练这样一个模型?训练参数是否有问题,或者如何正确显示