This page walks you through everything you need to go from a blank environment to a working xAIF argument graph. You will install theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/arg-tech/xaif/llms.txt
Use this file to discover all available pages before exploring further.
xaif package, import the AIF class, build a graph by adding locutions, propositions, and argument relations step by step, and finally export the resulting structure to a pandas DataFrame. Two complete, runnable examples are provided: one that starts from plain text and one that loads a pre-existing xAIF JSON object.
Installation
Example 1: Initialise from plain text
TheAIF constructor accepts a plain-text string. When given a string, it automatically creates the initial L-node (locution node) and registers a default speaker, giving you a minimal but valid xAIF structure to build on. You can then call add_component() repeatedly to attach more locutions, derive propositional I-nodes from them, and wire up argument relations.
Understanding the output
aif.xaif is a Python dictionary that mirrors the canonical xAIF JSON structure:
nodes list contains every L-node, I-node, YA-node, and RA/CA/MA-node added so far. Each edge in edges records a directed fromID → toID connection. The locutions list maps each L-node to the personID of its speaker in participants. The text field is an object with a txt key holding the HTML-annotated source text, and ova holds any OVA-tool metadata (an empty object for programmatically constructed graphs).
aif.get_csv("argument-relation") returns a pandas DataFrame with one row per ordered proposition pair and the following columns:
| Column | Description |
|---|---|
proposition1_id | Node ID of the source I-node |
proposition1_text | Text of the source proposition |
proposition2_id | Node ID of the target I-node |
proposition2_text | Text of the target proposition |
relation | Relation label (RA, CA, MA) or None if no relation exists |
relation = "None", giving downstream classifiers a ready-made positive/negative training set.
aif.get_csv("locution") returns the same five-column DataFrame but for L-node ↔ I-node pairs mediated by YA-nodes, with relation holding the YA-node text (e.g., "Default Illocuting").
Example 2: Initialise from an existing xAIF JSON
If you already have a JSON object conforming to the xAIF schema — for example, output from another arg-tech module — pass it directly to theAIF constructor. The object is stored as-is and all add_component / get_csv methods become available immediately.
Next steps
Now that you have a working graph, explore the rest of the documentation to go deeper:- xAIF Format Overview — complete reference for the JSON schema, all top-level keys, and the optional extension fields used by OVA, PropositionClassifier, and other arg-tech tools.
- AIF Class API — full method reference for
AIF, includingadd_component,get_csv,get_speaker,is_json_aif_dialog, and internal helpers.
