Your SlideShare is downloading. ×
Aws r
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Aws r


Published on

Taking information from social media, data repositories, building R Studio on the Amazon AWS platform. More to come.

Taking information from social media, data repositories, building R Studio on the Amazon AWS platform. More to come.

Published in: Technology, Business

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Taking  Social  Media  Text   Analysis  to  the  AWS  Cloud:   Social  Media,  Hadoop  MapReduce  and  R   Author:   Sherri  Verdugo  
  • 2. • Agenda   Where  this  presenta:on  is  going  to  go…   Discussion  Item  One  –  Introduc:on   Literature  Review,  Social  Media,  How  can  this  help  researchers?  Can  we  count  words  in  tweets?     Discussion  Item  Two  –  AWS  PlaHorm  by  Amazon   Working  on  the  cloud     Discussion  Item  Four  –  Hadoop  Mapreduce   A  Tutorial  based  discovery  of  social  media  word  count.     Discussion  Item  Five  –  R  Project  IDE   Taking  care  of  business….     Overview   PlaHorm   R   Server   Program   Discussion  Item  Three  –  Server  Setup   How  to  set  up  a  remote  server  for  research  teams?     Discussion  Item  Five  –  Conclusion     Wrap  up  and  concluding  thoughts.     Discussion  
  • 3. •  Qualita:ve  Data  is  Important  to  Research.   •  Some:mes  qualita:ve  data  is  overlooked.   •  Could  contain  important  informa:on   •  What  do  people  say  about  a  health  campaign?   •  Can  we  see  it  in  real  :me?   •  How  can  we  get  real  :me  informa:on  from  people?   •  Implemen:ng  a  cloud  computer  for  data   •  Using  Python  to  obtain  social  media  posts   •  Using  Hadoop  MapReduce  to  count  words   •  Can  anyone  do  this?   •  Yes  and  no.  You  need  pa:ence  and  a  familiarity  with  Python.   How  can  researchers  outside  of  computer  science  benefit?   • Introduc;on   Social  Media  (i.e.   Twi?er  and  FB)   Real  Time   informa;on  by   Real  People.   What  are   people  thinking   about?  
  • 4. TWITTER   •  Tweet  updates  by  users   •  Maximum  characters:  most  <  140   •  Items  trend  by  hash  tags   •  Python  can  retrieve  tweets  by  a   search  query  using  twier  or   twython  library   •  Less  difficult  to  obtain   •  Status  updates  by  users   •  Maximum  characters:  increasing   •  Items  are  liked  by  users   •  Informa:on  (json  file)  is   downloaded  by  url  using  an   applica:on  called  Graph  API  for   python  applica:ons   •  More  difficult  to  obtain   FACEBOOK   • Social  Media  Comparison   Leang  people  inform  research   Both  are   Real  Time   Examples  
  • 5. •  Step  1:  Set  up  an   Ubuntu  11.10   •  We  have  a  team  of   researchers  and  we   need  an  environment   to  work  in.  AWS  to  the   rescue   •  Seang  up  ssh   protocols  and   cer:ficates   •  Installa:on  of  R  Studio   for  quan:ta:ve  data   •  Installa:on  of  Python     and/or  libraries  for   qualita:ve  data   •  Wri:ng  MR  programs   in  Python…tutorial   word  count  can  see   twier   •  Python  can  even   handle  cleaning  up  the   data   • Qualita;ve  and  Quan;ta;ve  in  the  Cloud   Adventures  in  AWS  set  up  
  • 6. The  web  is  a  great  repository  of   knowledge.  You  can  obtain  more   informa:on  about  projects  that  are   needed  in  order  to  produce   deliverables.  In  this  case  research   informa:on.     Primary  Tutorial:    Blogclub  Tworkshops   URL:     hp://www.alex-­‐ tworkshops/         • Sources  of  Development   Tutorials  when  your  knowledge  falls  short.   Descrip;on   Comprehensive   Hadoop  MR   tutorial  for  Twier   Data   What  we   changed                           Installa:on  of  the   server  and   cleaning  process.   Mapper                                                         Used  to  process   lists  and  obtain   tweets   Mapper  and   Reducer                   Used  for  coun:ng   word  frequencies   in  twier  
  • 7. •  hp://   •  Cost  effec:ve   •  Portable  and  scalable   •  Tradi:onal  Servers  for  mul:ple   purposes   •  Elas:c  MapReduce  Servers  for   fast  and  intui:ve  integra:on  of   Hadoop  MR   •  Ease  of  installa:on  for  sta:s:cal   packages  and  python  libraries   for  qualita:ve  and  quan:ta:ve   data   • AWS:  A  plaPorm  for  research   Take  research  to  the  cloud.  
  • 8. • AWS:  Server  Set  up   Ubuntu  11.10:  The  Instance.  
  • 9. • AWS:  Server  Set  up   Ubuntu  11.10:  The  Security  Groups.  
  • 10. •  Real  :me  informa:on  for  researchers   •  Applica:ons:  public  health  trends   •  Qualita:ve  and  Quan:ta:ve   •  Python:  a  language  for  discovery   •  Word  Count  Tutorial  Mapper  can  be   modified  to  obtain  and  clean  informa:on   from  Twier   • Knowledge  Discovery  in  Databases   Leang  the  informa:on  guide  the  hypotheses  on  AWS   •  The  server  is  set  up  and  now  we  can  test   python  on  the  AWS  server  we  created.   •  Seang  cer:ficates  up  for  ssh  log  in   •  Configuring  ports  for  communica:on  
  • 11. Example  code  for  wri:ng  to  file  and  standard  out   #!usr/bin/env  python    import  sys    #the  input  comes  from  STDIN  (standard  input  vs.  file)   #  modifica:on  of  wordcount   #include  class  MyWrier  to  print  to  text  and  std.out    class  myWrier:                            def  __init__(self,  stdout,  filename):      self.stdout  =  stdout      self.logfile  =  filename(filename,  ‘a’)                          def  write(self,  text):      self.stdout.write(text)      self.logfile.write(text)                          def  close(self):                                  self.stdout.close()                                  self.logfile.close()    writer  =  MyWriter(sys.stdout,  "log.txt")   sys.stdout  =  writer    for  line  in  sys.stdin:    line  =  line.lower()                  #change  to  lower  case    line  =  line.strip()                      #remove  leading  and  trailing  white  spaces        line  =  line.strip(',’                  #remove  comas  from  the  text  file  in                                                            words  =  line.split()            #split  the  line  into  words  now    #increase  counters  to  get  all  of  the  results  to            #use  for  sen:ment  analysis                  for  word  in  words:                  #write  the  results  to  STDOUT  (print  on  screen)                                                                          print  '%st'  %  (word)     • Python:  a  method  of  cleaning  and  coun;ng   MR  can  be  applied  to  pre-­‐processing  tasks,  print  to  text  and  std.  out.  
  • 12. Prior  to  the  word  count  MR  program       The  Hadoop  word  count    was   modified  to  handle  tweets.  First,  the   mapper  was  used  to  obtain  and   clean  the  tweets.       Note  that  prior  to  the  reducer…the   word  count  defaults  to  one.  Not   really  informa:ve,  but  that  is  what   the  reducer  part  of  the  program  is   used  for.     Once  we  have  the  tweets  saved  and   cleaned  we  can  load  them  in  using   Standard  Input.  Once  we  sort  the   words  we  can  generate  the  output   to  save  in  a  text  file  and  print  on   screen.   • Python  Hadoop  Programs   From  preprocessing  to  word  coun:ng  of  tweets   Star Burst! Pre-­‐Reducer   Output   Count   MR  Output   Count   1130pm     1130pm     1130pm     1130pm     1130pm     1924     2013     230pm     2nite     2nite     35     a     a     a     a     a     a     about       1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1     1130pm     1924     2013     230pm     2nite     35     a     about     accding     again     alarmed     album     all     america     &amp     an     ann     anor       5   1   1   1   2   1   6   2   1   4   1   1   1   3   2   1   1   1    
  • 13. We  need  a  method  that  can   let  us  analyze  quan:ta:ve   data  from  the  word  count   programs.  We  also  need  a   program  for  analysis  that  sets   up  for  individuals  to  log  in   and  work  securely.     R  Project  for  sta:s:cal   analysis  can  help  with  our   project.       Now  that  we  have  installed   the  program  on  the  server   using  the  terminal…we  can   log  in.   • R  Project  for  Qualita;ve   We  only  have  half  the  story  so  far.  
  • 14. We  have  folders  for  easy   work  space  viewing.     Data  can  move  between   python  and  R.     Object  oriented   programming  for  qualita:ve   data.   • R  Project  for  Qualita;ve   We  only  have  half  the  story  so  far.  
  • 15. •  Step  1:  Set  up  an   Ubuntu  11.10   •  We  successfully  set  up   an  Ubuntu  11.10     •  Seang  up  ssh   protocols  and   cer:ficates   •  We  Installed  and   launched  R  Studio  for   quan:ta:ve  data   •  MR  programs  in   Python…word  count   can  get  tweets  and   FB  updates  (if  we   wanted  to)   •  Python  handled   cleaning  up  the  data   and  geang  the  RT   tweets   • Qualita;ve  and  Quan;ta;ve  in  the  Cloud   Adventures  in  AWS  set  up  
  • 16. Stage  1   • Knowledge  Discovery  in  Databases   Stage  2   • AWS  Setup   Stage  3   • Programming  in  the  cloud  (Python,  c,  c++,   etc.)   Stage  4   • Analysis  in  R  on  AWS   Cross-­‐field  applicability.     Those  that  could  benefit:    Communica:ons    Marke:ng    Pyschology    Public  Health    Business     Tutorials  on  the  web  for:      server  set  up  on  AWS    programming  language    R  analysis     Large  community  of  support.     • From  ?  To  Research….   Empowering  tutorial  based  research  projects  
  • 17. • Taking  Social  Media  Text  Analysis  to   the  AWS  Cloud:   Presented  by:  Sherri  Verdugo   Class:  CS540  High  Performance   Ques:ons?