Skip to content

Commit

Permalink
fixed formatting error
Browse files Browse the repository at this point in the history
  • Loading branch information
Abi1024 committed Jul 13, 2017
1 parent c16e503 commit 6d94a13
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Expand Up @@ -211,7 +211,7 @@ trait DataModel extends Logging {

/** Discrete sensor feature with range, same as real% and real[] in lbjava */
def apply(f: T => List[Double])(implicit tag: ClassTag[T], d1: DummyImplicit, d2: DummyImplicit,
d3: DummyImplicit): RealCollectionProperty[T] = {
d3: DummyImplicit): RealCollectionProperty[T] = {
def cachedF = if (cache) { x: T => getOrUpdate(x, f).asInstanceOf[List[Double]] } else f
val a = new RealCollectionProperty[T](name, cachedF, ordered) with NodeProperty[T] {
override def node: Node[T] = papply.node
Expand All @@ -223,7 +223,7 @@ trait DataModel extends Logging {

/** Discrete sensor feature with range, same as real name in lbjava */
def apply(f: T => Double)(implicit tag: ClassTag[T], d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit,
d4: DummyImplicit): RealProperty[T] = {
d4: DummyImplicit): RealProperty[T] = {
def cachedF = if (cache) { x: T => getOrUpdate(x, f).asInstanceOf[Double] } else f
val a = new RealProperty[T](name, cachedF) with NodeProperty[T] {
override def node: Node[T] = papply.node
Expand All @@ -235,7 +235,7 @@ trait DataModel extends Logging {

/** Discrete feature without range, same as discrete SpamLabel in lbjava */
def apply(f: T => String)(implicit tag: ClassTag[T], d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit,
d4: DummyImplicit, d5: DummyImplicit): DiscreteProperty[T] = {
d4: DummyImplicit, d5: DummyImplicit): DiscreteProperty[T] = {
def cachedF = if (cache) { x: T => getOrUpdate(x, f).asInstanceOf[String] } else f
val a = new DiscreteProperty[T](name, cachedF, None) with NodeProperty[T] {
override def node: Node[T] = papply.node
Expand All @@ -247,7 +247,7 @@ trait DataModel extends Logging {

/** Discrete array feature with range, same as discrete[] and discrete% in lbjava */
def apply(f: T => List[String])(implicit tag: ClassTag[T], d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit,
d4: DummyImplicit, d5: DummyImplicit, d6: DummyImplicit): DiscreteCollectionProperty[T] = {
d4: DummyImplicit, d5: DummyImplicit, d6: DummyImplicit): DiscreteCollectionProperty[T] = {
def cachedF = if (cache) { x: T => getOrUpdate(x, f).asInstanceOf[List[String]] } else f
val a = new DiscreteCollectionProperty[T](name, cachedF, !ordered) with NodeProperty[T] {
override def node: Node[T] = papply.node
Expand All @@ -259,8 +259,8 @@ trait DataModel extends Logging {

/** Discrete feature with range, same as discrete{"spam", "ham"} SpamLabel in lbjava */
def apply(range: String*)(f: T => String)(implicit tag: ClassTag[T], d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit,
d4: DummyImplicit, d5: DummyImplicit, d6: DummyImplicit,
d7: DummyImplicit): DiscreteProperty[T] = {
d4: DummyImplicit, d5: DummyImplicit, d6: DummyImplicit,
d7: DummyImplicit): DiscreteProperty[T] = {
def cachedF = if (cache) { x: T => getOrUpdate(x, f).asInstanceOf[String] } else f
val r = range.toList
val a = new DiscreteProperty[T](name, cachedF, Some(r)) with NodeProperty[T] {
Expand Down
Expand Up @@ -8,13 +8,12 @@ import edu.illinois.cs.cogcomp.saulexamples.circumplex.facebook.CircumplexReader

import scala.collection.JavaConversions._


object CircumplexApp extends App {

val Reader = new CircumplexReader("./data/circumplex/dataset-fb-valence-arousal-anon.csv.gz")

circumplex_post.populate(Reader.posts.toList.slice(0,Reader.posts.toList.size()-100));
circumplex_post.populate(Reader.posts.toList.slice(Reader.posts.toList.size()-100,Reader.posts.toList.size()), train = false)
circumplex_post.populate(Reader.posts.toList.slice(0, Reader.posts.toList.size() - 100));
circumplex_post.populate(Reader.posts.toList.slice(Reader.posts.toList.size() - 100, Reader.posts.toList.size()), train = false)
sentimentClassifier.learn(10)
sentimentClassifier.testContinuous();
sentimentClassifier.save()
Expand Down
Expand Up @@ -5,8 +5,7 @@ import edu.illinois.cs.cogcomp.saul.learn.MultilayerPerceptron
import edu.illinois.cs.cogcomp.saulexamples.circumplex.datastructures.Circumplex_Post
import circumplexDataModel._

/**
* Created by Abiyaz on 7/7/2017.
/** Created by Abiyaz on 7/7/2017.
*/
object circumplexClassifiers {
object sentimentClassifier extends Learnable[Circumplex_Post](circumplex_post) {
Expand Down
Expand Up @@ -4,10 +4,9 @@ import edu.illinois.cs.cogcomp.saul.datamodel.DataModel
import edu.illinois.cs.cogcomp.saulexamples.circumplex.datastructures.Circumplex_Post
import scala.collection.JavaConversions._

/**
* Created by Abiyaz on 7/7/2017.
/** Created by Abiyaz on 7/7/2017.
*/
object circumplexDataModel extends DataModel{
object circumplexDataModel extends DataModel {
val circumplex_post = node[Circumplex_Post]

val WordFeatures = property(circumplex_post) {
Expand All @@ -33,6 +32,6 @@ object circumplexDataModel extends DataModel{
}*/

var Label = property(circumplex_post) {
x: Circumplex_Post => x.getValence :: x.getArousal :: Nil;
x: Circumplex_Post => x.getValence :: x.getArousal :: Nil;
}
}

0 comments on commit 6d94a13

Please sign in to comment.