File size: 731 Bytes
8097001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()