Gainward777's picture
Upload 12 files
a03bfa8 verified
raw
history blame
1.02 kB
from preprocess.preprocess import Preprocessor
from processor.matching import prepare_groups_with_ids,new_find_matches_with_ids
class Processor():
def __init__(self, long_types_list, short_types_list, sour_list,
type_wine, gbs, colors_for_trim, grapes, other_words,
sour_merge_dict, type_merge_dict, color_merge_dict):
self.preprocessor=Preprocessor(long_types_list, short_types_list, sour_list,
type_wine, gbs, colors_for_trim, grapes, other_words,
sour_merge_dict, type_merge_dict, color_merge_dict)
def process(self, items, products, th=65):
items, products=self.preprocessor.process(self, items, products)
print('-----*-----Matching-----*-----')
items_groups = prepare_groups_with_ids(items)
res=new_find_matches_with_ids(products, items_groups, items, name_threshold=th)
return res.drop(['type','type_wine','year','alco','gb'], axis=1), items, products