Created
August 21, 2014 03:05
-
-
Save jakequist/3b975b4d869ef168331d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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