Package org.dbpedia.spotlight.spot.cooccurrence.classification

Examples of org.dbpedia.spotlight.spot.cooccurrence.classification.SpotClassification


        }else if(!filterPattern.applies(surfaceFormOccurrence)){
          decisions.add("Dropped by Pattern filter: " + surfaceFormOccurrence);
        }else{

                    SpotClassification spotClassification;
                    try {
                        spotClassification = unigramClassifier.classify(surfaceFormOccurrence);

                        if(spotClassification.getCandidateClass() == SpotClass.valid) {
                            selectedOccurrences.add(surfaceFormOccurrence);
                            //LOG.info(("Kept by UnigramClassifier (Confidence: " + spotClassification.getConfidence() + "): " + surfaceFormOccurrence);
                        }else{
                            decisions.add("Dropped by UnigramClassifier (Confidence: " + spotClassification.getConfidence() + "): " + surfaceFormOccurrence);
                        }

                    } catch (Exception e) {
                        LOG.error("Exception when classifying unigram candidate: " + e);
                    }

        }


      }else{

        /**
         * n > 1
         */

        SpotClassification spotClassification;
        try{
          spotClassification = ngramClassifier.classify(surfaceFormOccurrence);
        }catch (Exception e) {
                    LOG.error("Exception when classifying ngram candidate: " + e);
                    continue;
        }

        if(spotClassification.getCandidateClass() == SpotClass.valid) {
          selectedOccurrences.add(surfaceFormOccurrence);
          //LOG.info("Kept by nGramClassifier (Confidence: " + spotClassification.getConfidence() + "): " + surfaceFormOccurrence);
        }else{
          decisions.add("Dropped by NGramClassifier: " + surfaceFormOccurrence);
        }
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.spot.cooccurrence.classification.SpotClassification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.