-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataset_classification.py
More file actions
34 lines (29 loc) · 1.06 KB
/
Copy pathdataset_classification.py
File metadata and controls
34 lines (29 loc) · 1.06 KB
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
import pandas as pd
# Define the intents dictionary
intents = {
"greetings": {
"patterns": ["hi", "hello", "hey"],
"responses": ["hello sir, how are you?", "welcome back sir", "Good day, sir"]
},
"application": {
"patterns": ["open", "can you open", "start"],
"responses": ["sure sir", "working on it sir", "on it sir", "certainly initiating"]
},
"how": {
"patterns": ["how are you doing", "how are you jarvis", "are you there"],
"responses": ["Great! sir", "I'm doing well, thank you!", "Fantastic sir"]
},
# Add more intents as needed
}
# Create lists to store patterns and intents
patterns = []
intents_list = []
# Extract patterns and intents from the intents dictionary
for intent, data in intents.items():
for pattern in data['patterns']:
patterns.append(pattern)
intents_list.append(intent)
# Create a DataFrame to represent the dataset
dataset = pd.DataFrame({'Pattern': patterns, 'Intent': intents_list})
# Display the dataset
print(dataset)