Coding Script or Notebook
Google Colab
Free (Access via Email)

Entity Analysis & Relationship Mapping with IBM Watson NLU in Google Colab

Most NLP tutorials stop at entity extraction—this hands-on Google Colab notebook goes further by demonstrating IBM Watson’s Natural Language Understanding API for both entity recognition and entity relationship mapping with working Python code. Created by Lazarina Stoy as a comparative analysis lesson for her Introduction to ML for SEOs course, this notebook shows you how to extract not just who or what is mentioned in text, but also how those entities relate to each other through relationship types like “employedBy,” “partOfMany,” or “locatedIn”—critical insights for understanding content structure and knowledge graphs.
The notebook provides complete implementation code for IBM Watson NLU with two main workflows. First, you’ll extract entities (people, organizations, locations, job titles) with optional sentiment and emotion scores, confidence levels, and DBpedia disambiguation links—all exportable to CSV with flattened sentiment data and entity metadata. Second, you’ll map relationships between entity pairs, showing not just that “Lazarina Stoy” and “MLforSEO” appear in text, but that they’re connected through an “employedBy” relationship with confidence scores. The code includes custom functions that handle JSON responses, flatten nested data structures, and automatically download results as CSV files for analysis in spreadsheets or visualization tools. Real example text about MLforSEO demonstrates practical output, showing how Watson identifies entities, assigns types, calculates sentiment, and maps relationships with location indices in the source text.
Use this for:
‧ Building knowledge graphs by automatically extracting entity relationships from unstructured content like about pages, bios, or articles
‧ Understanding competitive landscapes by mapping relationships between companies, products, people, and technologies mentioned in industry content
‧ Enhancing content analysis with sentiment-aware entity recognition that shows not just what’s mentioned but how it’s perceived
‧ Creating structured data from text by identifying entities with DBpedia links for semantic web and schema markup applications
‧ Analyzing author expertise and topical authority by extracting entities and their relationships from content portfolios
‧ Comparing IBM Watson NLU capabilities with other NLP APIs covered in the broader course module
This is perfect for SEO professionals and marketers who want hands-on experience with enterprise-grade NLP APIs, need to process text for entity extraction and relationship mapping at scale, or are evaluating IBM Watson NLU against alternatives like Google Cloud Natural Language or Amazon Comprehend.

What’s Included

  • Complete working code for IBM Watson NLU API including authentication, entity extraction with sentiment, and relationship mapping with CSV export
  • Goes beyond basic entity recognition to map relationships between entities (employedBy, partOfMany, etc.) with confidence scores and source text locations
  • Includes data flattening and export functions that transform nested JSON responses into analysis-ready CSV files for spreadsheets or visualization tools

Get Instant Access

Enter your email and we’ll send you the download link immediately.

No spam, ever
Instant delivery