Search::ContextGraph - Run searches using a contextual network graph
use Search::ContextGraph; my $cg = Search::ContextGraph->new(); $cg->load( 'file.tdm' ); my %results = $cg->search( 'd1', 't34', 't12' );
Search a document collection using a spreading activation search. The search algorithm represents the collection as a set of term and document nodes, connected to one another based on a co-occurrence matrix. If a word occurs in a document, we create an edge between the appropriate term and document node. Searches take place by spreading energy from a query node along the edges of the graph according to some simple rules. All result nodes exceeding a threshold T are returned. You can read a full description of this algorithm at http://www.nitle.org/papers/Contextual_Network_Graph.pdf.
The search engine gives expanded recall (relevant results even when there is no keyword match) without incurring the kind of computational and patent issues inflicted by latent semantic indexing (LSI).
Object constructor. Parameters include:
Turns verbose mode on when true
initial starting energy, default 10000
Cutoff value for propagating energy to neighbor nodes
Accessor for threshold value. This value determines how far energy can spread in the graph
Accessor for initial energy value at the query node. The higher this value, the larger the result set
Opens and loads a term-document matrix (TDM) file to initialize the graph. Optionally also opens and loads a document link matrix (DLM) file of document-to-document links. The TDM encodes information about term-to-document links, while the DLM file holds information about inter-document links, like hyperlinks or citation data. For notes on these file formats, see the README file Note that document-document links are NOT YET IMPLEMENTED.
Given a list of nodes, returns a hash of nearest nodes with relevance values, in the format NODE => RELEVANCE, for all nodes above the threshold value. Term nodes are prefixed by 't', document nodes are prefixed by 'd'. It's your job to keep some kind of node index to value map handy.
Turns verbose comments on if given a true value as its argument
Opens and reads a term-document matrix (TDM) file. The format for this file is described in the README
Private method. Assigns a starting energy ENERGY to NODE, and recursively distributes the energy to neighbor nodes.
Maciej Ceglowski <maciej@ceglowski.com>
(C) 2003 Maciej Ceglowski, John Cuadrado, NITLE
This program may be distributed under the same terms as Perl itself.
To install Search::ContextGraph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::ContextGraph
CPAN shell
perl -MCPAN -e shell install Search::ContextGraph
For more information on module installation, please visit the detailed CPAN module installation guide.