{ "info": { "author": "MatchZoo-py Authors", "author_email": "fanyixing@ict.ac.cn", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "
\n\"logo\"\n
\n\n# MatchZoo-py [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=MatchZoo-py:%20deep%20learning%20for%20semantic%20matching&url=https://github.com/NTMC-Community/MatchZoo-py)\n\n> PyTorch version of [MatchZoo](https://github.com/NTMC-Community/MatchZoo).\n\n> Facilitating the design, comparison and sharing of deep text matching models.
\n> MatchZoo \u662f\u4e00\u4e2a\u901a\u7528\u7684\u6587\u672c\u5339\u914d\u5de5\u5177\u5305\uff0c\u5b83\u65e8\u5728\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u7684\u5b9e\u73b0\u3001\u6bd4\u8f83\u3001\u4ee5\u53ca\u5206\u4eab\u6700\u65b0\u7684\u6df1\u5ea6\u6587\u672c\u5339\u914d\u6a21\u578b\u3002\n\n[![Python 3.6](https://img.shields.io/badge/python-3.6%20%7C%203.7-blue.svg)](https://www.python.org/downloads/release/python-360/)\n[![Gitter](https://badges.gitter.im/NTMC-Community/community.svg)](https://gitter.im/NTMC-Community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n[![Documentation Status](https://readthedocs.org/projects/matchzoo-py/badge/?version=latest)](https://matchzoo-py.readthedocs.io/en/latest/?badge=latest)\n[![Build Status](https://travis-ci.org/NTMC-Community/MatchZoo-py.svg?branch=master)](https://travis-ci.org/NTMC-Community/MatchZoo-py)\n[![codecov](https://codecov.io/gh/NTMC-Community/MatchZoo-py/branch/master/graph/badge.svg)](https://codecov.io/gh/NTMC-Community/MatchZoo-py)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Requirements Status](https://requires.io/github/NTMC-Community/MatchZoo-py/requirements.svg?branch=master)](https://requires.io/github/NTMC-Community/MatchZoo-py/requirements/?branch=master)\n---\n\nThe goal of MatchZoo is to provide a high-quality codebase for deep text matching research, such as document retrieval, question answering, conversational response ranking, and paraphrase identification. With the unified data processing pipeline, simplified model configuration and automatic hyper-parameters tunning features equipped, MatchZoo is flexible and easy to use.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
TasksText 1Text 2Objective
Paraphrase Indentification string 1 string 2 classification
Textual Entailment text hypothesis classification
Question Answer question answer classification/ranking
Conversation dialog response classification/ranking
Information Retrieval query document ranking
\n\n## Get Started in 60 Seconds\n\nTo train a [Deep Semantic Structured Model](https://www.microsoft.com/en-us/research/project/dssm/), make use of MatchZoo customized loss functions and evaluation metrics to define a task:\n\n```python\nimport torch\nimport matchzoo as mz\n\nranking_task = mz.tasks.Ranking(losses=mz.losses.RankCrossEntropyLoss(num_neg=4))\nranking_task.metrics = [\n mz.metrics.NormalizedDiscountedCumulativeGain(k=3),\n mz.metrics.MeanAveragePrecision()\n]\n```\n\nPrepare input data:\n\n```python\ntrain_pack = mz.datasets.wiki_qa.load_data('train', task=ranking_task)\nvalid_pack = mz.datasets.wiki_qa.load_data('dev', task=ranking_task)\n```\n\nPreprocess your input data in three lines of code, keep track parameters to be passed into the model:\n\n```python\npreprocessor = mz.models.DSSM.get_default_preprocessor()\ntrain_processed = preprocessor.fit_transform(train_pack)\nvalid_processed = preprocessor.transform(valid_pack)\n```\n\nGenerate pair-wise training data on-the-fly:\n```python\ntrainset = mz.dataloader.Dataset(\n data_pack=train_processed,\n mode='pair',\n num_dup=1,\n num_neg=4\n)\nvalidset = mz.dataloader.Dataset(\n data_pack=valid_processed,\n mode='point'\n)\n```\n\nDefine padding callback and generate data loader:\n```python\npadding_callback = mz.models.DSSM.get_default_padding_callback()\n\ntrainloader = mz.dataloader.DataLoader(\n dataset=trainset,\n batch_size=32,\n stage='train',\n callback=padding_callback\n)\nvalidloader = mz.dataloader.DataLoader(\n dataset=validset,\n batch_size=32,\n stage='dev',\n callback=padding_callback\n)\n```\n\nInitialize the model, fine-tune the hyper-parameters:\n\n```python\nmodel = mz.models.DSSM()\nmodel.params['task'] = ranking_task\nmodel.params['vocab_size'] = preprocessor.context['vocab_size']\nmodel.guess_and_fill_missing_params()\nmodel.build()\n```\n\n`Trainer` is used to control the training flow:\n\n```python\noptimizer = torch.optim.Adam(model.parameters())\n\ntrainer = mz.trainers.Trainer(\n model=model,\n optimizer=optimizer,\n trainloader=trainloader,\n validloader=validloader,\n epochs=10\n)\n\ntrainer.run()\n```\n\n## References\n[Tutorials](https://github.com/NTMC-Community/MatchZoo-py/tree/master/tutorials)\n\n[English Documentation](https://matchzoo-py.readthedocs.io/en/latest/)\n\nIf you're interested in the cutting-edge research progress, please take a look at [awaresome neural models for semantic match](https://github.com/NTMC-Community/awaresome-neural-models-for-semantic-match).\n\n## Install\n\nMatchZoo is dependent on [PyTorch](https://pytorch.org). Two ways to install MatchZoo-py:\n\n**Install MatchZoo-py from Pypi:**\n\n```python\npip install matchzoo-py\n```\n\n**Install MatchZoo-py from the Github source:**\n\n```\ngit clone https://github.com/NTMC-Community/MatchZoo-py.git\ncd MatchZoo-py\npython setup.py install\n```\n\n\n## Models\n\n- [DRMM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/drmm.py): this model is an implementation of A Deep Relevance Matching Model for Ad-hoc Retrieval.\n- [DRMMTKS](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/drmmtks.py): this model is an implementation of A Deep Top-K Relevance Matching Model for Ad-hoc Retrieval.\n- [ARC-I](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/arci.py): this model is an implementation of Convolutional Neural Network Architectures for Matching Natural Language Sentences\n- [ARC-II](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/arcii.py): this model is an implementation of Convolutional Neural Network Architectures for Matching Natural Language Sentences\n- [DSSM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/dssm.py): this model is an implementation of Learning Deep Structured Semantic Models for Web Search using Clickthrough Data\n- [CDSSM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/cdssm.py): this model is an implementation of Learning Semantic Representations Using Convolutional Neural Networks for Web Search\n- [MatchLSTM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/matchlstm.py):this model is an implementation of Machine Comprehension Using Match-LSTM and Answer Pointer\n- [DUET](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/duet.py): this model is an implementation of Learning to Match Using Local and Distributed Representations of Text for Web Search\n- [KNRM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/knrm.py): this model is an implementation of End-to-End Neural Ad-hoc Ranking with Kernel Pooling\n- [ConvKNRM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/conv_knrm.py): this model is an implementation of Convolutional neural networks for soft-matching n-grams in ad-hoc search\n- [ESIM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/esim.py): this model is an implementation of Enhanced LSTM for Natural Language Inference\n- [BiMPM](https://github.com/NTMC-Community/MatchZoo-py/tree/master/matchzoo/models/bimpm.py): this model is an implementation of Bilateral Multi-Perspective Matching for Natural Language Sentences\n\n- Models under development: MatchPyramid, Match-SRNN, DeepRank, aNMM .... \n\n\n## Citation\n\nIf you use MatchZoo in your research, please use the following BibTex entry.\n\n```\n@inproceedings{Guo:2019:MLP:3331184.3331403,\n author = {Guo, Jiafeng and Fan, Yixing and Ji, Xiang and Cheng, Xueqi},\n title = {MatchZoo: A Learning, Practicing, and Developing System for Neural Text Matching},\n booktitle = {Proceedings of the 42Nd International ACM SIGIR Conference on Research and Development in Information Retrieval},\n series = {SIGIR'19},\n year = {2019},\n isbn = {978-1-4503-6172-9},\n location = {Paris, France},\n pages = {1297--1300},\n numpages = {4},\n url = {http://doi.acm.org/10.1145/3331184.3331403},\n doi = {10.1145/3331184.3331403},\n acmid = {3331403},\n publisher = {ACM},\n address = {New York, NY, USA},\n keywords = {matchzoo, neural network, text matching},\n} \n```\n\n\n## Development Team\n\n \u200b \u200b \u200b \u200b\n\n \n \n \n \n \n \n \n \n \n \n \n
\n \u200b \"faneshion\"
\n \u200b Yixing Fan \u200b\n

Core Dev
\n ASST PROF, ICT

\u200b\n
\n \"Chriskuei\"
\n Jiangui Chen \u200b\n

Core Dev
PhD. ICT

\u200b\n
\n \u200b \"caiyinqiong\"
\n Yinqiong Cai\n

Core Dev
M.S. ICT

\u200b\n
\n \u200b \"pl8787\"
\n \u200b Liang Pang \u200b\n

Core Dev
\n ASST PROF, ICT

\u200b\n
\n \u200b \"lixinsu\"
\n \u200b Lixin Su\n

Dev
\n PhD. ICT

\u200b\n
\n \u200b \"rgtjf\"
\n \u200b Junfeng Tian \u200b\n

Dev
\n M.S. ECNU

\u200b\n
\n \u200b \"wqh17101\"
\n \u200b Qinghua Wang \u200b\n

Documentation
\n B.S. Shandong Univ.

\u200b\n
\n\n\n\n\n## Contribution\n\nPlease make sure to read the [Contributing Guide](./CONTRIBUTING.md) before creating a pull request. If you have a MatchZoo-related paper/project/compnent/tool, send a pull request to [this awesome list](https://github.com/NTMC-Community/awaresome-neural-models-for-semantic-match)!\n\nThank you to all the people who already contributed to MatchZoo!\n\n[Bo Wang](https://github.com/bwanglzu), [Zeyi Wang](https://github.com/uduse), [Liu Yang](https://github.com/yangliuy), [Zizhen Wang](https://github.com/ZizhenWang), [Zhou Yang](https://github.com/zhouzhouyang520), [Jianpeng Hou](https://github.com/HouJP), [Lijuan Chen](https://github.com/githubclj), [Yukun Zheng](https://github.com/zhengyk11), [Niuguo Cheng](https://github.com/niuox), [Dai Zhuyun](https://github.com/AdeDZY), [Aneesh Joshi](https://github.com/aneesh-joshi), [Zeno Gantner](https://github.com/zenogantner), [Kai Huang](https://github.com/hkvision), [stanpcf](https://github.com/stanpcf), [ChangQF](https://github.com/ChangQF), [Mike Kellogg\n](https://github.com/wordreference)\n\n\n\n\n## Project Organizers\n\n- Jiafeng Guo\n * Institute of Computing Technology, Chinese Academy of Sciences\n * [Homepage](http://www.bigdatalab.ac.cn/~gjf/)\n- Yanyan Lan\n * Institute of Computing Technology, Chinese Academy of Sciences\n * [Homepage](http://www.bigdatalab.ac.cn/~lanyanyan/)\n- Xueqi Cheng\n * Institute of Computing Technology, Chinese Academy of Sciences\n * [Homepage](http://www.bigdatalab.ac.cn/~cxq/)\n\n\n## License\n\n[Apache-2.0](https://opensource.org/licenses/Apache-2.0)\n\nCopyright (c) 2019-present, Yixing Fan (faneshion)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NTMC-Community/MatchZoo-py", "keywords": "text matching models", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "MatchZoo-test", "package_url": "https://pypi.org/project/MatchZoo-test/", "platform": "", "project_url": "https://pypi.org/project/MatchZoo-test/", "project_urls": { "Homepage": "https://github.com/NTMC-Community/MatchZoo-py" }, "release_url": "https://pypi.org/project/MatchZoo-test/1.0/", "requires_dist": null, "requires_python": "", "summary": "Facilitating the design, comparison and sharingof deep text matching models.", "version": "1.0" }, "last_serial": 5707786, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c7fd8365a3d5f7a36a2d096b0b74a99e", "sha256": "66159089aee78a3f939663398dec5e8839c833899357c88f091aa100780d3192" }, "downloads": -1, "filename": "MatchZoo-test-1.0.tar.gz", "has_sig": false, "md5_digest": "c7fd8365a3d5f7a36a2d096b0b74a99e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84623, "upload_time": "2019-08-21T08:17:52", "url": "https://files.pythonhosted.org/packages/55/06/fde0d67785f2dfd66f32254b746a9e9b67b290e5d6454aa6474237d5ec48/MatchZoo-test-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c7fd8365a3d5f7a36a2d096b0b74a99e", "sha256": "66159089aee78a3f939663398dec5e8839c833899357c88f091aa100780d3192" }, "downloads": -1, "filename": "MatchZoo-test-1.0.tar.gz", "has_sig": false, "md5_digest": "c7fd8365a3d5f7a36a2d096b0b74a99e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84623, "upload_time": "2019-08-21T08:17:52", "url": "https://files.pythonhosted.org/packages/55/06/fde0d67785f2dfd66f32254b746a9e9b67b290e5d6454aa6474237d5ec48/MatchZoo-test-1.0.tar.gz" } ] }