TGA: Time Group Analysis

Online tools for speech annotation mining and analysis.

Dafydd Gibbon (Universität Bielefeld, 2012)


Presentation on TGA at the Chongqing Summer School on Contemporary Phonetics and Phonology, 2025

Lectures on AI in Phonology and Phonetics at the Xi'an Summer School on Contemporary Phonetics and Phonology, 2026, and at the Third International Symposium on Phonology, also Xi'an 2026




The original online policy for these browser-based apps to be available directly from this server website has had to be changed, for security reasons. All apps are derived from previous manually implemented apps using code suggestions from ChatGPT5.

The apps are available as MIT licensed software for running locally and safely in the browsers on your own computer, and in some cases your mobile phone. Nothing is processed online, nothing is tracked, nothing is uploaded and nothing is stored except the app itself.


FST Explorer

FST explorer is a browser app which converts a regular grammar, with pairs for terminal symbols and expressed as quadruples, as a finite state transducer, into an easily interpretable finite state network representation. In this case, "TGA" can be understood as Transducer Grammar Analysis. The app is designed for exploring finite state automaton and finite state transducer grammars for Finite State Phonology and Finite State Prosody, in order to represent the models of Chomsky (1965 on intonation), Reich, Johnson, Fujisaki, 't Hart et al., Pierrehumbert, Koskenniemi, Kay, Kaplan, Beesley, Gibbon. It will also have uses for FST models of other domains.
Download ZIP file:

TGAplus

New: Batch TGAplus with Batch tab for processing multiple TextGrid files. A Wagner Quadrant plot can be produced for each file singly or for all files together.

The TGAplus web app is intended for teaching and individual study projects. Since it is a downloadable single page web app, it is open source by definition. After saving the file in can be placed in any working directory. On startup the app opens a tab in a browser and can be used interactively in the browser. TGAplus was developed to work with the Chrome browser, but will work with other modern browsers.

The tool is a replacement for, and extension, of the old TGA tool, and will be extended further in future releases.

The facility for automatic segmentation and annotation from a transcription is optimised for CV and CVN languages and may be suboptimal for languages with more complex syllable structure. The annotation can be edited and saved as a TextGrid file. If a full TextGrid file is loaded, rather than a transcription, then this TextGrid file cannot be edited or re-exported.1

Further instructions are available in the Info tab in the web app.

Download ZIP file:

TextGridBatchInspector

TGAinspector is research tool in the form of a web app for TextGrid file validation, i.e. for analysing the content of Praat TextGrid files and checking for inconsistencies and other errors. As a single file web app implemented in HTML, CSS and JS, it is open source by definition and can be saved and operated locally.

The app has two main functions:

  • Validating the correctness of a batch of TextGrid files in the same directory by examining for inconsistencies and other errors, with error counts and descriptions of inconsistencies.
  • Analysing the batch of TextGrid files and providing basic descriptive statistics for the files, packaged in a ZIP file for downloading. This function presupposes that the files in the batch have already been validated. If this check is overridden the results are likely to be garbled.
Download ZIP file:

ProsCanvas

ProsCanvas, an experimental browser-based app for examining the acoustics of prosody, in particular the structure of InterPausal Units (IPUs, Time Groups). The app provides a workbench for examining prosodic dimensions of speech signals independently of phonological patterns: acoustic rhythms and melodies. The focus is on utterances well above word level, with at least 2 s duration, preferably more.

Unlike TGAplus and TGAinspector, ProsCanvas does not deal with the phonology or the 'linguistic phonetics' of annotation, but directly and exclusively with speech processing of the acoustic signal.

The ZIP file with the app is intended to be downloaded into your project working directory and run locally on your computer. In addition to builtin information panels and tooltips on user controls, a concise handbook is provided.


Download ZIP file:

Look at Speech!

Look at Speech! is the little brother of ProsCanvas. It is is a basic prosody demonstration application for displaying properties of speech rhythms and melodies, with waveforms and derived representations such as the AM envelope, the HF spectrogram and the F0 estimation, with a selection of user parameter controls. An unusual feature for speech F0 estimators is that it uses an enhanced ADMF (Average Magnitude Difference Function) - simple and effective. AMDF is loosely related to other time-domain F0 estimators but uses subtraction rather than correlation or multiplication.

TGAplus and TGAinspector (TextGrid Analyser plus and TextGrid inspector) are open source web app tools for annotation mining by analysing individual Praat TextGrid files. Documentation is included in the web apps themselves. The web apps come entirely without warranty of any kind. The web apps fulfil state of the art standards and use browser local storage for setting, but does not use cookies or coookie-like technologies. As uwith any web site, by using them or downloading them you assume full responsibility for any outputs or side-effects.

The web apps are built for distribution as single file HTML, CSS, JS applications and are thus by definition open source and can be saved and used locally offline.

Feel free to develop the apps further, but only as MIT licensed open source software. If you wish to develop it further, it will make most sense to modularise the code using an AI coding helper, as the present single file distribution consists of nearly 20000 lines. The original development environment for the online version is in fact highly modularised. The single-file build is intended for normal use. In future versions the filename will most likely remain the same.


For specific purposes the following tools, which do not require graphics, are available:
TextGrid to CSV conversion TextGrid2CSV
TGA-mini: Analysis of multiple TextGrids: Download ZIP file: TGA-mini (for TextGrid collections)
Note on use of TGA-mini:
Your TextGrid collection must be in a ZIP file for upload to TGA-mini.
TGA-mini is a standalone executable file using HTML with embedded JavaScript (you may have to allow your browser to use JavaScript).
You can download the HTML file and save it anywhere on your computer. You can run it offline (without an internet connection) using your browser.
TGA-micro - TextGrid analyser: TextGrid Analyser
Descriptive statistics: CalcuCopia




CITATION: In publications which use the online TGA tool, please cite:

Gibbon, Dafydd and Jue Yu. 2016. "Time Group Analyzer: Methodology And Implementation." The Phonetician 111/112:9-34.

See below for a list of papers for which the TGA tool has been used.

Demos - Graphics - Papers - Various notes
V 1.00 2012-07-09
V 3.03 2013-03-30
V 3.04 2015-09-08
V 4.00 2016-01-01
V 5.00 2016-02-13
Python powered

Note:
  1. To use the TGA online annotation mining tool, proceed to one of the demos, and replace the demo annotation with your own. Then adjust the parameters for the kind of analysis you are looking for.
  2. The TGA application has now been re-designed as a multi-user system.
  3. However, server space is limited, and therefore graphics files which are older than a certain time (initially set at 2 min) are removed when TGA is re-run, either by yourself or by another user.
  4. Consequently, it can happen that someone else may unintentionally delete your graphics files. This will only affect you when you need to download the files.
  5. If you have created graphics files snd need to download them but the file has been removed because someone else has re-run the TGA, then simply reload with the browser.
  6. If there are many users, this limit may cause problems. If you experience problems with this policy, please let me know and I will temporarily increase the wait time before cleanup.
  7. Graphics files have the format: "TGA_PID_*.png" (PID is the process ID).

Demos - Graphics - Papers - Various notes
TGA demos

The following demo applications use the old dysfunctional TGA and do not work. However, you can copy-paste the TextGrid examples in the input fields for testing TGAplus.

  1. Farsi (SM: "The North Wind and the Sun")
    1. Female
    2. Female-2.html
    3. Female-7.html
    4. Male-7.html
    5. Male-9.html
  2. Mandarin
    1. Syllables: read-aloud Mandarin from CASS corpus, Praat long TextGrid format, default tier: PY (syllable).
    2. Syllabic lexical tone: read-aloud Mandarin from CASS corpus, Praat long TextGrid format, default tier: Tone (includes box-and-whisker plot for different label types).
    3. Syllable rhymes: read-aloud Mandarin from Jue Yu corpus, Praat long TextGrid format, default tier: PY (syllable).
  3. Tem
    1. Syllables: read-aloud Tem from Tchagbale corpus for Tem<Gur<Niger-Congo (ISO 639-3 kdh, Togo), Praat long TextGrid format, default tier: Syllable.
    2. Syllables: read-aloud Tem from Tchagbale corpus for Tem<Gur<Niger-Congo (ISO 639-3 kdh, Togo), tabular CSV format (labelTABstartTABend), default tier: Syllable.
    3. Syllabic lexical tone: read-aloud Tem from Tchagbale corpus for Tem<Gur<Niger-Congo (ISO 639-3 kdh, Togo), Praat long TextGrid format, default tier: Tone (includes box-and-whisker plot for different label types).
  4. Canadian English (FS corpus):
    1. Female English monolingual
    2. Female Farsi-English bilingual
  5. English (Lancaster SEC/MARSEC/Aix-MARSEC corpus, Praat short TextGrid format, default tier Syllables)
    1. marsecA, Category A: Commentary:9066 words
    2. marsecB, Category B: News Broadcasts: 5235 words
    3. marsecC, Category C: Lecture Type 1: 4471 words
    4. marsecD, Category D: Lecture Type 11: 7451 words
    5. marsecE, Category E: Religlous Broadcast: 1503 words
    6. marsecF, Category F: Magazine-style reporting: 4710 words
    7. marsecG, Category G: Fiction: 7299 words
    8. marsecH, Category H: Poetry: 1292 words
    9. marsecJ, Category J: Dialogue: 6826 words
    10. marsecK, Category K: Propaganda: 1432 words
    11. marsecM, Category M: Miscellaneous: 3352 words
Note: If the selected tier has fewer than 16 different label types (e.g. a tone tier), then a box-and-whisker plot is automatically drawn.
Demos - Graphics - Papers - Various notes
TGA output types DDT and DB
The DDT (Duration Difference Token) display shows a sequence of symbols '/' (for short-long duration pairs), '\' (for long-short duration pairs), '=' (equal duration pairs), depending on the user-defined threshold for local duration differences. The motivation for the DDT representation is to illustrate the directionality (positive or negative) of duration differences between adjacent items, which is not captured by timing measures such as standard deviation or nPVI. In addition to showing individual DDT patterns, the TGA provides statistics over DDT n-gram sequences, which provide information about binary, ternary etc. rhythm types.
The DB (Duration Bar) display shows the durations of the items in the annotation labels, e.g. syllables, both in ms and as bars whose width and length (scaled differently) show the durations directly.


TGA graph output type BoxPlot
The BoxPlot graph output type applies only to annotation tiers with fewer than 16 label types, for example tones, accents, phoneme major class (C, V, G, L etc.) annotations, for comparing duration properties of values of these categories. The output for each value contains the following graphical information:
  1. Error bar (left).
  2. Box plot (centre) with horizontal 1st, 2nd (median, red bar) and 3rd quartile bars, with outliers above the 4th quartile bar. The mean is indicated by a red dot.
  3. Vertical plot (yellow) roughly indicating the distribution of values.

Box plot


Demos - Graphics - Papers - Various notes
TGA graph output type Wagner Quadrant Graphs (WQ graphs)
The Wagner Quadrant graph (WQ graph) is a scatter plot which displays the relation between durations of adjacent chunks of speech, e.g. syllables. The WQ graphs were developed by P. Wagner to provide information about rhythm types by illustrating and quantifying the directionality (positive or negative) of duration differences between adjacent items, which is not captured by measures such as standard deviation or nPVI.
The Wagner Quadrant graphs in the animations below were generated directly by the TGA, but the animations were created offline from the TGA outputs.
Note for English in each case the clustering of dots in the bottom left quadrant, contrasting with the relatively random distribution for Mandarin, Tem and the poor Mandarin L2 speaker.
Syllable duration typology (raw durations): English - Tem - Mandarin Syllable duration typology (unsigned durations): English - Tem - Mandarin Syllable duration in L2 learning: poor L2, advanced L2 - native US Syllable duration in English genres (Aix-MARSEC genres A-G)

Demos - Graphics - Papers - Various notes
Papers using TGA annotation mining methodology for analysis of rhythm, duration sequences and other timing patterns (currently Mandarin Chinese; L1 and L2 English; Polish)
  1. Yu, Jue and Gibbon, Dafydd, Criteria for database and tool design for speech timing analysis with special reference to Mandarin, Oriental COCOSDA 2012 (cf. IEEEexplore Conf ID 21048)
  2. Gibbon, Dafydd, TGA: a web tool for Time Group Analysis, TRASP 2013 (poster)
  3. Yu, Jue, Timing analysis with the help of SPPAS and TGA tools, TRASP 2013 (poster)
  4. Klessa, Katarzyna, Maciej Karpinski and Agnieszka Wagner, Annotation Pro: a new software tool for annotation of linguistic and paralinguistic features TRASP 2013
  5. Klessa, Katarzyna and Dafydd Gibbon, Annotation Pro+TGA: automation of speech timing analysis, LREC 2013.
  6. Yu, Jue, Dafydd Gibbon and Katarzyna Klessa, Computational annotation-mining of syllable durations in speech varieties, Speech Prosody 7, 2014.
  7. Gibbon, Dafydd, Katarzyna Klessa and Jolanta Bachan, Duration and speed of speech events: A selection of methods>. Lingua Posnaniensia, Volume 56, Issue 1 (Jun 2014). Studies in Phonetics and Psycholinguistics. Special issue dedicated to Professor Piotra Łobacz, Issue Editors: Maciej Karpiński, Nawoja Mikołajczak-Matyja. 59-83. 2014.
  8. Yu, Jue and Dafydd Gibbon, How natural is Chinese L2 English? ICPhS, Glasgow, 2015.
  9. Yu, Jue and Dafydd Gibbon, Time Group Types in Mandarin Syllable Annotations, O-COCOSDA, Shanghai, 2015.
  10. Gibbon, Dafydd and Jue Yu. Time Group Analyzer: Methodology And Implementation, The Phonetician 111/112:9-34. 2016.
  11. Gibbon, Dafydd. Time Group Analyzer: TGA: An Online Tool for Time Group Analysis, Interspeech 2015, Tutorial Slides.

Demos - Graphics - Papers - Various notes
Note:
  1. The duration visualisation graphics are not rendered correctly by Firefox, which has a bug in its HTML rendering. The vertical bars are incorrectly shown as circles. However, the information displayed by the circles is the same.
  2. This tool will DEFINITELY NOT work with most TextGrid files, because the tool is designed to handle ONLY one particular small set of ASCII symbols and (obviously) only interval tiers are handled.
  3. Within the above constraints, long or short TextGrid Interval Tier formats are handled. The tool was designed for syllable tiers, but in principle any tier can be handled. You will be lucky not to get arbitrary error output if you try anything else. Response time depends on TextGrid tier length and (for deceleration and acceleration) global threshold range. Be patient!
Automatic recognition heuristic for input data formats (examines only first line, not foolproof)
  1. Praat TextGrid full and short formats (specified tier picked out of arbitrarily many tiers)
  2. Single-tier CSV table (do not mix separators in the same data set):
      row := label sep starttime sep endtime [ sep duration ]
      sep := TAB | SP | "," | ";" | ":"
  3. Timestamp values in all formats are in seconds with dot decimal point (not milliseconds, and not comma), following Praat TextGrid conventions.

History

2012-07-09 V 1.0Basic Syllable and Time Group parser with deceleration and acceleration criteria
2012-08-15 V 1.1Bugfix and enriched output
2013-03-10 V 2.0Cycle through threshold range
2013-03-12 V 2.1Picks specifiedtier out of unedited TextGrids with arbitrary number of tiers
2013-03-13 V 2.2Pause group parsing option
2013-03-13 V 2.3Additional quantitative output; syllable tier symbol to be input by user
2013-03-21 V 2.4Further modularisation, more input options, no functional difference
2013-03-23 V 2.5Someerror proofing. Use of numpy.
2013-03-23 V 2.6Local longer-shorter-equal pattern visualisation
2013-03-23 V 2.7Pattern input options
2013-03-30 V 2.8Pattern testing
2013-03-30 V 2.9CSV input added; parse summary information extended
2013-03-30 V 2.10TimeTrees added.
2013-03-30 V 3.0SD added to TimeGroups; various correlations; green bar duration visualisation (Firefox bug shows bars as blobs).
2013-03-30 V 3.01ndiff analysis added to TimeGroup patterns.
2013-03-30 V 3.01ngramm and time tree analysis; various format and output additions.
2013-03-30 V 3.02some modularisation; duration difference ngrams; Time Tree Analysis.
2014-09-04 V 3.03Wagner Quadrant plots and other graphs.
2016-01-01 V 4.00deletion of segments with empty labels; comment lines permitted; frequency dictionary and concordance of label types with statistics; box plots for |labeltypes|<15.

Created:Tuesday, July 10, 2012 7:25:09 AM CEST.
Last modified: Monday, January 4, 2016 11:23:45 PM CET
D. Gibbon