{"id":18754006,"url":"https://github.com/dcavar/nltk-json-nlp","last_synced_at":"2025-04-13T00:31:58.798Z","repository":{"id":57446410,"uuid":"177872494","full_name":"dcavar/NLTK-JSON-NLP","owner":"dcavar","description":"NLTK wrapper to JSON-NLP.","archived":false,"fork":false,"pushed_at":"2019-05-25T17:42:00.000Z","size":47,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T17:16:10.660Z","etag":null,"topics":["json","natural-language-processing","nltk"],"latest_commit_sha":null,"homepage":"https://nlp-lab.org/nltkjsonnlp/","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/dcavar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T21:37:44.000Z","updated_at":"2019-06-26T06:19:59.000Z","dependencies_parsed_at":"2022-09-02T23:41:19.260Z","dependency_job_id":null,"html_url":"https://github.com/dcavar/NLTK-JSON-NLP","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2FNLTK-JSON-NLP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2FNLTK-JSON-NLP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2FNLTK-JSON-NLP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2FNLTK-JSON-NLP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcavar","download_url":"https://codeload.github.com/dcavar/NLTK-JSON-NLP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650590,"owners_count":21139670,"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":["json","natural-language-processing","nltk"],"created_at":"2024-11-07T17:27:46.399Z","updated_at":"2025-04-13T00:31:58.513Z","avatar_url":"https://github.com/dcavar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLTK-JSON-NLP\n\n(C) 2019 by [Damir Cavar], [Oren Baldinger], Maanvitha Gongalla, Anurag Kumar, Murali Kammili, Boli Fang\n\nBrought to you by the [NLP-Lab.org]!\n\n\n## Introduction\n\n[NLTK] wrapper to [JSON-NLP]. [NLTK] has a wide variety of capabilities, but for our purposes\nwe are limiting it to [WordNet], [VerbNet], and [FrameNet]. Other packages such as [spaCy] and \n[Flair] are more accurately able to annotate things like part of speech tags and dependency \nparses. See below for instruction on how to unify outputs from multiple packages.\n\n## Microservice\n\nThe [JSON-NLP] repository provides a Microservice class, with a pre-built implementation of [Flask]. To run it, execute:\n    \n    python nltkjsonnlp/server.py\n \nSince `server.py` extends the [Flask] app, a WSGI file would contain:\n\n    from nltkjsonnlp.server import app as application\n    \n## Pipeline\n\n[JSON-NLP] provides a simple `Pipeline` interface that we implement as `NltkPipeline`:\n    \n    pipeline = nltkjsonnlp.NltkPipeline()\n    print(pipeline.process(text='I am a sentence.'))\n            \n## Unification\n\nTo make the best use of this pipeline, it is best to unify it with a more accurate and complete\npipeline such as [spaCy-NLP-Json]:\n\n    class UnifiedPipeline(pyjsonnlp.pipeline.Pipeline):\n        def __init__(self):\n            super(UnifiedPipeline, self).__init__()\n            self.spacy = spacynlpjson.SpacyPipeline()\n            self.nltk = nltkjsonnlp.NltkPipeline()\n    \n        def process(self, text='', coreferences=True, constituents=False, dependencies=True, expressions=True,\n                    **kwargs) -\u003e OrderedDict:\n            # start with a spacy parse\n            spacy_json = self.spacy.process(text, spacy_model='en_core_web_md', constituents=False,\n                                            coreferences=coreferences, dependencies=dependencies, expressions=False)\n            # the get an nltk parse\n            nltk_json = self.nltk.process(text)\n            \n            # unify the parses\n            return pyjsonnlp.unification.unifier.add_annotation_to_a_from_b(a=spacy_json, \n                                                                            b=nltk_json, annotation='tokens')\n\n\n\n[Damir Cavar]: http://damir.cavar.me/ \"Damir Cavar\"\n[Oren Baldinger]: https://oren.baldinger.me/ \"Oren Baldinger\"\n[NLP-Lab.org]: http://nlp-lab.org/ \"NLP-Lab.org\"\n[JSON-NLP]: https://github.com/dcavar/JSON-NLP \"JSON-NLP\"\n[Flair]: https://github.com/zalandoresearch/flair \"Flair\"\n[spaCy]: https://spacy.io/ \"spaCy\"\n[NLTK]: http://nltk.org/ \"Natural Language Processing Toolkit\"\n[Polyglot]: https://github.com/aboSamoor/polyglot \"Polyglot\" \n[Xrenner]: https://github.com/amir-zeldes/xrenner \"Xrenner\"\n[CONLL-U]: https://universaldependencies.org/format.html \"CONLL-U\"\n[spaCy-NLP-Json]: https://github.com/dcavar/spaCy-JSON-NLP \"spaCy-JSON-NLP\"\n[WordNet]: https://wordnet.princeton.edu/ \"Wordnet\"\n[FrameNet]: https://framenet.icsi.berkeley.edu/fndrupal/ \"FrameNet\"\n[VerbNet]: https://verbs.colorado.edu/~mpalmer/projects/verbnet.html \"VerbNet\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcavar%2Fnltk-json-nlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcavar%2Fnltk-json-nlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcavar%2Fnltk-json-nlp/lists"}