Daily Tweet Sentiment Score Series

62 views
Skip to first unread message

Stever

unread,
Apr 21, 2013, 6:39:21 AM4/21/13
to pattern-f...@googlegroups.com

I hope everyone's doing well.  I've been trying to deal with a couple of fairly elementary problems but I've been really stuck.  I'd be really grateful for any advice.
  1. In the Belgian elections example (http://www.clips.ua.ac.be/pages/pattern-examples-elections), the script generates "harvest-*.txt" files - however the sentiment scores are added up, rather than broken down per day. 

    Is there a way to generate the graphs of tweets per day by day, i.e. tweet time series?  (I got it to graph the cumulative tweets, but stuck on generating the trend over time graph.)

  2. Does anyone know with Node Box for OpenGL, how you export it to a .png or .jpg file?
I'd be very grateful for your kind help.  Thanks very much in advance.

Stever

Tom De Smedt

unread,
May 16, 2013, 9:18:53 PM5/16/13
to pattern-f...@googlegroups.com
1) The trick is to create "bins" per day / week / month, and average all the scores for that day / week / month. You can create bins by keeping a dictionary indexed by an id based on the date (for example, "year-month-day", "year-weekday", ...) linking to a list of values. I've updated the example at http://www.clips.ua.ac.be/pages/pattern-examples-elections - let me know if that clarify things or not.

2) I think if you press CTRL-S during the animation, it exports a .png in the current folder. Otherwise, inside the draw(canvas) function, you can call canvas.save("your-file.png") during a frame of interest.

Let me know if that works.

Tom
Reply all
Reply to author
Forward
0 new messages