SemanticInterpretation
SemanticInterpretation["string"]
attempts to give the best semantic interpretation of the specified free-form string as a Wolfram Language expression.
SemanticInterpretation["string",pattern]
filters possible semantic interpretations, returning the best one that matches the specified pattern.
SemanticInterpretation["string",pattern,head]
returns the semantic interpretation wrapped with the specified head.
Details and Options
- "string" can be natural-language English text.
- Types of objects returned include numbers, formulas, Entity objects, DateObject, etc.
- The following options can be given:
-
AmbiguityFunction Automatic function to apply to the collection of possible interpretations GeoLocation $GeoLocation geo location to assume TimeZone $TimeZone time zone to assume for semantic interpretation - If multiple interpretations are found, SemanticInterpretation supplies the list of them (with the best first) to the function specified as the setting for AmbiguityFunction. The result of applying that function is returned as the result from SemanticInterpretation.
Examples
open allclose allScope (4)
Options (3)
AmbiguityFunction (3)
Get the most probable interpretation:
Apply an arbitrary function in the case of ambiguity:
The AmbiguityFunction is not used if there is no ambiguity:
Properties & Relations (1)
SemanticInterpretation["s"] and WolframAlpha["s","WolframResult"] are effectively equivalent:
So are SemanticInterpretation["s",_,HoldComplete] and WolframAlpha["s","WolframRParse]:
Text
Wolfram Research (2014), SemanticInterpretation, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticInterpretation.html.
CMS
Wolfram Language. 2014. "SemanticInterpretation." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SemanticInterpretation.html.
APA
Wolfram Language. (2014). SemanticInterpretation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticInterpretation.html