Skip to content

Instantly share code, notes, and snippets.

@jakequist
Created August 21, 2014 03:05
Show Gist options
  • Save jakequist/3b975b4d869ef168331d to your computer and use it in GitHub Desktop.
Save jakequist/3b975b4d869ef168331d to your computer and use it in GitHub Desktop.
require 'zillabyte'
# A component that can crawl a domain 'on the fly' and determine the aggregated sentiment of that domain.
comp = Zillabyte.component("domain_sentiment")
# Input domain
stream = comp.inputs do
field "text", :string
end
# Now extract sentiment on all the web pages. This too is a public component that consumes text and outputs a score
stream = stream.execute("sentiment")
# The stream is now [score, count]. We're done.
stream.outputs do
field :score, :double
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment