johnwdubois / rezonator

Rezonator: Dynamics of human engagement
35 stars 2 forks source link

DepRel: Syntactic dependency tree visualization #169

Open johnwdubois opened 5 years ago

johnwdubois commented 5 years ago

What is needed Implement a Dependency graph visualization to show syntactic dependency relations in Rezonator. Visualization options include:

Some useful visualizations of syntactic dependency (and related concepts):

As a sample, here is the first sentence of SBC001 (slightly edited): "So you don't need to go borrow equipment from anybody, to do the feet? Do the hooves?"

The following shows a "live" example from the Santa Barbara Corpus, as visualized in displaCy:
displaCy visualization of first sentence of SBC001 (partial) displaCy visualization of first sentence of SBC001 (complete)

Try copying and pasting this sentence into the following, to see how it is visualized in Stanford Core NLP:

What is needed

  1. Rezonator needs to offer the option to display syntactic dependency relations (DepRel) between words in a sentence. (See the test file below for details).
    • DepRel (Dependency relation between the current word and its head word): a Link from Source to Goal ["Destination"], visualized as a directed edge (arrow). This is the "Role" field in the Link grid.
    • wID = wordID of the current word, which is the Source in the Link grid (starting point of the arrow)
    • headID = wordID of the syntactic head for the current word, which is the Goal in the Link grid (endpoint of the arrow, with arrowhead)
  2. When the Dependency Graph is displayed, arrows are shown, and labels are attached to the arrows, as follows:
    • each arrow is labeled with its DepRel value
    • each word is labeled with its PartOfSpeech (noun, verb, preposition/adposition, etc.)
    • for maximum information, display both versions of PartOfSpeech (Spacy and Stanford)
  3. Give users the option to display the labels always, or only when hovering.

Test file The following file contains the first few turns of SBC001, with detailed annotation showing the syntactic dependency relations, among other things:
Word table excerpt (SBC001)**
Pay special attention to the following fields ((in both Spacy and Stanford versions, with a separate column for each):

Screenshots A graphical image of SBC001, sentence 1, as visualized by displaCy (displayed in two parts):

Dependency graph - SBC001_001a Dependency graph - SBC001_001b

A graphical image of SBC001, sentence 1, as visualized by Stanford CoreNLP:
Dependency graph - SBC001 1st sentence - Stanford

johnwdubois commented 5 years ago

For the meeting with Angus, let's make good use of the data in the grid created from the JSON TAG import. This should include the "relation" field.
For example, we'd like to see more visualization of features imported in the TAG files, such as DepRel - the labeled Roles (what TAG calls Relation), which we should attach to the Link arrows that connect Head and Dependent words. Preferably, these arrows will be curved, as in the typical representation of Dependency relations (DepRel).