From 9f61c619047f526968961d43f88d4ec94901129b Mon Sep 17 00:00:00 2001 From: Janez K Date: Wed, 16 Oct 2013 10:38:00 +0200 Subject: [PATCH] added text sentiment analysis --- workflows/streaming/db/package_data.json | 2016 +++++++++++----------- workflows/streaming/library.py | 46 + 2 files changed, 1098 insertions(+), 964 deletions(-) diff --git a/workflows/streaming/db/package_data.json b/workflows/streaming/db/package_data.json index ac833d3..bb04be1 100644 --- a/workflows/streaming/db/package_data.json +++ b/workflows/streaming/db/package_data.json @@ -1,965 +1,1053 @@ [ - { - "pk": 48, - "model": "workflows.category", - "fields": { - "uid": "ca549cd5-2041-46f1-b175-a743b71b0e9b", - "parent": null, - "workflow": null, - "user": null, - "order": 1, - "name": "Streaming" - } - }, - { - "pk": 292, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Add neutral zone", - "is_streaming": false, - "uid": "722e5c1f-9d52-4fa1-81f4-afde8ea508d8", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "neutral_zone.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_add_neutral_zone", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 719, - "model": "workflows.abstractinput", - "fields": { - "widget": 292, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "f3027af6-ee71-4991-9ae7-b8877de16b35", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "" - } - }, - { - "pk": 720, - "model": "workflows.abstractinput", - "fields": { - "widget": 292, - "name": "Neutral zone", - "short_name": "nz", - "uid": "607375c0-f4e3-43b8-9f99-2830ac7e5c83", - "default": "0.1", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "zone", - "parameter": true, - "order": 2, - "description": "A value between 0 and 1" - } - }, - { - "pk": 317, - "model": "workflows.abstractoutput", - "fields": { - "widget": 292, - "name": "List of Tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "f285bb7f-4298-4ef4-bab8-9d15572775f7", - "order": 1, - "description": "" - } - }, - { - "pk": 280, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Filter tweets by language", - "is_streaming": false, - "uid": "63608f38-ee19-4898-90ba-ea2a928daa1f", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "filter_tweets.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_filter_tweets_by_language", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 698, - "model": "workflows.abstractinput", - "fields": { - "widget": 280, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "e969d30e-dc5c-4c45-8fa4-319e83f20699", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "" - } - }, - { - "pk": 699, - "model": "workflows.abstractinput", - "fields": { - "widget": 280, - "name": "Language", - "short_name": "lan", - "uid": "9befb8ed-7644-4f41-8887-1c6f74bdeba7", - "default": "en", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "lang", - "parameter": true, - "order": 2, - "description": "" - } - }, - { - "pk": 308, - "model": "workflows.abstractoutput", - "fields": { - "widget": 280, - "name": "List of Tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "5642b7b5-596b-475c-b59c-2656427482ad", - "order": 1, - "description": "" - } - }, - { - "pk": 281, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "RSS Reader", - "is_streaming": true, - "uid": "723e4654-abf4-4c9f-920f-08915c4d7a72", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_rss_reader", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 700, - "model": "workflows.abstractinput", - "fields": { - "widget": 281, - "name": "RSS URL", - "short_name": "url", - "uid": "bab53d85-8423-409c-91c3-f36a857b5e5f", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "url", - "parameter": true, - "order": 1, - "description": "The URL of the RSS feed" - } - }, - { - "pk": 309, - "model": "workflows.abstractoutput", - "fields": { - "widget": 281, - "name": "URL", - "short_name": "url", - "variable": "url", - "uid": "50d8c3ec-e1df-4f0a-b743-5e00509fed02", - "order": 1, - "description": "" - } - }, - { - "pk": 291, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Remove words from tweets", - "is_streaming": false, - "uid": "258e97c6-e44d-41a3-97c0-689de94f3049", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_remove_words_from_tweets", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 717, - "model": "workflows.abstractinput", - "fields": { - "widget": 291, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "68692ac4-df32-432d-8b10-00ed68ec7c04", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "" - } - }, - { - "pk": 718, - "model": "workflows.abstractinput", - "fields": { - "widget": 291, - "name": "Words", - "short_name": "wrd", - "uid": "69b06741-8055-4dad-b677-3940d3434bc2", - "default": "", - "required": false, - "multi": false, - "parameter_type": "textarea", - "variable": "words", - "parameter": true, - "order": 2, - "description": "One word or phrase per line" - } - }, - { - "pk": 316, - "model": "workflows.abstractoutput", - "fields": { - "widget": 291, - "name": "List of Tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "fa942ac2-f92a-4f42-a806-56f359d41d93", - "order": 1, - "description": "" - } - }, - { - "pk": 290, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Simulate stream from Gamasystem csv", - "is_streaming": true, - "uid": "7a72dcc4-53a2-4a45-96e6-31b0c2e01e32", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "twitter.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_simulate_stream_from_csv", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "Simulates a stream from gama system's csv export" - } - }, - { - "pk": 716, - "model": "workflows.abstractinput", - "fields": { - "widget": 290, - "name": "CSV file", - "short_name": "csv", - "uid": "e064e54e-47de-42a1-a9a5-fa1552845403", - "default": "", - "required": false, - "multi": false, - "parameter_type": "file", - "variable": "csv", - "parameter": true, - "order": 1, - "description": "CSV file exportet by gamasystem's perceptionanalytics" - } - }, - { - "pk": 315, - "model": "workflows.abstractoutput", - "fields": { - "widget": 290, - "name": "List of tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "c63bf850-8c95-40e3-afc9-25ecb2783c44", - "order": 1, - "description": "A list of Tweets." - } - }, - { - "pk": 293, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Simulate stream from text file", - "is_streaming": true, - "uid": "9a20da2e-0903-4332-8938-63b15d370657", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "twitter.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_simulate_stream_from_text_file", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 721, - "model": "workflows.abstractinput", - "fields": { - "widget": 293, - "name": "Text file", - "short_name": "txt", - "uid": "b3f3126c-6004-41f4-839b-08e047ffcb62", - "default": "", - "required": false, - "multi": false, - "parameter_type": "file", - "variable": "file", - "parameter": true, - "order": 1, - "description": "Text file of line separated tweets" - } - }, - { - "pk": 318, - "model": "workflows.abstractoutput", - "fields": { - "widget": 293, - "name": "List of tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "76b17d4f-7bf4-4f7d-9685-1f2cb4dda73e", - "order": 1, - "description": "A list of Tweets." - } - }, - { - "pk": 282, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Sliding Window", - "is_streaming": true, - "uid": "b21b4e13-8d15-4584-ad17-03405a79b020", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "sliding-window.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_sliding_window", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 701, - "model": "workflows.abstractinput", - "fields": { - "widget": 282, - "name": "List", - "short_name": "lst", - "uid": "5411d874-0e24-446e-88b2-065c23ee2817", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "list", - "parameter": false, - "order": 1, - "description": "Any type of list" - } - }, - { - "pk": 702, - "model": "workflows.abstractinput", - "fields": { - "widget": 282, - "name": "Size", - "short_name": "siz", - "uid": "fb2215c6-04e6-4c0b-97e5-f380c4b2f6e8", - "default": "500", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "size", - "parameter": true, - "order": 2, - "description": "Window size" - } - }, - { - "pk": 310, - "model": "workflows.abstractoutput", - "fields": { - "widget": 282, - "name": "List", - "short_name": "lst", - "variable": "list", - "uid": "02cfba05-bf1c-44f1-a94a-324feed8f3bf", - "order": 1, - "description": "The window" - } - }, - { - "pk": 283, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Split positive and negative tweets", - "is_streaming": false, - "uid": "2786eaa2-3505-4d44-9962-23df9f23c072", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "split.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_split_pos_neg", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 703, - "model": "workflows.abstractinput", - "fields": { - "widget": 283, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "eea9cd8a-dbbb-4c08-98c4-d0d6df97aee0", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "" - } - }, - { - "pk": 311, - "model": "workflows.abstractoutput", - "fields": { - "widget": 283, - "name": "Positive tweets", - "short_name": "ptw", - "variable": "ptw", - "uid": "8694851c-3f97-4177-835e-fb49c43f8dcd", - "order": 1, - "description": "" - } - }, - { - "pk": 312, - "model": "workflows.abstractoutput", - "fields": { - "widget": 283, - "name": "Negative tweets", - "short_name": "ntw", - "variable": "ntw", - "uid": "bb2debb9-914d-4c8a-abc2-3eff09009dd9", - "order": 2, - "description": "" - } - }, - { - "pk": 284, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Tweet Sentiment Analysis", - "is_streaming": true, - "uid": "62e7f354-d6c7-4c4c-b1b7-795ac613a7e0", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "sentiment.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_tweet_sentiment_service", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "Annotates the list of tweets with sentiments, reliability and a corrected language." - } - }, - { - "pk": 704, - "model": "workflows.abstractinput", - "fields": { - "widget": 284, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "bf47f1f1-d4e2-47f8-bbe3-fa28281763e0", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "List of tweets generated by the twitter feed." - } - }, - { - "pk": 313, - "model": "workflows.abstractoutput", - "fields": { - "widget": 284, - "name": "Sentiment Annotated List Of Tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "163a4c4a-b72e-439e-85a1-eaa82fdd8846", - "order": 1, - "description": "An annotated list of tweets with Sentiment, Language and Reliability." - } - }, - { - "pk": 285, - "model": "workflows.abstractwidget", - "fields": { - "category": 48, - "treeview_image": "", - "name": "Twitter", - "is_streaming": true, - "uid": "3a929977-0708-4f92-8296-2e109ff0566a", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "twitter.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "", - "action": "streaming_twitter", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "Queries the twitter API for tweets. Also works in a streaming environment." - } - }, - { - "pk": 705, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Query", - "short_name": "q", - "uid": "07b8a51c-41d9-48af-b823-92e94ce300d2", - "default": "", - "required": false, - "multi": false, - "parameter_type": "textarea", - "variable": "query", - "parameter": true, - "order": 1, - "description": "" - } - }, - { - "pk": 706, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Geocode", - "short_name": "geo", - "uid": "80d1e542-7f7c-4a8e-b683-764d0a754b03", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "geocode", - "parameter": true, - "order": 2, - "description": "" - } - }, - { - "pk": 707, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Use ClowdFlows authentication (warning: not stable)", - "short_name": "cfa", - "uid": "c78c8f03-92c4-4f6c-972d-c064baecd09a", - "default": "", - "required": false, - "multi": false, - "parameter_type": "checkbox", - "variable": "cfauth", - "parameter": true, - "order": 3, - "description": "If this is set, the default consumer and access tokens are used." - } - }, - { - "pk": 708, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Consumer Key", - "short_name": "ck", - "uid": "ed2db381-2ed2-4a4d-bd6d-9f9dc0430a50", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "ck", - "parameter": true, - "order": 4, - "description": "Go to http://dev.twitter.com and create an app. The consumer key and secret will be generated for you after." - } - }, - { - "pk": 709, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Consumer Secret", - "short_name": "cs", - "uid": "9b9d6268-675a-46c5-82d5-b143e5fdd326", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "cs", - "parameter": true, - "order": 5, - "description": "" - } - }, - { - "pk": 710, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Access Token", - "short_name": "at", - "uid": "a951f2d1-c2d1-40b3-afe9-799195e03aa0", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "at", - "parameter": true, - "order": 6, - "description": "" - } - }, - { - "pk": 711, - "model": "workflows.abstractinput", - "fields": { - "widget": 285, - "name": "Access Token Secret", - "short_name": "as", - "uid": "299ae040-2916-4b88-8a79-3ced689ef23f", - "default": "", - "required": false, - "multi": false, - "parameter_type": "text", - "variable": "as", - "parameter": true, - "order": 7, - "description": "" - } - }, - { - "pk": 314, - "model": "workflows.abstractoutput", - "fields": { - "widget": 285, - "name": "List of tweets", - "short_name": "ltw", - "variable": "ltw", - "uid": "212aab18-6058-4e35-b64c-f1e1fb1078b7", - "order": 1, - "description": "A list of Tweets." - } - }, - { - "pk": 49, - "model": "workflows.category", - "fields": { - "uid": "d0803d58-35d4-4590-bb32-f2041e735247", - "parent": 48, - "workflow": null, - "user": null, - "order": 1, - "name": "Streaming Visualizations" - } - }, - { - "pk": 286, - "model": "workflows.abstractwidget", - "fields": { - "category": 49, - "treeview_image": "", - "name": "Collect and Display tweets", - "is_streaming": true, - "uid": "f950409e-5913-4937-b7e5-7d9677a88e19", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "display-tweets.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "streaming_collect_and_display_visualization", - "action": "streaming_collect_and_display_tweets", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 712, - "model": "workflows.abstractinput", - "fields": { - "widget": 286, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "8479d41b-43af-4db9-a144-d0a438400404", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "List of tweets (can be annotated or not)" - } - }, - { - "pk": 287, - "model": "workflows.abstractwidget", - "fields": { - "category": 49, - "treeview_image": "", - "name": "Display tweets", - "is_streaming": true, - "uid": "95027c9a-b555-4b47-9f9a-57cc4e40fb96", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "display-tweets.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "streaming_display_tweets_visualization", - "action": "streaming_display_tweets", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 713, - "model": "workflows.abstractinput", - "fields": { - "widget": 287, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "e8fc4c63-2e17-4ad4-a3ab-6ec8d554ecac", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "List of tweets (can be annotated or not)" - } - }, - { - "pk": 288, - "model": "workflows.abstractwidget", - "fields": { - "category": 49, - "treeview_image": "", - "name": "Sentiment graph", - "is_streaming": true, - "uid": "c4dc0648-79b0-49e8-b670-aef1f511050d", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "graph.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "streaming_sentiment_graph", - "action": "streaming_sentiment_graph", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 714, - "model": "workflows.abstractinput", - "fields": { - "widget": 288, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "0413b69e-b954-4a77-a8ad-59dc559ee4c6", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "List of tweets (can be annotated or not)" - } - }, - { - "pk": 289, - "model": "workflows.abstractwidget", - "fields": { - "category": 49, - "treeview_image": "", - "name": "Tweet word cloud", - "is_streaming": true, - "uid": "e83e17a4-6e8a-40de-8ebe-585503d065e5", - "interaction_view": "", - "image": "", - "package": "streaming", - "static_image": "word-cloud.png", - "post_interact_action": "", - "user": null, - "visualization_view": "", - "streaming_visualization_view": "streaming_tweet_cloud", - "action": "streaming_display_tweets", - "wsdl_method": "", - "wsdl": "", - "interactive": false, - "has_progress_bar": false, - "order": 1, - "description": "" - } - }, - { - "pk": 715, - "model": "workflows.abstractinput", - "fields": { - "widget": 289, - "name": "List of Tweets", - "short_name": "ltw", - "uid": "98c77b95-1221-4a85-bdbf-6436327e39b3", - "default": "", - "required": false, - "multi": false, - "parameter_type": null, - "variable": "ltw", - "parameter": false, - "order": 1, - "description": "List of tweets" - } - } -] \ No newline at end of file +{ + "pk": 37, + "model": "workflows.category", + "fields": { + "uid": "ca549cd5-2041-46f1-b175-a743b71b0e9b", + "parent": null, + "workflow": null, + "user": null, + "order": 1, + "name": "Streaming" + } +}, +{ + "pk": 200, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Add neutral zone", + "is_streaming": false, + "uid": "722e5c1f-9d52-4fa1-81f4-afde8ea508d8", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "neutral_zone.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_add_neutral_zone", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 428, + "model": "workflows.abstractinput", + "fields": { + "widget": 200, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "f3027af6-ee71-4991-9ae7-b8877de16b35", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 429, + "model": "workflows.abstractinput", + "fields": { + "widget": 200, + "name": "Neutral zone", + "short_name": "nz", + "uid": "607375c0-f4e3-43b8-9f99-2830ac7e5c83", + "default": "0.1", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "zone", + "parameter": true, + "order": 2, + "description": "A value between 0 and 1" + } +}, +{ + "pk": 222, + "model": "workflows.abstractoutput", + "fields": { + "widget": 200, + "name": "List of Tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "f285bb7f-4298-4ef4-bab8-9d15572775f7", + "order": 1, + "description": "" + } +}, +{ + "pk": 201, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Filter tweets by language", + "is_streaming": false, + "uid": "63608f38-ee19-4898-90ba-ea2a928daa1f", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "filter_tweets.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_filter_tweets_by_language", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 430, + "model": "workflows.abstractinput", + "fields": { + "widget": 201, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "e969d30e-dc5c-4c45-8fa4-319e83f20699", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 431, + "model": "workflows.abstractinput", + "fields": { + "widget": 201, + "name": "Language", + "short_name": "lan", + "uid": "9befb8ed-7644-4f41-8887-1c6f74bdeba7", + "default": "en", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "lang", + "parameter": true, + "order": 2, + "description": "" + } +}, +{ + "pk": 223, + "model": "workflows.abstractoutput", + "fields": { + "widget": 201, + "name": "List of Tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "5642b7b5-596b-475c-b59c-2656427482ad", + "order": 1, + "description": "" + } +}, +{ + "pk": 202, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "RSS Reader", + "is_streaming": true, + "uid": "723e4654-abf4-4c9f-920f-08915c4d7a72", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_rss_reader", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 432, + "model": "workflows.abstractinput", + "fields": { + "widget": 202, + "name": "RSS URL", + "short_name": "url", + "uid": "bab53d85-8423-409c-91c3-f36a857b5e5f", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "url", + "parameter": true, + "order": 1, + "description": "The URL of the RSS feed" + } +}, +{ + "pk": 224, + "model": "workflows.abstractoutput", + "fields": { + "widget": 202, + "name": "URL", + "short_name": "url", + "variable": "url", + "uid": "50d8c3ec-e1df-4f0a-b743-5e00509fed02", + "order": 1, + "description": "" + } +}, +{ + "pk": 203, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Remove words from tweets", + "is_streaming": false, + "uid": "258e97c6-e44d-41a3-97c0-689de94f3049", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_remove_words_from_tweets", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 433, + "model": "workflows.abstractinput", + "fields": { + "widget": 203, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "68692ac4-df32-432d-8b10-00ed68ec7c04", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 434, + "model": "workflows.abstractinput", + "fields": { + "widget": 203, + "name": "Words", + "short_name": "wrd", + "uid": "69b06741-8055-4dad-b677-3940d3434bc2", + "default": "", + "required": false, + "multi": false, + "parameter_type": "textarea", + "variable": "words", + "parameter": true, + "order": 2, + "description": "One word or phrase per line" + } +}, +{ + "pk": 225, + "model": "workflows.abstractoutput", + "fields": { + "widget": 203, + "name": "List of Tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "fa942ac2-f92a-4f42-a806-56f359d41d93", + "order": 1, + "description": "" + } +}, +{ + "pk": 204, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Simulate stream from Gamasystem csv", + "is_streaming": true, + "uid": "7a72dcc4-53a2-4a45-96e6-31b0c2e01e32", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "twitter.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_simulate_stream_from_csv", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "Simulates a stream from gama system's csv export" + } +}, +{ + "pk": 435, + "model": "workflows.abstractinput", + "fields": { + "widget": 204, + "name": "CSV file", + "short_name": "csv", + "uid": "e064e54e-47de-42a1-a9a5-fa1552845403", + "default": "", + "required": false, + "multi": false, + "parameter_type": "file", + "variable": "csv", + "parameter": true, + "order": 1, + "description": "CSV file exportet by gamasystem's perceptionanalytics" + } +}, +{ + "pk": 226, + "model": "workflows.abstractoutput", + "fields": { + "widget": 204, + "name": "List of tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "c63bf850-8c95-40e3-afc9-25ecb2783c44", + "order": 1, + "description": "A list of Tweets." + } +}, +{ + "pk": 205, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Simulate stream from text file", + "is_streaming": true, + "uid": "9a20da2e-0903-4332-8938-63b15d370657", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "twitter.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_simulate_stream_from_text_file", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 436, + "model": "workflows.abstractinput", + "fields": { + "widget": 205, + "name": "Text file", + "short_name": "txt", + "uid": "b3f3126c-6004-41f4-839b-08e047ffcb62", + "default": "", + "required": false, + "multi": false, + "parameter_type": "file", + "variable": "file", + "parameter": true, + "order": 1, + "description": "Text file of line separated tweets" + } +}, +{ + "pk": 227, + "model": "workflows.abstractoutput", + "fields": { + "widget": 205, + "name": "List of tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "76b17d4f-7bf4-4f7d-9685-1f2cb4dda73e", + "order": 1, + "description": "A list of Tweets." + } +}, +{ + "pk": 206, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Sliding Window", + "is_streaming": true, + "uid": "b21b4e13-8d15-4584-ad17-03405a79b020", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "sliding-window.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_sliding_window", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 437, + "model": "workflows.abstractinput", + "fields": { + "widget": 206, + "name": "List", + "short_name": "lst", + "uid": "5411d874-0e24-446e-88b2-065c23ee2817", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "list", + "parameter": false, + "order": 1, + "description": "Any type of list" + } +}, +{ + "pk": 438, + "model": "workflows.abstractinput", + "fields": { + "widget": 206, + "name": "Size", + "short_name": "siz", + "uid": "fb2215c6-04e6-4c0b-97e5-f380c4b2f6e8", + "default": "500", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "size", + "parameter": true, + "order": 2, + "description": "Window size" + } +}, +{ + "pk": 228, + "model": "workflows.abstractoutput", + "fields": { + "widget": 206, + "name": "List", + "short_name": "lst", + "variable": "list", + "uid": "02cfba05-bf1c-44f1-a94a-324feed8f3bf", + "order": 1, + "description": "The window" + } +}, +{ + "pk": 207, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Split positive and negative tweets", + "is_streaming": false, + "uid": "2786eaa2-3505-4d44-9962-23df9f23c072", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "split.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_split_pos_neg", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 439, + "model": "workflows.abstractinput", + "fields": { + "widget": 207, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "eea9cd8a-dbbb-4c08-98c4-d0d6df97aee0", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 229, + "model": "workflows.abstractoutput", + "fields": { + "widget": 207, + "name": "Positive tweets", + "short_name": "ptw", + "variable": "ptw", + "uid": "8694851c-3f97-4177-835e-fb49c43f8dcd", + "order": 1, + "description": "" + } +}, +{ + "pk": 230, + "model": "workflows.abstractoutput", + "fields": { + "widget": 207, + "name": "Negative tweets", + "short_name": "ntw", + "variable": "ntw", + "uid": "bb2debb9-914d-4c8a-abc2-3eff09009dd9", + "order": 2, + "description": "" + } +}, +{ + "pk": 214, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Text Sentiment Analysis", + "is_streaming": true, + "uid": "f54ed3e2-280e-48cf-b1f3-7e8fcfa2b94a", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "sentiment.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_sentiment_analysis", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 452, + "model": "workflows.abstractinput", + "fields": { + "widget": 214, + "name": "Text", + "short_name": "tex", + "uid": "f9236516-4a3b-4441-af21-86930bbd958a", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "text", + "parameter": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 453, + "model": "workflows.abstractinput", + "fields": { + "widget": 214, + "name": "Language", + "short_name": "lng", + "uid": "456adb59-6533-4d24-98c2-be076c43c1fb", + "default": "en", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "lang", + "parameter": true, + "order": 1, + "description": "" + } +}, +{ + "pk": 233, + "model": "workflows.abstractoutput", + "fields": { + "widget": 214, + "name": "Sentiment", + "short_name": "sen", + "variable": "sentiment", + "uid": "f7d0779a-92ed-4953-95a6-2cb4da96c75f", + "order": 1, + "description": "" + } +}, +{ + "pk": 234, + "model": "workflows.abstractoutput", + "fields": { + "widget": 214, + "name": "Reliability", + "short_name": "rel", + "variable": "reliability", + "uid": "797fcd60-a9f5-492d-9f67-833d8c606617", + "order": 1, + "description": "" + } +}, +{ + "pk": 208, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Tweet Sentiment Analysis", + "is_streaming": true, + "uid": "62e7f354-d6c7-4c4c-b1b7-795ac613a7e0", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "sentiment.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_tweet_sentiment_service", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "Annotates the list of tweets with sentiments, reliability and a corrected language." + } +}, +{ + "pk": 440, + "model": "workflows.abstractinput", + "fields": { + "widget": 208, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "bf47f1f1-d4e2-47f8-bbe3-fa28281763e0", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "List of tweets generated by the twitter feed." + } +}, +{ + "pk": 231, + "model": "workflows.abstractoutput", + "fields": { + "widget": 208, + "name": "Sentiment Annotated List Of Tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "163a4c4a-b72e-439e-85a1-eaa82fdd8846", + "order": 1, + "description": "An annotated list of tweets with Sentiment, Language and Reliability." + } +}, +{ + "pk": 209, + "model": "workflows.abstractwidget", + "fields": { + "category": 37, + "treeview_image": "", + "name": "Twitter", + "is_streaming": true, + "uid": "3a929977-0708-4f92-8296-2e109ff0566a", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "twitter.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "streaming_twitter", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "Queries the twitter API for tweets. Also works in a streaming environment." + } +}, +{ + "pk": 441, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Query", + "short_name": "q", + "uid": "07b8a51c-41d9-48af-b823-92e94ce300d2", + "default": "", + "required": false, + "multi": false, + "parameter_type": "textarea", + "variable": "query", + "parameter": true, + "order": 1, + "description": "" + } +}, +{ + "pk": 442, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Geocode", + "short_name": "geo", + "uid": "80d1e542-7f7c-4a8e-b683-764d0a754b03", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "geocode", + "parameter": true, + "order": 2, + "description": "" + } +}, +{ + "pk": 443, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Use ClowdFlows authentication (warning: not stable)", + "short_name": "cfa", + "uid": "c78c8f03-92c4-4f6c-972d-c064baecd09a", + "default": "", + "required": false, + "multi": false, + "parameter_type": "checkbox", + "variable": "cfauth", + "parameter": true, + "order": 3, + "description": "If this is set, the default consumer and access tokens are used." + } +}, +{ + "pk": 444, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Consumer Key", + "short_name": "ck", + "uid": "ed2db381-2ed2-4a4d-bd6d-9f9dc0430a50", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "ck", + "parameter": true, + "order": 4, + "description": "Go to http://dev.twitter.com and create an app. The consumer key and secret will be generated for you after." + } +}, +{ + "pk": 445, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Consumer Secret", + "short_name": "cs", + "uid": "9b9d6268-675a-46c5-82d5-b143e5fdd326", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "cs", + "parameter": true, + "order": 5, + "description": "" + } +}, +{ + "pk": 446, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Access Token", + "short_name": "at", + "uid": "a951f2d1-c2d1-40b3-afe9-799195e03aa0", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "at", + "parameter": true, + "order": 6, + "description": "" + } +}, +{ + "pk": 447, + "model": "workflows.abstractinput", + "fields": { + "widget": 209, + "name": "Access Token Secret", + "short_name": "as", + "uid": "299ae040-2916-4b88-8a79-3ced689ef23f", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "as", + "parameter": true, + "order": 7, + "description": "" + } +}, +{ + "pk": 232, + "model": "workflows.abstractoutput", + "fields": { + "widget": 209, + "name": "List of tweets", + "short_name": "ltw", + "variable": "ltw", + "uid": "212aab18-6058-4e35-b64c-f1e1fb1078b7", + "order": 1, + "description": "A list of Tweets." + } +}, +{ + "pk": 38, + "model": "workflows.category", + "fields": { + "uid": "d0803d58-35d4-4590-bb32-f2041e735247", + "parent": 37, + "workflow": null, + "user": null, + "order": 1, + "name": "Streaming Visualizations" + } +}, +{ + "pk": 210, + "model": "workflows.abstractwidget", + "fields": { + "category": 38, + "treeview_image": "", + "name": "Collect and Display tweets", + "is_streaming": true, + "uid": "f950409e-5913-4937-b7e5-7d9677a88e19", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "display-tweets.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "streaming_collect_and_display_visualization", + "action": "streaming_collect_and_display_tweets", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 448, + "model": "workflows.abstractinput", + "fields": { + "widget": 210, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "8479d41b-43af-4db9-a144-d0a438400404", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "List of tweets (can be annotated or not)" + } +}, +{ + "pk": 211, + "model": "workflows.abstractwidget", + "fields": { + "category": 38, + "treeview_image": "", + "name": "Display tweets", + "is_streaming": true, + "uid": "95027c9a-b555-4b47-9f9a-57cc4e40fb96", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "display-tweets.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "streaming_display_tweets_visualization", + "action": "streaming_display_tweets", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 449, + "model": "workflows.abstractinput", + "fields": { + "widget": 211, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "e8fc4c63-2e17-4ad4-a3ab-6ec8d554ecac", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "List of tweets (can be annotated or not)" + } +}, +{ + "pk": 212, + "model": "workflows.abstractwidget", + "fields": { + "category": 38, + "treeview_image": "", + "name": "Sentiment graph", + "is_streaming": true, + "uid": "c4dc0648-79b0-49e8-b670-aef1f511050d", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "graph.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "streaming_sentiment_graph", + "action": "streaming_sentiment_graph", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 450, + "model": "workflows.abstractinput", + "fields": { + "widget": 212, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "0413b69e-b954-4a77-a8ad-59dc559ee4c6", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "List of tweets (can be annotated or not)" + } +}, +{ + "pk": 213, + "model": "workflows.abstractwidget", + "fields": { + "category": 38, + "treeview_image": "", + "name": "Tweet word cloud", + "is_streaming": true, + "uid": "e83e17a4-6e8a-40de-8ebe-585503d065e5", + "interaction_view": "", + "image": "", + "package": "streaming", + "static_image": "word-cloud.png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "streaming_tweet_cloud", + "action": "streaming_display_tweets", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } +}, +{ + "pk": 451, + "model": "workflows.abstractinput", + "fields": { + "widget": 213, + "name": "List of Tweets", + "short_name": "ltw", + "uid": "98c77b95-1221-4a85-bdbf-6436327e39b3", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "ltw", + "parameter": false, + "order": 1, + "description": "List of tweets" + } +} +] diff --git a/workflows/streaming/library.py b/workflows/streaming/library.py index c7517d1..667e842 100644 --- a/workflows/streaming/library.py +++ b/workflows/streaming/library.py @@ -245,6 +245,52 @@ def streaming_tweet_sentiment_service(input_dict,widget,stream=None): return output_dict +def streaming_sentiment_analysis(input_dict,widget,stream=None): + import pickle + from pysimplesoap.client import SoapClient, SoapFault + import pysimplesoap + + client = SoapClient(location = "http://batman.ijs.si:8008/",action = 'http://batman.ijs.si:8008/',namespace = "http://example.com/tweetsentiment.wsdl",soap_ns='soap',trace = False,ns = False) + pysimplesoap.client.TIMEOUT = 60 + + try: + input_dict['lang'] + except: + input_dict['lang']="en" + + #list_of_tweets = input_dict['ltw'] + + new_list_of_tweets = [] + + new_list_of_tweets.append({'id':0,'text':input_dict['text'],'language':input_dict['lang']}) + + #for tweet in list_of_tweets: + # new_list_of_tweets.append({'id':tweet['id'],'text':tweet['text'],'language':tweet['lang']}) + + pickled_list_of_tweets = pickle.dumps(new_list_of_tweets) + + response = client.TweetSentimentService(tweets=pickled_list_of_tweets) + + new_ltw = pickle.loads(str(response.TweetSentimentResult)) + + output_dict = {} + + #i=0 + for new_tweet in new_ltw: + output_dict['sentiment']=new_tweet['sentiment'] + output_dict['language']=new_tweet['language'] + output_dict['reliability']=new_tweet['reliability'] + #list_of_tweets[i]['sentiment']=new_tweet['sentiment'] + #list_of_tweets[i]['lang']=new_tweet['language'] + #list_of_tweets[i]['reliability']=new_tweet['reliability'] + #i = i + 1 + + #output_dict = {} + + #output_dict['ltw'] = list_of_tweets + + return output_dict + def streaming_twitter(input_dict,widget,stream=None): import tweepy from streams.models import StreamWidgetData -- GitLab