Keyword or Keyphrase Extraction

A Specrom News API endpoint for extracting keywords or keyphrases from the input text.

This endpoint will take input text and extract the most relevant keywords and keyphrases from the input text.

Currently this model is in beta and only available for English.

Input

import requests

url = "https://specrom-news-api.p.rapidapi.com/"

payload = {
  "api_type": "keyword_extraction",
  "input_text": "While the big-name dropouts have dented Facebook's stock price and prompted leadership to address some of the concerns , it'll take a lot more to stop the company's digital advertising juggernaut. Facebook generated $69.7 billion from advertising in 2019, more than 98% of its total revenue for the year. And most of those ad dollars don't come from companies likeand Coca Cola so much as the sprawling list of small and medium-sized businesses who use Facebook to attract customers and build their brands. Facebook has 8 million advertisers, it said earlier this year. Of those, the highest-spending 100 brands accounted for $4.2 billion in Facebook advertising last year, according to data from marketing research firm Pathmatics -- or only about 6% of the platform's ad revenue. The last time Facebook shared that data itself was in April 2019 , when COO Sheryl Sandberg said the top 100 advertisers represented "
}

headers = {
  "content-type": "application/json",
  "X-RapidAPI-Key": API_Key,
  "X-RapidAPI-Host": "specrom-news-api.p.rapidapi.com"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
	
	POST / HTTP/1.1
Content-Type: application/json
X-Rapidapi-Key: API_Key
X-Rapidapi-Host: specrom-news-api.p.rapidapi.com
Host: specrom-news-api.p.rapidapi.com
Content-Length: 151

{
    "api_type": "keyword_extraction",
    "input_text": "While the big-name dropouts have dented Facebook's stock price and prompted leadership to address some of the concerns , it'll take a lot more to stop the company's digital advertising juggernaut. Facebook generated $69.7 billion from advertising in 2019, more than 98% of its total revenue for the year. And most of those ad dollars don't come from companies likeand Coca Cola so much as the sprawling list of small and medium-sized businesses who use Facebook to attract customers and build their brands. Facebook has 8 million advertisers, it said earlier this year. Of those, the highest-spending 100 brands accounted for $4.2 billion in Facebook advertising last year, according to data from marketing research firm Pathmatics -- or only about 6% of the platform's ad revenue. The last time Facebook shared that data itself was in April 2019 , when COO Sheryl Sandberg said the top 100 advertisers represented "
}
	
	
Parameter Description
api_type keyword_extraction
input_text input text

Output


[
{"keyphrase":"digital advertising juggernaut","weight":0.01},
{"keyphrase":"dented Facebook stock","weight":0.01},
{"keyphrase":"Facebook stock price","weight":0.01},
{"keyphrase":"company digital advertising","weight":0.01},
{"keyphrase":"big-name dropouts","weight":0.03},
{"keyphrase":"dropouts have dented","weight":0.03},
{"keyphrase":"stock price","weight":0.03},
{"keyphrase":"price and prompted","weight":0.03},
{"keyphrase":"prompted leadership","weight":0.03},
{"keyphrase":"leadership to address","weight":0.03}]
Parameter Description
keyphrase Extracted keyword or keyphrase that is central to the concept/idea/person/company being discussed in the input_text
weight A score (0-1) that indicates the overall weight of that keyword/keyphrase