SENTIMENT
Use this procedure to perform sentiment analysis for a document, determine a sentiment score for each topic within the document, and populate the results into a result table.
The mandatory inputs to this procedure include the name of a text index associated with the document set and the text key, which is a unique identifier that identifies each document. After sentiment classification is performed, the text segments from the document and their associated sentiment scores are populated into the result table. The sentiment score is a value between -100 and 100.
The result table must exist before you run this procedure. An error is returned if the result table does not exist or if the specified topic is null.
If the specified topic is not present in the document, then a default snippet and sentiment score of zero are written into the result table. If no sentiment classifier is specified, then the default sentiment classifier is used. The default classifier is only available when using AUTO_LEXER.
Syntax
SENTIMENT(
index_name IN VARCHAR2,
textkey IN VARCHAR2,
topic IN VARCHAR2,
restab IN VARCHAR2,
clsfier_name IN VARCHAR2 default NULL,
ttype IN VARCHAR2 default 'EXACT',
radius IN NUMBER default 50,
max_inst IN NUMBER default 5,
starttag IN VARCHAR2 default '',
endtag IN VARCHAR2 default '',
use_saved_copy IN NUMBER default 0
);
Most parameters in SENTIMENT are also used in SENTIMENT_AGGREGATE. For a description of parameters common to SENTIMENT and SENTIMENT_AGGREGATE, refer to SENTIMENT_AGGREGATE.
restab
Specify the name of the result table that will be populated with generated results. The table must exist and you must have INSERT permissions on the table. The table must have two columns, snippet of data type CLOB and score of data type NUMBER.
starttag
Specify the character(s) to be inserted to indicate the start of a highlighted term.
endtag
Specify the character(s) to be inserted to indicate the end of a highlighted term.
See Also: Oracle Text Application Developer’s Guide for an example of using the SENTIMENT procedure