File size: 2,161 Bytes
6f5156a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e511b5
 
 
6f5156a
 
 
 
 
 
 
 
2e511b5
 
 
 
 
 
 
6f5156a
 
 
 
 
 
2e511b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f5156a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[build-system]
requires = ["setuptools>=68.0", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[project]
name = "legex"
version = "0.1.0"
description = "Extract structured data from legal decisions with LLMs."
requires-python = ">=3.11"
dependencies = [
    "pydantic>=2.0",
    "pydantic-settings>=2.0",
    "requests>=2.32",
    "datasets>=2.0",
    "huggingface-hub>=0.24",
    "pandas>=2.0",
    "pyarrow>=15.0",
    "python-dotenv>=1.2.2",
    "openpyxl>=3.1",
    "pdfplumber>=0.11",
    "pypdf>=6.10.2",
    "litellm[google]>=1.50",
    "fpdf2>=2.8",
    "beautifulsoup4>=4.12",
    "lxml>=5.0",
    "pyyaml>=6.0",
    "playwright>=1.60.0",
    "scipy>=1.11",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.0",
    "pytest-asyncio>=0.23",
    "ruff>=0.4",
]
# Figures: legex-plots and scripts/appendix_frequencies.py need matplotlib,
# scripts/diversity_stats.py additionally needs wordcloud
# (or run with `uv run --with wordcloud ...`).
plots = [
    "matplotlib>=3.8",
    "wordcloud>=1.9",
]

[project.scripts]
legex-run = "legex.main:main"
legex-classify = "legex.inference:main"
legex-evaluate = "legex.evaluation:main"
legex-harvey-ingest = "legex.harvey:main"
legex-india-extract = "legex.scrapers.in_:_extract_cli"

# Full-text acquisition
legex-build-fulltext = "legex.fulltext.build_full_text:main"
legex-render-fulltext = "legex.fulltext.render_full_text:main"
# Evaluation & analysis
legex-analysis = "legex.analysis.aggregate:main"
legex-analysis-report = "legex.analysis.report:main"
legex-iaa = "legex.analysis.iaa:main"
legex-quant-results = "legex.analysis.quant_results:main"
legex-plots = "legex.analysis.plots:main"
legex-goldenset-quality = "legex.analysis.goldenset_quality:main"
# Refusal cleaning
legex-refusals-scan = "legex.evaluation.cleaning:scan_main"
legex-refusals-apply = "legex.evaluation.cleaning:apply_main"

[tool.setuptools.packages.find]
include = ["legex*"]

[tool.ruff]
line-length = 100

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"

[dependency-groups]
dev = [
    "matplotlib>=3.10.9",
    "pytest>=9.0.2",
    "pytest-asyncio>=1.3.0",
    "ruff>=0.15.8",
]