liveBook · Manning

Undirected graph

As explained in Natural Language Processing in Action, Second Edition

An undirected graph is a graph whose relationships do not have a direction.

An undirected graph represents entities as nodes and reciprocal relationships as edges. A Facebook friendship fits this model because neither person is a friend without reciprocation; following on Twitter is directed instead. section 6.4.6

Connecting similar sentences

Sentence embeddings turn each sentence into a vector. Pairwise similarity becomes graph edges, with edges above 0.95 retained; similar concepts then gather into clusters in a force-directed layout. section 6.4.6

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Defines nodes, edges, and reciprocity, then demonstrates thresholded weighted construction and force-directed plotting.
Examples
Uses Facebook friendships, Twitter following, sentence similarities, NetworkX nodes, weighted edges, and spring-layout plots.
What it assumes
Assumes word embeddings and sentence vectors, while defining graph terminology and reciprocity through familiar relationships.
What you can do after
Build it from scratch with Python and NetworkX, using similarity scores to create and plot an undirected graph.
How it connects
Connects graph data structures, directed graphs, sentence embeddings, similarity matrices, and force-directed layouts.

Also explained in

Compare how 5 books explain undirected graph →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.