I have written a script that generates a .gv file with the following content:
The nodes are the names of the topics and the links are expressed using semantic relatedness values computed using WikipediaMiner. The values are modified to reflect the line width in the generated graph:
graph G {
"Machine learning" -- "Keywords"[style=invis];
"Machine learning" -- "Natural language" [penwidth = "3"];
"Machine learning" -- "Knowledge" [penwidth = "2"];
...
}
- style=invis if relatedness = 0;
- otherwise penwidth is used.
Update: Additionally the top keyphrase returned by the algorithm is defined as the root of the graph (e.g. graph [root="Index (search engine)"] for the graph below). Also the font size reflects the rank of the keyphrase as determined by the algorithm.
Click on the graph to see the graph in full resolution. Or view the complete GraphViz script.
The beauty of GraphViz is that the generated graph can be exported into any format and expanded to any required size.
Furthermore, the visualization can be generated for any list of topics, as long as they can be mapped to titles of Wikipedia articles:
// first check if there is an article with the title "topic"
Article article = wikipedia.getArticleByTitle(topic);
// otherwise retrieve the most likely mapping
if (article == null) {
CaseFolder cs = new CaseFolder();
article = wikipedia.getMostLikelyArticle(topic,cs);
}
The script for generating such graphs is included as a part of Maui software.
No comments:
Post a Comment