ML.NET 发布0.11版本:.NET中的机器学习,为TensorFlow和ONNX添加了新功能
2019-03-12 13:50
459 查看
微软发布了其最新版本的机器学习框架:ML.NET0.11带来了新功能和突破性变化。
ML.NET的创新0.11
0.11版本的ML.NET现在还支持TensorFlowTransformer组件中的文本输入数据。TensorFlow模型不仅可用于图像,还可用于文本分析。这在publicclassTensorFlowSentiment
{
publicstringSentiment_Text;
[VectorType(600)]
publicint[]Features;
[VectorType(2)]
publicfloat[]Prediction;
}
[TensorFlowFact]
publicvoidTensorFlowSentimentClassificationTest()
{
varmlContext=newMLContext(seed:1,conc:1);
vardata=new[]{newTensorFlowSentiment(){Sentiment_Text="thisfilmwasjustbrilliantcastinglocationscenerystorydirectioneveryone'sreallysuitedtheparttheyplayedandyoucouldjustimaginebeingthererobert isanamazingactorandnowthesamebeingdirector fathercamefromthesamescottishislandasmyselfsoilovedthefacttherewasarealconnectionwiththisfilmthewittyremarksthroughoutthefilmweregreatitwasjustbrilliantsomuchthatiboughtthefilmassoonasitwasreleasedfor andwouldrecommendittoeveryonetowatchandtheflyfishingwasamazingreallycriedattheenditwassosadandyouknowwhattheysayifyoucryatafilmitmusthavebeengoodandthisdefinitelywasalso tothetwolittleboy'sthatplayedthe ofnormanandpaultheywerejustbrilliantchildrenareoftenleftoutofthe listithinkbecausethestarsthatplaythemallgrownuparesuchabigprofileforthewholefilmbutthesechildrenareamazingandshouldbepraisedforwhattheyhavedonedon'tyouthinkthewholestorywassolovelybecauseitwastrueandwassomeone'slifeafterallthatwassharedwithusall"}};
vardataView=mlContext.Data.ReadFromEnumerable(data);
varlookupMap=mlContext.Data.ReadFromTextFile(@"sentiment_model/imdb_word_index.csv",
columns:new[]
{
newTextLoader.Column("Words",DataKind.TX,0),
newTextLoader.Column("Ids",DataKind.I4,1),
},
separatorChar:','
);
varestimator=mlContext.Transforms.Text.TokenizeWords("TokenizedWords","Sentiment_Text")
.Append(mlContext.Transforms.Conversion.ValueMap(lookupMap,"Words","Ids",new[]{("Features","TokenizedWords")}));
vardataPipe=estimator.Fit(dataView)
.CreatePredictionEngine<TensorFlowSentiment,TensorFlowSentiment>(mlContext);
stringmodelLocation=@"sentiment_model";
vartfEnginePipe=mlContext.Transforms.ScoreTensorFlowModel(modelLocation,new[]{"Prediction/Softmax"},new[]{"Features"})
.Append(mlContext.Transforms.CopyColumns(("Prediction","Prediction/Softmax")))
.Fit(dataView)
.CreatePredictionEngine<TensorFlowSentiment,TensorFlowSentiment>(mlContext);
//Predictthesentimentforthesampledata
varprocessedData=dataPipe.Predict(data[0]);
Array.Resize(refprocessedData.Features,600);
varprediction=tfEnginePipe.Predict(processedData);
}还为MLContext目录添加了其他机器学习组件。这应该可以更容易地找到类和操作。该图显示了基于智能提示的用户体验。
相关文章推荐
- 机器学习 ML.NET 发布 1.0 RC
- iTerm2 2.0版本已发布,添加大量新功能,更易于使用
- asp.net(c#)操作iis全功能版系统(08年3月5日正式发布升级版本)
- TensorFlow官方教程学习笔记之2-用于机器学习初学者学习的MNIST数据集(MNIST For ML Beginners)
- GitHub发布年度机器学习榜:TensorFlow最火,PyTorch失踪,Julia第四
- 给kindeditor编辑器添加FLV上传播放功能,其中使用flowplayer,适用于大部分版本
- 微软一站式示例代码库(中文版)2011-08-08版本, 新添加ASP.NET, Azure, Silverlight, WinForm等15个Sample
- FckEditor添加右键菜单;增加编辑区右键图片删除功能(asp.net )
- ERP系统31.84版本发布,7大新功能轻松解决管理难题
- 企业级发布版本更新功能实现
- PageAdmin V2.1 20100101版本已发布,请更新到最新版本使用更多功能。
- ODP.NET Oracle12.1版本免安装发布(IIS WebServices)
- Google 升级 TensorFlow 2.0 Alpha ,发布机器学习新硬件 coral开发板
- Microsoft.NET Framework 3.0版本发布
- JEECG 什么是商业版本的功能最近添加的好友?
- AgileEAS.NET SOA 中间件2013第四季度发布&部分功能开源预告
- 自定义DelegatingHandler为ASP.NET Web Api添加压缩与解压的功能
- .Net Framework的前世今生--各个版本的新增功能
- 新增格式化单元格数据功能-dotNetFlexGrid更新1.24版本,快速的设置您的表格数据的不同样式;现在开始扔掉你的Asp.net GridView吧。
- 如何在ASP.NET Core中给上传图片功能添加水印实例代码