Spaces:
Running
Running
|
Download toolkit/README.md from Giuliocc/tacitus-source-lab: direct link, hf CLI and curl.
- Browser
- Download file 7.12 kB
-
https://huggingface.co/spaces/Giuliocc/tacitus-source-lab/resolve/main/toolkit/README.md
- Command line
-
hf download hf://spaces/Giuliocc/tacitus-source-lab/toolkit/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Giuliocc/tacitus-source-lab/resolve/main/toolkit/README.md
7.12 kB
| # TACITUS Source Toolkit | |
| A browser research release and local CPU baselines for three English-language source analysis tasks. Evidence compares a claim with a supplied passage. Actors finds typed mentions. Events proposes trigger spans for Attack, Arrest, Protest, and Request. Events shares the upstream GLiNER checkpoint with Actors during this baseline phase. Its trigger proposals need review, and the default app leaves participant extraction disabled. Every event's assertion status is unknown. | |
| ## Run locally | |
| Use Python 3.12. The first run downloads the pinned public checkpoints in `tacitus_nlp/sources.json`; allow approximately 2 GB of free model storage in addition to the Python environment. | |
| ```bash | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install torch==2.8.0 --index-url https://download.pytorch.org/whl/cpu | |
| pip install -r requirements.txt | |
| OMP_NUM_THREADS=4 python app.py | |
| ``` | |
| Open the local URL displayed by Gradio. The three tabs accept user text, display the model revision, and export response JSON in the browser. Actor and event views highlight source spans. The earlier saved-sample explorer is available by opening `space/saved-examples.html`. The new browser workbench uses the published model files. | |
| ```python | |
| from tacitus_nlp import Actors, Evidence, Events | |
| source = "Residents protested on Monday. Council members scheduled a vote for Wednesday." | |
| result = Evidence.from_pretrained().check(passage=source, claim="The council has voted.") | |
| actors = Actors.from_pretrained().extract(source) | |
| events = Events.from_pretrained().extract(source) | |
| ``` | |
| Offsets are Python Unicode code-point offsets with an exclusive end. Evidence shows uncalibrated class scores and requires review on every response. Actor mentions have no canonical identities. To experiment with target-conditioned event arguments, pass `role_schema={event_type: {role: definition}}` to `Events.from_pretrained()`. Supply roles verified against the upstream schema. The second pass marks the specific trigger occurrence and maps proposed role spans back to the original text. | |
| ## Verify and reproduce | |
| ```bash | |
| python -m unittest discover -s tests -v | |
| OMP_NUM_THREADS=4 python diagnostics.py | |
| OMP_NUM_THREADS=4 python evidence_pilot.py /path/to/new/scratch-checkpoint | |
| ``` | |
| `baseline-results.json` records actual predictions for the app examples. `diagnostic-results.json` compares pinned NLI and DOXA on three synthetic examples. For DOXA, obtain and review `verifier.py` and `adapter.json` from the pinned verifier revision in the source manifest, install ONNX Runtime, and pass their local directory as `--doxa-folder` to `diagnostics.py`. The comparison maps DOXA's `insufficient_context` to `insufficient_information` and leaves the source artifact intact. These cases are for diagnostics. A new independently reviewed benchmark and a SciFact rehydration check remain open. | |
| `evidence-pilot-results.json` records one CPU training step on three original diagnostic examples with a frozen encoder. The classifier changed and the saved checkpoint preserved the label mapping and logits on reload. This pilot checks compatibility. Its checkpoint is excluded from the archive, and its training loss is unsuitable as an estimate of accuracy. No paid compute was used. | |
| ## Dataset conversion | |
| ```bash | |
| python -m tacitus_nlp.data evidence evidence.jsonl train=vitaminc-train.jsonl dev=vitaminc-dev.jsonl | |
| python -m tacitus_nlp.data actors actors.jsonl train=few-nerd-train.jsonl dev=few-nerd-dev.jsonl --labels few-nerd-fine-labels.json | |
| python -m tacitus_nlp.data events events.jsonl train=maven-train.jsonl dev=maven-valid.jsonl | |
| ``` | |
| Inputs are original JSONL or JSONL exported from the pinned upstream dataset. For Few-NERD, export the supervised configuration and a JSON array of fine-label names in the same order as the dataset feature metadata. Its character offsets refer to a single-space reconstruction. Group audits compare normalized token sequences across splits. Article-level disjointness cannot be verified from the supervised token format. | |
| The audit rejects records with bad labels or offsets and partitions sharing a recorded group. It preserves a prior successful output when a run fails. A failed audit reports the file and line for investigation. The converters have unit coverage. The smoke test converted 25 VitaminC development records and 25 Few-NERD supervised validation records, yielding 28 mapped actor spans. MAVEN-ARG was exercised with synthetic records. Full archive conversion, conflict resolution, dataset coverage counts, and independent data review remain pending. | |
| - VitaminC supplies evidence labels and recovery identifiers under its listed CC BY-SA 3.0 terms. The canary is omitted. [VitaminC](https://huggingface.co/datasets/tals/vitaminc) | |
| - Few-NERD supplies the supervised fine labels under its listed CC BY-SA 4.0 terms. [Few-NERD](https://huggingface.co/datasets/DFKI-SLT/few-nerd) | |
| - MAVEN-ARG supplies linked trigger and participant spans. Obtain its archive and verify the official role definitions and redistribution terms. Official test argument labels are withheld. [MAVEN-ARG](https://github.com/THU-KEG/MAVEN-Argument) | |
| ## Hugging Face | |
| The [public Source Lab](https://huggingface.co/spaces/Giuliocc/tacitus-source-lab) runs the compact models entirely in the browser. The [TACITUS Source Toolkit collection](https://huggingface.co/collections/Giuliocc/tacitus-source-toolkit-6b0b0d1caaaa15fadc889d78) contains the Space and all six model and dataset repositories. Full neural fine-tuning and independent domain review remain open. The [research roadmap](research/ROADMAP.md) describes the follow-on experiments. | |
| ## v0.2.0 research release | |
| The static Space now runs compact, trained models on new text. The earlier saved examples and higher-capacity local Gradio baselines remain available. The published model cards link to held-out evaluation and dataset manifests. Use `research/REVIEW.md` for the review results and next experiments. | |
| From this directory install `requirements-research.txt`. Arrange the pinned download files as listed in each dataset's provenance. Keep upstream files out of the Space. The following commands reproduce the main release. | |
| ```sh | |
| python -m research.prepare /path/to/corpora /path/to/processed | |
| python -m research.train evidence /path/to/processed /path/to/trained | |
| python -m research.train actors /path/to/processed /path/to/trained | |
| python -m research.train events /path/to/processed /path/to/trained | |
| python -m research.train roles /path/to/processed /path/to/trained | |
| python -m research.event_pipeline /path/to/processed/events /path/to/trained | |
| python -m research.challenges /path/to/challenges | |
| python -m research.challenge_eval /path/to/trained /path/to/challenges /path/to/challenge-evaluation.json | |
| ``` | |
| The optional neural Evidence branch uses `python -m research.neural_evidence /path/to/processed/evidence /path/to/doxa /path/to/trained/neural`. Use the local reviewed DOXA `verifier.py` and `adapter.json` at the pinned source revision. The results apply to their named evaluation partitions. No mature domain quality is assumed. | |