Package seekfeel.miners.sentiwordnet

Examples of seekfeel.miners.sentiwordnet.SentiPanel


            }
        }
    }

    public EvaluationMeasures evaluateClassifer() {
        SentiPanel classifier = new SentiPanel();
        ArrayList<String> wrongPos = new ArrayList<String>();
        ArrayList<String> wrongNeg = new ArrayList<String>();
        ArrayList<String> notClassified = new ArrayList<String>();
        ArrayList<DataUnit> positiveExamples = annotatedCorpus.getPositiveExamples();
        ArrayList<DataUnit> negativeExamples = annotatedCorpus.getNegativeExamples();
        int numExs = positiveExamples.size() < negativeExamples.size() ? positiveExamples.size() : negativeExamples.size();
        int truePositive = 0;
        int trueNegative = 0;
        int allClassifiedPos = 0;
        int allClassifiedNeg = 0;
        Sentiment currentLabel;
        int numNotClassified = 0;
        SentenceFeaturePair tempEx;
        ArrayList<String> currentFeatures = new ArrayList<String>();
        for (int i = 0; i < numExs; i++) {
            tempEx = (SentenceFeaturePair) positiveExamples.get(i);
            currentFeatures.clear();
            currentFeatures.add(tempEx.getTheFeature().Name);
            currentLabel = classifier.classifyText(tempEx.getDataBody(), currentFeatures).get(tempEx.getTheFeature().Name);
            if (currentLabel == Sentiment.Positive) {
                truePositive++;
                allClassifiedPos++;
            } else if (currentLabel == Sentiment.Negative) {
                allClassifiedNeg++;
                wrongPos.add(tempEx.getTheFeature().Name + "---" + tempEx.getDataBody());
            } else {
                numNotClassified++;
                notClassified.add(tempEx.getTheFeature().Name + "---" + tempEx.getDataBody());
            }
        }

        for (int i = 0; i < numExs; i++) {
            tempEx = (SentenceFeaturePair) negativeExamples.get(i);
            currentFeatures.clear();
            currentFeatures.add(tempEx.getTheFeature().Name);
            currentLabel = classifier.classifyText(tempEx.getDataBody(), currentFeatures).get(tempEx.getTheFeature().Name);
            if (currentLabel == Sentiment.Negative) {
                trueNegative++;
                allClassifiedNeg++;
            } else if (currentLabel == Sentiment.Positive) {
                allClassifiedPos++;
View Full Code Here


  Relevance_Calculator rc = null;
  SentiPanel sentimizer;
  DataSource dataSource;

  public Controller() {
    sentimizer = new SentiPanel();
    tc = new TextCleaner();
    sp = new SentenceSplitter();
    rp = new Reviews_preprocessor();
    allSubscribedExtractors = new ArrayList<AspectExtractor>();
    allExtractedFeatures = new ArrayList<ArrayList<String>>();
View Full Code Here

    RelevanceCalculator rc = null;
    SentiPanel sentimizer;
    DataSource dataSource;

    public Controller() {
        sentimizer = new SentiPanel();
        tc = new TextCleaner();
        sp = new SentenceSplitter();
        rp = new Reviews_preprocessor();
        allSubscribedExtractors = new ArrayList<AspectExtractor>();
        allExtractedFeatures = new ArrayList<ArrayList<String>>();
View Full Code Here

TOP

Related Classes of seekfeel.miners.sentiwordnet.SentiPanel

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.