{ "info": { "author": "Cesar Perez", "author_email": "cperez@wnohang.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Topic :: Education", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "# zhang2016dependency\n\nThis package provides a simple implementation of the models proposed in\nthe paper:\n\n> Zhang, R., Lee, H., & Radev, D. (2016). Dependency sensitive convolutional neural networks for modeling sentences and documents. arXiv preprint arXiv:1611.02361.\n\n## Installation\nThis package depends on the [Keras](https://keras.io/) library. This\nmeans you will need to install a backend library in order to use this\nmodule. Take a look to [Keras installation](https://keras.io/#installation)\nto get more information.\n\nAfter having installed the backend of yout choice, you just need to\ninstall this package using [pip](https://pypi.org/):\n\n pip install zhang2016dependency\n\n## Usage\nThis package only provides a single model. To get detailed information\non the parameters the model accepts, take a look to the documentation\nincluded with the module class.\n\nHere is a complete example of instantiation of the model proposed in the\noriginal paper using two channel of randomly initialized word\nembeddings:\n\n```python\nimport numpy as np\nimport numpy.random as rng\n\nvocabulary_size = 1000\nembedding_size = 300\n\nvalue = np.sqrt(6/embedding_size)\n\nweights_shape = (vocabulary_size+1, embedding_size)\nweights = rng.uniform(low=-value, high=value, size=weights_shape)\n\nchannels = [\n {\n 'weights': [weights],\n 'trainable': False,\n 'input_dim': vocabulary_size + 1,\n 'output_dim': embedding_size,\n 'name': 'random-embedding-1'\n },\n {\n 'weights': [weights],\n 'trainable': True,\n 'input_dim': vocabulary_size + 1,\n 'output_dim': embedding_size,\n 'name': 'random-embedding-2'\n }\n]\n\nwindows = [\n {\n 'filters': 100,\n 'kernel_size': 3,\n 'activation': 'relu',\n 'name': '3-grams'\n },\n {\n 'filters': 100,\n 'kernel_size': 4,\n 'activation': 'relu',\n 'name': '4-grams'\n },\n {\n 'filters': 100,\n 'kernel_size': 5,\n 'activation': 'relu',\n 'name': '5-grams'\n }\n]\n\nfrom zhang2016dependency import Model\n\nmodel = Model(channels=channels,\n windows=windows,\n sentence_length=37,\n num_classes=6,\n dropout_rate=0.5,\n classifier_activation='softmax',\n include_top=True,\n name='DSCNN')\n\nmodel.compile(optimizer='adadelta',\n loss='categorical_crossentropy',\n metrics=['accuracy'])\n\nmodel.summary()\n\n\n", "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/wnohang/zhang2016dependency", "keywords": "research model", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zhang2016dependency", "package_url": "https://pypi.org/project/zhang2016dependency/", "platform": "", "project_url": "https://pypi.org/project/zhang2016dependency/", "project_urls": { "Homepage": "https://github.com/wnohang/zhang2016dependency", "Issues": "https://github.com/wnohang/zhang2016dependency/issues", "Source": "https://github.com/wnohang/zhang2016dependency" }, "release_url": "https://pypi.org/project/zhang2016dependency/0.1.0/", "requires_dist": [ "keras" ], "requires_python": "", "summary": "Implementation of zhang2016dependency", "version": "0.1.0" }, "last_serial": 4468930, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "180126e2fe138914e4e90d2dcf16373c", "sha256": "c5596de3f35f91d9c7aed46164b53afa526ee438c5d995bb97d3fad5fc2fa841" }, "downloads": -1, "filename": "zhang2016dependency-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "180126e2fe138914e4e90d2dcf16373c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5324, "upload_time": "2018-11-09T10:44:55", "url": "https://files.pythonhosted.org/packages/b5/64/d44410b884c202266d6cde121303e3b3256d475462337d0d3227dc9bc28d/zhang2016dependency-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "01e077500c7ecdf35615f57e78fdbb6b", "sha256": "8bb28d57b710cd713cd93a5b9f95cf51e57f9906ec282e5a29bc8a4b33c72932" }, "downloads": -1, "filename": "zhang2016dependency-0.1.0.tar.gz", "has_sig": false, "md5_digest": "01e077500c7ecdf35615f57e78fdbb6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4786, "upload_time": "2018-11-09T10:44:57", "url": "https://files.pythonhosted.org/packages/0a/db/2e87c80c5d219700f546390ce53f1829cab4b8f550898a83bde14bd8ab5d/zhang2016dependency-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "180126e2fe138914e4e90d2dcf16373c", "sha256": "c5596de3f35f91d9c7aed46164b53afa526ee438c5d995bb97d3fad5fc2fa841" }, "downloads": -1, "filename": "zhang2016dependency-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "180126e2fe138914e4e90d2dcf16373c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5324, "upload_time": "2018-11-09T10:44:55", "url": "https://files.pythonhosted.org/packages/b5/64/d44410b884c202266d6cde121303e3b3256d475462337d0d3227dc9bc28d/zhang2016dependency-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "01e077500c7ecdf35615f57e78fdbb6b", "sha256": "8bb28d57b710cd713cd93a5b9f95cf51e57f9906ec282e5a29bc8a4b33c72932" }, "downloads": -1, "filename": "zhang2016dependency-0.1.0.tar.gz", "has_sig": false, "md5_digest": "01e077500c7ecdf35615f57e78fdbb6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4786, "upload_time": "2018-11-09T10:44:57", "url": "https://files.pythonhosted.org/packages/0a/db/2e87c80c5d219700f546390ce53f1829cab4b8f550898a83bde14bd8ab5d/zhang2016dependency-0.1.0.tar.gz" } ] }