duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Holiday: Taken Offline -- Triggering Needs Overhaul for Improved Relevancy #2722

Closed tagawa closed 8 years ago

tagawa commented 8 years ago

It works fine on beta.duckduckgo.com but is not appearing on the live server: https://duckduckgo.com/?q=when+is+christmas


IA Page: http://duck.co/ia/view/holiday Maintainer: @sekhavati

iambibhas commented 8 years ago

@tagawa This seems like a triggering issue on the server side. The spice JS is not even being called. Maybe check with someone who can debug it from backend?

tagawa commented 8 years ago

Thanks for checking @iambibhas. I'll check with the backend devs.

moollaza commented 8 years ago

This IA was shut off because it was over triggering. The triggers need to be reigned in using a list of holiday names instead of "when is XXXX" so we're absolutely sure we know when to trigger the IA

moollaza commented 8 years ago

@duckduckgo/duckduckhack-contributors would anyone be interested in tackling this?

@sekhavati had started down the path and might have some code available. Basically we need to scrape a big list of popular holiday names from the internet (Wikipedia and Timeanddate would be a good place to start) so that we can verify the query contains an actual holiday name in it before making an API call.

The original trigger, "when is" had too many irrelevant queries for this IA an so we had to take it offline. I'd love to see it back online again!

This would be a big win for DuckDuckGo because this is likely to be a popular Instant Answer. I would personally use it all the time to check holiday dates!

NaveenKarippai commented 8 years ago

@moollaza what would be the preferred way to add scraped data - PR in a yml file?

moollaza commented 8 years ago

@NaveenKarippai yes I imagine a YAML or JSON file would be ideal, probably containing the normalized names of holidays and any aliases. The most important part is updating the logic to check for the existence of a valid holiday name in the query. A list of the most popular 100 holidays would be a good place to start. TimeAndDate has pages on their site that could likely be scraped. They organize holidays by country and the API works the same way

GuiltyDolphin commented 8 years ago

@moollaza @NaveenKarippai You might be able to grab some quite easily from http://holidayapi.com/v1/holidays?country=US&year=2016 (http://holidayapi.com); you can do some GET requests to get some common holidays for different countries.

Heck, they're on GitHub with the data - you should be able to use that https://github.com/joshtronic/holidayapi.com/tree/master/data

@NaveenKarippai A quick script to go through all the files and scrape the 'name' field should get you quite a lot of holidays (it's JSON - Perl would be perfect for this)!

moollaza commented 8 years ago

@GuiltyDolphin thanks for that link. I think it would be ideal to get the Holidays listed on TimeAndDate.com, because their API will have results for those for sure. I'm also not sure if they have results for holiday names in other alphabets

sekhavati commented 8 years ago

@moollaza I should have some time tomorrow to pick up where I left off with #2678 which will resolve this case

sekhavati commented 8 years ago

@tagawa @moollaza @GuiltyDolphin Looks like I can't even trigger this IA on my local server, can you enable it on the back-end so I can test my changes otherwise I wont be able to get very far tomorrow

edgesince84 commented 8 years ago

@sekhavati someone should be able to address your issue shortly! sorry for the delay

tagawa commented 8 years ago

Hi @sekhavati. This seems to be triggering for me, both with DuckPAN server in Codio and on the beta site: https://beta.duckduckgo.com/?q=when+is+christmas&ia=answer (although I had to click the Answer tab).

If you try with the query "when is christmas", is it still not triggering? If not, are you using Codio or a local installation of DuckPAN?

sekhavati commented 8 years ago

@tagawa Apologies I think I must have tested on a tree with other changes that were preventing it triggering, its working for me now.

tagawa commented 8 years ago

@sekhavati Good to hear! Thanks for the confirmation.

sekhavati commented 8 years ago

@tagawa This issue should now be fixed as #2678 has been merged and is live.

tagawa commented 8 years ago

Indeed it is! Nice job @sekhavati