Definitions

Text mining is the process of distilling actionable insights from text.

Text mining deals with helping computers understand the “meaning” of the text. Some of the common text mining applications include sentiment analysis e.g if a Tweet about a movie says something positive or not, text classification e.g classifying the mails you get as spam or ham etc.

Natural Language Processing (NLP) or Text mining helps computers to understand human language. It involves a set of techniques which automates text processing to derive useful insights from unstructured data. These techniques helps to transform messy text data sets into a structured form which can be used to train computers.

We’ll learn how to do sentiment analysis, how to build word clouds, and how to process your text so that you can do meaningful analysis with it.

This allowed us to analyze which words are used most frequenlty in news articles.

Furthermore, we can use the tools of text mining to approach the emotional content of text programmatically to infer whether current news is positive or negative, or perhaps characterized by some other more nuanced emotional content like surprise or anger.

Setup

The following packages are used:

library(rvest)
library(tm)
## Loading required package: NLP
library(SnowballC)
library(wordcloud2)
library(RColorBrewer)

Data Collection

For this exercise, we will collect the most recent news article from nation.africa website.

We will be using the rvest package that provides a clean way of collecting web data.

site <- 'https://nation.africa'

page_html <- read_html(site)
headline_class <- "headline-teasers_item"

page_html %>% html_elements(paste0(".",headline_class))

# titles
titles <- page_html %>% html_elements(paste0(".",headline_class)) %>%
  html_elements("h3") %>% html_text2()


# links
links <- page_html %>% html_elements(paste0(".",headline_class)) %>% 
  html_elements("a") %>% html_attr("href")

# links <- gsub("https?\\W+\\w+.\\w+","",links)

article_urls <- paste0(site, links)

df <- data.frame()

for(i in 1:length(article_urls)){
  article_url <- article_urls[i]
  
  article <- read_html(article_url)
  
  article_paragraph <- article %>% html_elements('.paragraph-wrapper') %>% html_text2() 
  
  # article_text <- cat(article_paragraph)
  article_text <- paste(article_paragraph, collapse = " ")
  article_text <- gsub("\\s{2,}","",article_text)
  # title, url, article
  article_details <- data.frame(title=titles[i], url=article_url, article=article_text)
  df <- rbind(df,article_details)
}

# save the collected data as a csv file
write.csv(df,'nation-articles.csv',append=FALSE)
df <- read.csv('nation-articles.csv',header=T)
df$titles
## NULL

Data Cleaning

Building a Corpus

A corpus is a collection of documents. A document can be understood as each row having product description and each column having terms. Terms refers to each word in the description. Usually, the number of documents in the corpus equals to number of rows in the given data.

These types of objects typically contain raw strings annotated with additional metadata and details.

articles.agg <- paste(df$article,collapse = " ")


docs <- Corpus(VectorSource(articles.agg))

inspect(docs)
## <<SimpleCorpus>>
## Metadata:  corpus specific: 1, document level (indexed): 0
## Content:  documents: 1
## 
## [1] The 16 boda boda riders arrested over the molesting of a Zimbabwean diplomat have been released after the Director of Public Prosecution (ODPP) said no case has been disclosed against them. The riders have been asked to collect their personal belongings, including lDs and motorbikes from Gigiri Police Station on April 1, 2022. DPP also directed that the prime suspect in the gender violence case against a Zimbabwean diplomat be charged. Zachariah Nyaore Obadiah will be charged over the molestation of the diplomat on March 4 at Westlands. On Thursday last week, Milimani magistrates Robinson Ondieki and Gilbert Shikwe were told the investigation file had been forwarded to the Director of Public Prosecutions (ODPP). Some of the suspects accused of assaulting a female motorist on Wangari Maathai Road.Photo credit: Dennis Onsongo | Nation Media Group Last week Ms Mwanzia asked the magistrates to give the ODPP five days to make its decision. “(Insp Mwanzia) has forwarded the file to the ODPP for perusal and advice on … whether to charge the suspects or not,” prosecutor Christine Oloo told Mr Shikwe. Ms Oloo urged the magistrate to remand the suspects for five more days as prosecutors awaited directions from the ODPP. The riders opposed the request, saying: “We oppose the plea given we have been incarcerated since March 9, 2022.” “We came to court hoping this matter will be finalised and rested today. We need to be free to rejoin our families,” rider James Mutinda Muema told the magistrate. Some of the boda boda riders who were charged at the Milimani Law Courts in Nairobi on March 8, 2022 for contravening traffic rules.Photo credit: Dennis Onsongo | Nation Media Group Those arrested and detained over the diplomat’s attack include Zachariah Nyaore Obadiah, James Mutinda Muema, Samuel Wafula Muswahili, Charles Omondi Were, Japheth Bosire Obano, Hassan Farah Forah, and Wanjuki Lincoln Kinyanjui. Firm decision The others are Joseph Ngugi Mbugu, Lenson Fundi Njururi, Harrison Maina Irungu, Benjamin Ngure Githimii, Ignatius Shitekha Mufwolobo, Martin Kamau Maina, Shadrack Ambia Luyeku, Shadrack Kioko Nyamai, Cliff Gikobi Oyaro and Joseph Kibui Mukambi. In his ruling, Mr Shikwe granted the ODPP two days, until March 28, to make a firm decision whether to charge suspects. But Magistrate Ondieki warned that he would free Mr Nyaore on bond if prosecutors do not charge him. Mr Nyaore was arrested as he attempted to flee to Tanzania after he got wind that police were looking for him. His photo was published as the mastermind of the attack on the diplomat. Eight suspects among the 17 told the magistrates they are not boda boda riders. They were arrested while waiting to board public service vehicles to their homes. All the suspects are remanded at the Gigiri Police Station. Inspector Mwanzia said they are being investigated for violent robbery and gender-based violence. Senior counsel Philip Murgor is representing the UN diplomat.\nMr Nyaore has been detained for 10 days while the other 16 have been in custody for 15 days. “I was arrested by police while passing through the scene of crime while proceeding to drop a client,” Mr Nyaore told Magistrate Ondieki. “My photo was then circulated in both electronic, print and social media depicting me as the key suspect. I was worried and fearing for my life then I decided to go into hiding.” Mr Murgor, a former Director of Public Prosecutions, said that “balanced but thorough investigations have to be conducted in the matter”. He did not oppose the police request to allow ODPP more time to peruse the file and decide whether to charge the suspects. [email protected] A university don who was found dead in a city bed-sitter late last year was in the company of a young lady who had just jetted in from Saudi Arabia. Ms Naomy Morang’a, 25, who had stayed with Prof Zachary Mosoti, 59, for about a week, went missing just after the don’s death in Kamulu area of Nairobi on December 10.Prof Mosoti taught Management and Human Resource Development at the United States International University, while Ms Morang’a had just returned home after two years in the Gulf, where she worked.She had told her friends that the don was not willing to release her so she could visit her parents in Kisii.“He knew that I was planning to travel to Kisii, but he has totally refused to allow me to leave. Yesterday he left and never came back,” Ms Morang’a is heard lamenting on a call to a friend.She also alleged that Prof Mosoti had informed her that his second wife had withdrawn Sh40,000 from his bank accounts. Ms Morang’a had also told her friends that she was not planning to go back to Saudi Arabia as the don had promised to build her a home in Ruai and also take her to college. Search for missing woman Mr Ezekiel Morang’a, her elder brother, said his sister had informed them that she would be landing on December 4. “She informed me that she was to jet into the country on a Saturday and the family was prepared to receive her. I had even travelled to Nairobi to receive her at the Jomo Kenyatta International Airport,” he told the Nation.Documents in our possession, however, show that Ms Morang’a had booked a December 2 flight through Alaklabi Travel and Cargo Agency, which is located at King Faizal street in Saudi Arabia.The Saudi Arabian Airlines plane departed at 10:15pm local time and arrived at Jeddah’s King Abdulaziz International Airport an hour later. She then left Jeddah on December 3 at 08:05am and arrived at JKIA at 11:50am.The brother said that the search for his sister had hit a dead end as no one was speaking about her as almost everyone had concentrated on the death of Prof Mosoti. He accused the police of laxity, saying that they were not keen to address her sister’s disappearance yet there was enough proof that the two had been living together. “We have really tried all we can to ensure that we get to know what really transpired but we are still in the dark. The police are not doing enough,” said Mr Morang’a.Went cold on the case “Were it not for her friends in Saudi Arabia, who shared details of the phone calls they had, we would be in total darkness. The police have abandoned this case,” he added. The family reported the matter at Kamulu police station, but there has been little progress on the case. Mr Morang’a lamented that they have never been informed anything about the matter since they reported, which has left the family in distress.A detective at Ruai police station said it was clear that Prof Mosoti was living with a lady, but they could not tell whether it was Ms Morang’a.“We found a bottle of mango juice, which Prof Mosoti was not using because he was diabetic. We also found receipts for a pair of stockings that had been bought from a local supermarket,” said the officer.He, however, said they were unable to tell whether the lady who was in the house was Ms Morang’a, adding that investigations were still ongoing.The Nation has established that officers went cold on the case despite an earlier indication that they were pursuing the matter as a “marriage gone wrong”.Prof Mosoti had reportedly left his first wife for a mistress and even built her a home. The first wife said the don had rented a house due to domestic issues with his mistress, who was allegedly mistreating him.[email protected] Will Smith stormed the Oscars stage and struck comedian Chris Rock across the face for joking about his wife, in a moment at Sunday's gala that immediately went viral and left stunned viewers questioning if it had been scripted or genuine. Rock, presenting the best documentary prize with a short comedy routine, had cracked a joke comparing Jada Pinkett Smith's tightly cropped hair to Demi Moore's appearance in the film "G.I. Jane" and suggesting she appear in a sequel. Will Smith and Jada Pinkett Smith attend the 94th Oscars at the Dolby Theatre in Hollywood, California on March 27, 2022.Photo credit: Robyn Beck | AFP In a moment that triggered awkward silence and confusion in the Dolby Theatre, Smith strode up to Rock and slapped him, before returning to his seat alongside Jada and shouting profanities. "Keep my wife's name out of your mouth," yelled Smith, forcing the producers to bleep out several seconds of audio from the televised broadcast in the United States. VIA JAPANESE TELEVISION: The uncensored exchange between Will Smith and Chris Rock pic.twitter.com/j0Z184ZyXa— Timothy Burke (@bubbaprog)March 28, 2022 Chris Rock made a joke about Will Smith's wife, Jada being in "G.I. Jane" because of her bald head.Will Smith went up to the stage, and slapped Chris Rock.pic.twitter.com/2BSVxERB6E— LetsOTT Global (@LetsOTT)March 28, 2022 Jada Pinkett Smith, who is also an actress, suffers from alopecia, and publicly revealed her diagnosis in 2018. According to The Hollywood Reporter's Scott Feinberg, in attendance, a tearful Smith needed to be "pulled aside and comforted" by Denzel Washington and Tyler Perry during a commercial break. US actor Denzel Washington (left), US actor Will Smith (centre) and US actor-producer Tyler Perry chat during the 94th Oscars at the Dolby Theatre in Hollywood, California on March 27, 2022.Photo credit: Robyn Beck | AFP "Will and Chris, we're going to solve that like family. Right now we're moving on with love," said Sean "Diddy" Combs, presenting the next section. Elders from Mt Kenya allied tribes at State House in Nairobi on Saturday renewed President Uhuru Kenyatta’s mantle to lead the community for the next five years. He had received the mantle in November 2012 to take over from Mwai Kibaki, and this saw him contest the presidency in 2013 and 2017 on their behalf. “We in 2012 handed him two special sticks (mithigi; muthigi, singular) that symbolise acceptance to lead. These are not ordinary sticks, because they have sacred rituals and accompanying instruments attached to them,” Agikuyu Council of Elders chairman Wachira Kiago told the Nation. One of the sticks is straight and denotes believe in one God while the other comes with two prongs at the top end, signifying the ancestral spirits (ngomi). For one to qualify for such trappings of the apex leadership of the communities, one must be a male, who together with his last-born son must be circumcised. That man is recommended to the community by two categories of elders – athuri a matathi and athuri a Matura Nguru – and the endorsement of the apex of elders called arathi (prophets) after conducting their own due diligence. “The arathi particularly vet whether the proposed community spokesman has engaged in serious crimes like murder, witchcraft and rape/defilement. No one found to have engaged in general crime against the community qualifies to be anointed as a leader,” Mr Kiago said. The muthigi signifying one God (Mwene Nyaga) and who is believed to reside in Mt Kenya (Kirima gia Kirinyaga) before presentation to the anointed spokesman is first taken for a 40-day prayer session at the throne of God in the mountain. Having done this 10 years ago, the prophets did not do it this time around because after deliberations they decided that “the President is still young and has not shown any sign of duty dereliction and hence a unanimous decision to renew the mantle for him”. In the custody of the President now are the two sticks – the two-pronged one being the bearer of the power to lead – a circumciser’s knife that bestows the President with power to circumcise the community’s lads and a set of stringed beads that gives him the power to recommend the dressing code for elders and others in their collective ringermates. He was also presented with a sword that gives him the power to slaughter a goat for rituals as well as a horn to empower him to rally the community together for a cause. “The President was also handed a spear and a Somali sword that empowers him to call his people to war,” he said. And immediately after his leadership mantle was renewed, the President invoked the horn to rally the Gikuyu, Embu and Meru Association (Gema) behind the presidential bid of Raila Odinga in the Azimio la Umoja coalition. “Most of the deliberations in the meeting cannot be discussed in an unstructured manner…That will go against our oath of confidentiality. But suffice to say that the President made his case for one uninterrupted hour in the Gikuyu language and we took the oath to rally our people behind that cause,” Mr Kiago said. Independent State House sources revealed that the President narrated to the elders – who numbered 3,500 and came from across the country where Gema people reside or work – the frustration he had endured at the hands of his deputy William Ruto. “The President emotionally accused Dr Ruto of abandoning his duties and hitting the campaign trail for 2022 and incited Mt Kenya leaders against him,” a source told the Nation. The bigger scheme was that Dr Ruto would inherit and dismantle President Kenyatta’s structures in Mt Kenya to relegate the latter to lame-duck status with no voice both nationally and in the region. According to the sources, the President explained his January 12, 2019 reference to some of his allies being “washenzi” (stupid). “He told us that he was incensed when he held a meeting the previous week with some Mt Kenya leaders to plan how the region would get more development projects…. He said it was for that purpose that he had appointed area people to head important ministries,” the source said. Some MPs from his political backyard leaked the information to the media while others posted it on social media. “We perfectly understood him and identified with his frustration that led him to use that word on those characters… He told us that he was deeply offended when he saw his longtime allies ganging up with Dr Ruto to reveal too much of him to members of the public in a way that even infringed his privacy,” said the source. The closing remarks, according to the sources, were that the President will team up with the elders and Mr Odinga, descend on the Mt Kenya region and hold at least 40 meetings to win area voters to Azimio la Umoja. This declaration on Sunday won the ridicule of MPs Rigathi Gachagua (Mathira) and Alice Wahome (Kandara), both of whom scorned the meeting as “dead on arrival”. Mr Gachagua said “let them come to our regions with their meetings and for every one they hold, we will be holding three counter-ones”. He said the President is late in staging a fight with Dr Ruto as the August 9 polls draw closer. “He will change nothing and his effect will be counterproductive. He remained aloof and coming back to us when we have grown up and moved on is being overambitious, especially coming riding on the backs of divisive political brokers,” he said. Ms Wahome said “the biggest enemy for Azimio success is the President himself since he is riding on the false hope that he can influence Mt Kenya like he used to do from 2012”. She that said if Mr Odinga was wise, “he is better off packaging himself as an independent aspirant”. She warned that the President “will mess you up, inconvenience you by promising you Mt Kenya numbers that are no longer under his grip and should you fall for that trap and shortchange your reliable traditional allies for deceptive newfound warmth in Mt Kenya, the blame will be you”. The elders and the President decided that the Mt Kenya region would only pursue its relevance in the next government through the National Assembly, Senate, Council of Governors and county assemblies. “With the State House tenancy now out of bounds for us in the next government, it was decided that we all belong to the Jubilee Party and insist on all our Mt Kenya leaders being elected under it,” Mr Kiago said. [email protected] The Supreme Court will deliver its judgement on the Building Bridges Initiative (BBI) on Thursday, the court's registrar has announced ending the rising anxiety among Kenyans and the country's political class.The case involves proposal to amend the 2010 Constitution and the dispute at the Supreme Court pits government against a citizens’ voluntary group opposed to the proposed amendments. The much awaited judgment will either revive or burry the government-backed process that started in 2018. The legal bid is also likely to shake up the country’s political and governance system. After conclusion of the hearings on January 23, 2022, the judges led by Chief Justice Martha Koome retreated to make write their judgment. It is not yet clear whether each of the seven judges will come up with his/her own judgment like it happened at the Court of Appeal or they will come up with a single judgment. Being multiple judges deciding together on the same case, there is likelihood of a disagreement on the outcome of the case considering that it also involves various issues and at least seven questions. In such circumstances there will be two or more decisions -a majority decision, dissenting or concurring decisions. Majority decision becomes the ruling of the court. The court’s decision on the BBI is so crucial that it may sway the forthcoming national elections as the judges will rule on whether President Uhuru Kenyatta’s reform plan and introduction of expanded Executive are constitutional. The President together with former Prime Minister Raila Odinga have been on one side of the dispute while Deputy President William Ruto has been on the other side. The reforms started in 2018 shortly after the March 9 ‘Handshake’ between President Kenyatta and Mr Odinga. The top Judges are expected to assess the High Court and Court of Appeal’s decisions to reject the sweeping reforms that were said to aim at ending the “winner takes all” and ethnic politics. The two lower superior courts found the proposed amendments were unconstitutional for various reasons including that the President has no authority to push for Constitutional amendments through popular initiative. Another reason was that the BBI promoters usurped the people's sovereign power.So tricky is the situation because the Supreme Court is expected to rule on the many proposals contained in the Constitutional Amendment Bill (2020) –BBI- among them recommendations regarding creation of the Judiciary Ombudsman who shall be appointed by the President. The proposed ombudsman will have powers to discipline Judiciary officials, including suspending, warning and reprimanding them. Another proposal concerning the Judiciary is enhancement of the number of executive appointees in the JSC from four to five. The Judiciary had initially protested against the proposal saying “the unusually heavy tilt towards Executive representation in the JSC compared to other Commissions has the potential danger of entrenching Executive authority in the JSC and by extension, in the Judiciary”. Other key issues to be determined by the top court relate to the Basic Structure Doctrine, the role of the President and state officers in the amendment of the constitution through popular initiative and immunity of the president. Also in the list is constitutionality of the second schedule to the Constitution (Amendment) Bill, 2020 and the quorum of the electoral Commission in discharging its constitutional mandate. The Supreme Court will be grappling with is the applicability of Basic Structure Doctrine in Kenya. It will determine whether the Kenya's Constitution can only be changed by following four sequential steps -civic education, public participation, constituent assembly debate, and a referendum. Both the High Court and the Court of Appeal ruled the BBI was unconstitutional for failing to follow the sequential steps. The two lower superior courts said basic structure principle is applicable to Kenya. On Basic Structure Doctrine the Supreme Court is expected to determine whether the constitution is subject to an implied limitation on the power of amendment of any of its provisions. Further whether the said limitation can be invoked outside the parameters set out under Chapter 16 which codifies the manner of its amendment.The top judges will also determine whether a President can initiate amendment of the Constitution through a popular initiative. The lower superior courts ruled that the President has no power to initiate an amendment of the Constitution through the popular initiative. The court will rule on the constitutional rights of the President as a citizen, including his right to equal treatment under the law (Article 27), freedom of expression (Article 33) and freedom to make political choices (Article 38). The question whose answer is expected from the court is does the president lose these rights by dint of his election as such?Further in the list is a question relating to allocation of the 70 parliamentary constituencies proposed by BBI promoters. The court of appeal and the High Court found that the proposal was illegal as delimitation of boundaries is the mandate of the Independent Electoral and Boundaries Commission (IEBC).Another question is whether President can be sued in his personal capacity for anything done or not done while in office (Presidential immunity). The lower superior courts said civil proceedings can be initiated against the President in his personal capacity, meaning he does not have pure immunity.Also to be determined is the question related to public participation in the BBI Bill and the quorum of the electoral commission at the time it was dealing with the BBI Bill. The main issue for settlement will be the object of Article 250(1) of the Constitution that sets the minimum number of commissioners of the IEBC at three while the IEBC Act places minimum quorum at five commissioners. If the commission is considered legitimately constituted with three commissioners, the court will be expected to resolve the question whether an Act of Parliament can set a higher legitimacy threshold for an independent commission than that set by the Constitution. Another issue is whether a referendum ballot paper involving multiple amendments should contain multiple questions or a single question. Ends Mystery surrounds the circumstances under which a man was boiled to death in a horrendous tragedy at a steel factory in Thika on Friday afternoon. Mr Caleb Otieno, 25, reportedly fell into a metal boiler at Blue Nile Rolling Mills Ltd while on duty in a horrific accident that has shocked his workmates, family and friends. It’s still unclear how Mr Otieno ended up in the boiler, where his body was completely liquefied, leaving his colleagues and relatives grieving. Some of his workmates said his entire body was mixed with the boiler’s contents. Mr Otieno’s family yesterday alleged that their loved one was thrown into the boiler, although some relatives questioned the company’s safety standards. “The company is not willing to tell us what happened or own up and take responsibility as our brother died within their factory. His colleagues told us that he died after he fell into a boiler. Nothing official has come from his employer,” said Mr John Agwambo, a brother. Blue Nile Rolling Mills Ltd is a sister company of Blue Nile Wire Products Ltd, the manufacturers of barbed wires and the two are owned by the Blue Nile Group. Blue Nile Rolling Mills Ltd are steel manufacturers and recently announced that they had received Sh862 million from the International Finance Corporation (IFC) – a private lending arm of the World Bank – to expand their plant in Thika, Kiambu. Mr Otieno left Kisumu East for Thika town nearly 10 years ago after finishing his Kenya Certificate of Secondary Education (KCSE). He started off as a casual labourer at consumer goods manufacturer, Bidco Africa, where he worked for three years before he got a job at Blue Nile Rolling Mills Ltd. He had worked there for seven years. “He was a quiet man who was committed to his work. It is unfortunate that we have lost him. I am not able to comment further because the management has told us not to speak about it as the matter is under investigation by police,” said one of his co-workers. Since Mr Otieno’s body was liquefied, the family said they would seek help from authorities to see whether the employer could empty the boiler for them to retrieve any remains for burial. “We just want the authorities to intervene and compel the company to give us access to the boiler and see whether we can salvage anything that we can use for burial. It’s so painful,” said Mr Agwambo. “The employees who were working with our brother have told us that he was burnt and absorbed into the metal boiler. He was completely liquefied, meaning we might not find anything,” he added. When the Nation contacted Blue Nile Rolling Mills Ltd, an official declined to comment about the incident and referred us to the human resource department. Efforts to contact the HR department were, however, unsuccessful. Thika DCIO Joseph Thuvi said investigations were under way. He, however, ruled out foul play and termed the incident as “an accident”. “The matter is under investigations and preliminary investigations have shown that it was an accident and that the deceased was not thrown into a metal boiler as it is being alleged,” he said. When the Nation contacted General Kago Funeral Home in Thika, an official said no booking of a body from the company had been made. General Kago Funeral Home is a public morgue near the steel factory. Blue Nile launched operations in 2006 by acquiring a steel wire product manufacturing facility in Kikuyu, Kiambu County. The plant has a capacity to produce 100,000 metric tonnes of steel products and 15,700 metric tonnes of wire products. Members of the National Assembly have dashed school going children’s hopes of receiving free milk, popularly known as Maziwa ya Nyayo, after it rejected the Basic Education (Amendment) Bill, 2020. The Bill, sponsored by Nominated Senator Beatrice Kwamboka, proposes re-introduction of free supply of milk to all pupils and pre-primary learners. “School milk programmes not only positively contribute to the growth of the dairy sector, but they also improve nutrition and increase school attendance,” the bill says. “School health and nutrition programmes, particularly when embedded within broader child development strategies, are an integral part of the long-term development of a child," further reads the Bill. The Bill emanated from the senate and was passed in July last year but was sent to the National Assembly for concurrence before being sent to President Uhuru Kenyatta to assent to it. However, the National Assembly committee on education slammed brakes on the Bill saying it would affect other school meal programmes which are currently ongoing. “The implementation of the amendment would amount to expanding the current school meals programme. In seeking to provide milk for learners, other meals would be affected owing budgetary shorts,” the committee says in its consideration of the proposal. The committee further pointed out that before the proposal is brought to Parliament as a legislation, it needs to become a policy first before it can be legislated. The Maziwa ya Nyayo programme was introduced by late President Daniel Moi but was cancelled after it proved too costly and unsustainable for successive governments. While passing the Bill last year, senators said the re-introduction of the will improve nutrition. “By supporting this Bill, we will not only increase enrolment of children to schools but also increase the literacy levels on a gender basis. We will also benefit in terms of equity of health nutrition,” Nominated Senator Naomi Shiyonga during the debate of the Bill in the senate. The Bill now heads back to the Senate. If Senators agree with the observations of the National Assembly, then that will be the end of it but if they reject the reasons advanced, then the Bill heads to the mediation committee. The mediation committee will have 30 days to thrash out the divisive clauses. Mediation is a process by which the Houses of Parliament attempt to build consensus on contended provisions of a Bill or the entire Bill whose passage requires consideration by both Houses. Mediation happens when one House disagrees with the version of a Bill or amendments made to it by the other House. The intention of mediation is to develop an agreed version of the Bill that can be passed by both Houses. A mediation committee consists of an equal number of members of both the National Assembly and Senate appointed by the two speakers who mostly consults the Whips. The committee mostly consists of the mover of the Bill, chairpersons or members of the relevant committee, ranking members that originally considered the Bill, members with strong views either against or in support of the contended clauses. Other members of the committee include members with experience on the subject of the Bill and leaders of the Majority and Minority parties. In accordance with Article 112 of the constitution, the mediation committee is required to resolve the stalemate within 30 days. When the mediation committee fails to agree, the Bill is deemed to have been defeated and the process starts afresh in the same or amended form. [email protected] This campaign period, political leaders are flocking churches to seek blessings and hunt for votes. Among the most popular churches for such politicians is the famed Dini ya Roho Mafuta Pole ya Afrika Church in West Pokot. Sitting prominently on a high point between the Tamugh and Sook hills, the church has over the past decade been giving special names to politicians who go there. Dini ya Roho is a majestic church with fine finishes, with no comparable building in the vicinity dotted by mostly traditional Pokot homes. This is the headquarters of the church, which has more than 60,000 members in West Pokot, Baringo and parts of Uganda. It was registered 10 years ago. Followers call it their "Jerusalem” – the place where they believe the Messiah, Jesus Christ, died and was resurrected. The church building has two doors. Men enter through the right door and women through the left. Before stepping into the church, believers must remove their shoes to show respect for their God. They always wear white gowns during prayers. On the door are the numbers 777. Church leaders explain that it is a recognition sign for the church as directed by the Holy Spirit. The organisational structure has three levels: the Jerusalem, the highest level; the Zion, the regional headquarters or diocese in charge of between 10 and 25 congregations/bomas; and the Boma, representing the individual congregation as the lowest unit. Various leaders from the county and across Kenya have visited the church to seek blessings and make contributions to develop the region. The latest to visit was Kapenguria MP Samuel Moroto, a member of the church who visited on Saturday and donated motorcycles to pastors to help spread the gospel. Deputy President William Ruto visited the church in 2018, ODM leader Raila Odinga in 2020, and Kanu chairman Gideon Moi in 2021. When Mr Odinga visited with a host of high-profile leaders, including Kakamega Governor Wycliffe Oparanya, it rekindled memories of the resilient journey of a traditional African church whose pioneers stood up against the colonial regime, culminating in a massacre some 70 years ago. The clerics prayed for Mr Odinga and DP Ruto on various dates and interceded for blessings for them from their God. DP Ruto was named Rimmon, Mr Odinga became Loisa, and Mr Moi was called Steve Stiko. Other leaders also received special names: West Pokot Governor John Lonyang’apuo was named Andika Zion; former Governor Simon Kachapin (Anzem); Senate Majority Leader Samuel Poghisio, who is also the West Pokot senator (Laifon); Mr Moroto (Restam Lambai: and Woman Representative Lillian Tomitom (Cheanzem). DP Ruto’s Rimmon is a name for a man of the tribe of Benjamin in the Bible. Benjamin was one of the 12 sons of Jacob. Mr Odinga’s Loisa was the name of an angel, which Bishop Risti Kapel said was revealed to him in a dream.\nBishop Kapel says every member of the church is given a name derived from the dreams of the apostles or senior members of the group. “The names we give to leaders came from the Holy Spirit through the church clerics as it was done by the founder of the Church Lukas,” he told Nation.Africa. He said the church put up a monument in Kolowa, Baringo County, to remember their founder Lukas Pkiech, who died there. Every year on April 24, the church visits Kolowa to mark his death. Bishop Kapel explains that the church preaches the Holy Bible, but blends it with Pokot culture and traditions and modern Christianity. Ali Mari, a worshipper, says politicians like to visit the church to seek blessings because they eventually succeed in getting the seats they aspire for. “When they visit the church, the religious leaders apply anointing oil on them and bless them, and when they leave here, they eventually succeed in their ambitions and dreams,” he said. Every year, on November 3, members of the influential church converge to thank God that their church was recognised after decades of alienation. The celebrations are also used by the church to raise money for various projects to help develop Jerusalem.\nDini ya Roho was founded in 1940 by Lukas Pkiech, a blacksmith who lived in Keringet village near today’s Kapenguria town. The church was founded by Pokots who were against European colonial rule. But it was sidelined by successive governments because it was believed to be anti-government. Local leaders had long pushed for the church's legalisation in vain, until 10 years ago. After years of pressure, the Justice minister at the time, Eugene Wamalwa, handed over the certificate of registration to Apostle Aristi Kapel, the head of the church, in Tamugh, Kapenguria constituency. Despite being regarded by many as a sect, its members have always insisted it is a church that follows the biblical story of Christianity. Founder Pkiech, who had links with Elijah Nameme, a Luhya “prophet”, was a strong political leader during the colonial time. He led the Pokot community against European colonisation, which led to the famous Pokot resistance of the 1950s. Pkiech said the Holy Spirit had renamed him Arususu and told him to start a church that would accommodate Africans. He used the opportunity to mobilise Pokots to organise anti-government campaigns and fight the Europeans. The resistance led to the deaths of Pkiech and more than 1,000 other Pokots in 1952 at a battle with colonialists in Kolowa. After independence, the group was declared a proscribed society and its members went underground. Others carried on Pkiech’s vision and assumed leadership, such as Rosti Lakuny, who fled Kolowa and continued with the church. Despite many hardships and under the ever-watchful eye of suspicious authorities, Dini ya Roho has developed its fellowship, built local churches and established a leadership structure and administration. Rosti died in 1997, and the current leader is Aristi Kapel. Apostle Kapel told Nation.Africa that the group's doctrines are entrenched in the Bible and guided by the Holy Spirit. He said the church supports good morals among members and doesn’t allow anything that is against the Holy Book. Krop Kilekwang, a member, says the church instills strong values in its faithful. “It is not just about our beautifully designed headquarters. It is about great values and beliefs. We are guided by the Ten Commandments in the Bible,” he says. Mariao Krop, another faithful, said: “This was the church that existed (in West Pokot) before missionaries and colonial masters came to interrupt our faith.” Pkech returned to West Pokot from Kabete in Kiambu County in the late 1930s. He had been trained as a blacksmith and upon his arrival, he started making jingles in his Keringet village. The Pokot loved traditional songs and Pkech skillfully delivered the most crucial instrument – the jingle – making him popular. Pkech was arrested for the second time and taken to Nakuru. He escaped and walked all the way to Kapenguria. He took his gospel to Kolowa in Tiaty, where he was allegedly assassinated by colonialists on April 24, 1950. Several worshippers were also shot dead in the carnage. Stephen Kodingura, a church member, says since its inception, the church has been on the frontline promoting peace, fighting retrogressive practices like female genital mutilation (FGM) and early forced marriages of young girls. "FGM is an outdated practice in this region. Early marriages are no longer experienced,” Mr Kodingura said. He said the church has helped restore peace among warring communities in the region. "The government should fund such churches in our county for long-term peace, especially on our borders with neighbouring counties.” Speaking in Tamugh during a meeting on Saturday, Mr Moroto, the Kapenguria MP, said the church has played a key role in restoring peace. [email protected] As the United Democratic Alliance (UDA) national delegates’ congress was going on recently, a video clip from the event was lighting up social media. It featured Deputy President William Ruto’s aide Farouk Taigut Kibet in an animated conversation with party chairman Johnson Muthama and secretary-general Veronica Maina. He appeared to be giving instructions on how the two leaders should progress with the NDC. “Sasa ambia kila mtu anyamaze (Now tell everyone to be quiet),” Mr Kibet can be heard instructing Mr Muthama in one of the clips. But Mr Muthama says the public misconstrued the conversation they were having. “That was a totally wrong perception. Why should I have commotion with Farouk? We were not sharing anything, he was not looking for a chance to speak. He was a messenger being sent from me to the DP and from the DP to me. That is what happened,” said Mr Muthama. It was not just Muthama and Ms Maina who were receiving the instructions from Mr Kibet. Even the event’s masters of ceremonies too ‘heard’ from him during the event. Powerful gatekeeper Such is the power that Mr Kibet wields around the deputy president that he has become one of the most powerful gatekeepers for any political leader. His name stands out among the DP’s aides: he determines who sees him and who will not. At the rallies, he also determines who speaks and in what order. In an earlier video clip from the DP’s campaign trail, he appears to order nominated senator Millicent Omanga back on stage to dance. With no clear job description, Mr Kibet is the ‘Mr Fix it’ for Mr Ruto and even MPs supporting the DP have to be in his good books to continue visiting the Karen residence. Whether the recent appointment of Davis Chirchir, a former Energy Cabinet Secretary in the Jubilee administration, to be Mr Ruto’s chief of staff could change the power matrix at the DP’s office remains to be seen. But Mr Kibet represents a growing list of powerful gatekeepers for leading Kenyan politicians. Often operating behind-the-scenes, these powerful men control access to the big men and women as well as the diaries of their bosses. In the process, some of them have become hugely wealthy because of their closeness to the bosses. Political commentator Javas Bigambo calls them the “socio-political enablers” of the leaders and adds that “any leader worth their name, not just the presidential hopefuls” have such people around them. Unquestionably loyal “They are unquestionably loyal and have got the best interests of the leader. They are also sworn confidants and even hold property in trust for the leaders,” he said. Former State House aide Joshua Kulei had a very close relationship with President Daniel Moi that some of the former president’s property were in his name. For Mr Dismas Mokua, the gatekeepers are important as a buffer and take the heat for their bosses. “These insiders are also used in plausible deniability projects. These insiders are also important because they offer the politicians safe landing and a buffer zone,” says Mr Mokua. Since his election in 2013, President Uhuru Kenyatta has held on to Joseph Kinyua not letting him go even when at one point it was reported that he had asked to leave. As the head of public service, he has often shunned the limelight and is politically less visible but has been devoted to the nuts and bolts of running the government. On the other side is State House Comptroller Kinuthia Mbugua, the former Nakuru governor. As the presidency’s accounting officer, people around Mr Ruto have accused him of denying the deputy president’s office financial resources to pay staff allowances and per diems, as well as fuelling the cars the DP uses in his political campaigns. Non-public servants But around the president are also non-public servants who are powerbrokers. For instance, there is Muhoho Kenyatta, the president’s brother who unofficially wields immense powers and has the president’s ear. As Prime Minister, Mr Odinga had Caroli Omondi, who as his Chief of Staff wielded immense power. The two have since fallen out and Mr Omondi has failed in all his attempts to capture the ODM party ticket to run for parliament. He still retains an array of aides to whom he can delegate duties including Andrew Mondoh, who heads his office at Capitol Hill. But some have stood out as the most trusted confidants. Suna East MP Junet Mohamed is emerging to be one such gatekeeper for the presidential hopeful. He has become one of Mr Odinga’s most trusted lieutenants and was the only MP to accompany him to the handshake with President Uhuru Kenyatta in March 2018. Mr Mohamed’s stature has grown over time: from a mayor, he now wields immense power around Mr Odinga, often emceeing his events and like Mr Kibet, has sway over who speaks at the events. Mr Mohamed’s closeness and growing influence around Mr Odinga has bred resentment by some ODM MPs towards him. One senator was even reported to have organised MPs to heckle him in Kisumu. As it turned out, the plan leaked and Mr Mohamed did not accompany Mr Odinga to Kisumu. But the MP has had a difficult time trying to get an audience with Mr Odinga to apologise. Odinga’s kitchen cabinet He has displaced traditional members of Mr Odinga’s kitchen cabinet such as Siaya Senator James Orengo who for long has been the go-to guy around the former premier. The powerful gatekeepers around Mr Odinga also consist of close family members like his wife Ida Odinga and daughter Winnie Odinga, the latter who has been described as the “real force” behind her father’s current presidential campaign secretariat. She has been involved in her father’s campaigns, taking up prominent roles, for instance, in organising the launch of Azimio la Umoja meeting in December 2021. She recently also accompanied Mr Odinga to the UK. In an interview she gave in 2018, she described herself as her father’s “bodyguard, his briefcase carrier, travel companion or even driver if need be.” But even more importantly, for Mr Odinga, the real power behind the throne is his wife, Ida. She wields immense power around her husband that sometimes those in the know say it is easier to get to the man through the family matriarch – she gets things done. She is one of the people said to have convinced Mr Odinga to agree on a political truce with the president in 2018, an act of rapprochement that changed the course of the country’s politics for good and left Deputy President William Ruto gasping for breath. Mudavadi’s spokesman Every big-name politician has one or two of such gatekeepers and ANC party leader Musalia Mudavadi is no exception. Given his longevity in politics, he has had many assistants yet one name has stuck around him for much longer than anybody else: Kibisu Kabatesi, his long-serving spokesman. In recent times he has, however, become less visible around Mr Mudavadi though he authoritatively speaks on his behalf. There is also Geoffrey Kanoti, the ANC director of political affairs and head of protocol at the Musalia Mudavadi presidential campaign centre. The man who is eyeing the Khwisero parliamentary seat represented Mr Mudavadi at what was to be the ANC leader’s last engagement as a member of One Kenya Alliance (OKA). Besides the two, there is Dan Ameyo who Mr Mudavadi trusts to negotiate political deals on his behalf. All the three have Mr Mudavadi’s ear and he confers with them a lot of times, according to people around Mr Mudavadi. Like Mr Odinga and President Kenyatta, the family has been key to Mr Mudavadi’s journey and his wife, Tessy, plays a very important, behind-the-scenes gatekeeping role. She has been very much involved in her husband’s political decisions and even had a major role in him agreeing to work with Mr Ruto under the Kenya Kwanza Coalition. Moi, Salat bond Around the Kanu chairman Gideon Moi, there is Nick Salat who is also the independence party secretary-general. He carries a lot of weight around Mr Moi and has remained the party secretary-general. Having undergone the rites of passage together in their teenage years, the bond between the two has stood the test of time and ‘chairman’ consults him before undertaking any major political decision. At a time when the Oka alliance was seen to be dragging its feet on whether to join forces with Azimio or go it alone, Mr Salat publicly urged Mr Moi to proceed on his own and join forces with Mr Odinga if his co-principals were having second thoughts about it. It didn’t take long before the Baringo Senator joined Azimio. From fielding questions from the press and sometimes meeting ‘difficult’ political players, Mr Salat takes the flak on behalf of his boss.[email protected]; [email protected] For the better part of last year and a bit of 2022, Alfred Arita kept his Facebook followers updated with posts on how he would wrestle for – and win – the West Murirango parliamentary seat in Nyamira County. He also shared his plans for the people of the constituency. Then, over a week ago, the missionary, who operates under the aegis of Alfred Arita Ministries, dropped a bombshell. He was quitting the race.“This decision comes after close to three months of some honest personal soul searching, deep reflection, wide consultations and quality prayers,” he said. Although Arita never delved into details, anecdotal evidence shows that we are in a political season when anything goes and many will do whatever it takes to bag a political seat. The church, being a magnet for worshippers each week, is a fertile hunting ground.Because of this, snake oil salesmen, charlatans, the flotsam and jetsam of society – in general men and women with the morals of a brothel owner – all rush to church to be identified as Christians. For genuine believers, the stakes are usually high, and some opt to drop out of the race altogether.\nJust around the same time Arita was announcing his withdrawal from contesting, he shared the frustrations of a close friend of his (name withheld) who is running for a parliamentary seat in one of the Luo Nyanza counties.The exasperated man said what he was learning on the ground was that it was hard to be a Christian and engage in politics at the same time. "Firstly, one needs full pockets all the time because voters believe that whoever is contesting must have enough money to dish out. When you don't have enough money to give tokens here and there plus fundraiser contributions, they (voters) don't take you seriously,” the candidate said.“That is not all. Opponents with branded cars and speakers singing all night are perceived as more serious aspirants than those without such political razzmatazz. Well-choreographed propaganda “Secondly, you need more lies because voters seem to love it more than the truth. My brother, I have discovered that truth doesn't make sense to voters. Blatant liars command such attention and support.“You have to lie about what you will do for them because you haven't been in that office after all. You also must peddle small lies here and there about your opponents.” He also cited the need to “have more well-choreographed propaganda about your competitors because it spreads faster than the best ideology. It also shifts perceptions.”“Lastly, and what is more challenging to me, it is like you must constantly sing about your party leader in every meeting as you attack his opponents, who are not necessarily your enemies.“That has been the most challenging for me as a Christian and that is why most of my supporters feel like I am a mole within their party. No room for neutrality." This is probably what pushes people like Osborne Osanjo, a deacon with a Seventh Day Adventist church on the outskirts of London, to conclude that politics and Christianity do not mix. “I don’t personally believe Christians should meddle in politics. That’s my personal belief, so I don’t vote at all. I don’t vote and it’s a personal conviction. But I don’t judge those who vote,” he said in an interview with the Nation. But talking to other Christians, the narrative that comes out is that politics is indeed a dirty game and it is for that reason Christians must join it and try to make a difference. Pastor Gibson Anduvate of International Christian Centre (ICC), a Kenya Assemblies of God congregation in Nairobi, says Christians are needed in politics. He quotes Proverbs 29:2: “When the righteous are in authority, the people rejoice: but when the wicked beareth rule, the people mourn.”Balkanising the country “Christians have the right to vie for leadership positions and they must do it in a way that adds value to the political scene. If they join politics and join the bandwagon then they will not be living up to their calling,” he said. Kenya is once again in the season when some political leaders will seek to balkanise the country into political silos, warned Dr Calisto Odede, the presiding bishop of Christ is The Answer Ministries (CITAM).People from a certain region are expected to support a leader from that region and going against the grain can have devastating consequences on the perceived traitor. Unfortunately, he says, even some men and women of the cloth have been caught up in the divisions. For his part, communication specialist Kaplich Barsito believes that Christians have every right to take part in politics. “Politics is wielded in the society and Christians are part of the society. So until they are called to heaven by rapture or death, Christians are called upon to be ambassadors of Christ including the political arena, which they should see as a mission field.” Barsito should know, having served in senior positions, including a stint as a personal assistant to Stephen Kalonzo Musyoka when the latter was vice-president.Talking of Musyoka, he is the senior-most politician publicly touting his born-again credentials. He has been commended by his admirers for taking his time before committing to a political cause. They attribute this to his Christian beliefs. Not so for Alfred Ng’ang’a. The journalist turned PR guru sees Musyoka differently. Challenging political terrain “As for Kalonzo, Christian or not, he would do better if he consulted widely and learnt to be a team player. He seems to be a man in a hurry to bag the prize at any expense. That exposes him to many risks, including perhaps falling into traps when carrots are dangled,” Ng’ang’a said.“A man of his stature must rely on the counsel of his trusted lieutenants. The lieutenants must scrutinise documents and ensure legal and public interest soundness before he puts pen to paper. His communication aides do a fine job but must also control his messaging. Few leaders do well with spontaneous messaging.” But Barsito counters with this: “I have served under the former vice-president and we are also friends. I can say for sure that he has done his best to remain true to his Christian walk and integrity as he navigates the challenging political terrain.” Another politician proud of his deep Christian faith is Deputy President William Ruto. The man with a fighting chance of succeeding Uhuru Kenyatta has been an ally of the Church for a long time, donating money all over the country for one project after another.This has not gone down well with his detractors, who allege, without proof, that the man has been involved in some Chinese accounting to land into such huge amounts.With all the allegations and claims of impropriety against him, Barsito said: “I have known the DP and Mama Rachel since 1990, especially in interactions at the North Rift Evangelistic Team (NORET), where he was a strong preacher and founder member.“Even though we have never been in the same political camp, I can testify to his faith as a Christian. Much has been said about him but who are we to judge?” [email protected]

Text preprocessing

Before we dive into analyzing text, we need to preprocess it. Text data contains white spaces, punctuations, stop words etc. These characters do not convey much information and are hard to process. For example, English stop words like “the”, “is” etc. do not tell you much information about the sentiment of the text, entities mentioned in the text, or relationships between those entities. Depending upon the task at hand, we deal with such characters differently. This will help isolate text mining in R on important words.

Common Text Cleaning Steps:

Remove stop words - Stop words are a set of words which helps in sentence construction and don’t have any real information. Words such as a, an, the, they, where etc. are categorized as stop words. Convert to lower - To maintain a standarization across all text and get rid of case differences and convert the entire text to lower.

Remove punctuation - We remove punctuation since they don’t deliver any information.

Remove number - Similarly, we remove numerical figures from text

Remove whitespaces - Then, we remove the used spaces in the text.

Stemming - Finally, we convert the terms into their root form. For example: Words like playing, played, plays gets converted to the root word ‘play’. It helps in capturing the intent of terms precisely.

# remove links
removeUrl = function(x) gsub("http\\S+","",x,perl=TRUE)
docs <- tm_map(docs, content_transformer(removeUrl))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(removeUrl)):
## transformation drops documents
# remove punctuation
docs <- tm_map(docs, removePunctuation)
## Warning in tm_map.SimpleCorpus(docs, removePunctuation): transformation drops
## documents
# remove special characters
# toSpace <- content_transformer(function(x,pattern){return(gsub(pattern," ",x))})
# docs <- tm_map(docs, toSpace, "-")
# docs <- tm_map(docs, toSpace, "'")
# docs <- tm_map(docs, toSpace, '"')

removeSpecialChars <- function(x)gsub("[^ [:alnum:]]","",x)
docs <- tm_map(docs, content_transformer(removeSpecialChars))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(removeSpecialChars)):
## transformation drops documents
# remove numbers
docs <- tm_map(docs, removeNumbers)
## Warning in tm_map.SimpleCorpus(docs, removeNumbers): transformation drops
## documents
# transform to lowercase
docs <- tm_map(docs, content_transformer(tolower))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(tolower)):
## transformation drops documents
# remove stop words
docs <- tm_map(docs, removeWords, stopwords('en'))
## Warning in tm_map.SimpleCorpus(docs, removeWords, stopwords("en")):
## transformation drops documents
# remove custom stop words
my_stop <- c('also','said','per','cent')
docs <- tm_map(docs, removeWords, my_stop)
## Warning in tm_map.SimpleCorpus(docs, removeWords, my_stop): transformation drops
## documents
# eliminate the extra whitespace
docs <- tm_map(docs, stripWhitespace)
## Warning in tm_map.SimpleCorpus(docs, stripWhitespace): transformation drops
## documents
inspect(docs)
## <<SimpleCorpus>>
## Metadata:  corpus specific: 1, document level (indexed): 0
## Content:  documents: 1
## 
## [1]  boda boda riders arrested molesting zimbabwean diplomat released director public prosecution odpp case disclosed riders asked collect personal belongings including lds motorbikes gigiri police station april dpp directed prime suspect gender violence case zimbabwean diplomat charged zachariah nyaore obadiah will charged molestation diplomat march westlands thursday last week milimani magistrates robinson ondieki gilbert shikwe told investigation file forwarded director public prosecutions odpp suspects accused assaulting female motorist wangari maathai roadphoto credit dennis onsongo nation media group last week ms mwanzia asked magistrates give odpp five days make decision insp mwanzia forwarded file odpp perusal advice whether charge suspects prosecutor christine oloo told mr shikwe ms oloo urged magistrate remand suspects five days prosecutors awaited directions odpp riders opposed request saying oppose plea given incarcerated since march came court hoping matter will finalised rested today need free rejoin families rider james mutinda muema told magistrate boda boda riders charged milimani law courts nairobi march contravening traffic rulesphoto credit dennis onsongo nation media group arrested detained diplomats attack include zachariah nyaore obadiah james mutinda muema samuel wafula muswahili charles omondi japheth bosire obano hassan farah forah wanjuki lincoln kinyanjui firm decision others joseph ngugi mbugu lenson fundi njururi harrison maina irungu benjamin ngure githimii ignatius shitekha mufwolobo martin kamau maina shadrack ambia luyeku shadrack kioko nyamai cliff gikobi oyaro joseph kibui mukambi ruling mr shikwe granted odpp two days march make firm decision whether charge suspects magistrate ondieki warned free mr nyaore bond prosecutors charge mr nyaore arrested attempted flee tanzania got wind police looking photo published mastermind attack diplomat eight suspects among told magistrates boda boda riders arrested waiting board public service vehicles homes suspects remanded gigiri police station inspector mwanzia investigated violent robbery genderbased violence senior counsel philip murgor representing un diplomatmr nyaore detained days custody days arrested police passing scene crime proceeding drop client mr nyaore told magistrate ondieki photo circulated electronic print social media depicting key suspect worried fearing life decided go hiding mr murgor former director public prosecutions balanced thorough investigations conducted matter oppose police request allow odpp time peruse file decide whether charge suspects email protected university don found dead city bedsitter late last year company young lady just jetted saudi arabia ms naomy moranga stayed prof zachary mosoti week went missing just dons death kamulu area nairobi december prof mosoti taught management human resource development united states international university ms moranga just returned home two years gulf workedshe told friends don willing release visit parents kisiihe knew planning travel kisii totally refused allow leave yesterday left never came back ms moranga heard lamenting call friendshe alleged prof mosoti informed second wife withdrawn sh bank accounts ms moranga told friends planning go back saudi arabia don promised build home ruai take college search missing woman mr ezekiel moranga elder brother sister informed landing december informed jet country saturday family prepared receive even travelled nairobi receive jomo kenyatta international airport told nationdocuments possession however show ms moranga booked december flight alaklabi travel cargo agency located king faizal street saudi arabiathe saudi arabian airlines plane departed pm local time arrived jeddahs king abdulaziz international airport hour later left jeddah december arrived jkia amthe brother search sister hit dead end one speaking almost everyone concentrated death prof mosoti accused police laxity saying keen address sisters disappearance yet enough proof two living together really tried can ensure get know really transpired still dark police enough mr morangawent cold case friends saudi arabia shared details phone calls total darkness police abandoned case added family reported matter kamulu police station little progress case mr moranga lamented never informed anything matter since reported left family distressa detective ruai police station clear prof mosoti living lady tell whether ms morangawe found bottle mango juice prof mosoti using diabetic found receipts pair stockings bought local supermarket officerhe however unable tell whether lady house ms moranga adding investigations still ongoingthe nation established officers went cold case despite earlier indication pursuing matter marriage gone wrongprof mosoti reportedly left first wife mistress even built home first wife don rented house due domestic issues mistress allegedly mistreating himemail protected will smith stormed oscars stage struck comedian chris rock across face joking wife moment sundays gala immediately went viral left stunned viewers questioning scripted genuine rock presenting best documentary prize short comedy routine cracked joke comparing jada pinkett smiths tightly cropped hair demi moores appearance film gi jane suggesting appear sequel will smith jada pinkett smith attend th oscars dolby theatre hollywood california march photo credit robyn beck afp moment triggered awkward silence confusion dolby theatre smith strode rock slapped returning seat alongside jada shouting profanities keep wifes name mouth yelled smith forcing producers bleep several seconds audio televised broadcast united states via japanese television uncensored exchange will smith chris rock pictwittercomjzzyxa timothy burke bubbaprogmarch chris rock made joke will smiths wife jada gi jane bald headwill smith went stage slapped chris rockpictwittercombsvxerbe letsott global letsottmarch jada pinkett smith actress suffers alopecia publicly revealed diagnosis according hollywood reporters scott feinberg attendance tearful smith needed pulled aside comforted denzel washington tyler perry commercial break us actor denzel washington left us actor will smith centre us actorproducer tyler perry chat th oscars dolby theatre hollywood california march photo credit robyn beck afp will chris going solve like family right now moving love sean diddy combs presenting next section elders mt kenya allied tribes state house nairobi saturday renewed president uhuru kenyattas mantle lead community next five years received mantle november take mwai kibaki saw contest presidency behalf handed two special sticks mithigi muthigi singular symbolise acceptance lead ordinary sticks sacred rituals accompanying instruments attached agikuyu council elders chairman wachira kiago told nation one sticks straight denotes believe one god comes two prongs top end signifying ancestral spirits ngomi one qualify trappings apex leadership communities one must male together lastborn son must circumcised man recommended community two categories elders athuri matathi athuri matura nguru endorsement apex elders called arathi prophets conducting due diligence arathi particularly vet whether proposed community spokesman engaged serious crimes like murder witchcraft rapedefilement one found engaged general crime community qualifies anointed leader mr kiago muthigi signifying one god mwene nyaga believed reside mt kenya kirima gia kirinyaga presentation anointed spokesman first taken day prayer session throne god mountain done years ago prophets time around deliberations decided president still young shown sign duty dereliction hence unanimous decision renew mantle custody president now two sticks twopronged one bearer power lead circumcisers knife bestows president power circumcise communitys lads set stringed beads gives power recommend dressing code elders others collective ringermates presented sword gives power slaughter goat rituals well horn empower rally community together cause president handed spear somali sword empowers call people war immediately leadership mantle renewed president invoked horn rally gikuyu embu meru association gema behind presidential bid raila odinga azimio la umoja coalition deliberations meeting discussed unstructured mannerthat will go oath confidentiality suffice say president made case one uninterrupted hour gikuyu language took oath rally people behind cause mr kiago independent state house sources revealed president narrated elders numbered came across country gema people reside work frustration endured hands deputy william ruto president emotionally accused dr ruto abandoning duties hitting campaign trail incited mt kenya leaders source told nation bigger scheme dr ruto inherit dismantle president kenyattas structures mt kenya relegate latter lameduck status voice nationally region according sources president explained january reference allies washenzi stupid told us incensed held meeting previous week mt kenya leaders plan region get development projects purpose appointed area people head important ministries source mps political backyard leaked information media others posted social media perfectly understood identified frustration led use word characters told us deeply offended saw longtime allies ganging dr ruto reveal much members public way even infringed privacy source closing remarks according sources president will team elders mr odinga descend mt kenya region hold least meetings win area voters azimio la umoja declaration sunday won ridicule mps rigathi gachagua mathira alice wahome kandara scorned meeting dead arrival mr gachagua let come regions meetings every one hold will holding three counterones president late staging fight dr ruto august polls draw closer will change nothing effect will counterproductive remained aloof coming back us grown moved overambitious especially coming riding backs divisive political brokers ms wahome biggest enemy azimio success president since riding false hope can influence mt kenya like used mr odinga wise better packaging independent aspirant warned president will mess inconvenience promising mt kenya numbers longer grip fall trap shortchange reliable traditional allies deceptive newfound warmth mt kenya blame will elders president decided mt kenya region pursue relevance next government national assembly senate council governors county assemblies state house tenancy now bounds us next government decided belong jubilee party insist mt kenya leaders elected mr kiago email protected supreme court will deliver judgement building bridges initiative bbi thursday courts registrar announced ending rising anxiety among kenyans countrys political classthe case involves proposal amend constitution dispute supreme court pits government citizens voluntary group opposed proposed amendments much awaited judgment will either revive burry governmentbacked process started legal bid likely shake countrys political governance system conclusion hearings january judges led chief justice martha koome retreated make write judgment yet clear whether seven judges will come hisher judgment like happened court appeal will come single judgment multiple judges deciding together case likelihood disagreement outcome case considering involves various issues least seven questions circumstances will two decisions majority decision dissenting concurring decisions majority decision becomes ruling court courts decision bbi crucial may sway forthcoming national elections judges will rule whether president uhuru kenyattas reform plan introduction expanded executive constitutional president together former prime minister raila odinga one side dispute deputy president william ruto side reforms started shortly march handshake president kenyatta mr odinga top judges expected assess high court court appeals decisions reject sweeping reforms aim ending winner takes ethnic politics two lower superior courts found proposed amendments unconstitutional various reasons including president authority push constitutional amendments popular initiative another reason bbi promoters usurped peoples sovereign powerso tricky situation supreme court expected rule many proposals contained constitutional amendment bill bbi among recommendations regarding creation judiciary ombudsman shall appointed president proposed ombudsman will powers discipline judiciary officials including suspending warning reprimanding another proposal concerning judiciary enhancement number executive appointees jsc four five judiciary initially protested proposal saying unusually heavy tilt towards executive representation jsc compared commissions potential danger entrenching executive authority jsc extension judiciary key issues determined top court relate basic structure doctrine role president state officers amendment constitution popular initiative immunity president list constitutionality second schedule constitution amendment bill quorum electoral commission discharging constitutional mandate supreme court will grappling applicability basic structure doctrine kenya will determine whether kenyas constitution can changed following four sequential steps civic education public participation constituent assembly debate referendum high court court appeal ruled bbi unconstitutional failing follow sequential steps two lower superior courts basic structure principle applicable kenya basic structure doctrine supreme court expected determine whether constitution subject implied limitation power amendment provisions whether limitation can invoked outside parameters set chapter codifies manner amendmentthe top judges will determine whether president can initiate amendment constitution popular initiative lower superior courts ruled president power initiate amendment constitution popular initiative court will rule constitutional rights president citizen including right equal treatment law article freedom expression article freedom make political choices article question whose answer expected court president lose rights dint election suchfurther list question relating allocation parliamentary constituencies proposed bbi promoters court appeal high court found proposal illegal delimitation boundaries mandate independent electoral boundaries commission iebcanother question whether president can sued personal capacity anything done done office presidential immunity lower superior courts civil proceedings can initiated president personal capacity meaning pure immunityalso determined question related public participation bbi bill quorum electoral commission time dealing bbi bill main issue settlement will object article constitution sets minimum number commissioners iebc three iebc act places minimum quorum five commissioners commission considered legitimately constituted three commissioners court will expected resolve question whether act parliament can set higher legitimacy threshold independent commission set constitution another issue whether referendum ballot paper involving multiple amendments contain multiple questions single question ends mystery surrounds circumstances man boiled death horrendous tragedy steel factory thika friday afternoon mr caleb otieno reportedly fell metal boiler blue nile rolling mills ltd duty horrific accident shocked workmates family friends still unclear mr otieno ended boiler body completely liquefied leaving colleagues relatives grieving workmates entire body mixed boilers contents mr otienos family yesterday alleged loved one thrown boiler although relatives questioned companys safety standards company willing tell us happened take responsibility brother died within factory colleagues told us died fell boiler nothing official come employer mr john agwambo brother blue nile rolling mills ltd sister company blue nile wire products ltd manufacturers barbed wires two owned blue nile group blue nile rolling mills ltd steel manufacturers recently announced received sh million international finance corporation ifc private lending arm world bank expand plant thika kiambu mr otieno left kisumu east thika town nearly years ago finishing kenya certificate secondary education kcse started casual labourer consumer goods manufacturer bidco africa worked three years got job blue nile rolling mills ltd worked seven years quiet man committed work unfortunate lost able comment management told us speak matter investigation police one coworkers since mr otienos body liquefied family seek help authorities see whether employer empty boiler retrieve remains burial just want authorities intervene compel company give us access boiler see whether can salvage anything can use burial painful mr agwambo employees working brother told us burnt absorbed metal boiler completely liquefied meaning might find anything added nation contacted blue nile rolling mills ltd official declined comment incident referred us human resource department efforts contact hr department however unsuccessful thika dcio joseph thuvi investigations way however ruled foul play termed incident accident matter investigations preliminary investigations shown accident deceased thrown metal boiler alleged nation contacted general kago funeral home thika official booking body company made general kago funeral home public morgue near steel factory blue nile launched operations acquiring steel wire product manufacturing facility kikuyu kiambu county plant capacity produce metric tonnes steel products metric tonnes wire products members national assembly dashed school going childrens hopes receiving free milk popularly known maziwa ya nyayo rejected basic education amendment bill bill sponsored nominated senator beatrice kwamboka proposes reintroduction free supply milk pupils preprimary learners school milk programmes positively contribute growth dairy sector improve nutrition increase school attendance bill says school health nutrition programmes particularly embedded within broader child development strategies integral part longterm development child reads bill bill emanated senate passed july last year sent national assembly concurrence sent president uhuru kenyatta assent however national assembly committee education slammed brakes bill saying affect school meal programmes currently ongoing implementation amendment amount expanding current school meals programme seeking provide milk learners meals affected owing budgetary shorts committee says consideration proposal committee pointed proposal brought parliament legislation needs become policy first can legislated maziwa ya nyayo programme introduced late president daniel moi cancelled proved costly unsustainable successive governments passing bill last year senators reintroduction will improve nutrition supporting bill will increase enrolment children schools increase literacy levels gender basis will benefit terms equity health nutrition nominated senator naomi shiyonga debate bill senate bill now heads back senate senators agree observations national assembly will end reject reasons advanced bill heads mediation committee mediation committee will days thrash divisive clauses mediation process houses parliament attempt build consensus contended provisions bill entire bill whose passage requires consideration houses mediation happens one house disagrees version bill amendments made house intention mediation develop agreed version bill can passed houses mediation committee consists equal number members national assembly senate appointed two speakers mostly consults whips committee mostly consists mover bill chairpersons members relevant committee ranking members originally considered bill members strong views either support contended clauses members committee include members experience subject bill leaders majority minority parties accordance article constitution mediation committee required resolve stalemate within days mediation committee fails agree bill deemed defeated process starts afresh amended form email protected campaign period political leaders flocking churches seek blessings hunt votes among popular churches politicians famed dini ya roho mafuta pole ya afrika church west pokot sitting prominently high point tamugh sook hills church past decade giving special names politicians go dini ya roho majestic church fine finishes comparable building vicinity dotted mostly traditional pokot homes headquarters church members west pokot baringo parts uganda registered years ago followers call jerusalem place believe messiah jesus christ died resurrected church building two doors men enter right door women left stepping church believers must remove shoes show respect god always wear white gowns prayers door numbers church leaders explain recognition sign church directed holy spirit organisational structure three levels jerusalem highest level zion regional headquarters diocese charge congregationsbomas boma representing individual congregation lowest unit various leaders county across kenya visited church seek blessings make contributions develop region latest visit kapenguria mp samuel moroto member church visited saturday donated motorcycles pastors help spread gospel deputy president william ruto visited church odm leader raila odinga kanu chairman gideon moi mr odinga visited host highprofile leaders including kakamega governor wycliffe oparanya rekindled memories resilient journey traditional african church whose pioneers stood colonial regime culminating massacre years ago clerics prayed mr odinga dp ruto various dates interceded blessings god dp ruto named rimmon mr odinga became loisa mr moi called steve stiko leaders received special names west pokot governor john lonyangapuo named andika zion former governor simon kachapin anzem senate majority leader samuel poghisio west pokot senator laifon mr moroto restam lambai woman representative lillian tomitom cheanzem dp rutos rimmon name man tribe benjamin bible benjamin one sons jacob mr odingas loisa name angel bishop risti kapel revealed dreambishop kapel says every member church given name derived dreams apostles senior members group names give leaders came holy spirit church clerics done founder church lukas told nationafrica church put monument kolowa baringo county remember founder lukas pkiech died every year april church visits kolowa mark death bishop kapel explains church preaches holy bible blends pokot culture traditions modern christianity ali mari worshipper says politicians like visit church seek blessings eventually succeed getting seats aspire visit church religious leaders apply anointing oil bless leave eventually succeed ambitions dreams every year november members influential church converge thank god church recognised decades alienation celebrations used church raise money various projects help develop jerusalemdini ya roho founded lukas pkiech blacksmith lived keringet village near todays kapenguria town church founded pokots european colonial rule sidelined successive governments believed antigovernment local leaders long pushed churchs legalisation vain years ago years pressure justice minister time eugene wamalwa handed certificate registration apostle aristi kapel head church tamugh kapenguria constituency despite regarded many sect members always insisted church follows biblical story christianity founder pkiech links elijah nameme luhya prophet strong political leader colonial time led pokot community european colonisation led famous pokot resistance s pkiech holy spirit renamed arususu told start church accommodate africans used opportunity mobilise pokots organise antigovernment campaigns fight europeans resistance led deaths pkiech pokots battle colonialists kolowa independence group declared proscribed society members went underground others carried pkiechs vision assumed leadership rosti lakuny fled kolowa continued church despite many hardships everwatchful eye suspicious authorities dini ya roho developed fellowship built local churches established leadership structure administration rosti died current leader aristi kapel apostle kapel told nationafrica groups doctrines entrenched bible guided holy spirit church supports good morals among members doesnt allow anything holy book krop kilekwang member says church instills strong values faithful just beautifully designed headquarters great values beliefs guided ten commandments bible says mariao krop another faithful church existed west pokot missionaries colonial masters came interrupt faith pkech returned west pokot kabete kiambu county late s trained blacksmith upon arrival started making jingles keringet village pokot loved traditional songs pkech skillfully delivered crucial instrument jingle making popular pkech arrested second time taken nakuru escaped walked way kapenguria took gospel kolowa tiaty allegedly assassinated colonialists april several worshippers shot dead carnage stephen kodingura church member says since inception church frontline promoting peace fighting retrogressive practices like female genital mutilation fgm early forced marriages young girls fgm outdated practice region early marriages longer experienced mr kodingura church helped restore peace among warring communities region government fund churches county longterm peace especially borders neighbouring counties speaking tamugh meeting saturday mr moroto kapenguria mp church played key role restoring peace email protected united democratic alliance uda national delegates congress going recently video clip event lighting social media featured deputy president william rutos aide farouk taigut kibet animated conversation party chairman johnson muthama secretarygeneral veronica maina appeared giving instructions two leaders progress ndc sasa ambia kila mtu anyamaze now tell everyone quiet mr kibet can heard instructing mr muthama one clips mr muthama says public misconstrued conversation totally wrong perception commotion farouk sharing anything looking chance speak messenger sent dp dp happened mr muthama just muthama ms maina receiving instructions mr kibet even events masters ceremonies heard event powerful gatekeeper power mr kibet wields around deputy president become one powerful gatekeepers political leader name stands among dps aides determines sees will rallies determines speaks order earlier video clip dps campaign trail appears order nominated senator millicent omanga back stage dance clear job description mr kibet mr fix mr ruto even mps supporting dp good books continue visiting karen residence whether recent appointment davis chirchir former energy cabinet secretary jubilee administration mr rutos chief staff change power matrix dps office remains seen mr kibet represents growing list powerful gatekeepers leading kenyan politicians often operating behindthescenes powerful men control access big men women well diaries bosses process become hugely wealthy closeness bosses political commentator javas bigambo calls sociopolitical enablers leaders adds leader worth name just presidential hopefuls people around unquestionably loyal unquestionably loyal got best interests leader sworn confidants even hold property trust leaders former state house aide joshua kulei close relationship president daniel moi former presidents property name mr dismas mokua gatekeepers important buffer take heat bosses insiders used plausible deniability projects insiders important offer politicians safe landing buffer zone says mr mokua since election president uhuru kenyatta held joseph kinyua letting go even one point reported asked leave head public service often shunned limelight politically less visible devoted nuts bolts running government side state house comptroller kinuthia mbugua former nakuru governor presidencys accounting officer people around mr ruto accused denying deputy presidents office financial resources pay staff allowances diems well fuelling cars dp uses political campaigns nonpublic servants around president nonpublic servants powerbrokers instance muhoho kenyatta presidents brother unofficially wields immense powers presidents ear prime minister mr odinga caroli omondi chief staff wielded immense power two since fallen mr omondi failed attempts capture odm party ticket run parliament still retains array aides can delegate duties including andrew mondoh heads office capitol hill stood trusted confidants suna east mp junet mohamed emerging one gatekeeper presidential hopeful become one mr odingas trusted lieutenants mp accompany handshake president uhuru kenyatta march mr mohameds stature grown time mayor now wields immense power around mr odinga often emceeing events like mr kibet sway speaks events mr mohameds closeness growing influence around mr odinga bred resentment odm mps towards one senator even reported organised mps heckle kisumu turned plan leaked mr mohamed accompany mr odinga kisumu mp difficult time trying get audience mr odinga apologise odingas kitchen cabinet displaced traditional members mr odingas kitchen cabinet siaya senator james orengo long goto guy around former premier powerful gatekeepers around mr odinga consist close family members like wife ida odinga daughter winnie odinga latter described real force behind fathers current presidential campaign secretariat involved fathers campaigns taking prominent roles instance organising launch azimio la umoja meeting december recently accompanied mr odinga uk interview gave described fathers bodyguard briefcase carrier travel companion even driver need even importantly mr odinga real power behind throne wife ida wields immense power around husband sometimes know say easier get man family matriarch gets things done one people convinced mr odinga agree political truce president act rapprochement changed course countrys politics good left deputy president william ruto gasping breath mudavadis spokesman every bigname politician one two gatekeepers anc party leader musalia mudavadi exception given longevity politics many assistants yet one name stuck around much longer anybody else kibisu kabatesi longserving spokesman recent times however become less visible around mr mudavadi though authoritatively speaks behalf geoffrey kanoti anc director political affairs head protocol musalia mudavadi presidential campaign centre man eyeing khwisero parliamentary seat represented mr mudavadi anc leaders last engagement member one kenya alliance oka besides two dan ameyo mr mudavadi trusts negotiate political deals behalf three mr mudavadis ear confers lot times according people around mr mudavadi like mr odinga president kenyatta family key mr mudavadis journey wife tessy plays important behindthescenes gatekeeping role much involved husbands political decisions even major role agreeing work mr ruto kenya kwanza coalition moi salat bond around kanu chairman gideon moi nick salat independence party secretarygeneral carries lot weight around mr moi remained party secretarygeneral undergone rites passage together teenage years bond two stood test time chairman consults undertaking major political decision time oka alliance seen dragging feet whether join forces azimio go alone mr salat publicly urged mr moi proceed join forces mr odinga coprincipals second thoughts didnt take long baringo senator joined azimio fielding questions press sometimes meeting difficult political players mr salat takes flak behalf bossemail protected email protected better part last year bit alfred arita kept facebook followers updated posts wrestle win west murirango parliamentary seat nyamira county shared plans people constituency week ago missionary operates aegis alfred arita ministries dropped bombshell quitting racethis decision comes close three months honest personal soul searching deep reflection wide consultations quality prayers although arita never delved details anecdotal evidence shows political season anything goes many will whatever takes bag political seat church magnet worshippers week fertile hunting groundbecause snake oil salesmen charlatans flotsam jetsam society general men women morals brothel owner rush church identified christians genuine believers stakes usually high opt drop race altogetherjust around time arita announcing withdrawal contesting shared frustrations close friend name withheld running parliamentary seat one luo nyanza countiesthe exasperated man learning ground hard christian engage politics time firstly one needs full pockets time voters believe whoever contesting must enough money dish dont enough money give tokens plus fundraiser contributions voters dont take seriously candidate saidthat opponents branded cars speakers singing night perceived serious aspirants without political razzmatazz wellchoreographed propaganda secondly need lies voters seem love truth brother discovered truth doesnt make sense voters blatant liars command attention supportyou lie will havent office must peddle small lies opponents cited need wellchoreographed propaganda competitors spreads faster best ideology shifts perceptionslastly challenging like must constantly sing party leader every meeting attack opponents necessarily enemiesthat challenging christian supporters feel like mole within party room neutrality probably pushes people like osborne osanjo deacon seventh day adventist church outskirts london conclude politics christianity mix dont personally believe christians meddle politics thats personal belief dont vote dont vote personal conviction dont judge vote interview nation talking christians narrative comes politics indeed dirty game reason christians must join try make difference pastor gibson anduvate international christian centre icc kenya assemblies god congregation nairobi says christians needed politics quotes proverbs righteous authority people rejoice wicked beareth rule people mournbalkanising country christians right vie leadership positions must way adds value political scene join politics join bandwagon will living calling kenya season political leaders will seek balkanise country political silos warned dr calisto odede presiding bishop christ answer ministries citampeople certain region expected support leader region going grain can devastating consequences perceived traitor unfortunately says even men women cloth caught divisions part communication specialist kaplich barsito believes christians every right take part politics politics wielded society christians part society called heaven rapture death christians called upon ambassadors christ including political arena see mission field barsito know served senior positions including stint personal assistant stephen kalonzo musyoka latter vicepresidenttalking musyoka seniormost politician publicly touting bornagain credentials commended admirers taking time committing political cause attribute christian beliefs alfred nganga journalist turned pr guru sees musyoka differently challenging political terrain kalonzo christian better consulted widely learnt team player seems man hurry bag prize expense exposes many risks including perhaps falling traps carrots dangled nganga saida man stature must rely counsel trusted lieutenants lieutenants must scrutinise documents ensure legal public interest soundness puts pen paper communication aides fine job must control messaging leaders well spontaneous messaging barsito counters served former vicepresident friends can say sure done best remain true christian walk integrity navigates challenging political terrain another politician proud deep christian faith deputy president william ruto man fighting chance succeeding uhuru kenyatta ally church long time donating money country one project anotherthis gone well detractors allege without proof man involved chinese accounting land huge amountswith allegations claims impropriety barsito known dp mama rachel since especially interactions north rift evangelistic team noret strong preacher founder membereven though never political camp can testify faith christian much judge email protected

Term Frequency

The Term Document Matrix

After cleaning the text data, the next step is to count the occurrence of each word, to identify popular or trending topics.

Using the function TermDocumentMatrix() from the text mining package (tm), you can build a Document Matrix – a table containing the frequency of words.

# Create a Term Document Matrix
tdm <- TermDocumentMatrix(docs)

tdm.mat <- as.matrix(tdm)

tdm.mat.sort <- sort(rowSums(tdm.mat), decreasing=TRUE)

# create a dataframe of words and associated frequencies
word_freq <- data.frame(words=names(tdm.mat.sort),freq=tdm.mat.sort)
head(word_freq,20)
##               words freq
## president president   43
## church       church   39
## will           will   38
## one             one   28
## political political   27
## bill           bill   23
## odinga       odinga   22
## kenya         kenya   19
## whether     whether   19
## court         court   18
## leaders     leaders   18
## told           told   18
## two             two   18
## can             can   17
## around       around   16
## members     members   16
## time           time   16
## ruto           ruto   14
## even           even   12
## like           like   12

Bar Plot

Plotting the top 10 most frequent words using a bar chart is a good basic way to visualize this word frequent data.

# Let's visualize the frequency of the words using a bar plot
barplot(word_freq[1:10,]$freq, names.arg = word_freq[1:10,]$words)

Let’s go a step further and customize our barplot

# Plot the most frequent words


# sort in ascending order to appear better in bar plot
top_10 <- word_freq[order(word_freq[1:10,]$freq),]

barplot(top_10$freq, names.arg = top_10$word, las=1,
        col="lightgreen",main="10 Most Frequent Words",
        xlab="Frequency",
        horiz = TRUE)

Word Cloud

A word cloud is a simple yet informative way to understand textual data and to do text analysis.

A word cloud is one of the most popular ways to visualize and analyze qualitative data. It’s an image composed of keywords found within a body of text, where the size of each word indicates its frequency in that body of text.

# use wordcloud2 package to visualize words and their frequencies
wordcloud2(word_freq,color=brewer.pal(8, "BrBG"))
dev.off()
## null device 
##           1

Sentiment Analysis

Sentiment analysis is the process of determining whether a piece of writing is positive, negative or neutral. Here, we’ll work with the package syuzhet.

# sentiment analysis
library(syuzhet)
## Warning: package 'syuzhet' was built under R version 4.1.3
sentiment <- get_nrc_sentiment(word_freq$words)


barplot(
  sort(colSums(prop.table(sentiment[, 1:8]))), 
  horiz = TRUE, 
  cex.names = 0.7, 
  las = 1, 
  main = "Emotions in news articles", xlab="Percentage"
)

Text Mining of Tweets

Load Necessary Packages

# load necessary packages
library(rtweet)
library(tm)
library(qdapRegex)

# authentication token
get_token()
## <Token>
## <oauth_endpoint>
##  request:   https://api.twitter.com/oauth/request_token
##  authorize: https://api.twitter.com/oauth/authenticate
##  access:    https://api.twitter.com/oauth/access_token
## <oauth_app> Data_Pipelines_in_R
##   key:    6UkFDRQDf3t3ocgQdzA9IniYx
##   secret: <hidden>
## <credentials> oauth_token, oauth_token_secret, user_id, screen_name
## ---
# collect tweets that mention the word KCPE
tweets_df <- search_tweets("KCPE", n = 5000, 
                          include_rts = FALSE)

tweets_df.orig <- tweets_df

#tweets_df <- tweets_df.orig

Data Cleaning

# Data Cleaning

#Remove characters functions
tweet.removeEmoji = function(x) gsub("\\p{So}|\\p{Cn}", "", x, perl = TRUE)
tweet.removeUrl = function(x) gsub("http\\S+","",x,perl=TRUE)
tweet.removeSpecialChar = function(x) gsub("[^[:alnum:]///' ]", "", x)
toSpace <- content_transformer(function(x, pattern) {return (gsub(pattern, " ", x))})

tweets_df$text <- rm_url(tweets_df$text)
tweets_df$text <- rm_twitter_url(tweets_df$text)

# Create a corpus
docs = Corpus(VectorSource(tweets_df$text))

docs = tm_map(docs, content_transformer(tweet.removeUrl))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(tweet.removeUrl)):
## transformation drops documents
docs <- tm_map(docs, toSpace, "-")
## Warning in tm_map.SimpleCorpus(docs, toSpace, "-"): transformation drops
## documents
docs <- tm_map(docs, toSpace, "`")
## Warning in tm_map.SimpleCorpus(docs, toSpace, "`"): transformation drops
## documents
docs <- tm_map(docs, toSpace, ":")
## Warning in tm_map.SimpleCorpus(docs, toSpace, ":"): transformation drops
## documents
docs <- tm_map(docs, removePunctuation)
## Warning in tm_map.SimpleCorpus(docs, removePunctuation): transformation drops
## documents
docs = tm_map(docs, content_transformer(tweet.removeEmoji))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(tweet.removeEmoji)):
## transformation drops documents
docs = tm_map(docs, content_transformer(tweet.removeSpecialChar))
## Warning in tm_map.SimpleCorpus(docs,
## content_transformer(tweet.removeSpecialChar)): transformation drops documents
docs <- tm_map(docs,content_transformer(tolower))
## Warning in tm_map.SimpleCorpus(docs, content_transformer(tolower)):
## transformation drops documents
docs <- tm_map(docs, removeNumbers)
## Warning in tm_map.SimpleCorpus(docs, removeNumbers): transformation drops
## documents
docs <- tm_map(docs, removeWords, stopwords("english"))
## Warning in tm_map.SimpleCorpus(docs, removeWords, stopwords("english")):
## transformation drops documents
docs <- tm_map(docs, stripWhitespace)
## Warning in tm_map.SimpleCorpus(docs, stripWhitespace): transformation drops
## documents
# inspect(docs)


# convert corpus to Document Term Matrix
tdm <-DocumentTermMatrix(docs)

# collapse matrix by summing over columns and then ordering by frequency
# convert to matrix
tdm_matrix <- as.matrix(tdm)
# tdm_matrix_sort <- sort(rowSums(tdm_matrix), decreasing = TRUE)
tdm_matrix_sort <- sort(colSums(as.matrix(tdm)),decreasing=T)
# create a data frame with two columns one for word and other for frequency
word_freq.df <- data.frame(word=names(tdm_matrix_sort),freq=tdm_matrix_sort)
head(word_freq.df,10)
##              word freq
## kcpe         kcpe 4703
## results   results 1222
## marks       marks  647
## mudavadi mudavadi  635
## watch       watch  463
## magoha     magoha  461
## will         will  435
## ruto         ruto  383
## andrew     andrew  360
## top           top  351

Wordcloud

library(wordcloud2)
# setting the same seed each time ensures consistent look across clouds

set.seed(10)
# wordCloud with colour for 50 words
wordcloud2(word_freq.df,color=brewer.pal(8, "RdYlBu"))

Barplot

# Let's visualize the frequency of the words using a bar plot
# sort in ascending order to appear better in bar plot
top_10 <- word_freq.df[order(word_freq.df[1:10,]$freq),]

barplot(top_10$freq, names.arg = top_10$word, las=1,
        col="lightblue",main="Most Frequent Words",
        xlab="Frequency",
        horiz = TRUE)

# save the tweets in a file to load later
#write.csv(tweets_df.orig, 'azimio_tweets.csv')

Sentiment Analysis

Begin by using the get_nrc_sentiment() function from the syuzhet library.

library(syuzhet)

my_sentiment <- get_nrc_sentiment(word_freq.df$word)

sentiment_score <- data.frame(colSums(my_sentiment[,]))

names(sentiment_score) <- "Score"
sentiment_score <- cbind("Sentiment"=rownames(sentiment_score),sentiment_score)

rownames(sentiment_score) <- NULL

Visualize Sentiments

library(ggplot2)
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:qdapRegex':
## 
##     %+%
## The following object is masked from 'package:NLP':
## 
##     annotate
ggplot(data=sentiment_score, aes(x=Sentiment,y=Score)) +
  geom_bar(aes(fill=Sentiment),stat="identity") + 
  theme(legend.position='none') +
  xlab("Sentiments") + ylab("Score") +
  ggtitle("Sentiments of people during release of KCPE results")

References