liveBook · Manning

Hashtag

As explained in Graph Algorithms for Data Science

A hashtag is a word or phrase prefixed with a hash symbol that labels social media content for categorization and discovery.

A hashtag is a relevant keyword or phrase prefixed with # in a tweet. It categorizes content and helps people discover posts about a topic, increasing visibility among interested users. section 2.4

Model each hashtag as its own Tag node rather than as text buried in a Tweet. Connect a tweet to every tag it contains with a specific HAS_TAG relationship; a tweet can therefore link to many tags. section 2.4.2

Specific relationship types make the graph easier to query and maintain:

  • Use HAS_TAG from Tweet to Tag, so following that relationship always reaches a Tag node. section 2.4.2
  • Avoid a generic HAS relationship for authors, tags, and links, because queries must inspect more relationships and target node types. section 2.4.2
  • Treat tweets and tags as a bipartite network: connections run between the two node types, not directly between two tweets or two tags. section 7.0

Build a hashtag co-occurrence network

Two tags co-occur when the same tweet uses both. Create direct CO_OCCURRENCE relationships between those Tag nodes with Cypher: MATCH (s:Tag)<-[:HAS_TAG]-(:Tweet)-[:HAS_TAG]->(t:Tag) CREATE (s)-[:CO_OCCURRENCE]->(t); This projection supports analysis of tag communities and importance for a hashtag strategy. section 7.0

Figure 2.23 Graph model of tweet’s hashtags
02-23

This graph view shows why hashtags are separate Tag nodes connected to tweets rather than generic properties or relationships. section 2.4.2

How Graph Algorithms for Data Science covers it

How deep it goes
Defines hashtag extraction and graph modeling, then builds a co-occurrence projection for community and importance analysis.
Examples
Uses tweets containing #KnowledgeGraph, #NamedEntityLinking, #Wikipedia, #NLP, #DataScience, and #Graphs, plus a Cypher co-occurrence query.
What it assumes
Assumes familiarity with graph patterns and introduces bipartite networks through tweet and hashtag nodes.
What you can do after
Apply via Cypher to construct hashtag co-occurrence networks and evaluate tags for a Twitter content strategy.
How it connects
Connects hashtags with tweets, bipartite networks, monopartite projections, Jaccard similarity, label propagation, and PageRank.

Also explained in

Compare how 2 books explain hashtag →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.