Grafeno

Grafeno logo

Interactive visualization of grafeno Graphs

We use the great D3 library: https://d3js.org/

In [1]:
from grafeno import Graph
from grafeno.transformers import get_pipeline
from grafeno.jupyter import visualize
In [2]:
import yaml
semantic_pipeline = yaml.load(open('../../configs/semantic.yaml'))
T = get_pipeline(['spacy_parse']+semantic_pipeline.get('transformers'))

One sentence

In [3]:
sentence = """
John writes a short program that works correctly and he comments his code like a good student.
"""
In [4]:
G1 = Graph(text=sentence, transformer=T)
In [5]:
visualize(G1)
Out[5]:

Bigger graph (from the simple.wikipedia page of AI)

In [6]:
text = """
An extreme goal of AI research is to create computer programs that can learn, solve problems, and think logically.
In practice, however, most applications have picked on problems which computers can do well.
Searching data bases and doing calculations are things computers do better than people.
On the other hand, "perceiving its environment" in any real sense is way beyond present-day computing.
"""
In [7]:
G2 = Graph(text=text, transformer=T)
In [8]:
visualize(G2)
Out[8]: