STARK : A Toolkit for Dependency (Sub)Tree Extraction and Analysis (2025)

Abstract: We present STARK, a lightweight and flexible Python toolkit for extracting and analyzing syntactic (sub)trees from dependency-parsed corpora. By systematically slicing each sentence into interpretable syntactic units based on configurable parameters, STARK enables bottom-up, data-driven exploration of syntactic patterns at multiple levels of abstraction—from fully lexicalized constructions to general structural templates. It supports any CoNLL-U-formatted corpus and is available as a command-line tool, Python library, and interactive online demo, ensuring seamless integration into both exploratory and large-scale corpus workflows. We illustrate its functionality through case studies in noun phrase analysis, multiword expression identification, and syntactic variation across corpora, demonstrating its utility for a wide range of corpus-driven syntactic investigations.

## introduction syntactically annotated corpora, or treebanks, have become indispensable in linguistic research, supporting work on grammar description @xcite , typological comparison @xcite , genre analysis @xcite , as well as language technology development and understanding @xcite @xcite . as their availability grows, so too does the ecosystem of tools designed to facilitate their exploration, most notably through treebank browsing services such as grew-match @xcite , pml tree query @xcite , and iness @xcite . despite this growing infrastructure, most existing tools are inherently query-based. they require the user to formulate a specific hypothesis or structural pattern of interest-typically by specifying the number of words involved, their morphological properties, and their syntactic relationships. such top-down approaches are well-suited for targeted investigation, but they offer limited support for inductive, bottom-up discovery of patterns-particularly in cases where no prior expectations about syntactic configurations are available or desirable. in practical terms, if a researcher is interested in noun phrase structures, most existing tools will allow them to search for examples of a specific pattern -for example, a noun preceded by an adjectival modifier. however, such tools do not typically support asking what kinds of noun phrase structure patterns actually occur in the corpus, how frequent they are, or whether any rare or unexpected patterns emerge -particularly in contrast to another dataset. to address this gap, we present stark (subtree analysis and retrieval kit), a toolkit for bottom-up, treebank-driven syntactic analysis. rather than relying on predefined queries, stark automatically extracts all trees and subtrees that meet general structural criteria specified by the user-effectively slicing a parsed corpus into interpretable syntactic patterns, which can then be counted and compared within or across corpora. the remainder of the paper introduces stark's core functionality and configurable parameters ( §2), illustrates its analytic capabilities through frequency, association, and comparison outputs ( §3), and then details its features for example retrieval and visualization ( §4), scalability and performance optimization ( §5), and accessibility via an interactive online demo and open-source release ( §6). ## core functionality stark is an open-source python toolkit for extracting and analyzing syntactic (sub)trees from dependency-parsed corpora. it operates by systematically slicing each sentence into smaller, interpretable syntactic units based on configurable structural parameters, described below. ## statistical analysis in addition to extracting and representing syntactic structures, stark provides a range of statistical measures that support quantitative corpus-based syntactic analysis. these include basic frequency counts, association scores, and keyness comparisons, all computed based on the extracted trees. in this section, we illustrate each type of analysis on different corpora and configurations to highlight stark's flexibility. foot_4 ## example retrieval and visualisation stark offers optional output enhancements to support qualitative analysis and visualization. users can retrieve a sample sentence per tree (--example), with marked nodes, or add node-level (--node_info) and head-level (--head_info) details for further analysis. stark also supports integration with online treebank browsing services. if the input is an official ud treebank (i.e., follows the standard naming convention), enabling the --grew_match option generates clickable links to the corresponding patterns in the grew-match interface @xcite . 5 these links let users explore all instances of a given tree in context within the latest ud release and leverage additional grew-match functionalities. for compatibility with legacy tools, the --depsearch option outputs trees in the dep_search syntax used by earlier platforms such as sets @xcite , dep_search @xcite or drevesnik (štravs and dobrovoljc, 2024). 6 5 scalability stark has been tested on all official ud treebanks and can handle corpora of various sizes and annotation styles, including multi-root sentences and non-standard labels. output volume can be managed via frequency thresholds (--frequency_threshold) or by capping the number of output trees (--max_lines), making it easy to scale stark to large datasets while maintaining interpretability. several advanced settings have also been introduced to further improve performance and scalability. these include multi-core support (--cpu_cores), internal caching for repeated experiments (--internal_saves), and chunked processing of directory-based corpora (--continuation_processing). users can also select between two extraction modes: the default greedy_counter, optimized for bottom-up tree extraction, and the query_counter, which performs better when used with specific target patterns. ## availability and online demo stark is freely available as an open-source tool under the apache 2.0 license. 7 in addition to the command-line interface, the tool is also released as a python library via pypi (pip install stark-trees), foot_8 enabling seamless integration into custom scripts and larger nlp workflows. comprehensive documentation is available through the github and pypi repositories where users can find detailed explanations of all parameters, usage examples, and configuration tips. to further support accessibility, stark is also available via an interactive online demo. 9 the web interface covers all core functionalities of the tool, allowing users to select a treebank, configure extraction settings (see section 2), and explore the output in an interactive table view. unlike the command-line version, the online interface also provides visualisations for one or multiple example instances of the tree. as such, the online demo is particularly useful for exploratory browsing, classroom use, and first-time users unfamiliar with the command-line interface. screenshots of both the settings panel and the output view are shown in figures 2 and 3 in appendix b. ## conclusion we introduced stark, a versatile toolkit for bottom-up syntactic analysis of dependency-parsed corpora. by extracting, ranking, and comparing syntactic (sub)trees, it enables exploratory and data-driven research without requiring predefined queries. the tool supports a wide range of configurations and outputs, and is available as a commandline tool, python library, and online demo. its practical value has already been demonstrated through early adoption in a range of re-search contexts, from integration into tools such as the delta diversity pipeline @xcite and comparatree treebank comparison tool @xcite , to studies on syntactic profiling of spoken data @xcite , learner essays @xcite , and parallel multilingual corpora @xcite .