{"id":20106183,"url":"https://github.com/himkt/optuna-allennlp","last_synced_at":"2025-08-03T11:32:29.121Z","repository":{"id":56055162,"uuid":"259009868","full_name":"himkt/optuna-allennlp","owner":"himkt","description":"🚀 A demonstration of hyperparameter optimization using Optuna for models implemented with AllenNLP.","archived":false,"fork":false,"pushed_at":"2020-11-28T08:51:53.000Z","size":41,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-23T16:51:37.225Z","etag":null,"topics":["allennlp","hyperparameter-optimization","natural-language-processing"],"latest_commit_sha":null,"homepage":"https://medium.com/pytorch/acb8d96737e5","language":"Jupyter Notebook","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/himkt.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}},"created_at":"2020-04-26T11:10:19.000Z","updated_at":"2024-01-04T16:45:16.000Z","dependencies_parsed_at":"2022-08-15T12:20:22.719Z","dependency_job_id":null,"html_url":"https://github.com/himkt/optuna-allennlp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Foptuna-allennlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Foptuna-allennlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Foptuna-allennlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Foptuna-allennlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himkt","download_url":"https://codeload.github.com/himkt/optuna-allennlp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228540834,"owners_count":17934030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["allennlp","hyperparameter-optimization","natural-language-processing"],"created_at":"2024-11-13T17:49:18.357Z","updated_at":"2024-12-07T00:09:41.270Z","avatar_url":"https://github.com/himkt.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"896\" alt=\"experimental_result\" src=\"https://user-images.githubusercontent.com/5164000/80803806-5a332500-8bee-11ea-862c-9db27e7091ba.png\"\u003e\n\n\n# Optuna using AllenNLP\n\nDemonstration for using [Optuna](https://github.com/optuna/optuna) with [AllenNLP](https://github.com/allenai/allennlp) integration.\n\n\n# Quick Start\n\n## Google Colab\n\n[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/himkt/optuna-allennlp/blob/master/notebook/Optuna_AllenNLP.ipynb)\n\n## On your computer\n\n```bash\n# create virtual environment\npython3 -m venv venv\n. venv/bin/activate\n\n# install libraries\npip install -r requirements.txt\n\n# train a model using AllenNLP cli\nallennlp train -s result/allennlp config/imdb_baseline.jsonnet\n\n# run hyperparameter optimization\npython optuna_train.py\n\n# define-and-run style example\npython optuna_train_custom_trainer.py --device 0 --target_metric accuracy --base_serialization_dir result\n```\n\n## [New!!] Use `allennlp-optuna`\n\nYou can use [`allennlp-optuna`](https://github.com/himkt/allennlp-optuna), an AllenNLP plugin for hyperparameter optimization.\n\n```bash\n\n# Installation\npip install allennlp-optuna\n\n# You need to register allennlp-optuna to allennlp using .allennlp_plugins\n# It is not required if .allennlp_plugins already exists on your working directory\necho 'allennlp_optuna' \u003e\u003e .allennlp_plugins\n\n# optimization\nallennlp tune config/imdb_optuna.jsonnet config/hparams.json --serialization-dir result\n```\n\n\n# Attention!\n\nDemonstration uses GPU.\nIf you want to run the scripts in this repository,\nplease update `cuda_device = -1` in [allennlp config](https://github.com/himkt/optuna-allennlp/blob/master/config/imdb_baseline.jsonnet#L3) and [optuna_config](https://github.com/himkt/optuna-allennlp/blob/master/config/imdb_optuna.jsonnet#L3).\n\n\n# Blog Articles\n\n- Japanese: https://medium.com/p/41ad5e8b2d1a\n- English: https://medium.com/p/54b4bfecd78b\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Foptuna-allennlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimkt%2Foptuna-allennlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Foptuna-allennlp/lists"}