{"id":22944885,"url":"https://github.com/mfa/allennlp-reverse-seq2seq","last_synced_at":"2025-04-01T21:43:20.702Z","repository":{"id":142565529,"uuid":"203426830","full_name":"mfa/allennlp-reverse-seq2seq","owner":"mfa","description":"Sequence-to-Sequence example with AllenNLP and attention visualization","archived":false,"fork":false,"pushed_at":"2020-06-26T15:51:05.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T14:22:37.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mfa.png","metadata":{"files":{"readme":"readme.org","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":"2019-08-20T17:53:04.000Z","updated_at":"2021-02-10T10:12:07.000Z","dependencies_parsed_at":"2023-04-10T17:49:19.311Z","dependency_job_id":null,"html_url":"https://github.com/mfa/allennlp-reverse-seq2seq","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/mfa%2Fallennlp-reverse-seq2seq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfa%2Fallennlp-reverse-seq2seq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfa%2Fallennlp-reverse-seq2seq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfa%2Fallennlp-reverse-seq2seq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfa","download_url":"https://codeload.github.com/mfa/allennlp-reverse-seq2seq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246716761,"owners_count":20822516,"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":[],"created_at":"2024-12-14T14:28:29.509Z","updated_at":"2025-04-01T21:43:20.671Z","avatar_url":"https://github.com/mfa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+STARTUP: showeverything\n#+OPTIONS: toc:nil\n#+OPTIONS: ^:nil\n\n** reverse\n\n*** about\n\nTrain a seq2seq encoder-decoder model to reverse the input string.\n\nrebuild of the tutorial of joeynmt:\nhttps://joeynmt.readthedocs.io/en/latest/tutorial.html\nin AllenNLP\n\nBlog posts describing the code in this repository:\n- https://madflex.de/posts/allennlp--reverse-sequence-example/\n- https://madflex.de/posts/allennlp--sequence-to-sequence-attention-plots/\n\n*** first\n\ndownload generator script from joeynmt\n#+BEGIN_SRC bash\nmkdir -p tools; cd tools\nwget https://raw.githubusercontent.com/joeynmt/joeynmt/master/scripts/generate_reverse_task.py\ncd ..\n#+END_SRC\n\ngenerate some data\n#+BEGIN_SRC bash\nmkdir data; cd data\npython ../tools/generate_reverse_task.py\ncd ..\n#+END_SRC\n\nconvert data to tsv for seq2seq datareader\n#+BEGIN_SRC bash\ncd data\npaste dev.src dev.trg \u003e dev.csv\npaste test.src test.trg \u003e test.csv\npaste train.src train.trg \u003e train.csv\ncd ..\n#+END_SRC\n\n*** training\n\n#+begin_src bash\nallennlp train configurations/reverse_starting_point.json -s output -f --include-package library\n#+end_src\n\n*** predict / evaluation\n\n#+begin_src bash\necho '{\"source\": \"15 28 32 4\", \"target\": \"4 32 28 15\"}' \u003e reverse_example.json\nallennlp predict output/model.tar.gz reverse_example.json --predictor seq2seq\n#+end_src\n\n*** predict with attention plots\n\n#+begin_src bash\nallennlp predict output/model.tar.gz --use-dataset-reader examples.csv --predictor my_seq2seq --output-file output/examples.output --include-package library\npython tools/plot_attention.py\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfa%2Fallennlp-reverse-seq2seq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfa%2Fallennlp-reverse-seq2seq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfa%2Fallennlp-reverse-seq2seq/lists"}