Mathematica的新功能——提取特征
1、首先,我们加载一篇文章——Alice In Wonderland——《Alice梦游记》:alic髫潋啜缅e = ExampleData[{"Text", "AliceInWonderland"}];
2、用逗号“,”把每一个单句分隔开来:sentences = TextSentences[alice];
3、提取每一个单句的特征:fe = FeatureExtraction[sentences]
4、生成体现所有单句特征的最亲近函数:nf = Nearest[fe[sentences] -> Automatic]
5、使用 NearestFunction,构建一个新的函数,来显示文中最接近的单句:nearestalice = sentences[[First@nf[fe[#]]]] &
6、用这个函数来查询几个例子:nearestalice["Alice and the Rabbit"]
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:77
阅读量:35
阅读量:63
阅读量:65
阅读量:90