public static class MetaObjectProfiSCT.DatabaseKeywordClassifier extends ExtendedDatabaseConnection implements Classifier<RankingQueryOperation,java.lang.String>
Classifier
that processes list of ranked abstract objects and provides keyword classification
with words belonging to the object locator URI with the respective confidence based on the ranking distance.ExtendedDatabaseConnection.ExtendedDatabaseConnectionPublic
Constructor and Description |
---|
MetaObjectProfiSCT.DatabaseKeywordClassifier(java.lang.String dbConnUrl,
java.util.Properties dbConnInfo,
java.lang.String dbDriverClass,
java.lang.String objectLocatorToWordSQL,
java.lang.String originalWordMapParameterName,
java.lang.String originalDistanceParameterName)
Creates a database word conversion classifier.
|
Modifier and Type | Method and Description |
---|---|
KeywordClassification<java.lang.String> |
classify(RankingQueryOperation operation,
Parametric parameters)
Classifies the given
object into zero, one, or several categories C . |
java.lang.Class<? extends java.lang.String> |
getCategoriesClass()
Returns the class of instances that represent the classification categories (classes).
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getOriginalWordMap(Parametric parameters)
Returns the original word
Map stored by this classifier in the given parameters. |
closeConnection, createConnection, createDriver, executeDataManipulation, executeSingleValue, finalize, getConnection, prepareAndExecute, prepareAndExecute, resultSetToMap, toString
public MetaObjectProfiSCT.DatabaseKeywordClassifier(java.lang.String dbConnUrl, java.util.Properties dbConnInfo, java.lang.String dbDriverClass, java.lang.String objectLocatorToWordSQL, java.lang.String originalWordMapParameterName, java.lang.String originalDistanceParameterName) throws java.lang.IllegalArgumentException, java.sql.SQLException
dbConnUrl
- the database connection URL (e.g. "jdbc:mysql://localhost/somedb")dbConnInfo
- additional parameters of the connection (e.g. "user" and "password")dbDriverClass
- class of the database driver to use (can be null if the driver is already registered)objectLocatorToWordSQL
- the SQL command used to transform the object locator URI (SQL command parameter) to associated words (the returned result-set first column)originalWordMapParameterName
- the name of the parameter to put the original word Map
into when classifyingoriginalDistanceParameterName
- the name of the parameter to put the original locator-distance pairs into when classifyingjava.lang.IllegalArgumentException
- if the connection url is null or the driver class cannot be registeredjava.sql.SQLException
- if there was a problem connecting to the databasepublic java.lang.Class<? extends java.lang.String> getCategoriesClass()
Classifier
getCategoriesClass
in interface Classifier<RankingQueryOperation,java.lang.String>
public KeywordClassification<java.lang.String> classify(RankingQueryOperation operation, Parametric parameters) throws ClassificationException
Classifier
object
into zero, one, or several categories C
.classify
in interface Classifier<RankingQueryOperation,java.lang.String>
operation
- the object to classifyparameters
- additional parameters for the classification;
the values for the parameters are specific to a given classifier
implementation and can be updated during the process if they are ModifiableParametric
ClassificationException
- if there was an error classifying the objectpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getOriginalWordMap(Parametric parameters)
Map
stored by this classifier in the given parameters.parameters
- the parameters to get the original word map from