metadata
language:
- fa
license: other
multilingual: false
pretty_name: encrypted_legal_dataset
task_categories:
- other
task_ids: []
source_datasets: []
dataset_info:
features:
- name: AnonymizedJudge_text
dtype: string
- name: AnonymizedJSS_text
dtype: string
- name: UniqueTables
dtype: string
- name: UniqueItemArray
dtype: string
- name: JSSType
dtype: string
- name: othersdoc
dtype: string
- name: legal_references
dtype: string
splits:
- name: train
num_bytes: 275010760
num_examples: 9404
download_size: 275143859
dataset_size: 275010760
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
ara_v7
ara_v7 is a dataset where the text column has been encrypted with AES-GCM (AES-256)
to preserve privacy while still allowing distribution.
Dataset Description
- Columns:
score: floating-point metadata valuetext: Base64-encoded string containing AES-GCM encrypted text
- Encryption:
- AES-256 in GCM mode
Usage
You can load the dataset using the 🤗 Datasets library:
import base64
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from datasets import load_dataset
# 🔑 Replace this with the Base64 key provided securely
key_b64 = "PASTE-YOUR-KEY-HERE"
key = base64.b64decode(key_b64)
aesgcm = AESGCM(key)
def decrypt(token: str) -> str:
data = base64.b64decode(token.encode())
nonce, ciphertext = data[:12], data[12:]
return aesgcm.decrypt(nonce, ciphertext, None).decode()
# Load dataset
dataset = load_dataset("QomSSLab/ara_v7")
# Decrypt rows
dataset = dataset.map(lambda x: {key: decrypt(x[key]) for key in ['AnonymizedJudge_text','AnonymizedJSS_text', 'UniqueTables', 'UniqueItemArray','JSSType','othersdoc']})