diff --git a/main.html b/main.html index ee16bac8c2eb7d892639c32b27d48c81d6adcb41..03671d5522f99df1c4813c1cabe08d783f884f2a 100644 --- a/main.html +++ b/main.html @@ -40,7 +40,7 @@ <div class="description"> <h2>Christy Tran</h2> <p>Developer</p> - <p>Computer Science</p> + <p>Software Engineerings</p> <p>ctt57@drexel.edu</p> </div> </div> diff --git a/main.py b/main.py index af39de31250e7279dbd479ddcf0b2d2d7a297563..27e954568fd5f48adc6a66dcfc32cc5cf13defcd 100644 --- a/main.py +++ b/main.py @@ -24,20 +24,41 @@ # If score is neutral (zero) then display image of middle cat # + from textblob import TextBlob -from newspaper import Article -url = "FIXME" -article = Article(url) -article.download() -article.parse() -article.nlp() +with open('mytext.txt','r') as f: + text=f.read() +blob=TextBlob(text) +sentiment = blob.sentiment.polarity #-1-1 +print(sentiment) +#simple sentiment text analysis (https://www.youtube.com/watch?v=tXuvh5_Xyrw&t=610s) -text = article.summary -print(text) +#if sentmient>1: +# figure out how to get images to appear +# elif sentiment<1: +# figure out how to get image to appear +# else: +# last image -blob = TextBlob(text) -sentiment = blob.sentiment.polarity_# -1 to 1 -print(sentiment) + + + +#from textblob import TextBlob +#from newspaper import Article + +#url = "FIXME" +#article = Article(url) + +#article.download() +#article.parse() +#article.nlp() + +#text = article.summary +#print(text) + +#blob = TextBlob(text) +#sentiment = blob.sentiment.polarity_# -1 to 1 +#print(sentiment) diff --git a/mytext.txt b/mytext.txt new file mode 100644 index 0000000000000000000000000000000000000000..1c627884aaf03c2b66e68b0a44ab05918f5299db --- /dev/null +++ b/mytext.txt @@ -0,0 +1,2 @@ +I hate hate hate lots of things +I am so negitive!!