Ngram and Hashtag Frequencies about Divorce on Twitter in the Philippines

by Alex John Quijano, Sinultian

Created: October 5, 2019, Updated: October 21, 2019

In response to the recent Philippine congressional hearing on three divorce bills, Filipinos expressed their opinions online. According to the Facebook comments reviewed by Rappler, Filipinos in favor for divorce law are citing that the divorce bill is pro women and children that are trapped in abusive households while those who oppose are citing that divorce destroys the sanctity of marriage. (Read on "Senate hearing divorce bill" by Rappler for the recent divorce bill hearing and "Netizens debate divorce" by Rappler for the Facebook comments reviews.)

In this blog, I explored hashtag trends and word usage on Twitter about the divorce bill in the Philippines. I saw similar discourse like the one from the comments on Rappler's Facebook page ("Netizens debate divorce" by Rappler).

The tweets in relation to divorce in the Philippines are scraped (34740 tweets including retweets) using Python programming language. You can reproduce the results shown here visit this Github page sinultian-tweets-philippines-divorce. The tweets are scraped using a public Twitter API. Scraping tweets from a public API is often problematic because the tweets might be automated bots or spam. In this case, I assumed that I sufficiently taken more tweets from legitimate users than automated users. However, further investigations on whether an account is automated or not should be considered in the future.

Figure 1: There are 34740 total tweets scraped. Shown here is the monthly tweet frequency trend from January 2015 to September 2019.

Figure 2: The language distribution of the Tweets.


The first congressional hearing on divorce happened on March 2018 and the second hearing started on September 2019. There is a sharp increase in tweets in 2018 and a gradual increase towards September 2019.

English is the dominant language used in the data. The second is Filipino. This is not a surprise since English is taught in Filipino schools as one of the official languages in the Philippines. The other is Filipino (also known as Tagalog). English is used mostly on mainstream and social media.


Figure 3: The monthly frequency trend of the top 13 occurring hashtags from January 2015 to September 2019. The most frequent hashtag is #divorcepilipinas.

Based on the data, the #divorcepilipinas and #divorcephnow started existing after the first congressional hearing. These hashtags are mostly used by Twitter users who support the divorce bills. Those in favor for the divorce bills are arguing that it helps women and children escape from unhealthy marriages. The #notodivorce and #notodivorceph are used by Twitter users who oppose the bills. Opposition argues that divorce hurts children and the structure of family. Opposition also argues that marriage is proclaimed by God and must not be broken.

I looked at the ngram counts of the tweets to see what words are used within the top 3 hashtags, #divorcepilipinas, #divorcephnow, and #notodivorce.

An ngram is a sequence of n words. For example, the sentence "I love you too." has 2-grams "I love", "love you", and "you too". For the Philippines tweets divorce data, I cleaned the the text first by removing hyperlinks, weird characters, and stopwords (i.e. "the", "and", "or", etc). The tweets are then tokenized and grouped according to language and the top 3 hashtags. All other hashtags are not counted as ngrams.

English Ngrams

Figure 4: The top 15 English 1-gram, 2-gram, and 3-gram for the top 3 hashtags, #divorcepilipinas, #divorcephnow, and #notodivorce.

For the 1-gram counts, the #divorcepilipinas and #divorcephnow has the most frequent words "yes", "us", "please", and "pass" suggesting that most of the tweets have ngrams in favor for the divorce bill. The 1-grams from #notodivorce has the most frequent words "marriage", "god", "union", "pope", and "family" suggesting that the tweets have ngrams associated with religion, the institution of marriage, and family.

We see similar ngram counts for English and Filipino tweets.

Filipino Ngrams

Figure 5: The top 15 Filipino 1-gram, 2-gram, and 3-gram for the top 3 hashtags, #divorcepilipinas, #divorcephnow, and #notodivorce.

Marriage is one of the seven sacraments that a person can attain in the Catholic faith. Catholicism is the dominant religion in the lives of millions of Filipinos around the world. Divorce is viewed by some Filipino Catholics as heresy. While the rest of the world have legal divorce, the Philippines and Vatican City remains without it.

Will the Philippines legalize and accept divorce? The Philippines is on its way to legalize divorce. While legislators are pushing the Divorce bill to pass, public opinion remains polarized because of the Catholic dogma of marriage dominating the Filipino society.

Example Tweets.

English: #divorcepilipinas and #divorcephnow

English: #notodivorce