Python package for API access to news articles and events in the Event Registry
Added
keywordSearchMode
parameter that can be used in QueryArticles
, QueryArticlesIter
, QueryEvents
, QueryEventsIter
and QueryEvent
constructors.keywordSearchMode
parameter to the advanced query languageUpdated
Added
typing
module. All parameters in the method calls use typing support to make it easier to understand what type is expected.suggestEventTypes
, suggestIndustries
, getSdgUris
, getSasbUris
- all to be used only when querying mentionsUpdated
QueryArticles
class. Added filters authorsFilter
, videosFilter
, linksFilter
QueryMentions
class. Added several filters: industryUri
, sdgUri
, sasbUri
, esgUri
, minSentenceIndex
, maxSentenceIndex
, showDuplicates
Added
QueryMentions
that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes QueryMentions
and QueryMentionsIter
can be used in the same way as classes for querying articles and events, except that some query parameters are addded and some removed. Examples for the classes were also added.Updated
initWithComplexQuery
we now check if the provided json is valid json object and report error in case it is notEventRegistry
class have been fixed.Added
required
and excluded
optional parameters to the TopicPage class to methods addConcept
, addKeyword
, addCategory
, addSource
, addSourceLocation
and addSourceGroup
.Added
EventRegistry.getServiceStatus()
method that reports status of the servicesComplexQueryArticles
and ComplexQueryEvents
classes now support in the constructor additional filters like minSentiment
, maxSentiment
, minFacebookShares
, endSourceRankPercentile
, etc.Updated
ReturnInfo
classes (ArticleInfoFlags
, ConceptInfoFlags
, ...) were updated. Some obsolete parameters were removed and we have added support for kwdargs to supply some very rarely used parameters directly.TopicPage.getArticles
and TopicPage.getEvents
methods now support also **kwargs
so that you can now also provide other available parameters that are less frequently used.Removed
EventRegistry.suggestCustomConcepts()
and EventRegistry.getCustomConceptUri()
methods. Not used anymore since we are not supporting anymore the correlation feature.Added
QueryArticles
, QueryArticlesIter
, QueryEvents
, QueryEventsIter
constructors now all have additional parameters minSentiment
and maxSentiment
that can be used to filter the articles and events. The valid values are between -1 (very negative sentiment) and 1 (very positive sentiment). Value 0 represents neutral sentiment.Updated
trainTopicOnTweets()
, trainTopicClearTopic()
and trainTopicGetTrainedTopic()
methods in the Analytics
class.Analytics.annotate()
method now supports passing custom parameters that should be used when annotating the text.trainTopicOnTweets()
, trainTopicClearTopic()
and trainTopicGetTrainedTopic()
methods in the Analytics
class.QueryArticles.initWithComplexQuery()
was updated - the parameter dataType
was removed (since the dataType
value should be provided in the $filter
section of the query)TopicPage
now supports setting also the source rank percentileAnalytics.extractArticleInfo
now also supports setting the headers and cookies to be used when making the requestsAdded
Analytics.trainTopicOnTweets()
method that can be used to train a topic by analyzing a group of tweets. See an example of usage on the wiki page.Analytics.trainTopic*()
methods that can be used to analyze your own documents and build a topic from them. See an example of usage on the wiki page.Added
EventRegistry.getUsageInfo()
method, which returns the number of used tokens and the total number of available tokens for the given user. The existing methods EventRegisty.getRemainingAvailableRequests()
and EventRegistry.getDailyAvailableRequests()
are still there, but their value is only valid after making at least one request.authorUri
parameter when creating the QueryArticles
and QueryEvents
instances.EventRegistry
class: EventRegistry.suggestAuthors()
to obtain uris of authors for given (partial) name and EventRegistry.getAuthorUri()
to obtain a single author uri for the given (partial) name.QueryArticles
and QueryEvents
constructors now also accept authorUri
parameter that can be used to limit the results to articles/events by those authors. Use QueryOper.AND()
or QueryOper.OR()
to specify multiple authors in the same query.startSourceRankPercentile
and endSourceRankPercentile
when creating the QueryArticles
instance. The default value for startSourceRankPercentile
is 0 and for endSourceRankPercentile
is 100. The values that can be set are not any value between 0 and 100 but has to be a number divisible by 10. By setting startSourceRankPercentile
to 0 and endSourceRankPercentile
to 20 you would get only articles from top ranked news sources (according to Alexa site ranking) that would amount to about approximately 20% of all matching content. Note: 20 percentiles do not represent 20% of all top sources. The value is used to identify the subset of news sources that generate approximately 20% of our collected news content. The reason for this choice is that top ranked 10% of news sources writes about 30% of all news content and our choice normalizes this effect. This feature could potentially change in the future.QueryEventArticlesIter
is now able to return only a subset of articles assigned to an event. You can use the same filters as with the QueryArticles
constructor and you can specify them when constructing the instance of QueryEventArticlesIter
. The same kind of filtering is also possible if you want to use the RequestEventArticles()
class instead.proxyUrl
to Analytics.extractArticleInfo()
. It can be used to download article info through a proxy that you provide (to avoid potential GDPR issues). The proxyUrl
should be in format {schema}://{username}:{pass}@{proxy url/ip}
.Added
TopicPage
class. It can be used to create a topic by specifying keywords, concepts, sources, ... as well as their weights. You can specify a threshold and receive only articles and events that match enough specified conditions to reach the required weight. Alternatively, you can simply sort the results by relevance and get the top-ranked results that are most related to your topic page. See TopicPageExamples.py
file for examples on how to use the topic pages.Analytics
. Call Analytics.ner(text)
to extract named entities.Updated
method
parameter. Possible values for it are vocabulary
(vocabulary based sentiment analysis, default) or rnn
(neural networks based model).Added
blog
data type. Various methods in EventRegistry
class accept it, such as suggestNewsSources()
, suggestSourcesAtPlace()
and getNewsSourceUri()
.Updated
QueryArticlesIter.initWithComplexQuery()
now accepts also the dataType
parameter (by default news
).Removed
articleBatchSize
from QueryArticlesIter.execQuery
since it was not useful. We are always returning the maximum number of results that can be obtained with a single query.