1. Michele Orrù
  2. wiki-polarization


Michele Orrù  committed 12c2312

Webapp working \o/

  • Participants
  • Parent commits d923edf
  • Branches default

Comments (0)

Files changed (1)

File webapp.py

View file
 import csv
+import logging
 import flask
 from pattern.en import sentiment
     The graph is supposed to show people with strong accordance more near than
     people in opposition.
-    talk_graph = graph.Graph()
+    talk_graph = graph.Graph(layout=graph._graph.SPRING)
     with open(txtcsv) as txt:
         csv_reader = csv.DictReader(txt,
             msg = line['msg']
             if not target:
-                logging.debug(('User %s reported this message referring to '
-                               'nobody: %s') % (author, msg))
-                continue
+                talk_graph.add_node(author)
                 # Add a new node using the Edge class declared above
                 talk_graph.add_edge(author, target,
                                     base=graph.Edge, type='is-related-to')
-    return graph.render(talk_graph, frames=1, ipf=0)
+    return graph.render(talk_graph)