-
Notifications
You must be signed in to change notification settings - Fork 54
Event for your text
Do you have some recent text - maybe from some article, blog post or caption - that you think is talking about an event. Would you like to match that text to an event and maybe get more information about the event, such as date, location, articles about it, etc.? In this case, you can use the GetEventForText
class.
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)
q = GetEventForText(er)
res = q.compute("Croatian leaders put the army on alert after chaos erupted on the border with Serbia, where thousands of asylum-seekers poured into the country")
By calling the compute
method and passing it the text you can find the most similar current events. The returned information contained in res
is of the following form:
[
{
"cosSim": 0.07660648086468567,
"eventUri": "4969",
"storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-40591"
},
{
"cosSim": 0.05851939237670918,
"eventUri": "5157",
"storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-56286"
},
// remaining items
]
The list of JSON objects contains the events that are most similar to the events that are currently happening in the world. If you wish to obtain more information about these events just use the QueryEvent
class and pass to it the eventUri
value(s).
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