-
Notifications
You must be signed in to change notification settings - Fork 54
Trends
Different things and topics are popular on different days. Today it can be refugees, tomorrow Malaysian Airlines. Event Registry can provide you with an up to date list of concepts and categories that are currently trending the most.
The trends in Event Registry are computed by comparing how much is a particular thing appearing in the articles in the last two days compared to the last two weeks.
In order to get a list of concepts that are currently trending the most, you can simply use the GetTrendingConcepts()
class. Here is an example use of this class:
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)
q = GetTrendingConcepts(source = "news", count = 10,
returnInfo = ReturnInfo(
conceptInfo = ConceptInfoFlags(trendingHistory = True)))
ret = er.execQuery(q)
The resulting list in ret
contains concept information of this form:
{
"id": "270226",
"uri": "http://en.wikipedia.org/wiki/Beau_Biden",
"type": "person",
"label": {
"eng": "Beau Biden"
},
"trendingScore": {
"news": {
"nullPopFq": 31,
"score": 209.213658995857,
"testPopFq": 244
}
},
"trendingHistory": {
"latestArticleTimestamp": "2015-06-01 17:02:00",
"news": [
0, 1, 0, 0, 3, 21, 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 9, 12, 1, 0, 4, 0, 2, 1, 1, 0, 0, 1, 220, 26
]
}
},
Beside the id
, uri
, type
, label
, the object also includes the trendingScore
information as well as the trendingHistory
with counts for the concept in the last 30 days.
The parameters that you can specify when constructing the GetTrendingConcepts()
class are the following:
-
source
: source information from which to compute top trends. Options:news
,social
-
count
: number of top trends to return -
returnInfo
: details about the concepts to return
As for trending concepts, we can also compute the currently top trending categories. The class to use in this case is GetTrendingCategories()
and it can be used as follows:
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)
q = GetTrendingCategories(source = "news", count = 10)
ret = er.execQuery(q)
Core Information
Usage tracking
Terminology
EventRegistry
class
ReturnInfo
class
Data models for returned information
Finding concepts for keywords
Filtering content by news sources
Text analytics
Semantic annotation, categorization, sentiment
Searching
Searching for events
Searching for articles
Article/event info
Get event information
Get article information
Other
Supported languages
Different ways to search using keywords
Feed of new articles/events
Social media shares
Daily trends
Find the event for your own text
Article URL to URI mapping