<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Graphing_Live_Twitter_Sentiment_Analysis_with_NLTK</id>
	<title>Graphing Live Twitter Sentiment Analysis with NLTK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Graphing_Live_Twitter_Sentiment_Analysis_with_NLTK"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Graphing_Live_Twitter_Sentiment_Analysis_with_NLTK&amp;action=history"/>
	<updated>2026-04-21T22:24:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Graphing_Live_Twitter_Sentiment_Analysis_with_NLTK&amp;diff=46832&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;Now that we have live data coming in from the Twitter streaming API, why not also have a live graph that shows the sentiment trend? To do this, we&#039;re going to combine this tut...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Graphing_Live_Twitter_Sentiment_Analysis_with_NLTK&amp;diff=46832&amp;oldid=prev"/>
		<updated>2017-01-31T10:41:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Now that we have live data coming in from the Twitter streaming API, why not also have a live graph that shows the sentiment trend? To do this, we&amp;#039;re going to combine this tut...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Now that we have live data coming in from the Twitter streaming API, why not also have a live graph that shows the sentiment trend? To do this, we&amp;#039;re going to combine this tutorial with the live matplotlib graphing tutorial.&lt;br /&gt;
&lt;br /&gt;
If you want to know more about how the code works, see that tutorial. Otherwise:&lt;br /&gt;
&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import matplotlib.animation as animation&lt;br /&gt;
from matplotlib import style&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
style.use(&amp;quot;ggplot&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
fig = plt.figure()&lt;br /&gt;
ax1 = fig.add_subplot(1,1,1)&lt;br /&gt;
&lt;br /&gt;
def animate(i):&lt;br /&gt;
    pullData = open(&amp;quot;twitter-out.txt&amp;quot;,&amp;quot;r&amp;quot;).read()&lt;br /&gt;
    lines = pullData.split(&amp;#039;\n&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    xar = []&lt;br /&gt;
    yar = []&lt;br /&gt;
&lt;br /&gt;
    x = 0&lt;br /&gt;
    y = 0&lt;br /&gt;
&lt;br /&gt;
    for l in lines[-200:]:&lt;br /&gt;
        x += 1&lt;br /&gt;
        if &amp;quot;pos&amp;quot; in l:&lt;br /&gt;
            y += 1&lt;br /&gt;
        elif &amp;quot;neg&amp;quot; in l:&lt;br /&gt;
            y -= 1&lt;br /&gt;
&lt;br /&gt;
        xar.append(x)&lt;br /&gt;
        yar.append(y)&lt;br /&gt;
        &lt;br /&gt;
    ax1.clear()&lt;br /&gt;
    ax1.plot(xar,yar)&lt;br /&gt;
ani = animation.FuncAnimation(fig, animate, interval=1000)&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
The next tutorial: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* https://pythonprogramming.net/graph-live-twitter-sentiment-nltk-tutorial/?completed=/twitter-sentiment-analysis-nltk-tutorial/&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>