Запросы в свободном формате о сущностях и их свойствах ( Free-Form Entity-Property)
Воспользуемся ресурсом Interpreter для того, чтобы построить функцию, подобную EntityValue, но принимающую естественный язык для спецификации сущностей типа EntityType, Entity, и EntityProperty.
In[1]:=

NLEntityValue[type_String, entity_String, property_String] :=
With[{res =
Map[{Replace[#, AmbiguityList[{a___}, ___] :> a]} &,
Interpreter[
CompoundElement[{"EntityType", "Entity", "EntityProperty"}],
AmbiguityFunction -> All][{type, entity, property}]]},
If[FreeQ[res, Failure],
EntityValue[FirstCase[res[[2]], Entity[res[[1, 1]], ___]],
FirstCase[res[[3]], EntityProperty[res[[1, 1]], ___]]],
Missing["Unknown"]]]
Применим функцию к различным типам сущностей, объектов и свойств.
In[2]:=

NLEntityValue["country", "GB", "oil imports"]
Out[2]=

In[3]:=

NLEntityValue["city", "windy city", "elderly population"]
Out[3]=

In[4]:=

NLEntityValue["celebrity", "the Boss", "birthday"]
Out[4]=

In[5]:=

NLEntityValue["moon", "ganymede", "image"]
Out[5]=

In[6]:=

Row[NLEntityValue["popular curve", #, "image"] & /@ {"trump",
"hillary clinton"}]
Out[6]=
