Skip to content

Commit

Permalink
Merge pull request #4 from freesoft/develop
Browse files Browse the repository at this point in the history
Latest merge to master
  • Loading branch information
freesoft authored Dec 16, 2018
2 parents aa5291c + 5626346 commit 570cbc4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The project has Dockerfile script that you can use for Docker image build. Also,

### 1. build Docker image and start

Install (Docker)[https://www.docker.com] for your macine and checkout the git repo. Once it's ready, then run
Install [Docker](https://www.docker.com) for your macine and checkout the git repo. Once it's ready, then run

```
docker build -t uiuc-cs410-fall2018:detox .
Expand Down Expand Up @@ -118,8 +118,8 @@ Parameter explanation:

* `<username>` : Your username on Twitch.
* `<client id>` : visit [https://glass.twitch.tv/](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/>
* `<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>`.
* `<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.
* `<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 "Connect with Twitch", and use it for `<oauth2 access token>`.
* `<channel name>` : TwitchTV channel name you'd like to deploy the Detox engine. 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.



Expand All @@ -138,4 +138,20 @@ First line should start with following header title,
and from 2nd line you can use your own data. The engine doesn't care much about the value in the "id" part and add whatever chat logs you'd like to test.

Training data file has similar format, but it has additional CSV column that needs to be pre-labeled by human so that it can be used for traning purpose.

### I'd like to know more about Twitch TV Chatbot. Where I can find the relevant docs?

Check out [https://dev.twitch.tv/docs/irc/guide/](https://dev.twitch.tv/docs/irc/guide/). You can find more on their [dev site](https://dev.twitch.tv/docs/.

### Where I can contact for aksing questions or issue to report?

Please [open a new issue](https://github.com/freesoft/detox_bot/issues/new) on this Github repository and I'll take a look shortly.

## Resources ##

* NLTK : https://www.nltk.org
* Scikit-learn : http://scikit-learn.org
* Docker : http://docker.com
* Heroku : http://heroku.com
* Docker Hub : http://dockerhub.com

6 changes: 3 additions & 3 deletions detox_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Author : Wonhee Jung ( wonheej2@illinois.edu, wonhee.jung@gmail.com )
Since : Nov, 2018
UIUC MCS-DS CS410 Fall 2018 Project
UIUC MCS-DS CS410 Fall 2018 Project.
'''
import csv
import gc
Expand Down Expand Up @@ -121,9 +121,9 @@ def tokenizer(s):
# with given parameter s, it returns whether s is toxic or not
# it is not expecting any arrays, it should be just single string value
def isToxic(self, s):
#print("input words:", self.vectorizer.transform( np.array([s])).toarray())

pred = self.classifier.predict( self.vectorizer.transform( np.array([s])).toarray() )
#print(pd.DataFrame(self.classifier.predict_log_proba( self.vectorizer.transform( np.array([s])).toarray() ), columns=self.classifier.classes_))

if pred[0] == 1:
return True
else:
Expand Down

0 comments on commit 570cbc4

Please sign in to comment.