Renard
Renard (Relationship Extraction from NARrative Documents) is a modular library for creating and using custom character networks extraction pipelines. Renard can extract dynamic as well as static character networks. Renard is modular, in the sense that you can easily create a custom extraction pipeline that fits your needs.
Installation
Currently, Renard supports Python>=3.10,<=3.14. You can install the latest version using pip:
pip install renard-pipeline
By default, this pulls the cuda version of pytorch. If you want a CPU-only version of torch you should do:
pip install torch --index-url https://download.pytorch.org/whl/cpu && pip install renard-pipeline
For an AMD rocm version of torch (ROCm 7.1):
pip install torch --index-url https://download.pytorch.org/whl/rocm6.4 && pip install renard-pipeline
Documentation
Documentation, including installation instructions, can be found at https://compnet.github.io/Renard/
If you need local documentation, it can be generated using Sphinx. From the docs directory, make html should create documentation under docs/_build/html.
Interactive Demo
You can check the interactive demo of Renard at HuggingFace. The demo uses the UI integrated in Renard.
Tutorial
Renard's central concept is the Pipeline.A Pipeline is a list of PipelineStep that are run sequentially in order to extract a character graph from a document. Here is a simple example:
from renard.pipeline import Pipeline
from renard.pipeline.tokenization import NLTKTokenizer
from renard.pipeline.ner import NLTKNamedEntityRecognizer
from renard.pipeline.character_unification import GraphRulesCharacterUnifier
from renard.pipeline.graph_extraction import CoOccurrencesGraphExtractor
with open("./my_doc.txt") as f:
text = f.read()
pipeline = Pipeline(
[
NLTKTokenizer(),
NLTKNamedEntityRecognizer(),
GraphRulesCharacterUnifier(min_appearance=10),
CoOccurrencesGraphExtractor(co_occurrences_dist=25)
]
)
out = pipeline(text)
For more information, see renard_tutorial.py, which is a tutorial in the jupytext format. You can open it as a notebook in Jupyter Notebook (or export it as a notebook with jupytext --to ipynb renard-tutorial.py).
Contributing
see the "Contributing" section of the documentation.
Running tests
Renard uses pytest for testing. To launch tests, use the following command :
uv run python -m pytest tests
Alternatively, the project Makefile has a test target:
make test
Expensive tests are disabled by default. These can be run by setting the environment variable RENARD_TEST_SLOW to 1.
Renard UI
Since version 0.7, Renard has a web interface powered by gradio. First, install the additional dependencies:
uv sync --group ui
Then, simply run:
make ui
And open your browser at http://127.0.0.1:7860
How to cite
If you use Renard in your research project, please cite it as follows:
@Article{Amalvy2024,
doi = {10.21105/joss.06574},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {98},
pages = {6574},
author = {Amalvy, A. and Labatut, V. and Dufour, R.},
title = {Renard: A Modular Pipeline for Extracting Character
Networks from Narrative Texts},
journal = {Journal of Open Source Software},
}
We would be happy to hear about your usage of Renard, so don't hesitate to reach out!
Metadata
Release files for renard-pipeline 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| renard_pipeline-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for renard_pipeline-0.7.2-py3-none-any.whl |
Release files / renard_pipeline-0.7.2-py3-none-any.whl
| Download URL | renard_pipeline-0.7.2-py3-none-any.whl |
|---|---|
| Size | 415.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c78fa496b7f5bdef0fee6c1c1ba337753521d234be1560964bc348806f1756be
|
|
BLAKE2b-256 checksum How to use checksums |
c4720aef073cc0f54561258856527bbc76030ae78e40f008fa6f51f62548d11a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for renard-pipeline 0.7.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.