#include <text_classification_results.h>
Overall results of a text classification.
Encapsulates the overall results of a text classification.
- See also
- TextClassification, HtmlTextClassifier, TextClassificationResult, TextCategories, HtmlText, CategoriesInfo
myHtmlTextClassifier.
classify( myHtmlText, myTextClassificationResults );
if( !myResult ) {
cout << "Received error from Text Classification (Error code: " <<
return;
}
cout << "No categories found for given HTML data." << endl;
return;
}
myTextClassificationResults[ i ];
cout << "Got result #" << (i+1) << " category id:" <<
myTCResult.
id() <<
", Score:" <<
myTCResult.
score() << endl;
}
Definition at line 29 of file text_classification_results.h.
◆ at()
Returns one result of the matched results (if any) with the given index.
- Parameters
-
[in] | index | The index of the result item. Range is from 0 to size() - 1 |
- Returns
- The result item for the given index in the container.
◆ operator[]()
Similar to at() but allows a more C++ style access.
- Parameters
-
[in] | index | The index of the result item. Range is from 0 to size() - 1 |
- Returns
- The result item for the given index in the container.
◆ size()
Returns the number of results in the container.
- Returns
- The size of the container or 0 if the container is empty.
◆ contains()
Fast method to see whether the results contain a given category or not.
- Parameters
-
[in] | catid | The category id to match |
- Returns
- true, if the given catid has been found in the container, false otherwise.
◆ byId()
If the results contain the given category the detailed result item is returned.
- Parameters
-
[in] | catid | The category id to match with |
[out] | result | Detailed text classification result item |
- Returns
- true, if the given catid has been found in the container, false otherwise.
The documentation for this class was generated from the following file:
Single result of a text classification.
HtmlTextClassifier createHtmlClassifier() const
Creates a HtmlTextClassifier that is used to classify HtmlText objects.
double score() const
Returns the score of the classification (if any), range is from 0.0 to 1.0.
bool isCategorized() const
Returns whether there are any results for the text classification.
DCA_SIZE_TYPE size() const
Returns the number of results in the container.
static HtmlText create(const DcaInstance &aDcaInstance, const std::string &htmlContent)
Creates an HTML text object, used as an input parameter for text classification.
HTML text classifier object for text classification.
FunctionResult classify(const HtmlText &aText, TextClassificationResults &aTextResults) const
The HTML Text Classification method. The method takes an initialized HtmlText object and returns the ...
DCA_CATEGORY_ID_TYPE id() const
Returns the category id of the classification (if any).
Encapsulates an HTML text object.
Overall results of a text classification.
static TextClassification create(const DcaInstance &aDcaInstance, const License &aLicense)
Initializes the TextClassification module.
The HTML Text Classification module class.