Beispiel #1
0
def aspace_mds():
    from csc.conceptnet.analogyspace import conceptnet_2d_from_db
    cnet = conceptnet_2d_from_db('en')
    aspace = cnet.normalized().svd(k=100)
    labels = cnet.label_list(0)

    ptmatrix = data(aspace.u)
    ptmatrix *= data(aspace.svals)

    proj = mds(ptmatrix)

    result = proj.project(data(aspace.u))
    return LabeledView(DenseTensor(result), [labels, None])
Beispiel #2
0
def aspace_mds():
    from csc.conceptnet.analogyspace import conceptnet_2d_from_db
    cnet = conceptnet_2d_from_db('en')
    aspace = cnet.normalized().svd(k=100)
    labels = cnet.label_list(0)

    ptmatrix = data(aspace.u)
    ptmatrix *= data(aspace.svals)

    proj = mds(ptmatrix)

    result = proj.project(data(aspace.u))
    return LabeledView(DenseTensor(result), [labels, None])
from luminoso.whereami import *
from csc.conceptnet.analogyspace import conceptnet_2d_from_db
import cPickle as pickle

picklefile = open(package_dir+'/study_skel/Matrices/conceptnet.pickle', 'w')
cnet = conceptnet_2d_from_db('en')
pickle.dump(cnet, picklefile)
picklefile.close()

def _get_size_blend():
    sizes = get_picklecached_thing(FILEPATH+os.sep+'sizematrix.pickle.gz', _make_size_matrix)
    cnet = get_picklecached_thing(FILEPATH+os.sep+'cnet.pickle.gz', lambda: conceptnet_2d_from_db('en'))
    size_blend = Blend([sizes, cnet]).normalized(mode=[0,1]).bake()
    return size_blend
Beispiel #5
0
from luminoso.whereami import *
from csc.conceptnet.analogyspace import conceptnet_2d_from_db
import cPickle as pickle

picklefile = open(package_dir + '/study_skel/Matrices/conceptnet.pickle', 'w')
cnet = conceptnet_2d_from_db('en')
pickle.dump(cnet, picklefile)
picklefile.close()
Beispiel #6
0
def _get_color_blend():
    colors = get_picklecached_thing(FILEPATH+os.sep+'colormatrix.pickle.gz', _make_color_matrix)
    cnet = get_picklecached_thing(FILEPATH+os.sep+'cnet.pickle.gz', lambda: conceptnet_2d_from_db('en'))
    colorblend = Blend([colors, cnet]).normalized(mode=[0,1]).bake()
    return colorblend