{"id":25689360,"url":"https://github.com/zcemycl/seq2seq-labelladder","last_synced_at":"2026-04-16T00:32:44.491Z","repository":{"id":114281778,"uuid":"434187222","full_name":"zcemycl/seq2seq-labelladder","owner":"zcemycl","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-02T12:08:45.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T05:14:13.004Z","etag":null,"topics":["encoder-decoder-model","hierarchical-attention-networks","nlp","pytorch","seq2seq"],"latest_commit_sha":null,"homepage":"","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/zcemycl.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-02T11:06:29.000Z","updated_at":"2021-12-02T12:08:48.000Z","dependencies_parsed_at":"2023-07-16T03:31:16.840Z","dependency_job_id":null,"html_url":"https://github.com/zcemycl/seq2seq-labelladder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zcemycl/seq2seq-labelladder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcemycl%2Fseq2seq-labelladder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcemycl%2Fseq2seq-labelladder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcemycl%2Fseq2seq-labelladder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcemycl%2Fseq2seq-labelladder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcemycl","download_url":"https://codeload.github.com/zcemycl/seq2seq-labelladder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcemycl%2Fseq2seq-labelladder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["encoder-decoder-model","hierarchical-attention-networks","nlp","pytorch","seq2seq"],"created_at":"2025-02-24T22:01:05.479Z","updated_at":"2026-04-16T00:32:44.468Z","avatar_url":"https://github.com/zcemycl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Sequence-to-sequence Hierarchical Categories Classification\nThe repo proposes a method (encoder-decoder-attention network) to classify paragraphs of texts to hierarchical labels, from level 1 to level3. There are 9 labels in l1, 70 in l2 ad 219 in l3, each label in layer n has different distribution of labels in next layer n+1, it manifests a ladder structure resembling a n-gram model, so that the rnn-based decoder can be useful.\n\n### How to run?\n1. Install the required packages,\n```\npip install -r requirements.txt\n```\n2. Train the network via,\n```\npython train.py [--csv classification_dataset.csv][--pairs_txt pairs.txt] \n [--seed 1][--split 0.99][--logdir log/run][--checkpoint weight/run]\n [--iters 75000][--saveIntervals 1000][--lr 0.01]\n```\n3. View training progress via tensorboard,\n```\ntensorboard --logdir log/run\n```\n4. Predict the new sentence via,\n```\npython predict.py [--weightE weight/run/encoder-75000.pth]\n [--weightD weight/run/attn_decoder-75000.pth][--pairs_txt pairs.txt]\n [--sentence 'He was a pupil of the painter Denis Calvaert, then of Guido Reni.']\n```\n\n### Results\n|Test Accuracy|Loss|\n|---|---|\n|\u003cimg src=\"misc/testacc.png\" width=\"400\"\u003e|\u003cimg src=\"misc/loss.png\" width=\"400\"\u003e|\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth colspan=3\u003eOutput (Ground Truth\u003c/th\u003e\n        \u003c/tr\u003e\n       \u003ctr\u003e\n            \u003cth\u003ePreprocessed Test Case\u003c/th\u003e\n            \u003cth\u003el1\u003c/th\u003e\n            \u003cth\u003el2\u003c/th\u003e\n            \u003cth\u003el3\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n        \u003ctr\u003e\n            \u003ctd\u003ebishop cathedral catholic church community diocesan diocese heart home know mother new parish present recently sacred seat well york\u003c/td\u003e\n            \u003ctd\u003eplace\u003c/td\u003e\n            \u003ctd\u003ebuilding\u003c/td\u003e\n            \u003ctd\u003ehistoricbuilding\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eborn footballer german marcel retire\u003c/td\u003e\n            \u003ctd\u003eagent\u003c/td\u003e\n            \u003ctd\u003eathlete\u003c/td\u003e\n            \u003ctd\u003esoccerplayer\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eaccepted also alumnus anonymous artist bachelor certificate college conjunction diploma doctor donation full graduate joint later master million music musical offering one performance professional program reveal school three twelve university yale\u003c/td\u003e\n            \u003ctd\u003eagent\u003c/td\u003e\n            \u003ctd\u003eperson (educationalinstitution)\u003c/td\u003e\n            \u003ctd\u003ejournalist (university)\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n         \u003ctd\u003eTest Accuracy\u003c/td\u003e\n         \u003ctd\u003e93.08%\u003c/td\u003e\n         \u003ctd\u003e85.04%\u003c/td\u003e\n         \u003ctd\u003e77.02%\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n         \u003ctd\u003eOverall\u003c/td\u003e\n         \u003ctd colspan=3\u003e75.77%\u003c/td\u003e\n        \u003c/tr\u003e\n\n\u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcemycl%2Fseq2seq-labelladder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcemycl%2Fseq2seq-labelladder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcemycl%2Fseq2seq-labelladder/lists"}