Listing nodes
The first thing I tend to do after constructing a network from text is to list the nodes that have been added to the network. This allows me to take a quick peek at the node names so that I can gauge the amount of cleanup I will need to do to remove and rename nodes. During our entity extraction, we had the opportunity to clean the entity output. The entity data is used to create the network data that is used to create the graph itself, so there are multiple steps during which cleanup and optimization are possible, and the more that you do upstream, the less that you have to do later.
However, it is still important to take a look at the node names, to identify any strangeness that still managed to find a way into the network:
- The simplest way to get a node list is to run the following
networkx
command:G.nodes
This will give you a NodeView
:
NodeView(('Rabbit', 'Alice', 'Longitude', 'New Zealand', "Ma&apos...