Пример #1
0
def get_eval_instances(handles, listener=False):
    insts = [(Instance(input=name, output=tuple(color))
              if listener else Instance(input=tuple(color), output=name))
             for name, handle in handles.iteritems()
             for color in munroecorpus.open_datafile(handle)]
    rng.shuffle(insts)
    return insts
def get_eval_instances(handles, listener=False):
    insts = [
        (Instance(input=name,
                  output=tuple(color))
         if listener else
         Instance(input=tuple(color),
                  output=name))
        for name, handle in handles.iteritems()
        for color in munroecorpus.open_datafile(handle)
    ]
    rng.shuffle(insts)
    return insts
Пример #3
0
def load_colors(h, s, v):
    return zip(*(munroecorpus.open_datafile(d) for d in [h, s, v]))
def load_colors(h, s, v):
    return zip(*(munroecorpus.open_datafile(d) for d in [h, s, v]))