Update sentiment.py
Browse files- sentiment.py +3 -0
sentiment.py
CHANGED
@@ -107,6 +107,7 @@ def transform_text(text):
|
|
107 |
|
108 |
|
109 |
def tokenize(text):
|
|
|
110 |
doc = nlp(text)
|
111 |
return [token.text for token in doc]
|
112 |
|
@@ -123,6 +124,7 @@ def analyze_comments(results, query):
|
|
123 |
all_comments = submission.comments.list()
|
124 |
|
125 |
for comment in all_comments:
|
|
|
126 |
comment_body = comment.body
|
127 |
|
128 |
text = transform_text(comment_body)
|
@@ -130,6 +132,7 @@ def analyze_comments(results, query):
|
|
130 |
comments_for_cloud.append(comment_body)
|
131 |
|
132 |
if text:
|
|
|
133 |
tokens = tokenize(text)
|
134 |
|
135 |
tokenized_input = tokenizer(
|
|
|
107 |
|
108 |
|
109 |
def tokenize(text):
|
110 |
+
print('inside tokenize')
|
111 |
doc = nlp(text)
|
112 |
return [token.text for token in doc]
|
113 |
|
|
|
124 |
all_comments = submission.comments.list()
|
125 |
|
126 |
for comment in all_comments:
|
127 |
+
print('inside comment')
|
128 |
comment_body = comment.body
|
129 |
|
130 |
text = transform_text(comment_body)
|
|
|
132 |
comments_for_cloud.append(comment_body)
|
133 |
|
134 |
if text:
|
135 |
+
print('inside text')
|
136 |
tokens = tokenize(text)
|
137 |
|
138 |
tokenized_input = tokenizer(
|