PyFCG: Fluid Construction Grammar in Python
Paul Van Eecke, Katrien Beuls · 2025
Read PyFCG: Fluid Construction Grammar in Python by Paul Van Eecke, Katrien Beuls (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-12920.txt.
Introduction
Paul Van Eecke and Katrien Beuls (2025) present PyFCG, a Python library that brings Fluid Construction Grammar into the Python ecosystem. Construction grammar treats language as learned pairings of form and meaning. The fluid variant is built for experiments on how such systems emerge and change. Until now the framework lived outside Python, cutting it off from that language's rich library ecosystem. PyFCG lets users call the grammar machinery inside ordinary Python programs and combine it freely with other tools.
Three walkthrough tutorials show the intended uses. The first formalizes and tests construction grammar analyses. The second learns usage-based grammars from text corpora. The third runs agent-based experiments on emerging communication, the framework's home territory. The library is open source. The authors pitch the port as an integration play. Grammar research gains Python's data tooling, and Python users gain a mature grammar formalism.
Catalog record
| CREATOR | Paul Van Eecke, Katrien Beuls |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 32 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2505-12920
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PyFCG: Fluid Construction Grammar in Python Paul Van Eecke, Katrien Beuls Abstract We present PyFCG, an open source software library that ports Fluid Construction Grammar (FCG) to the Python programming language. PyFCG enables its users to seamlessly integrate FCG functionality into Python programs, and to use FCG in combination with other libraries within Python’s rich ecosystem. Apart from a general description of the library, this paper provides three walkthrough tutorials that demonstrate example usage of PyFCG in typical use cases of FCG: (i) formalising and testing construction grammar analyses, (ii) learning usage-based construction grammars from corpora, and (iii) implementing agent-based experiments on emergent communication. 1 Fluid Construction Grammar Fluid Construction Grammar ( Steels, 2004 ; van Trijp et al., 2022 ; Beuls and Van Eecke, 2023 , FCG –) is a computational construction grammar framework that provides a collection of high-level building blocks for representing, processing and learning fully-operational construction grammars. The FCG framework is conceived as an open instrument that is not tied to a particular construction grammar theory, but that strives for compatibility with any linguistic theory that adheres to the most fundamental tenets underlying constructionist approaches to language ( Fillmore, 1988 ; Croft, 2001 ; Goldberg, 2003 , see e.g.) . As such, it subscribes to the view (i) that language users dynamically build up their own linguistic systems as they communicate with other members of their community, (ii) that these linguistic systems can be captured as a network of form-meaning mappings called constructions, and (iii) that these constructions can pair forms and meanings of arbitrary complexity and degree of abstraction, thereby facilitating a uniform handling of both compositional and non-compositional linguistic phenomena. FCG is primarily being used as the language representation, processing and learning component in agent-based models of linguistic communication. Such models simulate the emergence, evolution and acquisition of human languages in populations of artificial agents that take part in situated communicative interactions modelled after those that human language users continuously engage in ( van Trijp, 2016 ; Beuls and Van Eecke, 2024 , e.g.) . Other common uses of FCG include the formalisation and computational operationalisation of construction grammar analyses ( Gerasymova, 2012 ; Micelli, 2012 , e.g.) , and the corroboration of construction grammar theories with empirical data ( Moerman et al., 2024 , e.g.) . FCG is being developed as an open-source community project, which brings together the construction grammar and computational linguistics communities. While strong ties between both communities already existed when the field of construction grammar was founded in the 1980s, recent initiatives such as UCxn ( Weissweiler et al., 2024 ) and the Construction Grammars and NLP (CxGs+NLP) workshop series ( Bonial and Tayyar Madabushi, 2023 ) , along with an increasing volume of work on constructions in Large Language Models ( Tayyar Madabushi et al., 2020 ; Tseng et al., 2022 ; Weissweiler et al., 2022 ; Bonial and Tayyar Madabushi, 2024 ; Xu et al., 2024 , see e.g.) , bear witness to a growing interest in research at the intersection of both fields. 2 FCG in Python, Really? Readers who have regularly used FCG might argue that there already exists a stable and mature, efficient, cross-platform and open source implementation of FCG, with an active and dedicated, albeit small, developer community 1 1 1 See https://gitlab.ai.vub.ac.be/ehai/babel for the project’s code repository. . Indeed, the reference FCG implementation is written in Common Lisp, a dynamic and extensible programming language that, admittedly, excellently fits the project’s requirements, including multi-paradigm, high-level and multi-threaded programming, fast prototyping, and highly efficient symbol processing. So why would anyone spend time and effort on a Python port? The reality is that Python has become the most popular programming language in the world 2 2 2 https://www.tiobe.com/tiobe-index/ and that, more consequentially, it has also become the dominant language in programming education, as well as today’s de facto standard in both linguistics and natural language processing research. Practically speaking, this entails that the success of a software library targeted at the broader computational linguistics community depends before all other things on its compatibility with the Python ecosystem. While this might sound utterly unreasonable, it is not entirely so. For one thing, computer programs typically integrate a variety of external libraries, and, for better or for worse, the largest selection of libraries tends to be developed for the most popular programming languages. For another, the investment involved in learning to use a new programming language and environment is a very real obstacle for potential users in today’s time-pressed society. The development and release of PyFCG follows a trend set by many other libraries that are commonly used in the computational linguistics community. For example, the Stanford CoreNLP Java library ( Manning et al., 2014 ) is now accessible from Python through the Stanza library ( Qi et al., 2020 ) . Likewise, the PRAAT system for phonetic analysis ( Boersma and Weenink, 2025 ) , written in C and C++, is now widely used in Python programs via the Parselmouth library ( Jadoul et al., 2018 ) . The Torch library for tensor computation, written in C and Lua, is now even primarily being developed for Python as part of the PyTorch project ( Paszke et al., 2019 ) . 3 FCG in Python, Finally! Readers who have not yet used FCG, perhaps for the reasons mentioned above, might wonder why it has taken so long for FCG to make its way into the Python ecosystem. It could be ascribed to a lack of actual problems with the existing reference implementation, to the sheer size, scope and complexity of its codebase, to the difficulty of funding scientific software development, or perhaps most likely, to a combination of all these factors. But fret no more: ⬇ 1 $ pip install pyfcg Once pip-installed, PyFCG can readily be imported as a module into Python programs. It is customary to define fcg as an alias for the PyFCG module, so that all functionality is available within the fcg namespace. We initialise PyFCG by calling its init() function, which loads (or downloads if necessary) all external dependencies. PyFCG’s documentation is available on the Read the Docs platform 3 3 3 https://pyfcg.readthedocs.io and interactive tutorial notebooks supporting this paper can be downloaded from the FCG community website 4 4 4 https://fcg-net.org/pyfcg . ⬇ 1 >>> import pyfcg as fcg 2 >>> fcg . init () On the highest level, PyFCG defines three classes that are of interest to the user: Agent , Grammar and Construction . The idea is that an agent (of type Agent ) has a grammar (of type Grammar ), which in turn holds constructions (of type Construction ). The Agent class is the main entry point for the user. Upon the creation of a new agent, it is automatically initialised with an empty grammar, i.e. a grammar that holds zero constructions. ⬇ 1 >>> demo_agent = fcg . Agent () 2 >>> demo_agent . grammar . size () 3 0 It was an explicit design choice to tie grammars to agents, emphasising FCG’s view that a grammar always represents the linguistic knowledge of an individual language user. Grammars are in principle never shared between agents and cannot