Treebank StudioDocumentation

Treebank Studio on your own computer, with Annotald 2

Treebank Studio is the software that runs the search engine on treebankstudio.org and Annotald 2 is an editor for Penn-style phrase-structure treebanks in the labeled bracketing (.psd) format. Annotald 2 is integrated with Treebank Studio and .pacql queries can be used to flag annotation problems or edit only trees that match some pattern. If you want to use Treebank Studio to search parsed corpora on your own computer, or use Annotald 2 to edit your local treebank files, you can download the installation package below. Installation scripts for Windows, macOS, and Linux are included. This version runs without dependency issues on modern Python in 2026; theoretically, and in tests so far (some other versions run into issues).

After downloading, unzip the file and double click install-windows.cmd on Windows, or on macOS or Linux type sh install-linux-mac.sh in the terminal, in the unzipped folder.

This page has pointers to get started. More detailed documentation is found in the download.

Local Treebank Studio - getting started

The download includes treebankstudio-guide.html, a document with further instructions and examples to try out, but this is how you start using local Treebank Studio. Open PowerShell on Windows or the terminal on macOS/Linux and type (you can also always use the short form of the command, tbs instead of treebankstudio):

treebankstudio corpus add ~/corpora/mycorpus --name "My corpus" --id mycorpus

The folder that you name must include parsed .psd files in the Penn-style labeled bracketing format. Treebank Studio searches indexed corpora and therefore you have to use corpus add as above to add a corpus (and index it) before you search it. Its name will appear in the user interface and you will use the id to reindex the corpus if it changes or delete the index if you wish to do so. When you have added a corpus, you can start your local Treebank Studio server like this.

treebankstudio

The server starts running, a local URL is printed on the screen, and a web browser should open automatically at the right address. And you can start running queries. Refer to the PaCQL documentation for details on how to write them. You will also find useful advice by typing treebankstudio --help, treebankstudio corpus --help, etc.

The web-based user interface is convenient to use in many cases, but it is also possible to run Treebank Studio on queries in PowerShell/the terminal. The following command uses the short form tbs, equivalent to typing treebankstudio.

tbs query -c mycorpus myquery.pacql > outputfile.out

For this to work "mycorpus" has to be the id of some indexed corpus on the local Treebank Studio server; you can add a corpus to the server as shown above and you can list the currently indexed corpora by typing tbs corpus list. The query takes a PaCQL query file myquery.pacql as its input and because it writes the output of the search to stdout, one can use > outputfile.out to direct that output to a file. The format of the output is similar to CorpusSearch output and it is a .psd file compatible with indexing that file as a new corpus in Treebank Studio or searching the output directly in CorpusSearch. The query file is written the same way as the queries in the web interface, with the addition that definition files can be used to load saved patterns that match certain types of nodes. Definition files are written exactly like the define: section of a PaCQL query (see PaCQL tutorial) and they are loaded with a define section that gives the file name directly after the section heading instead of listing definitions below define:.

A definition section within the query is like this:

define:
object NP-OB[12]

A definition section that loads a file is like this:

define:mydefinitions.def

The two methods can be combined in the same query, but then they must be two distinct sections:

define:mydefinitions.def

define:
object NP-OB[12]

Several treebanks in the Penn-style tradition are available in open access, freely available for download and use. If you want to try adding one of these to your local installation of Treebank Studio, you can, for example, download IcePaHC (the Icelandic Parsed Historical Corpus) and use the tbs corpus add command like above, giving the path to the folder where the IcePaHC .psd files are located.

Annotald 2 - getting started

Annotald is an editor for parsed .psd files in the labeled bracketing format. It was originally written by Anton Karl Ingason for the IcePaHC (Icelandic Parsed Historical Corpus) project and this version builds on that original implementation (Anton again), while also both reimplementing some features that were introduced in the Annotald 1.x series (developed by Aaron Ecay and Jana Beck), and adding features that are completely new. The biggest difference is that Annotald 2 is integrated with Treebank Studio and can use its search engine to support annotation. The download has more documentation (see annotald-guide.html), but this is how you can start. If you open PowerShell (Windows) or your terminal (macOS/Linux), in the Annotald 2 folder in the extracted zip-download, and type the following, the sample treebank file is opened in Annotald 2.

annotald2 example/sample.psd

You can refer to annotald-keys.html in the download for how to use the keyboard and the mouse. If you have used other versions of Annotald, most of the user interface should be familiar. However, if you scroll down to the third tree, you can see that the editor has flagged a problem in the annotation:

Annotald 2 showing a tree with an annotation problem flagged

Various treebank projects in the Penn tradition have used "sanity checks" in the form of CorpusSearch queries that find structures that should not exist. For example, this tree has a finite main clause with two subjects, when there should be only one. This works here because the example folder has a settings file, annotald.toml, that indicates where the folder for sanity checks is, and anything that matches these queries is flagged in the user interface, updating live as you edit.

In addition to live sanity checks, Annotald can use the Treebank Studio search engine to open all trees in a corpus, across many files, that match the pattern described by a PaCQL query. You can try this using the same sanity check query as was used in the example above.

annotald2 --query example/checks/missing-subject.pacql example

This opens Annotald 2 in query mode, using the missing-subject.pacql query as a pattern to look for, and it will open all *.psd files in the folder "example", and only show the trees that match the pattern; these trees can now be edited. This can be an effective method to systematically annotate a specific construction. In query mode, you can split trees as usual, by moving a node to the file level (right click area outside trees), and they will be saved correctly to the same file, but you cannot merge trees, since trees that display next to each other in query mode are not next to each other in the files. While Treebank Studio search is fast on indexed corpora, query mode does not use indexed search and therefore it is much slower. A typical query may take about 20 seconds to open in query mode on IcePaHC, but this time will vary depending on the size of the corpus.

License - source code

Both the Treebank Studio core and all of Annotald 2 are free software under the GNU General Public License, version 3 or later (Copyright © 2026 Anton Karl Ingason). The source code is available on GitHub: https://github.com/antonkarl/annotald2. The "core" part of "Treebank Studio core" is just to express that Treebank Studio in a more broad sense is also the software that runs the treebankstudio.org website and some parts of that are specific to the configuration on the public server. The actual search engine is exactly the same in a local installation as it is on the public server.