AllThingsGraphed.com Exploring the graphs that surround us

A Matter of Degrees: Semantic linking of antonyms through synonym pathways

I've been away from doing posts for several weeks. A new baby, new opportunities at work (involving graph analysis), and presenting at a conference have taken over my free time. But things have settled a bit so I can get back to doing more posts here.

Idea

A popular concept is "degrees of separation" and that it's surprising how interconnected we all are. I wanted to take this concept and apply it to words. And not just any words, but antonym pairs. And in comparing antonyms, I wanted to see how they are linked using only synonym pathways. In this way you can get an idea how "connected" words are that we commonly think of as unconnected.

Methodology

I actually tried a few different datasets for this. First I crawled dictionary.com's thesaurus. This is actually a very good dataset and the results are quite good. However, dictionary.com has a strict usage policy prohibiting derivative works so I won't be publishing those results. I then downloaded the offline version of wiktionary.org and wrote a simple program to crawl synonym pairs using their API. However, I found this dataset quite sparse such that I wasn't able to find pathways between words that I could using dictionary.com's thesaurus. Finally, I used the wordnet database. This had the benefit of my being able to just crawl their web interface using my web crawler I have used for other posts.

To crawl, I just picked two antonyms and had my crawler crawl a max distance from each. The idea being that a common synonym pathway could be found. I could tell whether or not a pathway was found simply by seeing if the resulting network only had one component. If so, it meant that both antonym words were in the same network. The networks are visualized using Gephi.

Then, in order to find the pathway, I used Neo4j to load the network and use Dijkstra's algorithm to find shortest pathways. I ended up writing a generic tool for finding pathways in Neo4j graphs using two Cipher queries as starting points and a description of edge cost calculation and traversal. If anyone's interested, I can post this code on github.

Note: I'm simply telling Neo4j's Dijkstra's algorithm to return a shortest path. It's quite likely that there are other pathways with the same degree of separation. However, I'm simply showing the one Neo4j chooses to return.

Antonym Word Pairs

Here are the antonym word pairs that I ended up using:

  • Beauty & Ugliness
  • Good & Evil
  • Hope & Doubt
  • Liberal & Conservative
  • Love & Fear
  • Pleasure & Pain
  • Right & Wrong
  • Strong & Weak

I'll simply display each graph below along with the synonym pathway between the two with some brief comments. Note, since I'll be commenting on interrelated meanings and culture surrounding words, an element of subjectivity is somewhat unavoidable here.

Beauty & Ugliness

beauty ugliness synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Beauty -> Knockout -> Severe -> Stern -> Grim -> Dark -> Wickedness -> Ugliness

Degrees of separation: 7

Comments:

I think it's interesting here that the slang "knockout" immediately links the word "beauty" to words and meanings entirely opposite. This is a trend in the networks in this post: that slang or colloquialisms create very unintuitive pathways.

Good & Evil

good evil synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Good -> Practiced -> Do -> Come -> Fell -> Vicious -> Evil

Degrees of separation: 6

Comments:

I noticed that once a word path makes its way to a generic word like "do", all sorts of synonym pathways open up. Indeed, in this graph, the word "do" is in the top 0.01% of the most connected.

Hope & Doubt

hope doubt synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Hope -> Promise -> Prognosticate -> Betoken -> Point -> Head -> Question -> Doubt

Degrees of separation: 7

Comments:

I don't have much personal insight on this other than the observation that the word "hope" seems to be surrounded by words centered around trust. I think that's an important idea: that much of our ability to hope or make or keep promises involves mutual trust.

Liberal & Conservative

liberal conservative synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Liberal -> Loose -> Light -> Faint -> Timid -> Cautious -> Conservative

Degrees of separation: 6

Comments:

What jumps out at me (besides the political caricatures often used) is the symmetry here. The outside words (liberal/conservative) are the categorical descriptors. A step in (loose/cautious) could be considered an attribute describing liberal then conservative. Then, towards the middle with light/timid, the attribute becomes almost negative showing how the previous attributes (loose/cautious) can have negative applications. Then the middle word (faint) becomes a neutral term when no stance or world-view is applied.

Love & Fear

love fear synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Love -> Make out -> Deal -> Care -> Fear

Degrees of separation: 4

Comments:

Again, slang (make out) creates unintuitive pathways; sometimes shortening pathways.

Pleasure & Pain

pleasure pain synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Pleasure -> Delight -> Ravish -> Violate -> Offend -> Hurt -> Pain

Degrees of separation: 6

Comments:

For me what stuck out is how the focus is what changes as you go from pleasure to pain. That on the left you have enjoyment and awe experienced by the individual. Then as you go to the right, the awe experienced gives way to actions which harm another. And I wonder if there's an insight here on our interrelationships, particularly romantic relationships, in how love must be sustained through mutual respect and how relationships can break down and become abusive as actions become purely selfish and violate trust.

Right & Wrong

right wrong synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Right -> Redress -> Damages -> Wrong

Degrees of separation: 3

Comments:

It's interesting here that words like redress is the bridge between right and wrong. That reconciliation is how we right wrongs.

Strong & Weak

strong weak synonym wordnet graph

click on image to toggle showing pathway

Pathway:

Strong -> Solid -> Square -> Lame -> Feeble -> Weak

Degrees of separation: 5

Comments:

Here's another turn on a colloquialism (square -> lame). One thing to think about semantically is how that colloquialism seems to indicate that perfectionism (square) leads to weakness.

Conclusion

Beyond traditional analysis like community detection and centrality scoring, I think finding pathways in graphs can be an important tool of network analysis to understand relationships between key nodes in a graph.


Interested in seeing more visualizations and analysis like this? Have general feedback or an idea? Feel free to contact me.