alchemist hour: cognitive news

16
AlchemyAPI – Cognitive News

Upload: alchemyapi

Post on 14-Aug-2015

91 views

Category:

Technology


1 download

TRANSCRIPT

AlchemyAPI – Cognitive News

The housekeeping items

#AlchemistHour

• Webinar slides, recording and Q&A will be emailed• Enter questions in chat on webinar panel • Or ask your questions on Twitter @alchemyapi

• Use #AlchemistHour

Our Expert: Pawan Lakshmanan

#AlchemistHour

• Pawan is focused on developing intelligent data storage & analytics solutions to help our customers gain valuable insights into unstructured data

AlchemyData News Overview

#AlchemistHour

• A curated dataset of NLP enriched news and blogs

• Go beyond simple keyword search to look at sentiment, entities, events, and trends

• Updated with over 300k articles every day

Sample Query

#AlchemistHour

For an article that mentions "IBM" or "Apple" we want to find all of the named entities in the article body, and their types.

curl https://access.alchemyapi.com/calls/data/GetNews?outputMode=json&start=now-1d&end=now&count=1&q.enriched.url.title=O[IBM^Apple]&return=enriched.url.title,enriched.url.entities.entity.text,enriched.url.entities.entity.type&apikey=YOUR_API_KEY

Sample Response

#AlchemistHour

{ "result": { "docs": [ { "id": "Mjc5NDExNDQyfDE0Mjg4ODMyMDA", "source": { "enriched": { "url": { "entities": [ { "text": "IBM", "type": "Company" }, { "text": "Apple", "type": "Company" }, { "text": "Watson Health Cloud", "type": "Facility" }, { "text": "IBM Watson Health", "type": "Company" } ], "title": "Apple partners with IBM Watson Health Cloud to bring secure cloud, data analytics to HealthKit and ResearchKit"

Sample Query

#AlchemistHour

Find the 20 most recent articles (titles and URLs) mentioning "Alzheimer's" in the title.

curl https://access.alchemyapi.com/calls/data/GetNews?apikey=YOUR_APP_APIKEY&start=now-7d&end=now&return=enriched.url.url,enriched.url.title&q.enriched.url.title=Alzheimer%27s&outputMode=json&count=20

Sample Response

#AlchemistHour

{ "status": "OK", "totalTransactions": "60", "result": { "docs": [ { "id": "MTk5MTQzNjA2MXwxNDI5MTI3MjQ2", "source": { "enriched": { "url": { "title": "Study Suggests Link Between Alzheimer's And Immune System - Newsy Story", "url": "http://www.abcactionnews.com/newsy/study-suggests-link-between-alzheimers-and-immune-system" } } }, "timestamp": 1429127246 } ], "status": "OK" }}

Count and TimeSlice Queries

#AlchemistHour

Get count of articles over the past 30 days:

Get a time series count of articles over the past 7 days divided into 12-hour bins:

https://access.alchemyapi.com/calls/data/GetNews?apikey=YOUR_APP_APIKEY&outputMode=json&start=now-30d&end=now

https://access.alchemyapi.com/calls/data/GetNews?apikey=YOUR_APP_APIKEY&outputMode=json&start=now-7d&end=now&timeSlice=12h

Restrictions

#AlchemistHour

Title contains "baseball" AND "soccer":

Title does not contain "baseball":

Match all articles where document sentiment is positive and score is >= 0.5:

q.enriched.url.docSentiment.type=positive&q.enriched.url.docSentiment.score=>=0.5

q.enriched.url.title=-[baseball]

q.enriched.url.title=A[baseball^soccer]

Nested / Adjacent Fields

#AlchemistHour

Ex. A: "I moved from Denton, TX to Paris, France."Ex. B: "Paris walked fifteen miles to Denton, TX."

Query 1)q.enriched.url.enrichedTitle.entities.entity=|text=paris,type=city|

Query 2)q.enriched.url.enrichedTitle.entities.entity.text=paris&q.enriched.url.enrichedTitle.entities.entity.type=city

Query 1) is saying: I want at least one entity with the text 'Paris' and the type 'City'. Query 2) is saying: I want at least one entity in the title to have the text 'Paris' and at least one entity to be a city, but not necessarily the same entity.

Available Fields

• Over 400 fields available for querying and display

• Full list can be found here

#AlchemistHour

Are you ready to get started?

#AlchemistHour

• Get a key • Check out the news documentation and

query builder for more examples• Ask me questions!

#AlchemistHour

Q&A

• Look out for a follow up email with a copy of these slides, a recording of the webinar, Q&A recap, and additional resources

• View and share this presentation on SlideShare

• Follow us for more webinars

• The series continues bi-weekly on Wednesdays @ 12pm ET / 9am PT

• August 19 - AlchemyAPI for Finance

#AlchemistHour

What’s next?

Contact us1-877-253-0308

[email protected]

Thank you for attending!

#AlchemistHour