Class SentimentModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.sentiment.SentimentModel
- All Implemented Interfaces:
Serializable, opennlp.tools.util.model.ArtifactProvider
Class for the basis of the Sentiment Analysis model.
- See Also:
-
Field Summary
Fields inherited from class BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionSentimentModel(File file) Instantiates aSentimentModelmodel via aFilereference.SentimentModel(InputStream modelIn) Instantiates aSentimentModelmodel via aInputStreamreference.SentimentModel(String languageCode, opennlp.tools.ml.model.MaxentModel sentimentModel, Map<String, String> manifestInfoEntries, SentimentFactory factory) Instantiates aSentimentModelmodel.SentimentModel(URL modelURL) Instantiates aSentimentModelmodel via aURLreference. -
Method Summary
Modifier and TypeMethodDescriptionopennlp.tools.ml.model.MaxentModelMethods inherited from class BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
SentimentModel
public SentimentModel(String languageCode, opennlp.tools.ml.model.MaxentModel sentimentModel, Map<String, String> manifestInfoEntries, SentimentFactory factory) Instantiates aSentimentModelmodel.- Parameters:
languageCode- The code for the language of the text, e.g. "en"sentimentModel- AMaxentModelsentiment modelmanifestInfoEntries- Additional information in the manifestfactory- ASentimentFactoryinstance
-
SentimentModel
Instantiates aSentimentModelmodel via aURLreference.- Parameters:
modelURL- TheURLto a file required to load the model.- Throws:
IOException- Thrown if IO errors occurred.
-
SentimentModel
Instantiates aSentimentModelmodel via aFilereference.- Parameters:
file- TheFilerequired to load the model.- Throws:
IOException- Thrown if IO errors occurred.
-
SentimentModel
Instantiates aSentimentModelmodel via aInputStreamreference.- Parameters:
modelIn- TheInputStreamrequired to load the model.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
getFactory
- Returns:
- Retrieves the
SentimentFactoryfor the model.
-
getMaxentModel
public opennlp.tools.ml.model.MaxentModel getMaxentModel()- Returns:
- Retrieves the
MaxentModel.
-