用特征提取创建文本查询工具
根据《爱丽丝梦游仙境》中的句子培训特征提取器:
In[1]:=

alice = ExampleData[{"Text", "AliceInWonderland"}];
sentences = TextSentences[alice];
fe = FeatureExtraction[sentences]Out[1]=
根据从数据集提取的特征生成 NearestFunction.
In[2]:=
nf = Nearest[fe[sentences] -> Automatic]Out[2]=
构建显示与《爱丽丝梦游仙境》中最接近句子的函数,并对其他句子进行使用.
In[3]:=
nearestalice = sentences[[First@nf[fe[#]]]] &;In[4]:=
nearestalice["Alice and the Rabbit"]Out[4]=
In[5]:=
nearestalice["Off her head"]Out[5]=