Update app.py
Browse files
app.py
CHANGED
|
@@ -155,6 +155,30 @@ def split_and_search(text:str):
|
|
| 155 |
for each in plants:
|
| 156 |
sp=search_full_plant_information(each.strip()).replace('```json','').replace('```','').split('---')[0]+",\n" #.split('**Sponsored**')[0].split('**Sponsor**')[0]
|
| 157 |
#yield sp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
all_data+=sp
|
| 159 |
time.sleep(1)
|
| 160 |
return all_data
|
|
|
|
| 155 |
for each in plants:
|
| 156 |
sp=search_full_plant_information(each.strip()).replace('```json','').replace('```','').split('---')[0]+",\n" #.split('**Sponsored**')[0].split('**Sponsor**')[0]
|
| 157 |
#yield sp
|
| 158 |
+
if len(sp) < 10:
|
| 159 |
+
emptydata="{"+f'''
|
| 160 |
+
"Name": "No data for {plant_name}",
|
| 161 |
+
"Scientific Name": "",
|
| 162 |
+
"Alternate Names": "",
|
| 163 |
+
"Description": "",
|
| 164 |
+
"Plant Family": "",
|
| 165 |
+
"Origin": "",
|
| 166 |
+
"Growth Habitat": "",
|
| 167 |
+
"Active Components": "",
|
| 168 |
+
"Treatable Conditions": "",
|
| 169 |
+
"Preparation Methods": "",
|
| 170 |
+
"Dosage": "",
|
| 171 |
+
"Duration": "",
|
| 172 |
+
"Contraindications": "",
|
| 173 |
+
"Side Effects": "",
|
| 174 |
+
"Interactions": "",
|
| 175 |
+
"Part Used": "",
|
| 176 |
+
"Harvesting Time": "",
|
| 177 |
+
"Storage Tips": "",
|
| 178 |
+
"Images": "",
|
| 179 |
+
"Related Videos": "",
|
| 180 |
+
"Sources": ""'''+"}"
|
| 181 |
+
sp=emptydata#f"No data Found for {plant_name}!"
|
| 182 |
all_data+=sp
|
| 183 |
time.sleep(1)
|
| 184 |
return all_data
|