Packages

object SentimentAnalyzer

This companion object of class SentimentAnalyzer provides methods for initializing a analyzer instances from training data.

The methods expect the data to be in the following line-based format:

-1 Aggressive self-glorification and a manipulative whitewash.
2 A comedy-drama of nearly epic proportions rooted in a sincere performance by the title character undergoing midlife crisis.
-1 Narratively, Trouble Every Day is a plodding mess.
1 The Importance of Being Earnest, so thick with wit it plays like a reading from Bartlett's Familiar Quotations
0 It's everything you'd expect -- but nothing more.

That is, each line of input should start with a sentiment rating of -2, -1, 0, 1, 2. A negative numbers means that the rest of the line expresses a negative sentiment, as determined by a human rater; positive numbers correspondingly reflect positive sentiments.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SentimentAnalyzer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def fromFile(trainingDataPath: String): SentimentAnalyzer

    Given the path to a file that contains training data, returns a SentimentAnalyzer trained on that data.

    Given the path to a file that contains training data, returns a SentimentAnalyzer trained on that data.

    N.B. This method is unsafe: it will crash with an error if it fails to read the file. If it encounters invalid lines, the method will emit warnings and ignore that data.

  9. def fromSource(trainingData: Source): SentimentAnalyzer

    Given a Source that contains training data, returns a SentimentAnalyzer trained on that data.

    Given a Source that contains training data, returns a SentimentAnalyzer trained on that data.

    N.B. This method is unsafe: it will crash with an error if it fails to read the source. If it encounters invalid lines, the method will emit warnings and ignore that data.

  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString: String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped