Class SentimentConfig

java.lang.Object
com.norconex.importer.handler.parser.impl.SentimentConfig

public class SentimentConfig extends Object

Tika sentiment analysis configuration (via Tika's SentimentAnalysisParser).

Sentiment analysis is disabled by default because the parser downloads a model from the network the moment Tika is initialized, regardless of whether any document actually needs sentiment analysis. This can slow down or fail startup when the model URL is unreachable.

To enable it, set enabled to true and optionally override the default model path with modelPath (default: "https://raw.githubusercontent.com/USCDataScience/SentimentAnalysisParser/master/sentiment-models/src/main/resources/edu/usc/irds/sentiment/en-netflix-sentiment.bin").

Since:
4.0.0
  • Field Details

  • Constructor Details

    • SentimentConfig

      public SentimentConfig()
  • Method Details

    • isEnabled

      public boolean isEnabled()
    • getModelPath

      public String getModelPath()
    • setEnabled

      public SentimentConfig setEnabled(boolean enabled)
      Returns:
      this.
    • setModelPath

      public SentimentConfig setModelPath(String modelPath)
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object