1.创建一个work_get_result(text)函数
2.在main函数中创建一个ThreadPoolExecutor并提交n个任务到线程中
num_sample =len(text_list)
executor = concurrent.futures.ThreadPoolExecutor(max_workers=min(5,num_sample))
to_do_queue=list()
for idx,content in enumerate(text_list):
to_do_queue.append(executor.submit(work_get_result, content))
result_pred_list=list()
for idx,future in enumerate(concurrent.futures.as_completed(to_do_queue)):
pred_res = future.result()
result_pred_list.append(pred_res)
del pred_res
to_do_queue.remove(future)
del to_do_queue,executor