Hi,
The problem is a bit deeper than it is. Basically, DependencyGraph calls a root node a node that depends on the fake TOP node. In an empty graph there is only TOP node, so there can't be a root.
You can try this code:
>>> import nltk
>>> from nltk.parse import DependencyGraph
>>> def from_sentence(sent):
... tokens = nltk.word_tokenize(sent)
... tagged = nltk.pos_tag(tokens)
...
... records = (
... ' '.join([word, tag, '0']) for word, tag in tagged
... )
... dg = DependencyGraph(records)
... return dg
...
>>> dg = from_sentence("Natural Language Processing is really fun.")
>>> dg.tree().pprint()
(Natural )
The reason you see only Natural, is that some parts of the code assume that there is only one ROOT node (the node that depends on the TOP), while in this case there are many of them. This is a long known problem and we are working on it, I'll put more information regarding the issue on github.
However, there is information for all the nodes, if you check dg.nodes (reading dg.nodes should be OK, but changing them might break things).
--
Dima