Skip to main content

Documentation 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.

The get_csv method exports the argument graph as a pandas DataFrame, giving you a flat, tabular view of the proposition pairs and their relationships. This makes it straightforward to feed xAIF data directly into machine learning or NLP pipelines — for example, training a binary argument relation classifier or building a dataset for fine-tuning a language model on inference detection.

The Two Export Modes

get_csv accepts a single relation_type argument that controls which node types are used to form proposition pairs.

"argument-relation"

Traverses the RA, CA, and MA relation nodes to identify pairs of I-nodes (propositions) that are directly connected by an argument relation. The relation column contains the text of the relation node ("Default Inference", "Default Conflict", or "Default Rephrase"). All I-nodes in the graph are also combined into pairs without a relation, and those unrelated pairs are appended with relation="None". This produces a complete pairwise matrix over propositions, useful for training binary or multi-class classifiers.
df = aif.get_csv("argument-relation")

"locution"

Traverses the YA nodes to identify pairs of L-nodes (raw locutions) mapped to I-nodes (their semantic propositions). Each row connects an L-node on the left with the I-node it illocutes on the right, with the YA-node’s text in the relation column.
df = aif.get_csv("locution")

DataFrame Schema

Both modes return a DataFrame with the same five columns:
ColumnDescription
proposition1_idNode ID of the first proposition (I-node or L-node, depending on mode)
proposition1_textText content of the first proposition
proposition2_idNode ID of the second proposition (I-node, for both modes)
proposition2_textText content of the second proposition
relationRelation type string, e.g. "Default Inference", "Default Conflict", "Default Rephrase", or "None"

Full Example

from xaif import AIF

# Build a small argument graph from scratch
aif = AIF("First Sentence. ")
aif.add_component(component_type="locution", text="Second Sentence.", speaker="Default Speaker")
aif.add_component(component_type="proposition", Lnode_ID=0, proposition="First sentence.")
aif.add_component(component_type="proposition", Lnode_ID=1, proposition="Second sentence.")
aif.add_component(component_type="argument_relation", relation_type="RA", iNode_ID2=2, iNode_ID1=4)

# Export proposition pairs with their argument relations
df_args = aif.get_csv("argument-relation")
print(df_args)
#    proposition1_id  proposition1_text  proposition2_id  proposition2_text          relation
# 0                4  Second sentence.                 2   First sentence.  Default Inference
# 1                2   First sentence.                 4  Second sentence.               None

# Export locution-to-proposition pairs via YA nodes
df_locs = aif.get_csv("locution")
print(df_locs)
#    proposition1_id                proposition1_text  proposition2_id  proposition2_text             relation
# 0                0            First Sentence.                      2   First sentence.  Default Illocuting
# 1                1           Second Sentence.                      4  Second sentence.  Default Illocuting
For both "argument-relation" and "locution" modes, get_csv always appends every possible ordered pair of nodes that does not already appear as a related pair, and marks those rows with relation="None". For "argument-relation" mode this means every unrelated ordered I-node pair is included; for "locution" mode every unrelated ordered L-node pair is included. This design choice means you do not need to generate negative examples separately — the DataFrame already contains both related and unrelated pairs, which is useful for training binary classifiers. To work only with proposition pairs that have an explicit relation, filter the DataFrame after export:
related = df_args[df_args["relation"] != "None"]
print(related)
#    proposition1_id proposition1_text  proposition2_id proposition2_text           relation
# 0                4  Second sentence.                2   First sentence.  Default Inference
get_csv requires pandas to be installed. pandas is included as a dependency of the xaif package, so it is available automatically when you install xAIF via pip install xaif.
For the full method signature, accepted arguments, and edge-case behaviour (such as empty graphs or graphs without edges), see the API reference.

Build docs developers (and LLMs) love