process_mining / pm4py /examples /declare_simple.py
linpershey's picture
Add 'pm4py/' from commit '80970016c5e1e79af7c37df0dd88e17587fe7bcf'
b4ba3ec
raw
history blame
731 Bytes
import pm4py
def execute_script():
"""
Example script to discover a DECLARE model from an event log,
obtain its textual (LLM) abstraction, and perform conformance checking.
"""
log = pm4py.read_xes("../tests/input_data/receipt.xes")
declare_model = pm4py.discover_declare(log)
print(declare_model)
# prints a textual abstraction of the declare model that can be provided to GPT
text_abstr = pm4py.llm.abstract_declare(declare_model)
print(text_abstr)
# provides conformance checking based on the DECLARE model
conf_result = pm4py.conformance_declare(log, declare_model, return_diagnostics_dataframe=True)
print(conf_result)
if __name__ == "__main__":
execute_script()