Package com.chatmotorapi.api.functional
Class MotorCategorization
java.lang.Object
com.chatmotorapi.api.functional.MotorCategorization
public class MotorCategorization extends Object
The
MotorCategorization
class represents a data transfer object (DTO) for text categorization results.
It encapsulates the category assigned to a text, the confidence level of the categorization,
and the reasoning behind the assigned category.
This class is designed for use in applications that require categorization of text data into predefined categories such as Business, Culture, Education, Entertainment, Environment, Finance, Healthcare, Lifestyle, Politics, Religion, Science, Sports, and Technology. If a text does not fit any of these categories, it is labeled as 'Other'.
The confidence level indicates the certainty of the categorization, which can be either 'low', 'middle', or 'high'.
- Since:
- 1.2
-
Constructor Summary
Constructors Constructor Description MotorCategorization(String category, String confidence, List<String> reasoning)
Constructs aMotorCategorization
object with the specified category, confidence level, and reasoning. -
Method Summary
Modifier and Type Method Description String
getCategory()
Returns the category assigned to the text.String
getConfidence()
Returns the confidence level of the categorization.List<String>
getReasoning()
Returns the list of reasons supporting the categorization.void
setCategory(String category)
Sets the category assigned to the text.void
setConfidence(String confidence)
Sets the confidence level of the categorization.void
setReasoning(List<String> reasoning)
Sets the list of reasons supporting the categorization.String
toString()
Returns a string representation of theMotorCategorization
object in a JSON-like format.
-
Constructor Details
-
MotorCategorization
Constructs aMotorCategorization
object with the specified category, confidence level, and reasoning.- Parameters:
category
- the category assigned to the textconfidence
- the confidence level of the categorization ('low', 'middle', 'high')reasoning
- a list of reasons supporting the categorization
-
-
Method Details
-
getCategory
Returns the category assigned to the text.- Returns:
- the category assigned to the text
-
setCategory
Sets the category assigned to the text.- Parameters:
category
- the category to be assigned to the text
-
getConfidence
Returns the confidence level of the categorization.- Returns:
- the confidence level of the categorization
-
setConfidence
Sets the confidence level of the categorization.- Parameters:
confidence
- the confidence level of the categorization ('low', 'middle', 'high')
-
getReasoning
Returns the list of reasons supporting the categorization.- Returns:
- the list of reasons supporting the categorization
-
setReasoning
Sets the list of reasons supporting the categorization.- Parameters:
reasoning
- a list of reasons supporting the categorization
-
toString
Returns a string representation of theMotorCategorization
object in a JSON-like format.
-