Flickr API Searches and Improving Accuracy


One of the big challenges with @theDesireBot is finding good Flickr images, based on keyword searches. For my Twitter bot, I work with a tweet that I eventually distill down to a set of nouns. I then use these nouns to form my search string.

The trick, though, is how to best go about searching on Flickr. Originally, I was specifying that I wanted to search based on a photo’s tags. This worked out to a certain degree, but a lot of this depends on the person doing the actual tagging.

A few folks on Flickr are a bit overzealous with their tags. As a result, here’s something that would get returned as a “match” according to the bot’s logic:

Search String: experience,snow
Tweet: I just want to experience snow!!!!
Pic: https://www.flickr.com/photos/12688708@N00/178238080/

Note that if you look at the photo’s tags, you’ll see that it’s tagged with both “experience” and “snow.” And a, uh… whole assortment of other things. Swing and a hit, but also swing and a miss.

So what I opted for instead is to search by text. This approach returns a photo if any of the search terms appear in a phot’s title, description, or tags. To help improve the chances that I’m found a relevant photo… I also do an additional check to see if any of the search words appear in the photo’s title.

If so, I give these photos preferential treatment and they get bumped to the top of the list. If not, I just pick any of the matches at random.

I think that the logic for photo selection has definitely improved, over the past week. Here’s an example of it working out fairly well:

The fun part though, in my opinion, is when things match but aren’t directly related. Serendipity plays a great role in something like this getting created:

One of the big challenges with Twitter bots, in my opinion, is finding that ambiguous space where really great combinations occur. Make it too weird or vague, and it comes off as jibberish. Make it too exact, and it just becomes a parrot or a copy machine.

A large part of this is also the viewer, who fills in the narrative between the text and the image. Even if it doesn’t make sense, we’re natural storytellers – we want things to make sense. And so we try, looking for commonality even when none might exist.

I got a lot of practice, searching for photos on Flickr. I learned to get more exact, but in doing so… learned that proximity, not exactitude, can yield more interesting results.

Related:
Desire Bot: A Twitter Bot That Re-Posts What the World Wants
Recursive Google Image Search, Starting with a Transparent Image

This Post Has 0 Comments

Leave A Reply