{ "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": "# nifWrapper\n\nThe NLP Interchange Format (NIF) is a RDF/OWL-based format wich allows the spotting of words from text corpora and its metada such as part-of-speech tags, knowledge-base links, entity type, etc. Likewise other Python libraries (e.g., [pynif](https://github.com/wetneb/pynif)), this library transform NIF data to python classes in order to better proccessing this information. \n\nIf you want to create/visualizate NIF data see NIFify in [GitHub](https://github.com/henryrosalesmendez/NIFify_v2) or a [demo](https://users.dcc.uchile.cl/~hrosales/NIFify_v2.html).\n\n## Example\n\nInstall first the library:\n\n```\npip install nifwrapper\n```\n\nand then, try:\n\n```python\nfrom nifwrapper import *\n\n\ngold_ttl = '''\n@prefix rdf: .\n@prefix xsd: .\n@prefix nif: .\n@prefix itsrdf: .\n\n\n a nif:String , nif:Context , nif:RFC5147String ;\n nif:isString \"\"\"Kiev is an important industrial, scientific, educational and cultural center of Eastern Europe.\"\"\"^^xsd:string ;\n nif:beginIndex \"0\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"95\"^^xsd:nonNegativeInteger ;\n nif:sourceUrl .\n\n\n a nif:String , nif:Context , nif:RFC5147String ;\n nif:isString \"\"\"Kiev is an important industrial, scientific, educational and cultural center of Eastern Europe.\"\"\"^^xsd:string ;\n nif:beginIndex \"0\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"95\"^^xsd:nonNegativeInteger ;\n nif:broaderContext .\n\n\n a nif:String , nif:Context , nif:Phrase , nif:RFC5147String ;\n nif:referenceContext ;\n nif:context ;\n nif:anchorOf \"\"\"Kiev\"\"\"^^xsd:string ;\n nif:beginIndex \"0\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"4\"^^xsd:nonNegativeInteger ;\n itsrdf:taIdentRef .\n\n\n a nif:String , nif:Context , nif:Phrase , nif:RFC5147String ;\n nif:referenceContext ;\n nif:context ;\n nif:anchorOf \"\"\"scientific\"\"\"^^xsd:string ;\n nif:beginIndex \"33\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"43\"^^xsd:nonNegativeInteger ;\n itsrdf:taIdentRef .\n\n\n a nif:String , nif:Context , nif:Phrase , nif:RFC5147String ;\n nif:referenceContext ;\n nif:context ;\n nif:anchorOf \"\"\"educational\"\"\"^^xsd:string ;\n nif:beginIndex \"45\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"56\"^^xsd:nonNegativeInteger ;\n itsrdf:taIdentRef .\n\n\n a nif:String , nif:Context , nif:Phrase , nif:RFC5147String ;\n nif:referenceContext ;\n nif:context ;\n nif:anchorOf \"\"\"Eastern Europe\"\"\"^^xsd:string ;\n nif:beginIndex \"80\"^^xsd:nonNegativeInteger ;\n nif:endIndex \"94\"^^xsd:nonNegativeInteger ;\n itsrdf:taIdentRef .\n'''\n\n## ---- parsing\nparser = NIFParser()\nwrp_gold = parser.parser_turtle(gold_ttl)\n\n## ---- displaying turtle format\nprint(wrp_gold.toString()) \n\n## --- Benchmark\n\n# - inline NIF corpus creation\nwrp_sys = NIFWrapper()\ndoc = NIFDocument(\"https://example.org/doc1\")\n#--\nsent = NIFSentence(\"https://example.org/doc1#char=0,95\")\nsent.addAttribute(\"nif:isString\",\"Kiev is an important industrial, scientific, educational and cultural center of Eastern Europe.\",\"xsd:string\")\nsent.addAttribute(\"nif:broaderContext\",[\"https://example.org/doc1\"],\"URI LIST\")\n\n#-- \na1 = NIFAnnotation(\"https://example.org/doc1#char=0,4\", \"0\", \"4\", [\"https://en.wikipedia.org/wiki/Kiev\"], [\"dbo:Place\"])\na1.addAttribute(\"nif:anchorOf\",\"Kiev\",\"xsd:string\")\na1.addAttribute(\"ex:newPredicate\",\"This is a test\",\"xsd:string\")\nsent.pushAnnotation(a1)\n\n#--\na2 = NIFAnnotation(\"https://example.org/doc1#char=45,56\", \"45\", \"56\", [\"https://en.wikipedia.org/wiki/University\"], [\"dbo:Organization\"])\na2.addAttribute(\"nif:anchorOf\",\"educational\",\"xsd:string\")\nsent.pushAnnotation(a2)\n\n#--\na3 = NIFAnnotation(\"https://example.org/doc1#char=80,94\", \"80\", \"94\", [\"https://en.wikipedia.org/wiki/Eastern_Europe\"], [\"dbo:Organization\"])\na3.addAttribute(\"nif:anchorOf\",\"Eastern Europe\",\"xsd:string\")\nsent.pushAnnotation(a3)\n#--\ndoc.pushSentence(sent)\nwrp_sys.pushDocument(doc)\n\n\n## Quality Evaluation\nbmk = NIFBenchmark(wrp_sys, wrp_gold)\nprint(bmk.microF())\n```\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": "https://github.com/henryrosalesmendez/nifwrapper", "keywords": "NIF parser NLP", "license": "", "maintainer": "", "maintainer_email": "", "name": "nifwrapper", "package_url": "https://pypi.org/project/nifwrapper/", "platform": "", "project_url": "https://pypi.org/project/nifwrapper/", "project_urls": { "Bug Reports": "https://github.com/henryrosalesmendez/nifwrapper/issues", "Funding": "https://github.com/henryrosalesmendez/nifwrapper", "Homepage": "https://github.com/henryrosalesmendez/nifwrapper", "Say Thanks!": "https://github.com/henryrosalesmendez/nifwrapper", "Source": "https://github.com/henryrosalesmendez/nifwrapper" }, "release_url": "https://pypi.org/project/nifwrapper/1.5.2/", "requires_dist": [ "check-manifest ; extra == 'dev'", "coverage ; extra == 'test'" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "summary": "Parsing and storing NIF information", "version": "1.5.2" }, "last_serial": 6001108, "releases": { "1.5.1": [ { "comment_text": "", "digests": { "md5": "77d27016265554437323f64ca36d588e", "sha256": "b61aca8897dbc51dd4ad2e31efc288e208c31deb001fd7faa8e4bb87cc297cf9" }, "downloads": -1, "filename": "nifwrapper-1.5.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "77d27016265554437323f64ca36d588e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 30458, "upload_time": "2019-09-07T14:28:35", "url": "https://files.pythonhosted.org/packages/83/63/e0b46747837a0b9f7249f5d33560c0032c639e55f4ce561a167584797928/nifwrapper-1.5.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dcdf734f35e8383c590eaa18c8445f33", "sha256": "9324ec48ddd036b861c3b7819978cc81314e5b41e8d17f6dc2c187406113d250" }, "downloads": -1, "filename": "nifwrapper-1.5.1.tar.gz", "has_sig": false, "md5_digest": "dcdf734f35e8383c590eaa18c8445f33", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 29896, "upload_time": "2019-09-07T14:28:38", "url": "https://files.pythonhosted.org/packages/ec/88/82279423a60a5317e60609464366b3bf9df66a017718f907304c29f40938/nifwrapper-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "f67416fb40240725c12f8cc57606a31a", "sha256": "3d832e24f57a10db60d85ec8d8b83b248c3440762fa720220d172594dae77ec7" }, "downloads": -1, "filename": "nifwrapper-1.5.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f67416fb40240725c12f8cc57606a31a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 31217, "upload_time": "2019-10-19T21:44:13", "url": "https://files.pythonhosted.org/packages/b3/07/cfc905928b9a7b613ba401f295a3d8fb608bf2f52fdaf00a12dc5d788094/nifwrapper-1.5.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "334bbfaca8ca7ef0854804eb852a1c9e", "sha256": "148bbd9f988a6d19d4d38f06e705e18edd7fa9c83ed1f08dab8a3351a306a540" }, "downloads": -1, "filename": "nifwrapper-1.5.2.tar.gz", "has_sig": false, "md5_digest": "334bbfaca8ca7ef0854804eb852a1c9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 30777, "upload_time": "2019-10-19T21:44:15", "url": "https://files.pythonhosted.org/packages/36/45/47fe08caa8bc91bf6ccb221621b6f56519aad4eddcde92cd927c61f26974/nifwrapper-1.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f67416fb40240725c12f8cc57606a31a", "sha256": "3d832e24f57a10db60d85ec8d8b83b248c3440762fa720220d172594dae77ec7" }, "downloads": -1, "filename": "nifwrapper-1.5.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f67416fb40240725c12f8cc57606a31a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 31217, "upload_time": "2019-10-19T21:44:13", "url": "https://files.pythonhosted.org/packages/b3/07/cfc905928b9a7b613ba401f295a3d8fb608bf2f52fdaf00a12dc5d788094/nifwrapper-1.5.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "334bbfaca8ca7ef0854804eb852a1c9e", "sha256": "148bbd9f988a6d19d4d38f06e705e18edd7fa9c83ed1f08dab8a3351a306a540" }, "downloads": -1, "filename": "nifwrapper-1.5.2.tar.gz", "has_sig": false, "md5_digest": "334bbfaca8ca7ef0854804eb852a1c9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 30777, "upload_time": "2019-10-19T21:44:15", "url": "https://files.pythonhosted.org/packages/36/45/47fe08caa8bc91bf6ccb221621b6f56519aad4eddcde92cd927c61f26974/nifwrapper-1.5.2.tar.gz" } ] }