{"id":13936966,"url":"https://github.com/vinhkhuc/MemN2N-babi-python","last_synced_at":"2025-07-19T22:33:41.584Z","repository":{"id":77713014,"uuid":"49356897","full_name":"vinhkhuc/MemN2N-babi-python","owner":"vinhkhuc","description":"End-To-End Memory Networks for bAbI question-answering tasks","archived":false,"fork":false,"pushed_at":"2019-04-13T01:54:18.000Z","size":16394,"stargazers_count":577,"open_issues_count":9,"forks_count":146,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-08-08T23:24:56.656Z","etag":null,"topics":["machine-learning","python","question-answering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinhkhuc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-01-10T06:56:50.000Z","updated_at":"2024-08-01T22:14:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f8b7ae3-153e-41d7-a8b8-d42ec0e3efa8","html_url":"https://github.com/vinhkhuc/MemN2N-babi-python","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/vinhkhuc%2FMemN2N-babi-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhkhuc%2FMemN2N-babi-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhkhuc%2FMemN2N-babi-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhkhuc%2FMemN2N-babi-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinhkhuc","download_url":"https://codeload.github.com/vinhkhuc/MemN2N-babi-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226693903,"owners_count":17667757,"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":["machine-learning","python","question-answering"],"created_at":"2024-08-07T23:03:09.987Z","updated_at":"2024-11-27T05:30:46.973Z","avatar_url":"https://github.com/vinhkhuc.png","language":"Python","readme":"## End-To-End Memory Networks for Question Answering\nThis is an implementation of MemN2N model in Python for the [bAbI question-answering tasks](http://fb.ai/babi) \nas shown in the Section 4 of the paper \"[End-To-End Memory Networks](http://arxiv.org/abs/1503.08895)\". It is based on \nFacebook's [Matlab code](https://github.com/facebook/MemNN/tree/master/MemN2N-babi-matlab).\n\n![Web-based Demo](http://i.imgur.com/mKtZ7kB.gif)\n\n## Requirements\n* Python 2.7\n* Numpy, Flask (only for web-based demo) can be installed via pip:\n```\n$ sudo pip install -r requirements.txt\n```\n* [bAbI dataset](http://fb.ai/babi) should be downloaded to `data/tasks_1-20_v1-2`: \n```\n$ wget -qO- http://www.thespermwhale.com/jaseweston/babi/tasks_1-20_v1-2.tar.gz | tar xvz -C data\n```\n\n## Usage\n* To run on a single task, use `babi_runner.py` with `-t` followed by task's id. For example,   \n```\npython babi_runner.py -t 1\n```\nThe output will look like:\n```\nUsing data from data/tasks_1-20_v1-2/en\nTrain and test for task 1 ...\n1 | train error: 0.876116 | val error: 0.75\n|===================================               | 71% 0.5s\n```\n* To run on 20 tasks:\n```\npython babi_runner.py -a\n```\n* To train using all training data from 20 tasks, use the joint mode:\n```\npython babi_runner.py -j\n```\n\n## Question Answering Demo\n* In order to run the Web-based demo using the pretrained model `memn2n_model.pklz` in `trained_model/`, run:\n```\npython -m demo.qa\n```\n\n* Alternatively, you can try the console-based demo:\n```\npython -m demo.qa -console\n```\n\n* The pretrained model `memn2n_model.pklz` can be created by running:\n```\npython -m demo.qa -train\n```\n\n* To show all options, run `python -m demo.qa -h`\n\n## Benchmarks\nSee the results [here](https://github.com/vinhkhuc/MemN2N-babi-python/tree/master/bechmarks).\n\n### Author\nVinh Khuc\n\n### Future Plans\n* Port to TensorFlow/Keras\n* Support Python 3\n\n### References\n* Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus, \n  \"[End-To-End Memory Networks](http://arxiv.org/abs/1503.08895)\",\n  *arXiv:1503.08895 [cs.NE]*.","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinhkhuc%2FMemN2N-babi-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinhkhuc%2FMemN2N-babi-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinhkhuc%2FMemN2N-babi-python/lists"}