Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ValueError
Message:      Expected object or value
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1779, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 237, in _generate_tables
                  examples = [ujson_loads(line) for line in batch.splitlines()]
                              ^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/utils/json.py", line 20, in ujson_loads
                  return pd.io.json.ujson_loads(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              ValueError: Expected object or value
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 882, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 943, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1832, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

document_id
string
year
int64
text
string
total_entities
int64
entities
list
1950_1_1008_1018_EN
1,950
Patntalal Jankid-:u v, Mohanlal and Another, Pata1tjali S11stri J. !950 Deo, 21. SUPREME COURT REPORTS [1950] of section 14, it seems to me, they would be bringing themselves under the bar of section 18 (2). The respondents cannot therefore claim that the loss of the goods was explosion damage within the meanin...
79
[ { "text": "Patntalal Jankid-:u", "label": "OTHER_PERSON", "start_char": 0, "end_char": 19, "source": "ner", "metadata": { "in_sentence": "Patntalal Jankid-:u\n\nv, Mohanlal and\n\nAnother,\n\nPata1tjali S11stri J.\n\n!" } }, { "text": "S11", "label": "PROVISION", "s...
1950_1_15_25_EN
1,950
S.C.R. SUPREME COURT REPORTS RAM KRISHNA RAMNATH AGARWAL OF KAMPTEE v. SECRETARY, MUNICIPAL COMMITTEE, KAMP TEE. UNION OF INDIA AND GOVERNMENT OF MAD HY A PRADESH : INTERVENERS. [SHRI HARILAL KANIA C.J., SAIYID FAZL ALI, PATANJALI SASTRI, MEHR CHAND MAHAJAN, MuKHERJEA, and S.R. DAS JJ.] Govl!rnment of India A...
106
[ { "text": "RAM KRISHNA RAMNATH AGARWAL\n\nOF KAMPTEE", "label": "PETITIONER", "start_char": 31, "end_char": 70, "source": "metadata", "metadata": { "canonical_name": "RAM KRISHNA RAMNATH AGARWAL OF KAMPTEE", "offset_not_found": false } }, { "text": "SECRETARY, MUNICIP...
1950_1_25_29_EN
1,950
S.C.R. SUPREME COUR1' REPORTS 25 the octroi duty under the Municipal Act continues to be valid. On this point again the appellant's argument is that the levy of a duty at any stage of the manufacture of bidis out of tobacco would be the levy of the excise duty and therefore those provisions were contrary to the provi...
69
[ { "text": "Section 66", "label": "PROVISION", "start_char": 698, "end_char": 708, "source": "regex", "metadata": { "statute": null } }, { "text": "Rajinder Narain", "label": "LAWYER", "start_char": 909, "end_char": 924, "source": "ner", "metadata": { ...
1950_1_30_63_EN
1,950
"l[areh li.\n\nSUPREME COURT REPORTS\n\nABDULLA AHMED v.\n\nANIMENDRA KISSEN MITTER.\n\n[SHRI HARILA(...TRUNCATED)
112
[{"text":"ABDULLA AHMED","label":"PETITIONER","start_char":35,"end_char":48,"source":"metadata","met(...TRUNCATED)
1950_1_335_390_EN
1,950
"S.C.R.\n\nSUPREME COURT REPORTS 335\n\nCOMMISSIONER OF INCOME-TAX, BOMBAY\n\nAHMEDBHAI UMARBHAI & C(...TRUNCATED)
308
[{"text":"335\n\nCOMMISSIONER OF INCOME-TAX, BOMBAY","label":"PETITIONER","start_char":30,"end_char"(...TRUNCATED)
1950_1_391_434_EN
1,950
"S.C.R.\n\n. SUPREME COURT REPORTS 391\n\nNANALAL ZAVER AND ANOTHER\n\nBOMBAY LIFE ASSURANCE CO. LTD(...TRUNCATED)
186
[{"text":"391\n\nNANALAL ZAVER AND ANOTHER","label":"PETITIONER","start_char":32,"end_char":62,"sour(...TRUNCATED)
1950_1_435_452_EN
1,950
"S.~.R.\n\nSUPREME COURT REPORTS\n\nCOMMISSIONER OF AGRICULTURAL\n\nINCOME-TAX, BENGAL V.\n\nSRI KES(...TRUNCATED)
130
[{"text":"COMMISSIONER OF AGRICULTURAL\n\nINCOME-TAX, BENGAL","label":"PETITIONER","start_char":31,"(...TRUNCATED)
1950_1_453_459_EN
1,950
"S.C.R.\n\nSUPREME COURT REPORTS 453\n\nPRITAM SINGH\n\nTHE STATE\n\n[SAIYID FAZL ALI, PATANJALI SAS(...TRUNCATED)
65
[{"text":"453\n\nPRITAM SINGH","label":"PETITIONER","start_char":30,"end_char":47,"source":"metadata(...TRUNCATED)
1950_1_459_519_EN
1,950
"~.C.R.\n\nSUPREME COURT REPORTS 459\n\na sound basis for invoking the discretion of this Court in g(...TRUNCATED)
321
[{"text":"S. P. Varma","label":"LAWYER","start_char":640,"end_char":651,"source":"ner","metadata":{"(...TRUNCATED)
1950_1_519_536_EN
1,950
"S.C.R.\n\nSUPREME COURT REPORTS 519\n\nEven assuming for argument's sake that we have got jurisdict(...TRUNCATED)
147
[{"text":"article 136","label":"PROVISION","start_char":105,"end_char":116,"source":"regex","metadat(...TRUNCATED)
End of preview.

indian-sc-judgments-ner-silver

33,000 Indian Supreme Court judgments annotated with silver NER labels.

Covers 1950–2024. Each document contains the full cleaned judgment text and all automatically generated entity spans with verified character offsets. Designed as the training corpus for evolawyer/inlegalbert-sc-ner-silver.

Usage

Load with the HuggingFace datasets library:

from datasets import load_dataset

ds = load_dataset("evolawyer/indian-sc-judgments-ner-silver")
doc = ds["train"][0]

text = doc["text"]
for entity in doc["entities"]:
    span = text[entity["start_char"]:entity["end_char"]]
    assert span == entity["text"]          # always holds
    print(f"{entity['label']:<20} {span}")

Or load a specific year directly from the JSONL files:

import json
from pathlib import Path

def iter_year(data_root: str, year: int):
    path = Path(data_root) / f"{year}.jsonl"
    with open(path, encoding="utf-8") as f:
        for line in f:
            yield json.loads(line)

for doc in iter_year("data", 2019):
    print(doc["document_id"], len(doc["entities"]), "entities")

Coverage

Property Value
Documents ~33,000 (25 test-set files withheld — see below)
Years 1950–2024
Source Supreme Court of India
Language English
Annotation Silver (automatic)
Entity types 13

Entity Types

Label Description Primary Source
STATUTE Indian Act, Code, or Constitutional document Regex + gazetteer
PROVISION Section, article, rule, or schedule Regex
CASE_CITATION Reporter citation for a prior case Regex
JUDGE Presiding judge name Header projection
PETITIONER Appellant / petitioner party Header projection
RESPONDENT Respondent party Header projection
LAWYER Appearing counsel OpenNyAI NER
COURT Court name mentioned in the judgment OpenNyAI NER
ORG Organisation other than a court OpenNyAI NER
GPE Geopolitical entity OpenNyAI NER
DATE Date mentioned in the judgment OpenNyAI NER
OTHER_PERSON Named person not in any other category OpenNyAI NER
WITNESS Witness name OpenNyAI NER

Document Schema

Each file is a self-contained JSON document with the full judgment text embedded:

{
  "document_id": "2019_10_961_995_EN",
  "year": 2019,
  "text": "REPORTABLE\n\nIN THE SUPREME COURT OF INDIA\n\nCIVIL APPELLATE JURISDICTION\n...",
  "total_entities": 118,
  "entities": [
    {
      "text": "(2017) 15 SCC 720",
      "label": "CASE_CITATION",
      "start_char": 4821,
      "end_char": 4838,
      "source": "regex",
      "metadata": {}
    },
    {
      "text": "Consumer Protection Act, 1986",
      "label": "STATUTE",
      "start_char": 1204,
      "end_char": 1233,
      "source": "gazetteer",
      "metadata": {
        "canonical_name": "Consumer Protection Act, 1986",
        "act_id": "A1986-68"
      }
    }
  ]
}

text is the full cleaned judgment text (OCR-cleaned). All start_char / end_char offsets are character positions into this field.

end_char is exclusive (Python slice convention): doc["text"][entity["start_char"]:entity["end_char"]] == entity["text"] holds for every entity in every document.

source field values: regex · ner · header · gazetteer

Withheld Test Set

The 25 files listed in test_set_ids.json are excluded from this dataset, stratified across eras:

Era Files
1950–1969 5
1970–1989 5
1990–2009 8
2010–2024 7

These files are reserved for final evaluation of the gold-annotated v1.0 model and have never been seen during training or validation.

Annotation Pipeline

Silver labels were produced by four automatic annotation stages merged into a single authoritative span set per document:

  1. Metadata + header projection — case metadata JSONs (party names, judge names) mapped to character offsets via RapidFuzz fuzzy match for parties and strict regex for judges; confined to the document header zone (<1,500 chars). Produces JUDGE, PETITIONER, RESPONDENT.
  2. Regex extraction — 14-pattern case citation extractor; statute and provision extractor with hierarchical linking. Produces CASE_CITATION, STATUTE, PROVISION.
  3. OpenNyAI transformer NERen_legal_ner_trf (InLegalBERT-based), run on GPU with character offset correction applied to align spans against the cleaned text. Produces LAWYER, COURT, ORG, GPE, DATE, OTHER_PERSON, WITNESS.
  4. Gazetteer enrichment — full-corpus fuzzy matching against an alias dictionary built from 858 Central Act JSONs. Adds and confirms STATUTE spans missed by regex.

Merge authority rules: metadata owns the header zone for party/judge labels; regex overrides NER for overlapping citation and statute spans. All entity offsets verified: doc["text"][start_char:end_char] == entity["text"] passes for 100% of entities.

Related

License

Apache 2.0

Downloads last month
7