{ "info": { "author": "Henry Rosales", "author_email": "hrosmendez@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Education", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# Coreference Resolution wrapper\n\nCoreference Resolution is the task of finding all expressions that refer to the same entity in a text. It is an important step for a lot of higher level NLP tasks that involve natural language understanding such as document summarization, question answering, and information extraction.\n\nThis is a simple library that wrap two Coreference Resolution models form StanfordNLP package: the statistic and neural models. We use here the SpaCy package to load the neural model (a.k.a, *NeuralCoref*), and the stanfordnlp package to load the statistic model (a.k.a, *CoreNLPCoref*).\n\n## Requirements\n\n```bash\npip3 install spacy\npip3 install stanfordnlp\npip3 install wrapperCoreference\n```\n\nStanfordNLP also require the manual downloading of a core of modules, review [here](https://stanfordnlp.github.io/CoreNLP/download.html) for more details.\n\n```bash\nwget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip\n```\n\n## Methods\nExample of usage of the neural model \n```python\nfrom wrapperCoreference import WrapperCoreference\nwc = WrapperCoreference()\nwc.NeuralCoref(u'My sister has a dog. She loves him.')\n#output: [{'start': 21, 'end': 24, 'text': 'She', 'resolved': 'My sister'}, {'start': 31, 'end': 34, 'text': 'him', 'resolved': 'a dog'}]\n```\n\n\nExample of usage of the statistic model \n```python\nfrom wrapperCoreference import WrapperCoreference\nwc = WrapperCoreference()\nwc.setCoreNLP('/tmp/stanford-corenlp-full-2018-10-05')\nprint(wc.CoreNLPCoref(u'My sister has a dog. She loves him.'))\n#output: [{'start': 31, 'end': 34, 'text': 'him', 'resolved': 'a dog', 'fullInformation': [{'start': 14, 'end': 19, 'text': 'a dog'}]}, {'start' : 21, 'end': 24, 'text': 'She', 'resolved': 'My sister', 'fullInformation': [{'start': 0, 'end': 9, 'text': 'My sister'}]}]\n```\n\n\n\n## Combining the output with Entity Linking\n\nYou can use the [nifwrapper](https://github.com/henryrosalesmendez/nifwrapper) library in order to merge the coreference outputs with Entity Linking annotations.\n```python\n\nfrom wrapperCoreference import WrapperCoreference\nfrom nifwrapper import *\n\n#---- Obtaining coreferences\nwc = WrapperCoreference()\ncorefResults = wc.NeuralCoref(u'My sister has a dog. She loves him.')\n#corefResults = [{'start': 21, 'end': 24, 'text': 'She', 'resolved': 'My sister'}, {'start': 31, 'end': 34, 'text': 'him', 'resolved': 'a dog'}]\n\n\n#---- Obtaining Entity Linking results\n# inline NIF corpus creation\nwrp = NIFWrapper()\ndoc = NIFDocument(\"https://example.org/doc1\")\n#--\nsent = NIFSentence(\"https://example.org/doc1#char=0,19\")\nsent.addAttribute(\"nif:beginIndex\",\"0\",\"xsd:nonNegativeInteger\")\nsent.addAttribute(\"nif:endIndex\",\"19\",\"xsd:nonNegativeInteger\")\nsent.addAttribute(\"nif:isString\",\"My sister has a dog.\",\"xsd:string\")\nsent.addAttribute(\"nif:broaderContext\",[\"https://example.org/doc1\"],\"URI LIST\")\n\n\n#-- \na1 = NIFAnnotation(\"https://example.org/doc1#char=14,19\", \"14\", \"19\", [\"https://en.wikipedia.org/wiki/ExambleDogUri\"], [\"dbo:FamilyRelations\"])\na1.addAttribute(\"nif:anchorOf\",\"a dog\",\"xsd:string\")\nsent.pushAnnotation(a1)\ndoc.pushSentence(sent)\n\n#--\nsent2 = NIFSentence(\"https://example.org/doc1#char=21,35\")\nsent2.addAttribute(\"nif:isString\",\"She loves him.\",\"xsd:string\")\nsent2.addAttribute(\"nif:broaderContext\",[\"https://example.org/doc1\"],\"URI LIST\")\nsent2.addAttribute(\"nif:beginIndex\",\"21\",\"xsd:nonNegativeInteger\")\nsent2.addAttribute(\"nif:endIndex\",\"35\",\"xsd:nonNegativeInteger\")\ndoc.pushSentence(sent2)\n#--\nwrp.pushDocument(doc)\n\n#---- Combining EL annotations with coreferences \nwrp.extendsDocWithCoref(corefResults, doc.uri)\n\nprint(wrp.toString())\n```\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": "", "keywords": "Coreference Resolution,NLP", "license": "", "maintainer": "", "maintainer_email": "", "name": "wrapperCoreference", "package_url": "https://pypi.org/project/wrapperCoreference/", "platform": "", "project_url": "https://pypi.org/project/wrapperCoreference/", "project_urls": null, "release_url": "https://pypi.org/project/wrapperCoreference/0.0.4/", "requires_dist": [ "check-manifest ; extra == 'dev'", "coverage ; extra == 'test'" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "summary": "Coreference Resolution wrapper", "version": "0.0.4" }, "last_serial": 6001789, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fb1292be0f53dff95c60aae0aeb8b230", "sha256": "ecb205d0e794c69fa712a0ca377dd9c9b6ea03fd22aa2c5a55882884a3396a44" }, "downloads": -1, "filename": "wrapperCoreference-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fb1292be0f53dff95c60aae0aeb8b230", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 4176, "upload_time": "2019-10-19T22:02:46", "url": "https://files.pythonhosted.org/packages/2d/95/3bd5ab6af7fe11fd8606590aac6987568d555dac5589dc112af0ba794a76/wrapperCoreference-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b17eb929d38f6d22079df089298118cc", "sha256": "4ce06c4f3356d90e8846ca85a76696b6bd82a91054506da6b76c4bc117d6522a" }, "downloads": -1, "filename": "wrapperCoreference-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b17eb929d38f6d22079df089298118cc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 6397, "upload_time": "2019-10-19T22:02:48", "url": "https://files.pythonhosted.org/packages/4f/e3/88065c924f68aab57b1a37a30bd6969224bd4a2ed894a2dbab3c64690bf2/wrapperCoreference-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e99d8ace0ceb038f93bb146f2dc55a41", "sha256": "114ae05cd6ff5e8f85c869ef696557d5c5689e49459f015f4bc2f844ddc3516a" }, "downloads": -1, "filename": "wrapperCoreference-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e99d8ace0ceb038f93bb146f2dc55a41", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 4203, "upload_time": "2019-10-20T01:05:25", "url": "https://files.pythonhosted.org/packages/10/c8/09d562ebdf71fa0876f22cbafcc479edb71893fa8d4a771f5b8a630cef32/wrapperCoreference-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d15843056990cc5729568c2eb1bff9c", "sha256": "4bfc767d9ca72d77537146233feace85a16e090ee28a8d9230382dcc484ad198" }, "downloads": -1, "filename": "wrapperCoreference-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3d15843056990cc5729568c2eb1bff9c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 6417, "upload_time": "2019-10-20T01:05:27", "url": "https://files.pythonhosted.org/packages/b1/67/27d3448299f6dca81967b5c62beac6d3b06f87a768475b12569966fc01bb/wrapperCoreference-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "84d4b369897f64d655bee3d3d6d69ae3", "sha256": "ad829e22a0fd6e087467a3b7d4dc5deff4a8c4059d2e9ed459806c88d40e35af" }, "downloads": -1, "filename": "wrapperCoreference-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "84d4b369897f64d655bee3d3d6d69ae3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 4722, "upload_time": "2019-10-20T02:38:04", "url": "https://files.pythonhosted.org/packages/7c/51/88b69a5808487442a77af35b4b8e40161efe14ef0162c276cb9b3040d64c/wrapperCoreference-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b79af741df55bce61b09325e75c011c7", "sha256": "a0696170b4cde2afd3860088428238157f2907b15fe9b91a811a1c25777d6748" }, "downloads": -1, "filename": "wrapperCoreference-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b79af741df55bce61b09325e75c011c7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 7106, "upload_time": "2019-10-20T02:38:06", "url": "https://files.pythonhosted.org/packages/9d/e6/0bc307ba2b7ee2061a6d584a82588e7c66273b10e4a0b50cbf44743f7ed1/wrapperCoreference-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "1f02e6892e50805ec6e81ded01b1d548", "sha256": "f41d53acf6e73969c993a0871c1dea30fcb938b7f56b0f400c0f9f2ca08a1407" }, "downloads": -1, "filename": "wrapperCoreference-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "1f02e6892e50805ec6e81ded01b1d548", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 4708, "upload_time": "2019-10-20T03:28:29", "url": "https://files.pythonhosted.org/packages/59/20/ffd5522d7dde96afc16968b173bae8eec4db32248cbeb16f70928a14d2c0/wrapperCoreference-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3e6c95241f12aababc874b11fa3ab61", "sha256": "74fdd5a6b824ca4e5dba463b48119a6141f3c3a9c0c09c3be45faf3a6117efe2" }, "downloads": -1, "filename": "wrapperCoreference-0.0.4.tar.gz", "has_sig": false, "md5_digest": "a3e6c95241f12aababc874b11fa3ab61", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 7084, "upload_time": "2019-10-20T03:28:31", "url": "https://files.pythonhosted.org/packages/be/cd/c369e2a3f839c6c0726ee85ccc6c9faae91fde2d550a547188f451de5b40/wrapperCoreference-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f02e6892e50805ec6e81ded01b1d548", "sha256": "f41d53acf6e73969c993a0871c1dea30fcb938b7f56b0f400c0f9f2ca08a1407" }, "downloads": -1, "filename": "wrapperCoreference-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "1f02e6892e50805ec6e81ded01b1d548", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 4708, "upload_time": "2019-10-20T03:28:29", "url": "https://files.pythonhosted.org/packages/59/20/ffd5522d7dde96afc16968b173bae8eec4db32248cbeb16f70928a14d2c0/wrapperCoreference-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3e6c95241f12aababc874b11fa3ab61", "sha256": "74fdd5a6b824ca4e5dba463b48119a6141f3c3a9c0c09c3be45faf3a6117efe2" }, "downloads": -1, "filename": "wrapperCoreference-0.0.4.tar.gz", "has_sig": false, "md5_digest": "a3e6c95241f12aababc874b11fa3ab61", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 7084, "upload_time": "2019-10-20T03:28:31", "url": "https://files.pythonhosted.org/packages/be/cd/c369e2a3f839c6c0726ee85ccc6c9faae91fde2d550a547188f451de5b40/wrapperCoreference-0.0.4.tar.gz" } ] }