[minhashing] Export the demo of minhashing to the new api
authorSimon Chabot <simon.chabot@logilab.fr>
Wed, 14 Nov 2012 09:40:30 +0100
changeset 129 7120da9101de
parent 128 228d0da19e3f
child 130 79d506091e46
[minhashing] Export the demo of minhashing to the new api
minhashing.py
--- a/minhashing.py	Tue Nov 13 16:46:16 2012 +0100
+++ b/minhashing.py	Wed Nov 14 09:40:30 2012 +0100
@@ -178,7 +178,7 @@
 
 if __name__ == '__main__':
     from alignment.normalize import (loadlemmas, simplify)
-    from alignment.aligner import parsefile
+    from alignment.dataio import parsefile
     from time import time
     import matplotlib.pyplot as plt
     from scipy import polyfit
@@ -197,12 +197,8 @@
         length = int(size * len(sentences) / 100)
         minlsh.train((simplify(s, lemmas) for s in sentences[:length]), 1, 100)
         t1 = time()
-        r = minlsh.predict(0.7)
+        r = minlsh.predict(0.3)
         t2 = time()
-        for _e in r:
-            for e in _e:
-                print sentences[e]
-            break
         print 'Nb sentences : %d' % length
         print 'Training + signaturing time : %.3fs' % (t1 - t0)
         print 'Similarity %.3fs' % (t2 - t1)