Skip to content

The official template for new Python projects at UKP Lab

License

Notifications You must be signed in to change notification settings

UKPLab/ukp-project-template

 
 

Repository files navigation

ukp_project_template

Arxiv License Python Versions CI

This is the official template for new Python projects at UKP Lab. It was adapted for the needs of UKP Lab from the excellent python-project-template by rochacbruno.

It should help you start your project and give you continuous status updates on the development through GitHub Actions.

Abstract: The study of natural language processing (NLP) has gained increasing importance in recent years, with applications ranging from machine translation to sentiment analysis. Properly managing Python projects in this domain is of paramount importance to ensure reproducibility and facilitate collaboration. The template provides a structured starting point for projects and offers continuous status updates on development through GitHub Actions. Key features include a basic setup.py file for installation, packaging, and distribution, documentation structure using mkdocs, testing structure using pytest, code linting with pylint, and entry points for executing the program with basic CLI argument parsing. Additionally, the template incorporates continuous integration using GitHub Actions with jobs to check, lint, and test the project, ensuring robustness and reliability throughout the development process.

Contact person: Federico Tiblias

UKP Lab | TU Darmstadt

Don't hesitate to send us an e-mail or report an issue, if something is broken (and it shouldn't be) or if you have further questions.

Getting Started

DO NOT CLONE OR FORK

If you want to set up this template:

  1. Request a repository on UKP Lab's GitHub by following the standard procedure on the wiki. It will install the template directly. Alternatively, set it up in your personal GitHub account by clicking Use this template.
  2. Wait until the first run of CI finishes. Github Actions will commit to your new repo with a "✅ Ready to clone and code" message.
  3. Delete optional files:
    • If you don't need automatic documentation generation, you can delete folder docs, file .github\workflows\docs.yml and mkdocs.yml
    • If you don't want automatic testing, you can delete folder tests and file .github\workflows\tests.yml
  4. Prepare a virtual environment:
python -m venv .venv
source .venv/bin/activate
pip install .
pip install -r requirements-dev.txt # Only needed for development
  1. Adapt anything else (for example this file) to your project.

  2. Read the file ABOUT_THIS_TEMPLATE.md for more information about development.

Usage

Using the classes

To import classes/methods of ukp_project_template from inside the package itself you can use relative imports:

from .base import BaseClass # Notice how I omit the package name

BaseClass().something()

To import classes/methods from outside the package (e.g. when you want to use the package in some other project) you can instead refer to the package name:

from ukp_project_template import BaseClass # Notice how I omit the file name
from ukp_project_template.subpackage import SubPackageClass # Here it's necessary because it's a subpackage

BaseClass().something()
SubPackageClass().something()

Using scripts

This is how you can use ukp_project_template from command line:

$ python -m ukp_project_template

Expected results

After running the experiments, you should expect the following results:

(Feel free to describe your expected results here...)

Parameter description

  • x, --xxxx: This parameter does something nice

  • ...

  • z, --zzzz: This parameter does something even nicer

Development

Read the FAQs in ABOUT_THIS_TEMPLATE.md to learn more about how this template works and where you should put your classes & methods. Make sure you've correctly installed requirements-dev.txt dependencies

Cite

Please use the following citation:

@InProceedings{smith:20xx:CONFERENCE_TITLE,
  author    = {Smith, John},
  title     = {My Paper Title},
  booktitle = {Proceedings of the 20XX Conference on XXXX},
  month     = mmm,
  year      = {20xx},
  address   = {Gotham City, USA},
  publisher = {Association for XXX},
  pages     = {XXXX--XXXX},
  url       = {http://xxxx.xxx}
}

Disclaimer

This repository contains experimental software and is published for the sole purpose of giving additional background details on the respective publication.

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%