-
Notifications
You must be signed in to change notification settings - Fork 0
/
Information_management.py
62 lines (53 loc) · 1.99 KB
/
Information_management.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Define information management rules and corresponding actions
information_rules = {
"rule1": {
"keywords": ["document", "file", "report"],
"action": "Organize the document in the appropriate category."
},
"rule2": {
"keywords": ["article", "publication", "journal"],
"action": "Catalog the article under the relevant topic or subject."
},
"rule3": {
"keywords": ["data", "record", "dataset"],
"action": "Store and manage the data in the specified database or repository."
},
"rule4": {
"keywords": ["knowledge base", "information repository"],
"action": "Update and maintain the knowledge base with the latest information."
}
}
def manage_information(input_text):
"""
Manage information based on predefined rules and user input.
Args:
input_text (str): User's input text describing the information.
Returns:
str: Recommended action for managing the information.
"""
for rule_name, rule_data in information_rules.items():
keywords = rule_data["keywords"]
if any(keyword in input_text.lower() for keyword in keywords):
return rule_data["action"]
# Default action if no rules match
return "Unable to determine a management recommendation."
def get_user_input():
"""
Prompt user to enter a description of the information.
Returns:
str: User's input text describing the information.
"""
input_text = input("Please describe the information you want to manage: ")
return input_text
def handle_information_management():
"""
Handle information management based on user input and expert system rules.
"""
print("Welcome to the Information Management Expert System")
input_text = get_user_input()
action = manage_information(input_text)
print(f"Based on your input, the recommended action is: {action}")
def main():
handle_information_management()
if __name__ == "__main__":
main()