You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by komal <ko...@hotmail.com> on 2017/03/20 06:31:33 UTC

calculate term co-occurrence matrix

hi all,
i need term co-occurrence matrix code. if anyone have plz share it with me.



--
View this message in context: http://lucene.472066.n3.nabble.com/calculate-term-co-occurrence-matrix-tp4325899.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: calculate term co-occurrence matrix

Posted by "Allison, Timothy B." <ta...@mitre.org>.
I have code as part of LUCENE-5318 that counts terms that cooccur within a window of where your query terms appear.  This makes a really useful query term recommender, and the math is dirt simple.

INPUT
Doc1: quick brown fox jumps over the lazy dog
Doc2: quick green fox leaps over the lazy dog

Query: fox , window size before =2, window size after = 3

OUTPUT:
Quick: 2 (and 2 * idf(quick))
Over: 2
Brown: 1
Green: 1
Jumps: 1
Leaps: 1

The query can be anything that can be transformed into a SpanQuery.

If you want examples or help, just drop a line.

See:
https://github.com/tballison/lucene-addons/tree/master/lucene-5317

Also available on Maven: 
https://mvnrepository.com/artifact/org.tallison.lucene/lucene-addons/6.4-0.1 


P.S. Thanks to David Smiley for pointing out this request to me. 

-----Original Message-----
From: komal [mailto:komallatif@hotmail.com] 
Sent: Monday, March 20, 2017 2:32 AM
To: dev@lucene.apache.org
Subject: calculate term co-occurrence matrix

hi all,
i need term co-occurrence matrix code. if anyone have plz share it with me.



--
View this message in context: http://lucene.472066.n3.nabble.com/calculate-term-co-occurrence-matrix-tp4325899.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org