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 Details

    • MotorCategorization

      public MotorCategorization​(String category, String confidence, List<String> reasoning)
      Constructs a MotorCategorization object with the specified category, confidence level, and reasoning.
      Parameters:
      category - the category assigned to the text
      confidence - the confidence level of the categorization ('low', 'middle', 'high')
      reasoning - a list of reasons supporting the categorization
  • Method Details

    • getCategory

      public String getCategory()
      Returns the category assigned to the text.
      Returns:
      the category assigned to the text
    • setCategory

      public void setCategory​(String category)
      Sets the category assigned to the text.
      Parameters:
      category - the category to be assigned to the text
    • getConfidence

      public String getConfidence()
      Returns the confidence level of the categorization.
      Returns:
      the confidence level of the categorization
    • setConfidence

      public void setConfidence​(String confidence)
      Sets the confidence level of the categorization.
      Parameters:
      confidence - the confidence level of the categorization ('low', 'middle', 'high')
    • getReasoning

      public List<String> getReasoning()
      Returns the list of reasons supporting the categorization.
      Returns:
      the list of reasons supporting the categorization
    • setReasoning

      public void setReasoning​(List<String> reasoning)
      Sets the list of reasons supporting the categorization.
      Parameters:
      reasoning - a list of reasons supporting the categorization
    • toString

      public String toString()
      Returns a string representation of the MotorCategorization object in a JSON-like format.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the MotorCategorization object