📦ChatBot.cs - ChatBot

Код класса:

ChatBot.cs
public class Data
{
    public string Text { get; set; }
    
    public string Response { get; set; }
    
    public int ReturnCode { get; set; }
}

internal class Prediction
{
    [ColumnName("PredictedLabel")]
    public string Response { get; set; }
}

public class CResponse
{
    public string Response { get; set; }
    
    public int ReturnCode { get; set; }
}

public static class ChatBot
{
    static ChatBot() => mlContext = new MLContext(); 
    
    public static void Initialize(List<Data> trainingData) {...}
    
    public static CResponse GetResponse(string userInput) {...}
}

Last updated

Was this helpful?