Пример #1
0
from csc.conceptnet4.analogyspace import conceptnet_by_relations, identities_for_all_relations
from csc.divisi.blend import Blend
from csc.divisi import export_svdview

byrel = conceptnet_by_relations('en')
t=identities_for_all_relations(byrel)
b=Blend(byrel.values()+[t])
s=b.svd()
export_svdview.write_packed(s.u, 'littleblend', lambda x:x)
s.summarize()
Пример #2
0
def run_cnet_blend(other, FILENAME='blend'):
    blend = get_picklecached_thing(FILENAME+'.pickle.gz',
        lambda: make_blend(other))
    svd = blend.svd()
    write_packed(svd.u, FILENAME, unstem=lambda x: x)
    return svd
Пример #3
0
from csc.conceptnet4.analogyspace import conceptnet_by_relations, identities_for_all_relations
from csc.divisi.blend import Blend
from csc.divisi import export_svdview

byrel = conceptnet_by_relations('en')
t = identities_for_all_relations(byrel)
b = Blend(byrel.values() + [t])
s = b.svd()
export_svdview.write_packed(s.u, 'littleblend', lambda x: x)
s.summarize()