Skip to content

Commit 711a57c

Browse files
committed
update stopwords to have widely used slang that I don't need to analyze
1 parent e608f5e commit 711a57c

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ Since the code has tiny TwitchTV chatbot integrated(`chatbot.py`), you can use t
6363
Simply type
6464

6565
```
66-
python3 chatbot.py Moira <client id> <oauth2 acccess token> <channel name>
66+
python chatbot.py <username> <client id> <oauth2 acccess token> <channel name>
6767
```
6868
and you'll see that the program is collecting the live chat log from the TwhtchTV channel, and determine if chat is toxic or not.
6969

7070
Parameter explanation:
7171

72+
* `<username>` : Your username on Twitch.
7273
* `<client id>` : visit https://glass.twitch.tv/ and login with your own Twitch account. Once you create new app, you'll be able to get Client ID on Dashboard -> App section. <br/>
7374
* `<oauth2 access token>` : visit [here](https://twitchapps.com/tmi/#access_token=flwh72scl6503e6bs2xnwl6g6l5jeu&scope=chat%3Aread+chat%3Aedit+channel%3Amoderate+chat_login&token_type=bearer) and click "Connec with Twitch", and use it for `<oauth2 access token>`.
7475
* `<channel name>` : TwitchTV channel name you'd like to deploy Moira. Use the channel name you can check from web browser's url, which is generally all lowercase regardless of what you can see on twitch user's dashboard.

chatbot.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44

55
import constant
6-
from sentiment_twitch import ToxicityClassifier
6+
from detox_engine import ToxicityClassifier
77

88
from joblib import dump, load
99

@@ -98,6 +98,12 @@ def do_command(self, e, cmd):
9898
print("Did not understand command:" + cmd)
9999

100100
def main():
101+
102+
if not sys.version_info[:1] == (3,):
103+
print(sys.version_info[:1] )
104+
sys.stderr.write("Python version 3 is required.\n")
105+
exit(1)
106+
101107
if len(sys.argv) != 5:
102108
print("Usage: twitchbot <username> <client id> <token> <channel>")
103109
sys.exit(1)

detox_engine.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
# !!!! IMPORTANT !!!
3131
#
32-
# Which means if you ever chagne any code in __init___ that could affect the way how classifier/vectorizer is going to work,
32+
# Which means if you ever chagne any code in __init__ that could affect the way how classifier/vectorizer is going to work,
3333
# then you need to delete two files so that program recrete them. Those two files you need to delete are "classifier.joblib", and "vectorizer.joblib"
3434
# defined in constant.py.
3535
class ToxicityClassifier():

stopwords.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ asked
5353
asking
5454
asks
5555
at
56+
atm
5657
av
5758
away
5859
b
@@ -61,6 +62,7 @@ backed
6162
backing
6263
backs
6364
be
65+
bc
6466
became
6567
because
6668
become
@@ -201,7 +203,9 @@ grouped
201203
grouping
202204
groups
203205
h
206+
ha
204207
had
208+
haha
205209
halves
206210
hardly
207211
has
@@ -237,6 +241,7 @@ however
237241
howevhowevhoif
238242
howsoever
239243
i
244+
ic
240245
ie
241246
if
242247
important
@@ -263,12 +268,17 @@ it
263268
its
264269
itself
265270
j
271+
jk
266272
just
267273
k
268274
keep
269275
keeps
270276
kg
271277
kind
278+
kk
279+
kkk
280+
kkkk
281+
kkkkk
272282
km
273283
knew
274284
know
@@ -290,9 +300,13 @@ lets
290300
like
291301
likely
292302
little
303+
lmao
304+
lmk
305+
lol
293306
long
294307
longer
295308
longest
309+
lul
296310
ltd
297311
m
298312
made
@@ -348,14 +362,14 @@ notwithstanding
348362
now
349363
nowadays
350364
nowhere
365+
np
351366
number
352367
numbers
353368
o
354369
of
355370
off
356371
often
357372
ok
358-
old
359373
older
360374
oldest
361375
on
@@ -482,6 +496,7 @@ stave
482496
staves
483497
still
484498
such
499+
sup
485500
supposing
486501
sure
487502
t
@@ -553,6 +568,7 @@ up
553568
upon
554569
upward
555570
upwards
571+
ur
556572
us
557573
use
558574
used
@@ -633,6 +649,7 @@ worst
633649
would
634650
wow
635651
x
652+
xdd
636653
y
637654
ye
638655
year
@@ -648,3 +665,4 @@ yourself
648665
yourselves
649666
yyyyyyyung
650667
z
668+
zzz

0 commit comments

Comments
 (0)