Extract Keywords for Textual Analysis

Objective: To extract keywords from text using MonkeyLearn API

Step 1: Install and Load required packages

>install.packages("devtools")
>library(devtools)
>devtools::install_github("ropensci/monkeylearn")
>library(monkeylearn)

Step 2: Get API Key from MonkeyLearn 


Visit this Website and sign up with your email ID,

Click on your name in right side top corner and select My Account,

Select API Keys from the Left side menu and copy it. 

Step 3: Extract keywords using your API key


>text <- "Namaste, PlanetAnalytics is a blog for data analysts and enthusiasts. It's a knowledge sharing platform for anyone and everyone who wants to learn and explore the realm of Data Analytics. Our articles are designed to provide a simple approach towards the Analytics and help learn and explore various software and tools present in the market. We try to fill the gap between analytics and its users in the simplest way possible."

>output <- monkeylearn_extract(request = text, key = MyKey,
                              extractor_id = "ex_y7BPYzNG")

>print(output)

Output:



Create a function for KeyWord Extraction:

>Keywords <- function(Text){
  A<-monkeylearn_extract(request = Text, key = "YOUR API KEY", extractor_id = "ex_y7BPYzNG")
  print(A)
}

#Do replace your API key with commas

>Keywords("Namaste, PlanetAnalytics is a blog for data analysts and enthusiasts. It's a knowledge sharing platform for anyone and everyone who wants to learn and explore the realm of Data Analytics. Our articles are designed to provide a simple approach towards the Analytics and help learn and explore various software and tools present in the market. We try to fill the gap between analytics and its users in the simplest way possible.")

#You will get the same output