A theory-driven framework for computational humor detection
Logo automatically generated by ChatGPT on 02/23/2024.
THInC is a framework for computational humor detection that is driven by humor theories. This Github repository is an implementation of the THInC framework by the authors. The language of this code is Python using a Python Notebook. The calculation of the proxy features in our implementation is pre-saved, as is the benchmark RoBERTa model. For results, we would like to refer to our paper, for which a reference can be found below.
README.md
: this fileTHInC framework.ipynb
: the Python notebook containing all the source code needed to train and test all models, and to do the interpretability evaluationsrequirements.txt
: the Python requirements for running the source code notebookimages/
: the images for this README filedatasets/
: datasets that are used in this implementationsaves/
: pre-calculated proxy features and time seriessaves/models/
: saved finetuned benchmark model
All requirements for the Python environment can be found in requirements.txt
. Notice that a custom installation of the transformers or Pytorch packages might be needed, depending on the architecture this code is run on. You need to be able to run Python notebooks to run this repository.
The most architecture-intensive parts of the source code are 3.1.a (requiring to load Llama-2-13b in half precision), 3.1.g (requiring around 10 GB of RAM), and 4.1 (requiring to load a large RoBERTa model).
To run this source code, simply run all cells of the Notebook THInC framework.ipynb
. More information about which part concerns which calculation can be found inside the notebook.
The quickest run of our implementation can be achieved by running Sections 1, 2 and 4.2 in the notebook, providing all results and interpretability possibilities, without the benchmark model. This quick run is possible on most modern architectures without using too much resources.
TBA