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()
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
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()