Text Classification
SkillfulAPI.TextClassification
SkillfulAPI.TextClassificationOverview
Class Definition
using SkillfulAI.API;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TextClassification : MonoBehaviour
{
/// <summary>
/// Unity's Start method, called when the script is initialized. Initiates the text classification process.
/// </summary>
public void Start()
{
ClassifyText();
}
/// <summary>
/// Initiates text classification based on a specified input text.
/// </summary>
public void ClassifyText()
{
// Input text to be classified
string inputText = "You did amazing in the race. However you were in last place. You did not make qualification.";
// Perform text classification on the input text
SkillfulAPI.TextClassification(inputText, response =>
{
// Log positive and negative scores from the classification response
Debug.Log("Positive Score: " + response.PositiveScore);
Debug.Log("Negative Score: " + response.NegativeScore);
});
}
}Detailed Explanation
Usage Example
Conclusion
Last updated