postprocess0106.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. from template import xuanxiang
  2. from config import simplemodel
  3. import time
  4. tuliaos=[
  5. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 薄型 0.5小时',
  6. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 薄型 1小时',
  7. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 薄型 1.5小时',
  8. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 薄型 2小时',
  9. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 厚型 2小时',
  10. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 厚型 2.5小时',
  11. '第十七章 油漆、涂料、裱糊工程 17.1 油漆、涂料 17.1.2 金属面油漆 17.1.2.3 防火涂料 金属面防火涂料 厚型 3小时',
  12. ]
  13. tuliao_options=[]
  14. tuliao_letters='ABCDEFG'
  15. for i in range(len(tuliaos)):
  16. tuliao_options.append('给定选项'+tuliao_letters[i]+', 内容为' + tuliaos[i])
  17. import json
  18. with open('nantong_rule', 'r') as f:
  19. content = f.read()
  20. import json
  21. obj=json.loads(content)
  22. from fallback import fallback
  23. def fanghuotuliao(A, #options
  24. B, #data
  25. aiclient,
  26. qwclient,
  27. sfclient,
  28. dw):
  29. options=[]
  30. letters = "ABCDEFGHIJKLMN"
  31. for i in range(len(A)):
  32. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  33. completion = aiclient.chat.completions.create(
  34. model="glm-4.5-air",
  35. #model="Qwen/Qwen3-14B",
  36. messages=[
  37. {"role": "system", "content": "You are a helpful assistant."},
  38. {"role": "user", "content": "问题描述: " + ','.join(options) + "。请问选项中是否有防火涂料相关选项,请回答是或者否"},
  39. ],
  40. extra_body={"thinking": {"type": "disabled"}},
  41. #extra_body={"enable_thinking": False},
  42. )
  43. json_string = completion.choices[0].message.content
  44. print(json_string)
  45. if len(json_string) < 4:
  46. if '是' in json_string:
  47. return True
  48. else:
  49. return False
  50. completion = sfclient.chat.completions.create(
  51. model=simplemodel(),
  52. messages=[
  53. {"role": "system", "content": "You are a helpful assistant.请将最终答案以JSON格式输出"},
  54. {"role": "user", "content": " 给你一段文字如下, " + json_string + ",其中给出了一个是或者否的判断作为结果,请将该最终结果输出"},
  55. ],
  56. extra_body={"thinking": {"type": "disabled"}},
  57. #extra_body={"enable_thinking": False},
  58. )
  59. json_string = completion.choices[0].message.content
  60. print(json_string)
  61. answer=[]
  62. if '否' in json_string:
  63. return False
  64. return True
  65. def fanghuo(A, #options
  66. B, #data
  67. aiclient,
  68. qwclient,
  69. sfclient,
  70. dw):
  71. options=[]
  72. letters = "ABCDEFGHIJKLMN"
  73. for i in range(len(A)):
  74. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  75. completion = aiclient.chat.completions.create(
  76. model="glm-4.5-air",
  77. #model="Qwen/Qwen3-14B",
  78. messages=[
  79. {"role": "system", "content": "You are a helpful assistant."},
  80. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + "。请问工作内容是否提及防火要求,请回答是或者否"},
  81. ],
  82. extra_body={"thinking": {"type": "disabled"}},
  83. #extra_body={"enable_thinking": False},
  84. )
  85. json_string = completion.choices[0].message.content
  86. print(json_string)
  87. if len(json_string) < 4:
  88. if '是' in json_string:
  89. return True
  90. else:
  91. return False
  92. completion = sfclient.chat.completions.create(
  93. model=simplemodel(),
  94. messages=[
  95. {"role": "system", "content": "You are a helpful assistant.请将最终答案以JSON格式输出"},
  96. {"role": "user", "content": " 给你一段文字如下, " + json_string + ",其中给出了一个是或者否的判断作为结果,请将该最终结果输出"},
  97. ],
  98. extra_body={"thinking": {"type": "disabled"}},
  99. #extra_body={"enable_thinking": False},
  100. )
  101. json_string = completion.choices[0].message.content
  102. print(json_string)
  103. answer=[]
  104. if '否' in json_string:
  105. return False
  106. return True
  107. def tuliaofilter(A, #options
  108. B, #data
  109. aiclient,
  110. qwclient,
  111. sfclient,
  112. dw):
  113. completion = aiclient.chat.completions.create(
  114. model="glm-4.5-air",
  115. #model="Qwen/Qwen3-14B",
  116. messages=[
  117. {"role": "system", "content": "You are a helpful assistant."},
  118. {"role": "user", "content": "问题描述: 给定一段涉及防火涂料的工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(tuliao_options) + "。请选出最恰当的选项。请返回类似A或者B或者C这样的结果"},
  119. ],
  120. extra_body={"thinking": {"type": "disabled"}},
  121. #extra_body={"enable_thinking": False},
  122. )
  123. json_string = completion.choices[0].message.content
  124. print(json_string)
  125. if len(json_string) < 4:
  126. if 'A' in json_string:
  127. return tuliaos[0]
  128. if 'B' in json_string:
  129. return tuliaos[1]
  130. if 'C' in json_string:
  131. return tuliaos[2]
  132. if 'D' in json_string:
  133. return tuliaos[3]
  134. if 'E' in json_string:
  135. return tuliaos[4]
  136. if 'F' in json_string:
  137. return tuliaos[5]
  138. if 'G' in json_string:
  139. return tuliaos[6]
  140. completion = sfclient.chat.completions.create(
  141. model=simplemodel(),
  142. messages=[
  143. {"role": "system", "content": "You are a helpful assistant.请将最终答案以JSON格式输出"},
  144. {"role": "user", "content": " 给你一段文字如下, " + json_string + ",其中给出了一个类似于A或者B的字母作为结果,请将该最终结果输出"},
  145. ],
  146. extra_body={"thinking": {"type": "disabled"}},
  147. #extra_body={"enable_thinking": False},
  148. )
  149. json_string = completion.choices[0].message.content
  150. print(json_string)
  151. if 'A' in json_string:
  152. return tuliaos[0]
  153. if 'B' in json_string:
  154. return tuliaos[1]
  155. if 'C' in json_string:
  156. return tuliaos[2]
  157. if 'D' in json_string:
  158. return tuliaos[3]
  159. if 'E' in json_string:
  160. return tuliaos[4]
  161. if 'F' in json_string:
  162. return tuliaos[5]
  163. if 'G' in json_string:
  164. return tuliaos[6]
  165. def aifilter3(A, #options
  166. B, #data
  167. aiclient,
  168. qwclient,
  169. sfclient,
  170. dw):
  171. options=[]
  172. letters = "ABCDEFGHIJKLMN"
  173. for i in range(len(A)):
  174. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  175. time.sleep(5)
  176. completion = aiclient.chat.completions.create(
  177. model="glm-4.5-air",
  178. #model="Qwen/Qwen3-14B",
  179. messages=[
  180. {"role": "system", "content": "You are a helpful assistant."},
  181. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“零星钢构件制作”字样的选项,并且同时选项中有含有“铁件制作”字样的选项,则二者只能选一(并删除另一个),且优先选择出现靠前的选项"},
  182. {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
  183. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(options) + "。请根据处理要求做出处理,并返回结果,删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
  184. ],
  185. extra_body={"thinking": {"type": "disabled"}},
  186. #extra_body={"enable_thinking": False},
  187. )
  188. json_string = completion.choices[0].message.content
  189. print(json_string)
  190. completion = sfclient.chat.completions.create(
  191. model=simplemodel(),
  192. messages=xuanxiang(json_string),
  193. extra_body={"thinking": {"type": "disabled"}},
  194. #extra_body={"enable_thinking": False},
  195. )
  196. json_string = completion.choices[0].message.content
  197. print(json_string)
  198. answer=[]
  199. if 'A' in json_string and len(A) > 0:
  200. answer.append(A[0])
  201. if 'B' in json_string and len(A) > 1:
  202. answer.append(A[1])
  203. if 'C' in json_string and len(A) > 2:
  204. answer.append(A[2])
  205. if 'D' in json_string and len(A) > 3:
  206. answer.append(A[3])
  207. if 'E' in json_string and len(A) > 4:
  208. answer.append(A[4])
  209. if 'F' in json_string and len(A) > 5:
  210. answer.append(A[5])
  211. if 'G' in json_string and len(A) > 6:
  212. answer.append(A[6])
  213. if 'H' in json_string and len(A) > 7:
  214. answer.append(A[7])
  215. if 'I' in json_string and len(A) > 8:
  216. answer.append(A[8])
  217. if 'J' in json_string and len(A) > 9:
  218. answer.append(A[9])
  219. return answer
  220. def aifilter1(A, #options
  221. B, #data
  222. aiclient,
  223. qwclient,
  224. sfclient,
  225. dw):
  226. options=[]
  227. letters = "ABCDEFGHIJKLMN"
  228. for i in range(len(A)):
  229. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  230. completion = aiclient.chat.completions.create(
  231. model="glm-4.5-air",
  232. #model="Qwen/Qwen3-14B",
  233. messages=[
  234. {"role": "system", "content": "You are a helpful assistant."},
  235. {"role": "user", "content": " 特殊处理要求一:如果选项中有晒衣架制作安装的选项,但是工作内容中不涉及晒衣架,则去除选项中的晒衣架制作安装的选项"},
  236. {"role": "user", "content": " 特殊处理要求二:如果选项中有龙骨钢骨架制作安装的选项,但是工作内容中不涉及龙骨钢骨架,则去除选项中的龙骨钢骨架的选项"},
  237. {"role": "user", "content": " 特殊处理要求三:保留选项中的其他选项"},
  238. {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
  239. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(options) + "。请根据处理要求做出处理,并返回结果,删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
  240. ],
  241. extra_body={"thinking": {"type": "disabled"}},
  242. #extra_body={"enable_thinking": False},
  243. )
  244. json_string = completion.choices[0].message.content
  245. print(json_string)
  246. completion = sfclient.chat.completions.create(
  247. model=simplemodel(),
  248. messages=xuanxiang(json_string),
  249. extra_body={"thinking": {"type": "disabled"}},
  250. #extra_body={"enable_thinking": False},
  251. )
  252. json_string = completion.choices[0].message.content
  253. print(json_string)
  254. answer=[]
  255. if 'A' in json_string:
  256. answer.append(A[0])
  257. if 'B' in json_string:
  258. answer.append(A[1])
  259. if 'C' in json_string:
  260. answer.append(A[2])
  261. if 'D' in json_string:
  262. answer.append(A[3])
  263. if 'E' in json_string:
  264. answer.append(A[4])
  265. if 'F' in json_string:
  266. answer.append(A[5])
  267. if 'G' in json_string:
  268. answer.append(A[6])
  269. if 'H' in json_string:
  270. answer.append(A[7])
  271. if 'I' in json_string:
  272. answer.append(A[8])
  273. if 'J' in json_string:
  274. answer.append(A[9])
  275. return answer
  276. def aifilter5(A, #options
  277. B, #data
  278. aiclient,
  279. qwclient,
  280. sfclient,
  281. dw):
  282. options=[]
  283. letters = "ABCDEFGHIJKLMN"
  284. for i in range(len(A)):
  285. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  286. time.sleep(5)
  287. completion = aiclient.chat.completions.create(
  288. model="glm-4.5-air",
  289. #model="Qwen/Qwen3-14B",
  290. messages=[
  291. {"role": "system", "content": "You are a helpful assistant."},
  292. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“铁件安装”字样的选项,并且选项中没有其他具体的钢构件安装选项(安装选项,不是制作选项),则不做任何处理"},
  293. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“铁件安装”字样的选项,并且选项中有其他具体的钢构件安装选项(例如钢骨架安装),则去除选项中的含有“铁件安装”字样的选项"},
  294. {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
  295. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(options) + "。请根据处理要求做出处理,并返回结果,删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
  296. ],
  297. extra_body={"thinking": {"type": "disabled"}},
  298. #extra_body={"enable_thinking": False},
  299. )
  300. json_string = completion.choices[0].message.content
  301. print(json_string)
  302. if len(json_string) < 4:
  303. answer=[]
  304. if 'A' in json_string:
  305. answer.append(A[0])
  306. if 'B' in json_string:
  307. answer.append(A[1])
  308. if 'C' in json_string:
  309. answer.append(A[2])
  310. if 'D' in json_string:
  311. answer.append(A[3])
  312. if 'E' in json_string:
  313. answer.append(A[4])
  314. if 'F' in json_string:
  315. answer.append(A[5])
  316. if 'G' in json_string:
  317. answer.append(A[6])
  318. if 'H' in json_string:
  319. answer.append(A[7])
  320. if 'I' in json_string:
  321. answer.append(A[8])
  322. if 'J' in json_string:
  323. answer.append(A[9])
  324. return answer
  325. completion = sfclient.chat.completions.create(
  326. model=simplemodel(),
  327. messages=xuanxiang(json_string),
  328. extra_body={"thinking": {"type": "disabled"}},
  329. #extra_body={"enable_thinking": False},
  330. )
  331. json_string = completion.choices[0].message.content
  332. print(json_string)
  333. answer=[]
  334. if 'A' in json_string:
  335. answer.append(A[0])
  336. if 'B' in json_string:
  337. answer.append(A[1])
  338. if 'C' in json_string:
  339. answer.append(A[2])
  340. if 'D' in json_string:
  341. answer.append(A[3])
  342. if 'E' in json_string:
  343. answer.append(A[4])
  344. if 'F' in json_string:
  345. answer.append(A[5])
  346. if 'G' in json_string:
  347. answer.append(A[6])
  348. if 'H' in json_string:
  349. answer.append(A[7])
  350. if 'I' in json_string:
  351. answer.append(A[8])
  352. if 'J' in json_string:
  353. answer.append(A[9])
  354. return answer
  355. def aifilter4(A, #options
  356. B, #data
  357. aiclient,
  358. qwclient,
  359. sfclient,
  360. dw):
  361. options=[]
  362. letters = "ABCDEFGHIJKLMN"
  363. for i in range(len(A)):
  364. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  365. time.sleep(5)
  366. completion = aiclient.chat.completions.create(
  367. model="glm-4.5-air",
  368. #model="Qwen/Qwen3-14B",
  369. messages=[
  370. {"role": "system", "content": "You are a helpful assistant."},
  371. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“铁件制作”字样的选项,并且选项中没有其他具体的钢构件制作选项(制作选项,不是安装选项),则不做任何处理"},
  372. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“铁件制作”字样的选项,并且选项中有其他具体的钢构件选项(例如CZ轻钢檩条),则去除选项中的含有“铁件制作”字样的选项"},
  373. {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
  374. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(options) + "。请根据处理要求做出处理,并返回结果,删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
  375. ],
  376. extra_body={"thinking": {"type": "disabled"}},
  377. #extra_body={"enable_thinking": False},
  378. )
  379. json_string = completion.choices[0].message.content
  380. print(json_string)
  381. if len(json_string) < 4:
  382. answer=[]
  383. if 'A' in json_string:
  384. answer.append(A[0])
  385. if 'B' in json_string:
  386. answer.append(A[1])
  387. if 'C' in json_string:
  388. answer.append(A[2])
  389. if 'D' in json_string:
  390. answer.append(A[3])
  391. if 'E' in json_string:
  392. answer.append(A[4])
  393. if 'F' in json_string:
  394. answer.append(A[5])
  395. if 'G' in json_string:
  396. answer.append(A[6])
  397. if 'H' in json_string:
  398. answer.append(A[7])
  399. if 'I' in json_string:
  400. answer.append(A[8])
  401. if 'J' in json_string:
  402. answer.append(A[9])
  403. return answer
  404. completion = sfclient.chat.completions.create(
  405. model=simplemodel(),
  406. messages=xuanxiang(json_string),
  407. extra_body={"thinking": {"type": "disabled"}},
  408. #extra_body={"enable_thinking": False},
  409. )
  410. json_string = completion.choices[0].message.content
  411. print(json_string)
  412. answer=[]
  413. if 'A' in json_string:
  414. answer.append(A[0])
  415. if 'B' in json_string:
  416. answer.append(A[1])
  417. if 'C' in json_string:
  418. answer.append(A[2])
  419. if 'D' in json_string:
  420. answer.append(A[3])
  421. if 'E' in json_string:
  422. answer.append(A[4])
  423. if 'F' in json_string:
  424. answer.append(A[5])
  425. if 'G' in json_string:
  426. answer.append(A[6])
  427. if 'H' in json_string:
  428. answer.append(A[7])
  429. if 'I' in json_string:
  430. answer.append(A[8])
  431. if 'J' in json_string:
  432. answer.append(A[9])
  433. return answer
  434. def aifilter2(A, #options
  435. B, #data
  436. aiclient,
  437. qwclient,
  438. sfclient,
  439. dw):
  440. options=[]
  441. letters = "ABCDEFGHIJKLMN"
  442. for i in range(len(A)):
  443. options.append("给定选项" + letters[i]+",内容为"+A[i] )
  444. time.sleep(5)
  445. completion = aiclient.chat.completions.create(
  446. model="glm-4.5-air",
  447. #model="Qwen/Qwen3-14B",
  448. messages=[
  449. {"role": "system", "content": "You are a helpful assistant."},
  450. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“零星钢构件制作”字样的选项,并且选项中没有其他具体的钢构件制作选项(制作选项,不是安装选项),则不做任何处理"},
  451. {"role": "user", "content": " 特殊处理要求:如果选项中有含有“零星钢构件制作”字样的选项,并且选项中有其他具体的钢构件选项(例如CZ轻钢檩条),则去除选项中的含有“零星钢构件制作”字样的选项"},
  452. {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
  453. {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " + B['mc'] + " " + B['tz'] + ",".join(options) + "。请根据处理要求做出处理,并返回结果,删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
  454. ],
  455. extra_body={"thinking": {"type": "disabled"}},
  456. #extra_body={"enable_thinking": False},
  457. )
  458. json_string = completion.choices[0].message.content
  459. print(json_string)
  460. if len(json_string) < 4:
  461. answer=[]
  462. if 'A' in json_string:
  463. answer.append(A[0])
  464. if 'B' in json_string:
  465. answer.append(A[1])
  466. if 'C' in json_string:
  467. answer.append(A[2])
  468. if 'D' in json_string:
  469. answer.append(A[3])
  470. if 'E' in json_string:
  471. answer.append(A[4])
  472. if 'F' in json_string:
  473. answer.append(A[5])
  474. if 'G' in json_string:
  475. answer.append(A[6])
  476. if 'H' in json_string:
  477. answer.append(A[7])
  478. if 'I' in json_string:
  479. answer.append(A[8])
  480. if 'J' in json_string:
  481. answer.append(A[9])
  482. return answer
  483. completion = sfclient.chat.completions.create(
  484. model=simplemodel(),
  485. messages=xuanxiang(json_string),
  486. extra_body={"thinking": {"type": "disabled"}},
  487. #extra_body={"enable_thinking": False},
  488. )
  489. json_string = completion.choices[0].message.content
  490. print(json_string)
  491. answer=[]
  492. if 'A' in json_string:
  493. answer.append(A[0])
  494. if 'B' in json_string:
  495. answer.append(A[1])
  496. if 'C' in json_string:
  497. answer.append(A[2])
  498. if 'D' in json_string:
  499. answer.append(A[3])
  500. if 'E' in json_string:
  501. answer.append(A[4])
  502. if 'F' in json_string:
  503. answer.append(A[5])
  504. if 'G' in json_string:
  505. answer.append(A[6])
  506. if 'H' in json_string:
  507. answer.append(A[7])
  508. if 'I' in json_string:
  509. answer.append(A[8])
  510. if 'J' in json_string:
  511. answer.append(A[9])
  512. return answer
  513. def postprocess0106_(selected, data, aiclient, qwclient, sfclient, label_name, name_dw):
  514. if len(selected) == 1:
  515. return selected
  516. return aifilter5(aifilter4(aifilter3(aifilter2(aifilter1(selected, data, aiclient, qwclient, sfclient, name_dw), data, aiclient, qwclient, sfclient, name_dw), data, aiclient, qwclient, sfclient, name_dw),data,aiclient,qwclient,sfclient,name_dw),data,aiclient,qwclient,sfclient,name_dw)
  517. def postprocess0106(selected, data, aiclient, qwclient, sfclient, label_name, name_dw,yqspecial):
  518. selected = [x for x in selected if '金属面油漆' not in x]
  519. selected = selected + yqspecial
  520. if len([x for x in selected if '氟碳漆' in x]) > 0:
  521. selected = [x for x in selected if '红丹防锈漆' not in x and '调和漆' not in x and '银粉漆' not in x]
  522. if len([x for x in selected if '环氧富锌漆' in x]) > 0:
  523. selected = [x for x in selected if '红丹防锈漆' not in x ]
  524. selected = postprocess0106_(selected, data, aiclient, qwclient, sfclient, label_name, name_dw)
  525. hit = fanghuo(selected, data, aiclient, qwclient, sfclient, name_dw)
  526. if hit:
  527. tuliao = fanghuotuliao(selected, data, aiclient, qwclient, sfclient, name_dw)
  528. if not tuliao:
  529. selected.append(tuliaofilter(selected, data, aiclient, qwclient, sfclient, name_dw))
  530. return selected
  531. else:
  532. return selected