Multi-term named entities in Stanford Named Entity Recognizer

前端 未结 8 1355
春和景丽
春和景丽 2021-01-31 19:33

I\'m using the Stanford Named Entity Recognizer http://nlp.stanford.edu/software/CRF-NER.shtml and it\'s working fine. This is

    List&         


        
8条回答
  •  难免孤独
    2021-01-31 19:59

    Make use of the classifiers already provided to you. I believe this is what you are looking for:

        private static String combineNERSequence(String text) {
    
        String serializedClassifier = "edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz";      
        AbstractSequenceClassifier classifier = null;
        try {
            classifier = CRFClassifier
                    .getClassifier(serializedClassifier);
        } catch (ClassCastException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    
        System.out.println(classifier.classifyWithInlineXML(text));
    
        //  FOR TSV FORMAT  //
        //System.out.print(classifier.classifyToString(text, "tsv", false));
    
        return classifier.classifyWithInlineXML(text);
    }
    

提交回复
热议问题