{"id":17842850,"url":"https://github.com/shashwath94/hierarchical-seq2seq","last_synced_at":"2025-07-15T12:41:20.334Z","repository":{"id":131397902,"uuid":"132256978","full_name":"shashwath94/Hierarchical-Seq2Seq","owner":"shashwath94","description":"A PyTorch implementation of the hierarchical encoder-decoder architecture (HRED) introduced in Sordoni et al (2015). It is a hierarchical encoder-decoder architecture for modeling conversation triples in the MovieTriples dataset. This version of the model is built for the MovieTriples dataset.","archived":false,"fork":false,"pushed_at":"2018-05-05T16:32:56.000Z","size":23,"stargazers_count":28,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T10:43:58.283Z","etag":null,"topics":["deep-learning","hred","nlp","pytorch","seq2seq-pytorch"],"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/shashwath94.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":"2018-05-05T14:49:17.000Z","updated_at":"2024-12-05T02:57:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9cd77c5-5bc1-4b8d-8fde-77df08209f3a","html_url":"https://github.com/shashwath94/Hierarchical-Seq2Seq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shashwath94/Hierarchical-Seq2Seq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashwath94%2FHierarchical-Seq2Seq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashwath94%2FHierarchical-Seq2Seq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashwath94%2FHierarchical-Seq2Seq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashwath94%2FHierarchical-Seq2Seq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shashwath94","download_url":"https://codeload.github.com/shashwath94/Hierarchical-Seq2Seq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashwath94%2FHierarchical-Seq2Seq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265437185,"owners_count":23765116,"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":["deep-learning","hred","nlp","pytorch","seq2seq-pytorch"],"created_at":"2024-10-27T21:18:19.643Z","updated_at":"2025-07-15T12:41:20.082Z","avatar_url":"https://github.com/shashwath94.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hierarchical-Seq2Seq\nA PyTorch implementation of the hierarchical encoder-decoder architecture (HRED) introduced in Sordoni et al (2015). It is a hierarchical encoder-decoder architecture for modeling conversation triples. This version of the model is built for the MovieTriples dataset.\n\nLink to related papers - \u003ca href='https://arxiv.org/abs/1507.02221'\u003e HRED\u003c/a\u003e, \u003ca href='https://arxiv.org/pdf/1507.04808.pdf'\u003e Modified HRED\u003c/a\u003e\n\n\u003ch4\u003e Dataset details \u003c/h4\u003e\nThis model is trained for the MovieTriples dataset. This dataset is available on request to the lead author of the second paper mentioned above and is not publicly available. \n\nTraining commands \n\nFor baseline seq2seq model - ` python3 train.py -n seq2seq -tf -bms 20 -bs 100 -e 80 -seshid 300 -uthid 300 -drp 0.4 -lr 0.0005 -s2s -pt 3`\n\nFor HRED model - `python3 train.py -n HRED -tf -bms 20 -bs 100 -e 80 -seshid 300 -uthid 300 -drp 0.4 -lr 0.0005 -pt 3`\n\nFor Bi-HRED + Language model objective (inverse sigmoid teacher forcing rate decay) - `python3 train.py -n BiHRED+LM -bi -lm -nl 2 -lr 0.0003 -e 80 -seshid 300 -uthid 300  -bs 10 -pt 3`\n\nFor Bi-HRED + Language model objective (Ful teacher forcing) - `python3 train.py -n model3 -nl 2 -bi -lm -drp 0.4 -e 25 -seshid 300 -uthid 300 -lr 0.0001 -bs 100 -tf`\n\nAt test time, we use beam search decoding with beam size set at 20. For reranking the candidates during beam search, we use the MMI Anit-LM following the method in \u003ca href='https://arxiv.org/pdf/1510.03055.pdf'\u003e paper \u003c/a\u003e\n\nTest command - Just add the following flags for testing the model. `-test -mmi -bms 50`\n\nTo perform a sanity check on the model, train the model on a small subset of the dataset with the flag `-toy`. It should overfit with a training error of 0.5.\n\nTo bootstrap the encoder with pretrained  word embeddings use `-embed` flag. You should have a embeddings text file in /data/embeddings folder.\n\nThe default evaluation metric used is word perplexity. To evaluate the model on word embedding metrics, run the command `python metrics.py \u003cground_truth txt file\u003e \u003cmodel_output txt file\u003e \u003cpretrained word2vec embeddings binary\u003e`. The metrics script was taken from \u003ca href='https://github.com/julianser/hed-dlg-truncated/blob/master/Evaluation/embedding_metrics.py'\u003ehere \u003c/a\u003e. The word embedding based metric is done using the pretrained word2vec trained on Google news corpus. Download it from \u003ca href='https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM'\u003e here\u003c/a\u003e and place it in /data/embeddings folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashwath94%2Fhierarchical-seq2seq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshashwath94%2Fhierarchical-seq2seq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashwath94%2Fhierarchical-seq2seq/lists"}