Package org.apache.tika.parser.sentiment
Class SentimentAnalysisParser
java.lang.Object
org.apache.tika.parser.sentiment.SentimentAnalysisParser
- All Implemented Interfaces:
Serializable,Initializable,Parser
This parser classifies documents based on the sentiment of document.
The classifier is powered by Apache OpenNLP's Maximum Entropy Classifier
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetSupportedTypes(ParseContext context) Returns the types supportedvoidinitialize(Map<String, Param> params) voidparse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) Performs the parse
-
Field Details
-
DEF_MODEL
- See Also:
-
-
Constructor Details
-
SentimentAnalysisParser
public SentimentAnalysisParser()
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceInitializable- Parameters:
params- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
- Specified by:
checkInitializationin interfaceInitializable- Parameters:
handler- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
getSupportedTypes
Returns the types supported- Specified by:
getSupportedTypesin interfaceParser- Parameters:
context- the parse context- Returns:
- the set of types supported
-
parse
public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException Performs the parse- Specified by:
parsein interfaceParser- Parameters:
stream- the inputhandler- the content handlermetadata- the metadata passedcontext- the context for the parser- Throws:
IOException- if the document stream could not be readSAXException- if the SAX events could not be processedTikaException- if the document could not be parsed
-