Package com.logicaldoc.ai.nlp
Class Classifier
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.ai.AIModel<String,String>
com.logicaldoc.ai.nlp.NaturalLanguageModel
com.logicaldoc.ai.nlp.Classifier
- All Implemented Interfaces:
Serializable
Classifies a text on the basis of natural language. It must be trained with
pairs of strings where the first element is the category and the second is a
pertinent text that must terminate with the sequence ' .', a tab character
must be used to separate the two elements
SEARCHDOC Find documents with content "papers" . GETDOC Get document with ID 1233587 . SEARCHFILE Get document called "paper.pdf" .
- Since:
- 9.2
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Field Summary
Fields inherited from class com.logicaldoc.ai.AIModel
AIQUERY, AIQUERY_HYPHENFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the ordered list of feature namesConcrete implementations must give a prediction from a single sentenceMethods inherited from class com.logicaldoc.ai.nlp.NaturalLanguageModel
equals, getCutoff, getLanguage, getNgramMax, getNgramMin, hashCode, setCutoff, setLanguage, setNgramMax, setNgramMinMethods inherited from class com.logicaldoc.ai.AIModel
getDescription, getLabel, getName, getTraining, newModel, query, setDescription, setLabel, setName, setTraining, toString, typesMethods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Constructor Details
-
Classifier
public Classifier() -
Classifier
-
Classifier
-
-
Method Details
-
getFeaturesList
Description copied from class:AIModelGets the ordered list of feature names- Specified by:
getFeaturesListin classAIModel<String,String> - Returns:
- list of feature names
-
query
public QueryResult<String> query(String content) throws IOException, com.logicaldoc.core.PersistenceException Description copied from class:NaturalLanguageModelConcrete implementations must give a prediction from a single sentence- Specified by:
queryin classNaturalLanguageModel- Parameters:
content- The sentence to process- Returns:
- The prediction
- Throws:
IOException- I/O errorcom.logicaldoc.core.PersistenceException- Error in the data layer
-