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_HYPHEN
Fields 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, setNgramMin
Methods inherited from class com.logicaldoc.ai.AIModel
getDescription, getLabel, getName, getTraining, newModel, query, setDescription, setLabel, setName, setTraining, toString, types
Methods 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:AIModel
Gets the ordered list of feature names- Specified by:
getFeaturesList
in 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:NaturalLanguageModel
Concrete implementations must give a prediction from a single sentence- Specified by:
query
in classNaturalLanguageModel
- Parameters:
content
- The sentence to process- Returns:
- The prediction
- Throws:
IOException
- I/O errorcom.logicaldoc.core.PersistenceException
- Error in the data layer
-