Update LLM_automation_Groq.py
Browse files- LLM_automation_Groq.py +2 -3
LLM_automation_Groq.py
CHANGED
@@ -40,9 +40,8 @@ def create_data(description):
|
|
40 |
df = description
|
41 |
df = df.fillna(0)
|
42 |
dj=[]
|
43 |
-
|
44 |
for i in range(len(df)):
|
45 |
-
dj.append(chain.invoke({"question" : df['
|
46 |
|
47 |
df2=df.copy()
|
48 |
df2['Report Type']=dj
|
@@ -60,7 +59,7 @@ def create_data(description):
|
|
60 |
### Now finding column values using llm:
|
61 |
### A function to invoke the llm. For some reason phi3 doesn't give accurate result sometimes if used directly in dj.append()
|
62 |
def res(i):
|
63 |
-
response=chain.invoke({"question" : df2['Description'][i]+f"""Provide only the answers of the following question seperated by a comma only:
|
64 |
If the news was published on {df2['Publish Date'][i]}, what is the date of accident occurrence? The date must be in Day-Month-Year format. Be careful because publish date and accident occurrence date may or may not be the same. Try to deduce correct accident date,
|
65 |
Time of Accident occured, How many people were killed in the accident in numeric number?,
|
66 |
How many people were injured in the accident in numeric number?,
|
|
|
40 |
df = description
|
41 |
df = df.fillna(0)
|
42 |
dj=[]
|
|
|
43 |
for i in range(len(df)):
|
44 |
+
dj.append(chain.invoke({"question" : df['Description'][i]+" Is the news about road accident? If no, then reply 'General'. Else if the news is about road accident then check if the news is referring to a specific accident incident or accident in general? Answer only in a word: Either specific or general."}))
|
45 |
|
46 |
df2=df.copy()
|
47 |
df2['Report Type']=dj
|
|
|
59 |
### Now finding column values using llm:
|
60 |
### A function to invoke the llm. For some reason phi3 doesn't give accurate result sometimes if used directly in dj.append()
|
61 |
def res(i):
|
62 |
+
response=chain.invoke({"question" : df2['Description'][i]+f"""Provide only the answers of the following question seperated by a comma only and your answers MUST BE IN ENGLISH:
|
63 |
If the news was published on {df2['Publish Date'][i]}, what is the date of accident occurrence? The date must be in Day-Month-Year format. Be careful because publish date and accident occurrence date may or may not be the same. Try to deduce correct accident date,
|
64 |
Time of Accident occured, How many people were killed in the accident in numeric number?,
|
65 |
How many people were injured in the accident in numeric number?,
|