Package seekfeel.utilities.stanfordwrapper

Examples of seekfeel.utilities.stanfordwrapper.ParsingOptions


    }

    @Override
    public Sentiment classifyText(String text) {
        ArrayList<Word> allWords = StringToWordsTokenizer.tokenize(text);
        ParsingOptions popts = new ParsingOptions();
        popts.setParseRelations(true);
        popts.setPosTag(true);
        ParsedData result = sParser.parse(allWords, popts);
        return classifyTextByNouns(result, allWords);
    }
View Full Code Here


        String[] textAndFeat = new String[]{text, feature};
        prepareFeaturesInText(textAndFeat);
        text = textAndFeat[0];
        feature = textAndFeat[1];
        ArrayList<Word> Words = StringToWordsTokenizer.tokenize(text);
        ParsingOptions opts = new ParsingOptions();
        opts.setPosTag(true);
        opts.setParseRelations(true);
        ParsedData resultData = sParser.parse(Words, opts);
        Word featureWord = new Word(feature);
        int featIndex = Words.indexOf(featureWord);
        Sentiment sentimentResult = Sentiment.Neutral;
        if (!feature.equals("") && featIndex != -1) {
View Full Code Here

        neededTags.add(PosTag.VBG);
        neededTags.add(PosTag.VBN);
        neededTags.add(PosTag.VBP);
        neededTags.add(PosTag.VBZ);

        ParsingOptions opts = new ParsingOptions();
        opts.setPosTag(true);
        opts.setNeededTags(neededTags);

        ParsedData outData = theParser.parse(allWords, opts);
        ArrayList<WordPos> taggedWords = outData.getTaggedWords();
        SWNEntryKey tempFeatKey;
        SentimentFeature tempFeature;
View Full Code Here

    public LinkedHashMap<Integer, Double> computeFeatures(DataUnit example, ArrayList<Feature> features, CorpusHolder corpus) {
        LinkedHashMap<Integer, Double> featuresValues = new LinkedHashMap<Integer, Double>();
        ArrayList<Feature> taggedStems = new ArrayList<Feature>();
        TaggedStem temp;
        StanfordParser theParser = new StanfordParser(Language.Arabic);
        ParsingOptions opts = new ParsingOptions();
        opts.setPosTag(true);
        ArrayList<Word> textWords;
        ParsedData parsedOut;
        ArabicStemmerKhoja arabicStemmer = new ArabicStemmerKhoja();
        // Convert the Example into a tagged Stems Array
        textWords = StringToWordsTokenizer.tokenize(example.getDataBody());
View Full Code Here

        neededTags.add(PosTag.VBN);
        neededTags.add(PosTag.VBP);
        neededTags.add(PosTag.VBZ);

        ParsedData parsingResult = null;
        ParsingOptions opts = new ParsingOptions();
        opts.setNeededTags(neededTags);
        opts.setPosTag(true);


        ArrayList<Word> allWords;

        for (DataUnit posReview : posExamples) {
View Full Code Here

        ArrayList<DataUnit> positiveExs = corpus.getPositiveExamples();
        ArrayList<DataUnit> negativeExs = corpus.getNegativeExamples();
        ArrayList<Feature> taggedStems = new ArrayList<Feature>();
        TaggedStem temp;
        StanfordParser theParser = new StanfordParser(Language.Arabic);
        ParsingOptions opts = new ParsingOptions();
        opts.setPosTag(true);
        ArrayList<Word> textWords;
        ParsedData parsedOut;
        ArabicStemmerKhoja arabicStemmer = new ArabicStemmerKhoja();
        for (DataUnit textUnit : positiveExs) {
            textWords = StringToWordsTokenizer.tokenize(textUnit.getDataBody());
View Full Code Here

        if (allWords.isEmpty()) {
            return;
        }


        ParsingOptions popts = new ParsingOptions();
        popts.setParseRelations(true);
        popts.setPosTag(true);

        ParsedData result = sParser.parse(allWords, popts);
        ArrayList<WordPos> wordsPos = result.getTaggedWords();

        setTextDependencyRelations(result.getDependencyRelations());
View Full Code Here

            }
            return tokens;
        }
        private ParsedData parse(ArrayList<Word> words)
        {
            ParsingOptions opts = new ParsingOptions();
            opts.setPosTag(true);
            opts.setParseRelations(true);
            ParsedData resultData = stParser.parse(words, opts);
            return resultData;

        }
View Full Code Here

TOP

Related Classes of seekfeel.utilities.stanfordwrapper.ParsingOptions

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.