{"id":13595614,"url":"https://github.com/zhiguowang/BiMPM","last_synced_at":"2025-04-09T13:32:51.278Z","repository":{"id":47684097,"uuid":"89270839","full_name":"zhiguowang/BiMPM","owner":"zhiguowang","description":"BiMPM: Bilateral Multi-Perspective Matching for Natural Language Sentences","archived":false,"fork":false,"pushed_at":"2021-08-18T08:20:14.000Z","size":83,"stargazers_count":440,"open_issues_count":43,"forks_count":151,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-01T16:41:45.567Z","etag":null,"topics":["duplicate-questions-identification","natural-language-inference","paraphrase-identification","sentence-match","sentence-similarity"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhiguowang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T17:57:34.000Z","updated_at":"2024-07-18T20:09:02.000Z","dependencies_parsed_at":"2022-08-21T21:00:17.947Z","dependency_job_id":null,"html_url":"https://github.com/zhiguowang/BiMPM","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/zhiguowang%2FBiMPM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiguowang%2FBiMPM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiguowang%2FBiMPM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiguowang%2FBiMPM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhiguowang","download_url":"https://codeload.github.com/zhiguowang/BiMPM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223394647,"owners_count":17138591,"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":["duplicate-questions-identification","natural-language-inference","paraphrase-identification","sentence-match","sentence-similarity"],"created_at":"2024-08-01T16:01:53.625Z","updated_at":"2024-11-06T18:31:22.232Z","avatar_url":"https://github.com/zhiguowang.png","language":"Python","readme":"# BiMPM: Bilateral Multi-Perspective Matching for Natural Language Sentences\n\n## Updates (Jan 28, 2018)\n* This repository has been updated to tensorflow 1.5\n* The training process speeds up 15+ times without lossing the accuracy.\n* All codes have been re-constructed for better readability and adaptability.\n\n## Description\nThis repository includes the source code for natural language sentence matching. \nBasically, the program takes two sentences as input, and predict a label for the two input sentences. \nYou can use this program to deal with tasks like [paraphrase identification](https://aclweb.org/aclwiki/index.php?title=Paraphrase_Identification_%28State_of_the_art%29), [natural language inference](http://nlp.stanford.edu/projects/snli/), [duplicate questions identification](https://data.quora.com/First-Quora-Dataset-Release-Question-Pairs) et al. More details about the underneath model can be found in our [paper](https://arxiv.org/pdf/1702.03814.pdf) published in IJCAI 2017. Please cite our paper when you use this program! :heart_eyes:\n\n## Requirements\n* python 2.7\n* tensorflow 1.5\n\n## Data format\nBoth the train and test sets require a tab-separated format.\nEach line in the train (or test) file corresponds to an instance, and it should be arranged as\n\u003e label\tsentence#1\tsentence#2 instanceID\t\n\nFor more details about the data format, you can download the [SNLI](https://drive.google.com/file/d/1CxjKsaM6YgZPRKmJhNn7WcIC3gISehcS/view?usp=sharing) and the [Quora Question Pair](https://drive.google.com/file/d/0B0PlTAo--BnaQWlsZl9FZ3l1c28/view?usp=sharing) datasets used in our [paper](https://arxiv.org/pdf/1702.03814.pdf).\n\n\n## Training\nYou can find the training script at BiMPM/src/SentenceMatchTrainer.py\n\nFirst, edit the configuration file at ${workspace}/BiMPM/configs/snli.sample.config (or ${workspace}/BiMPM/configs/quora.sample.config ).\nYou need to change the \"train\\_path\", \"dev\\_path\", \"word\\_vec\\_path\", \"model\\_dir\", \"suffix\" to your own setting.\n\nSecond, launch job using the following command line\n\u003e python  ${workspace}/BiMPM/SentenceMatchTrainer.py --config\\_path ${workspace}/BiMPM/configs/snli.sample.config\n\n\n## Testing\nYou can find the testing script at BiMPM/src/SentenceMatchDecoder.py\n\u003e python  ${workspace}/BiMPM/src/SentenceMatchDecoder.py --in\\_path ${your\\_path\\_to}/dev.tsv --word\\_vec\\_path ${your\\_path\\_to}/wordvec.txt --out\\_path ${your\\_path\\_to}/result.json --model\\_prefix ${model\\_dir}/SentenceMatch.${suffix}\n\nWhere \"model\\_dir\" and \"suffix\" are the variables set in your configuration file.\n\nThe output file is a json file with the follwing format.\n\n```javascript\n{\n    { \n        \"ID\": \"instanceID\",\n        \"truth\": label,\n        \"sent1\": sentence1,\n        \"sent2\": sentence2,\n        \"prediction\": prediciton,\n        \"probs\": probs_for_all_possible_labels\n    },\n    { \n        \"ID\": \"instanceID\",\n        \"truth\": label,\n        \"sent1\": sentence1,\n        \"sent2\": sentence2,\n        \"prediction\": prediciton,\n        \"probs\": probs_for_all_possible_labels\n    }\n}\n```\n\n\n## Reporting issues\nPlease let [me](https://zhiguowang.github.io/) know, if you encounter any problems.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiguowang%2FBiMPM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhiguowang%2FBiMPM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiguowang%2FBiMPM/lists"}