31 lines
804 B
C#
31 lines
804 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.ML;
|
|
using RatePlanNameAnalysis.Model;
|
|
|
|
namespace RatePlanNameAnalysis.Api.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class DiscernController : ControllerBase
|
|
{
|
|
|
|
public DiscernController()
|
|
{
|
|
}
|
|
|
|
[HttpPost(Name = "Analysis")]
|
|
public IActionResult Analysis(string ratePlanName)
|
|
{
|
|
// 创建样例数据的单个实例对模型输入数据集的第一行
|
|
ModelInput input = new ModelInput()
|
|
{
|
|
RatePlanName = ratePlanName,
|
|
};
|
|
// 获取预测结果
|
|
var predictionResult = ConsumeModel.Predict(input);
|
|
//System.IO.File.Delete(filefullname);
|
|
return Ok(predictionResult.BedTypeName);
|
|
}
|
|
}
|
|
}
|