MCPcopy Create free account
hub / github.com/Alibaba-NLP/ViDoRAG / search_multi_session

Method search_multi_session

search_engine.py:201–216  ·  view source on GitHub ↗
(self,output_file='search_result.json')

Source from the content-addressed store, hash-verified

199 return example
200
201 def search_multi_session(self,output_file='search_result.json'):
202 os.makedirs(self.output_dir, exist_ok=True)
203 with open(self.rag_dataset_path, 'r') as f:
204 dataset = json.load(f)
205 data = dataset['examples']
206 results = []
207 if self.workers == 1:
208 for example in tqdm(data):
209 results.append(self.search_example(example))
210 else:
211 with ThreadPoolExecutor(max_workers=self.workers) as executor:
212 future_to_file = {executor.submit(self.search_example, example): example for example in data}
213 for future in tqdm(as_completed(future_to_file), total=len(data), desc='Processing files'):
214 results.append(future.result())
215 with open(os.path.join(self.output_dir, output_file), 'w') as json_file:
216 json.dump(results, json_file, indent=2, ensure_ascii=False)
217
218class HybridSearchEngine:
219

Callers

nothing calls this directly

Calls 1

search_exampleMethod · 0.95

Tested by

no test coverage detected