TextStructure
TextStructure["text"]
generates a nested collection of TextElement objects representing the grammatical structure of natural language text.
TextStructure["text",form]
generates a representation of the type specified by form of the grammatical structure of text.
Details and Options
- TextStructure[{text1,text2,…},…] yields a list with the respective results for texti.
- Possible types of text structure include:
-
"ConstituentTree" nested text elements of phrase structure "ConstituentGraphs" graph of phrase structure "ConstituentStrings" string representing phrase structure "PartsOfSpeech" text elements tagging parts of speech "DependencyGraphs" graph of grammatical dependencies "DependencyStrings" string representing grammatical dependencies - The following option can be given:
-
PerformanceGoal Automatic favor algorithms with specific advantages
Examples
open allclose allScope (6)
Display the constituent tree of a sentence:
Return the constituent tree as a graph:
Return the constituent tree as a string of nested parentheses:
Return the grammatical dependencies as a graph:
Display the dependency tree as a string of nested brackets:
Display the grammatical structure of several sentences at once:
Options (1)
PerformanceGoal (1)
Faster parts of speech tagging can be achieved by using PerformanceGoal->"Speed":
Applications (1)
Get the text content of a Wikipedia page using WikipediaData:
Extract the first paragraph using TextCases:
Use TextStructure to visualize the grammatical structure of this paragraph:
Text
Wolfram Research (2015), TextStructure, Wolfram Language function, https://reference.wolfram.com/language/ref/TextStructure.html (updated 2019).
CMS
Wolfram Language. 2015. "TextStructure." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/TextStructure.html.
APA
Wolfram Language. (2015). TextStructure. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextStructure.html