Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/hotfixes' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Apr 1, 2024
2 parents a6ba08e + ca12c16 commit d5f12e7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pm4py/algo/querying/llm/abstractions/declare_to_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ def get_model_description():
return "".join(ret)


def get_model_implementation():
implementation = "A DECLARE model in pm4py is expressed as a Python dictionary containing the following keys:\n"
implementation += "'" + "', '".join([EXISTENCE, ABSENCE, EXACTLY_ONE, INIT, RESPONDED_EXISTENCE, COEXISTENCE, RESPONSE, PRECEDENCE, SUCCESSION, ALTRESPONSE, ALTPRECEDENCE, ALTSUCCESSION, CHAINRESPONSE, CHAINPRECEDENCE, CHAINSUCCESSION, NONCOEXISTENCE, NONSUCCESSION, NONCHAINSUCCESSION]) + "'\n"
implementation += "For the keys {'"+"', '".join([EXISTENCE, ABSENCE, EXACTLY_ONE, INIT])+"'}, the value is a dictionary containing as keys the activities and as corresponding value the support (please set it to 1.0) and confidence of the declarative rule.\n"
implementation += "For the keys {'"+"', '".join([RESPONDED_EXISTENCE, COEXISTENCE, RESPONSE, PRECEDENCE, SUCCESSION, ALTRESPONSE, ALTPRECEDENCE, ALTSUCCESSION, CHAINRESPONSE, CHAINPRECEDENCE, CHAINSUCCESSION, NONCOEXISTENCE, NONSUCCESSION, NONCHAINSUCCESSION])+"'}, the value is a dictionary containing as keys the activities and as corresponding value the support (please set it to 1.0) and confidence of the declarative rule.\n"

return implementation


def apply(declare: Dict[str, Dict[Any, Dict[str, int]]], parameters: Optional[Dict[Any, Any]] = None) -> str:
"""
Gets a textual abstraction of a DECLARE model
Expand Down
8 changes: 8 additions & 0 deletions pm4py/algo/querying/llm/abstractions/logske_to_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def get_model_description():
return description


def get_model_implementation():
implementation = "The Log Skeleton is expressed as a Python dictionary containing the keys: 'equivalence', 'always_before', 'always_after', 'never_together', 'activ_freq', 'directly_follows'.\n"
implementation += "The values associated to 'equivalence', 'always_before', 'always_after', 'never_together', 'directly_follows' are sets containing the couples of activities satisfying the constraints.\n"
implementation += "The value associated to 'activ_freq' is a dictionary whose keys are the activities, and the values are the allowed number of occurrences for the given activity. For example, {'A': {0, 1}, 'B': {1, 2}} tells that A could occur 0 or 1 time inside a case, while B could occur 1 or 2 times.\n"

return implementation


def apply(lsk: Dict[str, Any], parameters: Optional[Dict[Any, Any]] = None) -> str:
if parameters is None:
parameters = {}
Expand Down
5 changes: 5 additions & 0 deletions pm4py/algo/querying/llm/abstractions/tempprofile_to_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def get_model_description():
return description


def get_model_implementation():
implementation = "The temporal profile is expressed as a Python dictionary associating to some couples of activities the average and the standard deviation of the times. Example: {('A', 'B'): (86400, 3600), ('B', 'C'): (3600, 3600)} indicates that the average time between A and B is 1 day, while the standard deviation is 1 hour. On the other hand, the average time between B and C is 1 hour, while the standard deviation is 1 hour."
return implementation


def apply(temporal_profile: Dict[Tuple[str, str], Tuple[float, float]],
parameters: Optional[Dict[Any, Any]] = None) -> str:
"""
Expand Down

0 comments on commit d5f12e7

Please sign in to comment.