{"id":15014178,"url":"https://github.com/opennyai/opennyai","last_synced_at":"2025-08-21T07:33:00.171Z","repository":{"id":60489863,"uuid":"543177068","full_name":"OpenNyAI/Opennyai","owner":"OpenNyAI","description":"Opennyai : An efficient NLP Pipeline for Indian Legal documents","archived":false,"fork":false,"pushed_at":"2024-05-08T12:32:18.000Z","size":1114,"stargazers_count":67,"open_issues_count":2,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-19T21:09:17.161Z","etag":null,"topics":["indian-laws","indian-legal-judgements","legalnlp","machine-learning","natural-language-processing","nlp","python","spacy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenNyAI.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-29T14:50:19.000Z","updated_at":"2024-09-26T05:18:10.000Z","dependencies_parsed_at":"2023-01-31T03:15:31.841Z","dependency_job_id":"981c0625-c16e-4162-b7b8-c48ecfb941f7","html_url":"https://github.com/OpenNyAI/Opennyai","commit_stats":{"total_commits":242,"total_committers":7,"mean_commits":34.57142857142857,"dds":0.487603305785124,"last_synced_commit":"6a5ee133c834c6668b4b268b70b80f30c3fc6586"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNyAI%2FOpennyai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNyAI%2FOpennyai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNyAI%2FOpennyai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNyAI%2FOpennyai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenNyAI","download_url":"https://codeload.github.com/OpenNyAI/Opennyai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230501172,"owners_count":18236061,"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":["indian-laws","indian-legal-judgements","legalnlp","machine-learning","natural-language-processing","nlp","python","spacy"],"created_at":"2024-09-24T19:45:17.797Z","updated_at":"2024-12-19T21:09:21.719Z","avatar_url":"https://github.com/OpenNyAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/OpenNyAI/Opennyai\"\u003e\u003cimg src=\"https://github.com/OpenNyAI/Opennyai/raw/master/asset/final-logo-01.jpeg\" width=\"190\" height=\"65\" align=\"right\" /\u003e\u003c/a\u003e\n\n# Opennyai : An efficient NLP Pipeline for Indian Legal documents\n\n[![Current Release Version](https://img.shields.io/github/release/OpenNyAI/opennyai.svg?style=flat-square\u0026logo=github)](https://github.com/OpenNyAI/Opennyai/releases)\n[![PyPI version](https://img.shields.io/pypi/v/opennyai.svg?style=flat-square\u0026logo=pypi\u0026logoColor=white)](https://pypi.org/project/opennyai/)\n[![python version](https://img.shields.io/badge/Python-%3E=3.8-blue)](https://github.com/OpenNyAI/Opennyai)\n[![python version](https://img.shields.io/badge/Python-\u003c3.11-blue)](https://github.com/OpenNyAI/Opennyai)\n[![Downloads](https://pepy.tech/badge/opennyai)](https://github.com/OpenNyAI/Opennyai)\n\nOpennyai is a python library for natural language preprocessing on Indian legal texts.\n\nThis library provides unified access to the following 3 pre-trained AI models developed by OpenNyAI which focus on\nIndian court\njudgments:\n\n* Named Entity Recognition (NER): [GitHub](https://github.com/Legal-NLP-EkStep/legal_NER)\n  , [paper](https://arxiv.org/pdf/2211.03442.pdf), [Huggingface Datasets](https://huggingface.co/datasets/opennyaiorg/InLegalNER)\n* Judgment Structuring using Sentence Rhetorical\n  Roles: [GitHub](https://github.com/Legal-NLP-EkStep/rhetorical-role-baseline) \n  , [paper](http://www.lrec-conf.org/proceedings/lrec2022/pdf/2022.lrec-1.470.pdf), [Huggingface Datasets](https://huggingface.co/datasets/opennyaiorg/InRhetoricalRoles)\n* Extractive Summarizer: [GitHub](https://github.com/Legal-NLP-EkStep/judgment_extractive_summarizer)\n\nThis library is mainly for running the pretrained models on your custom input judgments text. For more details about\ndata and model training, please refer to individual git repo links.\n\n# 🔧 1. Installation\n\nTo get started using opennyai first create a new python virtual environment using [conda](https://www.anaconda.com/):\n\nSupports python 3.8, 3.9, 3.10\n\n```bash\nconda create -n opennyai python=3.8\nconda activate opennyai\n```\n\nInstall it using pip by running the following line in your terminal\n\n```bash\npip install -U opennyai\n```\n\n#### For GPU support\n\nIf you want to utilize spacy with GPU please install [Cupy](https://anaconda.org/conda-forge/cupy) and\n[cudatoolkit](https://anaconda.org/anaconda/cudatoolkit) dependency of appropriate version.\n\n```bash\nconda install cudatoolkit==\u003cyour_cuda_version\u003e #### E.g. cudatoolkit==11.2\npip install cupy-cuda\u003cyour_cuda_version\u003e ##### E.g. cupy-cuda112\n```\n\nIn case of any issue with installation please refer to [spacy installation with cupy](https://spacy.io/usage)\n\nRemember you need spacy of 3.2.4 version for models to work perfectly.\n\n# 📖 2. Documentation\n\nPlease refer to the [Documentation](https://opennyai.readthedocs.io/en/latest/index.html#) for more details.\n\n# 👩‍💻 3. Usage\n\nTo run the 3 OpenNyAI models on judgment texts of your choice please run following python code\n\n```python\nfrom opennyai import Pipeline\nfrom opennyai.utils import Data\nimport urllib\n\n# Get court judgment texts on which to run the AI models\ntext1 = urllib.request.urlopen(\n    'https://raw.githubusercontent.com/OpenNyAI/Opennyai/master/samples/sample_judgment1.txt').read().decode()\ntext2 = urllib.request.urlopen(\n    'https://raw.githubusercontent.com/OpenNyAI/Opennyai/master/samples/sample_judgment2.txt').read().decode()\n\n# you can also load your text files directly into this\ntexts_to_process = [text1, text2]\n\n# create Data object for data  preprocessing before running ML models\ndata = Data(texts_to_process)\n\n# If you have access to GPU then set this to True else False\nuse_gpu = True\n\n# Choose which of the AI models you want to run from the 3 models 'NER', 'Rhetorical_Role','Summarizer'. E.g. If just Named Entity is of interest then just select 'NER'\n\npipeline = Pipeline(components=['NER', 'Rhetorical_Role', 'Summarizer'], use_gpu=use_gpu, verbose=True)\n\nresults = pipeline(data)\n```\n\nThe output of each model is present in following keys of each element of the output\n\n```python\nresults[0][\n    'annotations']  ## shows the result of model at sentence level, each entry will have entities, rhetorical role, and other details\nresults[0]['summary']  ## shows Summary for each of the Rheorical Role for first judgment text \n```\n\nFor more details on usage please refer to the [documentation](https://opennyai.readthedocs.io/en/latest/index.html#)\n\nGoogle Colab Notebook\n----------------------\nWe encourage you to use the local machine installation of opennyai library instead of Google colab as it works with python 3.8. Since Google colab works with higher versions of python, opennyai installation does not work.\n\n| Description               | Link  |\n|---------------------------|-------|\n| Run Inference          | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1rNA6XVyD-GCTd0YtosjiKON_p9bGuVwz) |\n\nVisualization of outputs\n-----------------------\nWe encourage users to use [our webapp](https://summarizer-fer6v2lowq-uc.a.run.app/) for visualizing the results for a\njudgment of your choice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennyai%2Fopennyai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennyai%2Fopennyai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennyai%2Fopennyai/lists"}