All projects
07Graph theory / NLP2024

Graph-Based Text Classifier

Network analysis of Medium articles via graph theory, spanning trees, and centrality.

Context
Graph Theory course, UET Lahore
Period
2024
Stack
Python · GraphQL · NetworkX · Gravis
Source

How it works

Articles as graphs.

Takes three topics from the user, collects 15 Medium articles per topic through observed GraphQL requests, cleans and tokenizes the content, converts each article into a graph structure, and runs network analysis — then visualizes the result with Gravis.

  • Accept three topics from the user as input.
  • Use observed Medium GraphQL request patterns to fetch 15 articles per topic (45 total).
  • Clean and tokenize text, removing stopwords, punctuation, and low-frequency terms.
  • Build a graph per article where nodes are tokens and edges are co-occurrence within a window.
  • Run network analysis: minimum spanning tree, degree centrality, betweenness centrality.
  • Visualize graphs and spanning trees interactively with Gravis.

Engineering detail

Medium does not expose a simple public article-search API for this workflow. Understanding the request shape and constructing valid queries was a core part of the project.