<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Text Analytics on Tweets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528527#M144265</link>
    <description>&lt;P&gt;we need to calculate the score for each day for each tweet. Where we have a word polarity sheet with score and a sheet with tweets data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jan 2019 18:44:28 GMT</pubDate>
    <dc:creator>Guptashwe</dc:creator>
    <dc:date>2019-01-19T18:44:28Z</dc:date>
    <item>
      <title>Text Analytics on Tweets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528527#M144265</link>
      <description>&lt;P&gt;we need to calculate the score for each day for each tweet. Where we have a word polarity sheet with score and a sheet with tweets data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 18:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528527#M144265</guid>
      <dc:creator>Guptashwe</dc:creator>
      <dc:date>2019-01-19T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528538#M144266</link>
      <description>Hi:&lt;BR /&gt;  Here's a previous posting &lt;A href="https://communities.sas.com/t5/SAS-Programming/Perform-Sentiment-Analysis-Using-Base-advanced-Sas/td-p/306572" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Perform-Sentiment-Analysis-Using-Base-advanced-Sas/td-p/306572&lt;/A&gt; on the topic that may get your started. If you have SAS Enterprise Miner, SAS Text Miner and SAS Sentiment Analysis tools, those might mean using a different approach.&lt;BR /&gt;Cynthia</description>
      <pubDate>Sat, 19 Jan 2019 15:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528538#M144266</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-19T15:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Text Analytics on Tweets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528553#M144274</link>
      <description>&lt;P&gt;FYI - I've changed the subject in your thread to be more related to your question. 'Need help' is very vague and doesn't indicate the subject of your question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a similar example of something I tried a while back for data analysis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Create sample data;
data random_sentences;
    infile cards truncover;
    informat sentence $256.;
    input sentence $256.;
    cards;
This is a random sentence
This is another random sentence
Happy Birthday
My job sucks.
This is a good idea, not.
This is an awesome idea!
How are you today?
Does this make sense?
Have a great day!
;
    ;
    ;
    ;

*Partition into words;
data f1;
    set random_sentences;
    id=_n_;
    nwords=countw(sentence);
    nchar=length(compress(sentence));

    do word_order=1 to nwords;
        word=scan(sentence, word_order);
        output;
    end;
run;

*Add happiness index and pos;

proc sql ;
    create table scored as 
    select a.*, b.happiness_rank, c.pos, c.pos1
    from f1 as a 
    left join ta.sentiment as b 
    on a.word=b.word 
    left join ta.corpus as c
    on a.word=c.word
    order by sentence, word_order;
quit;

*Calculate sentence happiness score;
proc sql;
create table sentence_sentiment as
select distinct sentence, sum(happiness_rank) as sentiment
from scored
group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/249630"&gt;@Guptashwe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;we need to calculate the score for each day for each tweet. Where we have a word polarity sheet with score and a sheet with tweets data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 18:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Analytics-on-Tweets/m-p/528553#M144274</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-19T18:51:56Z</dc:date>
    </item>
  </channel>
</rss>

