PyFCG: Fluid Construction Grammar in Python
Paul Van Eecke, Katrien Beuls
TL;DR
PyFCG addresses the gap between Fluid Construction Grammar and the Python data-science ecosystem by wrapping the Lisp-based FCG Go backend and exposing a Pythonic API. The approach combines a pip-installable package with a background FCG Go subprocess, ensuring performance and compatibility without reimplementing FCG. The paper demonstrates three tutorials—grammar formalisation and testing, learning grammars from corpora, and emergent-communication experiments—illustrating practical integration in Python workflows. The contribution enables researchers to build, test, and deploy constructional language processing and learning within Python pipelines, aligning with open-source development practices.
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.
