Examples of classifyWord()


Examples of org.apache.stanbol.enhancer.engines.sentiment.api.SentimentClassifier.classifyWord()

            } //else process all tokens ... no POS tag checking needed
            if(process){
                String word = token.getSpan();
                double sentiment = 0.0;
                if(cats.isEmpty()){
                    sentiment = classifier.classifyWord(null, word);
                } else { //in case of multiple Lexical Cats
                    //we build the average over NOT NULL sentiments for the word
                    int catSentNum = 0;
                    for(LexicalCategory cat : cats){
                        double catSent = classifier.classifyWord(cat, word);
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.sentiment.api.SentimentClassifier.classifyWord()

                    sentiment = classifier.classifyWord(null, word);
                } else { //in case of multiple Lexical Cats
                    //we build the average over NOT NULL sentiments for the word
                    int catSentNum = 0;
                    for(LexicalCategory cat : cats){
                        double catSent = classifier.classifyWord(cat, word);
                        if(catSent != 0.0){
                            catSentNum++;
                            sentiment = sentiment + catSent;
                        }
                    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.sentiment.api.SentimentClassifier.classifyWord()

                    ignore = !state && value.probability() >= minPOSConfidence;
                    process = state && value.probability() >= (minPOSConfidence/2.0);
                }
            } //else process all tokens ... no POS tag checking needed
            if(process){
                double sentiment = classifier.classifyWord(token.getSpan());
                if(sentiment != 0.0){
                    token.addAnnotation(SENTIMENT_ANNOTATION, new Value<Double>(sentiment));
                } //else do not set sentiments with 0.0
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.