Update LLM_automation_Groq.py
Browse files- LLM_automation_Groq.py +29 -9
LLM_automation_Groq.py
CHANGED
@@ -104,18 +104,38 @@ def create_data(description):
|
|
104 |
for i in range(len(dj2)):
|
105 |
words = dj2[i].split(";") # Splitting at the semicolon delimiter
|
106 |
#print(f"Date: {words[0]}")
|
107 |
-
|
|
|
|
|
|
|
108 |
|
109 |
#print(f"Time: {words[1]}")
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
112 |
#print(f"Casualities: {words[2]}")
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
#### Probable type of final dataframe:
|
121 |
df2["Accident Date"]=Date
|
|
|
104 |
for i in range(len(dj2)):
|
105 |
words = dj2[i].split(";") # Splitting at the semicolon delimiter
|
106 |
#print(f"Date: {words[0]}")
|
107 |
+
try:
|
108 |
+
Date.append(words[0])
|
109 |
+
except:
|
110 |
+
Date.append("Could not extract date")
|
111 |
|
112 |
#print(f"Time: {words[1]}")
|
113 |
+
try:
|
114 |
+
Time.append(words[1])
|
115 |
+
except:
|
116 |
+
Time.append("Could not extract time")
|
117 |
+
|
118 |
#print(f"Casualities: {words[2]}")
|
119 |
+
try:
|
120 |
+
Killed.append(words[2])
|
121 |
+
except:
|
122 |
+
Killed.append("Could not extract killed")
|
123 |
+
try:
|
124 |
+
Injured.append(words[3])
|
125 |
+
except:
|
126 |
+
Injured.append("Could not extract injured")
|
127 |
+
try:
|
128 |
+
Location.append(words[4])
|
129 |
+
except:
|
130 |
+
Location.append("Could not extract location")
|
131 |
+
try:
|
132 |
+
Road_Characteristic.append(words[5])
|
133 |
+
except:
|
134 |
+
Road_Characteristic.append("Could not extract road characteristic")
|
135 |
+
try:
|
136 |
+
Pedestrian_Involved.append(words[6])
|
137 |
+
except:
|
138 |
+
Pedestrian_Involved.append("Could not extract pedestrian involved")
|
139 |
|
140 |
#### Probable type of final dataframe:
|
141 |
df2["Accident Date"]=Date
|