{"id":24390492,"url":"https://github.com/lgirrbach/sigmorphon-2023-inflection","last_synced_at":"2026-04-17T04:01:51.264Z","repository":{"id":186497154,"uuid":"610169809","full_name":"LGirrbach/sigmorphon-2023-inflection","owner":"LGirrbach","description":"Code for our SIGMORPHON 2023 shared task description paper: Tü-CL at SIGMORPHON 2023: Straight-Through Gradient Estimation for Hard Attention","archived":false,"fork":false,"pushed_at":"2023-08-06T10:04:19.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T22:42:26.613Z","etag":null,"topics":["inflection","morphological-inflection","morphology","seq2seq","straight-through-gradient","transducer"],"latest_commit_sha":null,"homepage":"https://aclanthology.org/2023.sigmorphon-1.17/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LGirrbach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-06T08:30:50.000Z","updated_at":"2024-05-13T18:13:34.000Z","dependencies_parsed_at":"2024-02-06T02:32:21.568Z","dependency_job_id":null,"html_url":"https://github.com/LGirrbach/sigmorphon-2023-inflection","commit_stats":null,"previous_names":["lgirrbach/sigmorphon-2023-inflection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LGirrbach/sigmorphon-2023-inflection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGirrbach%2Fsigmorphon-2023-inflection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGirrbach%2Fsigmorphon-2023-inflection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGirrbach%2Fsigmorphon-2023-inflection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGirrbach%2Fsigmorphon-2023-inflection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LGirrbach","download_url":"https://codeload.github.com/LGirrbach/sigmorphon-2023-inflection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGirrbach%2Fsigmorphon-2023-inflection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31914458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inflection","morphological-inflection","morphology","seq2seq","straight-through-gradient","transducer"],"created_at":"2025-01-19T16:17:58.209Z","updated_at":"2026-04-17T04:01:51.228Z","avatar_url":"https://github.com/LGirrbach.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tü-CL at SIGMORPHON 2023: Straight-Through Gradient Estimation for Hard Attention\n## Introduction\n\nThis repository contains code for our system description paper [Tü-CL at SIGMORPHON 2023: Straight-Through Gradient Estimation for Hard Attention](https://aclanthology.org/2023.sigmorphon-1.17/) for the [Morphological Inflection shared task](https://aclanthology.org/2023.sigmorphon-1.13/).\nNote, that the code for the interlinear glossing model can be found [in this repository](https://github.com/LGirrbach/sigmorphon-2023-glossing).\n\nThe implementation of the hard-attention transducer is in [model.py](model.py).\n\n## Setup\nCreate a virtual environment, e.g. by using [Anaconda](https://docs.conda.io/en/latest/miniconda.html):\n```\nconda create -n inflection python=3.9 pip\n```\nActivate the environment:\n```\nconda activate inflection\n```\nThen, install the dependencies in [requirements.txt](requirements.txt):\n```\npip install -r requirements.txt\n```\nFinally, place the shared task data in the repository, i.e. there should be a folder called `data`. The data can be obtained from [the shared task's main repository](https://github.com/sigmorphon/2023InflectionST/tree/main/part1).\n\n## Train a model\nTo train a single model and get predictions for the corresponding test set, run\n```\npython experiment.py --language LANGUAGE\n```\nHere, `LANGUAGE` is a (three letter) code for the language. We assume the respective files `LANGUAGE.trn`, `LANGUAGE.dev` and `LANGUAGE.covered.tst` are in `./data`.\nTo see all command line options and hyperparameters, run\n```\npython experiment.py --help\n```\n\n## Hyperparameter tuning\nTo tune hyperparameters, use the script [hyperparameter_tuning.py](hyperparameter_tuning.py).\nThe main parameters are `--language` which specifies the dataset as before, and `--trials`, which specifies the number of evaluated hyperparameter combinations.\nTo parse the results from tuning logs, we provide the scrip [parse_hyperparameters.py](parse_hyperparameters.py).\nThe best parameters from our tuning runs are in [best_hyperparameters.json](best_hyperparameters.json).\nWe evaluated 50 trials per language to get these parameters.\n\nFinally, we provide a script [train_best_parameters.py](train_best_parameters.py), that retrains models (from scratch) using the hyperparameters in [best_hyperparameters.json](best_hyperparameters.json).\n\n## Citation\nIf you use this code, consider citing our paper:\n```\n@inproceedings{girrbach-2023-tu,\n    title = {T{\\\"u}-{CL} at {SIGMORPHON} 2023: Straight-Through Gradient Estimation for Hard Attention},\n    author = \"Girrbach, Leander\",\n    booktitle = \"Proceedings of the 20th SIGMORPHON workshop on Computational Research in Phonetics, Phonology, and Morphology\",\n    month = jul,\n    year = \"2023\",\n    address = \"Toronto, Canada\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2023.sigmorphon-1.17\",\n    pages = \"151--165\",\n}\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgirrbach%2Fsigmorphon-2023-inflection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flgirrbach%2Fsigmorphon-2023-inflection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgirrbach%2Fsigmorphon-2023-inflection/lists"}