Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tulane Guest authored and Tulane Guest committed Oct 4, 2016
1 parent 5f47ef3 commit 2cd6e5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.illinois.cs.cogcomp.saulexamples.nlp.TwitterSentimentAnalysis

import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils
import edu.illinois.cs.cogcomp.saulexamples.nlp.EmailSpam.SpamClassifiers.SpamClassifier
import edu.illinois.cs.cogcomp.saulexamples.twitter.datastructures.Tweet
import edu.illinois.cs.cogcomp.saulexamples.twitter.tweet.TweetReader
import org.apache.commons.io.filefilter.FalseFileFilter
Expand All @@ -17,7 +18,9 @@ object SentimentApp extends App {
tweet.populate(TrainReader.tweets.toList)
tweet.populate(TestReader.tweets.toList, train = false)
//sentimentClassifier.learn(10)
ClassifierUtils.LoadClassifier(sentimentClassifier)
//SpamClassifier.save()
sentimentClassifier.load()
//ClassifierUtils.LoadClassifier("models/", sentimentClassifier)
sentimentClassifier.classifier.discreteValue(new Tweet("here is my tweet."))
sentimentClassifier.test()
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object twitterClassifiers {

object sentimentClassifier extends Learnable[Tweet](tweet) {
def label = Label
override def feature = using(WordFeatures,BigramFeatures)
override def feature = using(WordFeatures, BigramFeatures)
override lazy val classifier = new SparseNetworkLearner()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object twitterDataModel extends DataModel {

val WordFeatures = property(tweet) {
x: Tweet =>
val a= x.getWords.toList
val a = x.getWords.toList
a
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.util
import com.twitter.hbc.core.endpoint.Location
import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils
import edu.illinois.cs.cogcomp.saulexamples.nlp.TwitterSentimentAnalysis.twitterClassifiers.sentimentClassifier
import edu.illinois.cs.cogcomp.saulexamples.twitter.tweet.{ClassifierMessageHandler, Locations, TwitterClient}
import edu.illinois.cs.cogcomp.saulexamples.twitter.tweet.{ ClassifierMessageHandler, Locations, TwitterClient }

import scala.collection.JavaConversions._

Expand Down

0 comments on commit 2cd6e5e

Please sign in to comment.