Spaces:
Sleeping
Sleeping
[email protected]
commited on
Commit
·
96f2e3d
1
Parent(s):
eab8d68
change the text split in talk page model
Browse files- talk_page_analysis.py +1 -1
talk_page_analysis.py
CHANGED
@@ -41,7 +41,7 @@ def tone_talkpage(url):
|
|
41 |
tone_labels = {'anger': 0, 'anticipation': 0, 'disgust': 0, 'fear': 0, 'joy': 0, 'love': 0, 'optimism': 0, 'pessimism': 0, 'sadness': 0, 'surprise': 0, 'trust': 0}
|
42 |
if talk_content:
|
43 |
breakdown = talk_content.split()
|
44 |
-
n =
|
45 |
breakdown_lst = [' '.join(breakdown[i:i+n]) for i in range(0,len(talk_content),n)]
|
46 |
for ele in breakdown_lst:
|
47 |
res = classifier(ele)[0]
|
|
|
41 |
tone_labels = {'anger': 0, 'anticipation': 0, 'disgust': 0, 'fear': 0, 'joy': 0, 'love': 0, 'optimism': 0, 'pessimism': 0, 'sadness': 0, 'surprise': 0, 'trust': 0}
|
42 |
if talk_content:
|
43 |
breakdown = talk_content.split()
|
44 |
+
n = 150 #because the max amount of sequence length is 512
|
45 |
breakdown_lst = [' '.join(breakdown[i:i+n]) for i in range(0,len(talk_content),n)]
|
46 |
for ele in breakdown_lst:
|
47 |
res = classifier(ele)[0]
|