From 56263469b2840bd0c6b54079407fb0ffa7f4d80e Mon Sep 17 00:00:00 2001 From: freesoft Date: Sun, 16 Dec 2018 14:54:13 -0800 Subject: [PATCH] update README --- README.md | 22 +++++++++++++++++++--- detox_engine.py | 6 +++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fd48049..06de276 100644 --- a/README.md +++ b/README.md @@ -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 . @@ -118,8 +118,8 @@ Parameter explanation: * `` : Your username on Twitch. * `` : 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.
-* `` : 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 ``. -* `` : 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. +* `` : 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 ``. +* `` : 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. @@ -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 + diff --git a/detox_engine.py b/detox_engine.py index 698b86f..0cc1e69 100644 --- a/detox_engine.py +++ b/detox_engine.py @@ -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 @@ -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: