Mathematica的新功能——提取特征

 时间:2026-04-22 02:27:24

1、首先,我们加载一篇文章——Alice In Wonderland——《Alice梦游记》:

alice = ExampleData[{"Text", "AliceInWonderland"}];

Mathematica的新功能——提取特征

2、用逗号“,”把每一个单句分隔开来:

sentences = TextSentences[alice];

Mathematica的新功能——提取特征

3、提取每一个单句的特征:

fe = FeatureExtraction[sentences]

Mathematica的新功能——提取特征

4、生成体现所有单句特征的最亲近函数:

nf = Nearest[fe[sentences] -> Automatic]

Mathematica的新功能——提取特征

5、使用 NearestFunction,构建一个新的函数,来显示文中最接近的单句:

nearestalice = sentences[[First@nf[fe[#]]]] &

Mathematica的新功能——提取特征

6、用这个函数来查询几个例子:

nearestalice["Alice and the Rabbit"]

Mathematica的新功能——提取特征

  • Mathematica--解最基本的线性代数问题
  • Matlab2016怎么建立使用多维数组
  • 从Matlab的Fig图里面导出数据
  • 如何使用matlab中的胞元数组?
  • MATLAB字符串调整有关函数总结
  • 热门搜索
    思域怎么样 静脉曲张怎么预防 我的世界锁链甲怎么做 胸一大一小怎么办 糖耐量试验怎么做 怎么截取视频 怎么治咳嗽 手机进水怎么处理 折线图怎么做 意外怀孕了怎么办