Making a Simple Image Viewer using React and Express Aug 13.Making a Menger Sponge with BeetleBlocks Sep 3.Latin Square and Sudoku Solver Using SAT Solver (JavaScript logic-solver) Nov 24.Greedy Set Cover Sample Implementation Aug 18.Short Example of Logstash Multiple Pipelines Aug 25.JavaScript Port of Computational Substrate of Jared Tarbell Jul 7.jeremyevans/sequel: Sequel: The Database Toolkit for Ruby.Franz M, Lopes CT, Huck G, Dong Y, Sumer O, Bader GDĬytoscape.js: a graph theory library for visualisation and analysisīioinformatics (2016) 32 (2): 309-311 first published online Septemdoi:10.1093/bioinformatics/btv557.The corresponding SQL query is as follows: SELECT "synset1", "synset2" FROM "synlink" WHERE (( "synset1" = synset ) AND ( "link" = "hype" )) References Straightforward in Sequel: def synset_to_hypernyms ( synset ). The synlink table ( has pairs of (synset1, synset2) each of which has a type link. "wordid" ) WHERE ( "lemma" = lemma ) Finding Hypernyms "lemma" FROM "word" INNER JOIN "sense" ON ( "sense". The corresponding SQL query is as follows: SELECT "synset", "word". Sequel.qualify(:word, :lemma) can be written also as Sequel. join ( :sense, :wordid => :wordid ) senses. where ( :lemma => lemma ) senses = words. We specify the word table ( join the sense table,Īnd select columns of interest. To look up synsets from a given word lemma lemma, sqlite ( './wnjpn.sqlite3' ) Synset Look Up from Word We can construct SQL queries by chaining methods as is often done in Ruby.Ī sample code for assigning a new Sequel instance to an instance variable of some (arbitrary) class based on the SQLite 3 database file. The sequel gem is quite handy for such tasks because There is a Ruby Gem wordnet but we cannot use it for Japanese WordNetīecause its schema seems to be different from English WordNet.Īnyway, we can query the database directly. The graph data is constructed by firstly querying SQLite 3 database ofĪnd secondly formatting the retrieved results for Cytoscape.js. The higher the return value of the function applied to a node, the nearer the center it is placed. The positions of nodes are determined by the concentric function. InitializationĪ sample code snippet for initializing visualization of a given graph: var cy = cytoscape ( Once we have graph data in a format taylored to Cytoscape.js, we are ready to enjoy the features provided by the library.īelow are very short excerpts (modified and simplified) from the code in the app. The advantage of using Cytoscape.js is not only rendering of graphsīut also builtin support for standard gestures to pan and zoom the viewport and many many others. Frontend script using Cytoscape.js to visualize the graph returned from Sinatra server.Synset look up in the WordNet SQLite database using sequel Ruby Gem.The web app is made up of the tree parts below: The cytoscape-qtip plugin is used to enable this. One of them navigates you to Google for instance. The following example is a graph rendered for a word "programmer:"Ĭlicking a node causes the app to change the layout of the graph to show all the words in the synset of the clicked node.Įach word in a synset can be clicked to show a tooltip carrying some buttons. If a synset is found, the app visualizes the network involves it. Typing a word in the text box at the topmost navbar and hitting Go button causes the app to look up the synset containing the word entered. Nodes and edges can be moved around by dragging.Īnd the viewport can be panned and zoomed by dragging the background and using mouse wheel. (Some arrows represent other relationships such as membership relation but the app does not make clear distinction among them.) The node at the tip of an arrow is a synset of the hypernym (in most cases) of the synset at the origin. Do not visit when the battery is running low:)Ī graph is displayed at the center of the page.Įach vertex of the graph represents a synset and each edge represents relationship between two synsets. (Heads up! This site is a little energy consuming. Then, I tried visualizing the results with Cytoscape.js.įinally, I ended up building the following simple web app. Out of curiosity, I wrote some queries to examine what is inside the Japanese WordNet database. WordNet is a large lexical database that groups synonymous words into an unordered set called "synset" and contains relations among synsets. I was fascinated and started playing with its easy-to-use API.Īlso, I was interested in WordNet, which has nothing to do with Cytoscape.js, and wanted a tool for it. The official site has some demonstrations that show its capabilities. JavaScript graph visualization NLP WordNetĬytoscape.js is a JavaScript library for graph visualization that enables rendering network structures on a web browser. Cytoscape.js powered Interactive Graph Visualization of WordNet Synsets
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |