public int GetAverageProbability() { var model = BuildAndTrainModel(mlContext); var probability = new ReadAndWriteCommentsProbability(productId); return(probability.GetAverageProbabilityMark()); }
public async Task <int> UpdateDataAndGetAverageProbability(string sentiment) { var model = BuildAndTrainModel(mlContext); var statementProbability = PredictStatementProbability(mlContext, model, sentiment); var probability = new ReadAndWriteCommentsProbability(productId); await probability.WriteProbabilityData(statementProbability); return(probability.GetAverageProbabilityMark()); }