MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / cal_precise_unionablity

Function cal_precise_unionablity

union/TUS/Uset_run.py:268–286  ·  view source on GitHub ↗
(type, values_of_this_column, lsh_result, folder_path, model)

Source from the content-addressed store, hash-verified

266
267
268def cal_precise_unionablity(type, values_of_this_column, lsh_result, folder_path, model):
269 #计算values_of_this_column与候选列的精确可并行分数
270 #后面加上u_NL的分数
271 col_dict = {}
272 for r in lsh_result:
273 file_name, column_name = r.split(maxsplit=1)
274 file_path = os.path.join(folder_path, file_name)
275 df_query = pd.read_csv(file_path)
276 if type == 'Uset' or type == 'Usem':
277 unionablity = u_set_or_sem(type, values_of_this_column, df_query[column_name].to_list())
278 else:
279 unionablity = u_nl(values_of_this_column, df_query[column_name], model)
280 if file_name in col_dict:
281 if unionablity > col_dict[file_name]:
282 col_dict[file_name] = unionablity
283 else:
284 col_dict[file_name] = unionablity
285
286 return col_dict
287
288
289#save_dict_to_json(u_set_distribution(u_set_Lsh()), 'result/uset_lsh.json')

Callers

nothing calls this directly

Calls 2

u_nlFunction · 0.90
u_set_or_semFunction · 0.70

Tested by

no test coverage detected