Beispiel #1
0
 def split_by_order_ve(self, messages):
     voter = voters()
     redis_read = redis_deal()
     raw_words = redis_read.read_from_redis('order_raw_words')
     w_converter = word_convert()
     order_words = w_converter.convert_order_to_raw(raw_words)
     order_words['300'] = 1000000
     boundaries = voter.raw_boundary_generate(messages, order_words)
     return boundaries
Beispiel #2
0
 def get_format(self,format_type, messages, h, combine, model, v_way, T=0, r=0, ways="g"):
     """
     get single format
     """
     voter = voters()
     infer_format = None
     if format_type == "ies":
         infer_format = voter.get_info(messages, h, combine, model, v_way, T, r, ways)
     elif format_type == "tree":
         prime_los = voter.single_message_voter(messages, h, combine, model, v_way, T, r)
         infer_format = self.loctotree(prime_los)
     return infer_format
Beispiel #3
0
 def split_by_ve(self,
                 messages,
                 h,
                 combine,
                 model,
                 v_way,
                 T=0,
                 r=0,
                 ways="g"):
     voter = voters()
     split_messages = voter.single_message_voter(messages, h, combine,
                                                 model, v_way, T, r)
     converter = transer()
     return converter.listtoids(split_messages)
Beispiel #4
0
 def __init__(self):
     self.prefix = ve_strategy().get_strategy_str()
     self.redis_read = redis_deal()
     self.parameters = ve_strategy().vote_parameters
     self.ngram = voters()
     self.cvt = Converter()
Beispiel #5
0
def TestWords():
    UserConfig.userId = '15895903730'
    UserConfig.path = '/home/wxw/data/ToolDatas/15895903730.10.222'
    Voter = voters()
    print(Voter.getQueryWords(UserConfig.getUserPath()))
Beispiel #6
0
 def __init__(self):
     self.vv = voters()