Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions clickfait_training_data_visualization.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@




<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<title>Bokeh Plot</title>







<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.0.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>




</head>


<body>






<div class="bk-root" id="f443540c-dc36-49a0-bd4e-cda4e8edc065" data-root-id="1004"></div>





<script type="application/json" id="1175">
{"3e3ac9ec-c88e-4913-8075-fcbfe06e82d9":{"defs":[],"roots":{"references":[{"attributes":{"data":{"desc":["Should I Get Bings","Which TV Female Friend Group Do You Belong In","The New \"Star Wars: The Force Awakens\" Trailer Is Here To Give You Chills","This Vine Of New York On \"Celebrity Big Brother\" Is Fucking Perfect","A Couple Did A Stunning Photo Shoot With Their Baby After Learning She Had An Inoperable Brain Tumor","How To Flirt With Queer Girls Without Making A Total Fool Of Yourself","32 Cute Things To Distract From Your Awkward Thanksgiving","If Disney Princesses Were From Florida","What's A Quote Or Lyric That Best Describes Your Depression","Natalie Dormer And Sam Claflin Play A Game To See How They'd Actually Last In \"The Hunger Games\"","16 Perfect Responses To The Indian Patriarchy","21 Times I Died During The \"Captain America: Civil War\" Teaser","17 Times Kourtney Kardashian Shut Down Her Own Family","Does Coffee Make You Poop","Who Is Your Celebrity Ex Based On Your Zodiac","17 Hairdresser Struggles Every Black Girl Knows To Be True","Are You More Walter White Or Heisenberg","The Most Canadian Groom Ever Left His Wedding To Plow Out His Guests In A Snow Storm","Here's One Really Weird Thing About Butterfree","15 Resolutions To Make Good On In 2016","What New Thing Should You Try In 2016","Zoo Animals Around The World Are Opening Their Christmas Presents Early","Tell Us About Yourself(ie): Erica Ash","9 Times I Cried","21 Vegetarian Dump Dinners For The Crock Pot","This Goat Has Been Bullying His Tiger Friend","8 Fall Shows To Be Excited About, 10 To Give A Chance, And 6 To Avoid","Another Round, Episode 25: Stop Telling Women To Smile","16 Signs You Are Too Stubborn To Live","This Country Singer Makes Music On His Game Boy In His Spare Time","When You Realize Every Guy Is Taken","An Awesome Look At The Behind-The-Scenes Concept Art Of \"Aladdin\"","Sarah Jessica Parker Talks Being A Carrie, \"Hocus Pocus,\" And Her Love Of New York","Which Type Of Swearer Are You","A Dad Recorded All The Adorable Questions His Son Asked When Watching Star Wars For The First Time","29 Impossibly Stylish Cat Gifts, In Order Of Awesomeness","13 Of The Most Glorious Made-Up Words From Literature","We Pranked A Bunch Of People By Dropping An iPhone In Front Of Them","23 Flaws Every Sneakerhead Has","We Know Your Zodiac Sign Based On Which Cat You Choose","Grimes On Her New Album And The Heartbreaking Inspiration Behind \"Oblivion\"","This Instagram Account Is Recreating 2015's Greatest Hits With Barbies","The 22 Best Adele Memes","17 Pictures Hot People Will Never Understand","How Badly Are You Taking The One Direction Hiatus","We Know What You Want For Christmas Based On Your Zodiac Sign","Guys Try Pinterest Leaf Hacks","22 Tips For Hiking With Kids That Every Parent Should Know","The Scariest Halloween Candy Taste Test","This Dog Begging For His Human's Forgiveness Is The Cutest Thing You'll See Today","Here's 100 Years Of Bollywood Cinema In Under Four Minutes","Ed Westwick Showed Up To An Emmys Party Looking Like The Chuck Bass Of Your Dreams","What Is Your Favorite Activity When Visiting Family","Take This Color Test To See How Far You'd Go For Love","Are You Brave Enough To Date A Werewolf","18 Things Everyone Who Hates PDA Will Understand","27 Things That Always Happen In The Office During Christmas","How Many Of These SpongeBob Faces Do You Recognize","Which Golden Globe Reaction Face Are You Based On Your Zodiac Sign","25 Reasons A Trip To Costa Rica Could Actually Change Your Life","Literally Just 46 Photos Of Scotland Looking Sexy As Hell","58 Things That Mildly Annoy Anyone Who Lives With Someone Messy","17 Places All Music Lovers Should Go In London","Do You Know The Lyrics To \"Hotline Bling\" By Drake","Which Weasley Should Be Your Best Friend","29 Books Every '90s Kid Will Immediately Recognize","This Organisation Is Trying To Launch India's First Transgender Model Agency","Request Timeout","Issa Rae's \"Insecure\" Is Coming To HBO At Long Last","How Well Do You Know \"Pretty Little Liars\"","You've Been Using Your Rice Cooker Wrong The Entire Time","No Actors Of Color Were Nominated For An Oscar This Year And People Are Pissed","This Guy Totally Nailed What A Modern Day Aladdin Would Look Like","18 Easy And Delicious One-Pan Breakfasts","We Tried Out Magic Wands And Here's What Happened","Charli XCX Looked Like A Space Dominatrix At The MTV EMAs","If The Avengers Looked Like They Originally Did In The Comics","13 Reasons Urinals Are The Worst Human Invention Of All Time","Will You Get A Free Car From Oprah Or A Free Tub Of Vaseline From Tyra","28 Of The Most Canadian Crimes Ever Committed","19 Beautiful Places In Scotland That Give People All The Feels","Here's How To Actually Get Rid Of Acne All Over Your Body","This 24-Year-Old Guy Got Drunk And Accidentally Booked An Insane Vacation","I Asked Guys If They Were Going To Buy Leona Lewis's Exclusive Grindr Album","24 Delicious Thanksgiving Desserts That Aren't Pie","Country Star Jason Aldean Wore Blackface On Halloween To Dress Up As Lil Wayne","17 Times College Literally Sucked The Life Out Of You","The Hardest \"America's Next Top Model\" Quiz You'll Take Today","This Color Test Will Determine How You Like To Masturbate","42 Of The Most Romantic Lines From YA Literature","This Reporter Responded To A Vulgar Comment With An Awesome \"Your Mama\" Joke","22 People Who Were Just Smooth AF","Are You Bart Or Lisa","Which Zodiac Sign Are You Most Compatible With","How Well Do You Remember \"The Vampire Diaries\" Murder House Party","How Well Do You Remember \"Sabrina, The Teenage Witch\"","12 Signs You Grew Up In San Francisco","What You Say To Someone With Chronic Pain And What They Hear","23 Totally Amazing BodyCon Looks You'll Wanna Rock This Fall"],"x":[-0.2,0.0,0.0,0.0,0.8,-0.5,0.8,-0.2,-0.5,0.0,0.8,0.0,-0.2,0.0,0.0,0.1,0.0,0.2,0.0,0.1,0.0,0.0,0.0,0.1,0.0,0.0,-0.4,-0.3,-0.3,0.7,0.0,0.2,0.5,0.0,0.5,0.6,0.0,0.0,0.0,0.1,0.3,0.0,0.9,0.1,-0.3,0.4,0.5,0.3,0.1,0.1,0.0,0.6,0.6,0.0,-0.3,0.1,0.1,-0.1,0.0,0.0,-0.1,-0.3,0.1,0.0,0.1,0.2,0.0,0.0,0.1,0.0,-0.8,0.0,0.7,0.9,-0.6,-0.3,-0.1,0.0,0.0,0.2,0.8,0.0,0.1,-0.2,0.8,0.1,0.1,0.0,0.2,0.0,0.7,0.0,-0.1,0.4,0.2,0.1,0.0,-0.3,-0.1],"y":[0.8,1.0,0.45,0.6,0.45,0.8,0.45,0.8,1.0,0.65,0.15,0.3,0.15,0.45,1.0,0.45,0.45,0.0,0.45,0.15,1.0,0.45,0.45,0.45,0.45,0.45,0.5,0.225,0.45,0.45,0.45,0.45,0.3,1.0,0.3,0.8,0.15,0.3,0.45,1.0,0.45,0.15,0.45,0.45,0.8,1.0,0.45,0.575,0.45,0.45,0.45,0.65,0.8,0.8,0.45,0.3,0.405,0.8,1.0,0.425,0.45,0.045,0.845,0.45,1.0,0.45,0.465,0.45,0.45,0.8,0.45,0.45,0.8,0.45,0.8,0.45,0.8,0.21,0.3,0.45,0.35,0.8,0.45,0.845,0.45,0.375,0.8,0.495,0.8,0.45,0.3,0.45,0.45,1.0,0.8,0.8,0.45,0.8,0.45]},"selected":{"id":"1053"},"selection_policy":{"id":"1052"}},"id":"1003","type":"ColumnDataSource"},{"attributes":{},"id":"1009","type":"DataRange1d"},{"attributes":{},"id":"1052","type":"UnionRenderers"},{"attributes":{"coordinates":null,"data_source":{"id":"1003"},"glyph":{"id":"1040"},"group":null,"hover_glyph":null,"muted_glyph":{"id":"1042"},"nonselection_glyph":{"id":"1041"},"view":{"id":"1044"}},"id":"1043","type":"GlyphRenderer"},{"attributes":{},"id":"1053","type":"Selection"},{"attributes":{"callback":null,"tooltips":[["Title","@desc"],["Sentiment","$x"],["Withholding Information","$y"]]},"id":"1037","type":"HoverTool"},{"attributes":{},"id":"1011","type":"LinearScale"},{"attributes":{"fill_alpha":{"value":0.1},"fill_color":{"value":"navy"},"hatch_alpha":{"value":0.1},"hatch_color":{"value":"navy"},"line_alpha":{"value":0.1},"line_color":{"value":"navy"},"size":{"value":8},"x":{"field":"x"},"y":{"field":"y"}},"id":"1041","type":"Circle"},{"attributes":{"align":"center","coordinates":null,"group":null,"text":"Clickfait - Training Data Sample","text_font_size":"25pt"},"id":"1005","type":"Title"},{"attributes":{"below":[{"id":"1015"}],"center":[{"id":"1018"},{"id":"1022"}],"left":[{"id":"1019"}],"renderers":[{"id":"1043"}],"title":{"id":"1005"},"toolbar":{"id":"1030"},"width":800,"x_range":{"id":"1007"},"x_scale":{"id":"1011"},"y_range":{"id":"1009"},"y_scale":{"id":"1013"}},"id":"1004","subtype":"Figure","type":"Plot"},{"attributes":{"tools":[{"id":"1023"},{"id":"1024"},{"id":"1025"},{"id":"1026"},{"id":"1027"},{"id":"1028"},{"id":"1037"}]},"id":"1030","type":"Toolbar"},{"attributes":{},"id":"1007","type":"DataRange1d"},{"attributes":{"axis":{"id":"1015"},"coordinates":null,"group":null,"ticker":null},"id":"1018","type":"Grid"},{"attributes":{},"id":"1016","type":"BasicTicker"},{"attributes":{},"id":"1013","type":"LinearScale"},{"attributes":{"axis_label":"Sentiment","axis_label_text_font_size":"15pt","coordinates":null,"formatter":{"id":"1050"},"group":null,"major_label_policy":{"id":"1051"},"ticker":{"id":"1016"}},"id":"1015","type":"LinearAxis"},{"attributes":{},"id":"1024","type":"WheelZoomTool"},{"attributes":{"axis_label":"Withholding Information","axis_label_text_font_size":"15pt","coordinates":null,"formatter":{"id":"1047"},"group":null,"major_label_policy":{"id":"1048"},"ticker":{"id":"1020"}},"id":"1019","type":"LinearAxis"},{"attributes":{"axis":{"id":"1019"},"coordinates":null,"dimension":1,"group":null,"ticker":null},"id":"1022","type":"Grid"},{"attributes":{},"id":"1047","type":"BasicTickFormatter"},{"attributes":{},"id":"1020","type":"BasicTicker"},{"attributes":{"fill_alpha":{"value":0.7},"fill_color":{"value":"navy"},"hatch_alpha":{"value":0.7},"hatch_color":{"value":"navy"},"line_alpha":{"value":0.7},"line_color":{"value":"navy"},"size":{"value":8},"x":{"field":"x"},"y":{"field":"y"}},"id":"1040","type":"Circle"},{"attributes":{},"id":"1048","type":"AllLabels"},{"attributes":{},"id":"1028","type":"HelpTool"},{"attributes":{},"id":"1023","type":"PanTool"},{"attributes":{"fill_alpha":{"value":0.2},"fill_color":{"value":"navy"},"hatch_alpha":{"value":0.2},"hatch_color":{"value":"navy"},"line_alpha":{"value":0.2},"line_color":{"value":"navy"},"size":{"value":8},"x":{"field":"x"},"y":{"field":"y"}},"id":"1042","type":"Circle"},{"attributes":{"overlay":{"id":"1029"}},"id":"1025","type":"BoxZoomTool"},{"attributes":{},"id":"1050","type":"BasicTickFormatter"},{"attributes":{},"id":"1026","type":"SaveTool"},{"attributes":{},"id":"1027","type":"ResetTool"},{"attributes":{},"id":"1051","type":"AllLabels"},{"attributes":{"source":{"id":"1003"}},"id":"1044","type":"CDSView"},{"attributes":{"bottom_units":"screen","coordinates":null,"fill_alpha":0.5,"fill_color":"lightgrey","group":null,"left_units":"screen","level":"overlay","line_alpha":1.0,"line_color":"black","line_dash":[4,4],"line_width":2,"right_units":"screen","syncable":false,"top_units":"screen"},"id":"1029","type":"BoxAnnotation"}],"root_ids":["1004"]},"title":"Bokeh Application","version":"2.4.0"}}
</script>
<script type="text/javascript">
(function() {
const fn = function() {
Bokeh.safely(function() {
(function(root) {
function embed_document(root) {

const docs_json = document.getElementById('1175').textContent;
const render_items = [{"docid":"3e3ac9ec-c88e-4913-8075-fcbfe06e82d9","root_ids":["1004"],"roots":{"1004":"f443540c-dc36-49a0-bd4e-cda4e8edc065"}}];
root.Bokeh.embed.embed_items(docs_json, render_items);

}
if (root.Bokeh !== undefined) {
embed_document(root);
} else {
let attempts = 0;
const timer = setInterval(function(root) {
if (root.Bokeh !== undefined) {
clearInterval(timer);
embed_document(root);
} else {
attempts++;
if (attempts > 100) {
clearInterval(timer);
console.log("Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing");
}
}
}, 10, root)
}
})(window);
});
};
if (document.readyState != "loading") fn();
else document.addEventListener("DOMContentLoaded", fn);
})();
</script>

</body>

</html>
53 changes: 53 additions & 0 deletions data_visualization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from bokeh.plotting import figure, output_file, show, ColumnDataSource, save # figure for plots, output html file, show
from bokeh.models.tools import HoverTool # for tooltips
from bokeh.transform import factor_cmap
from bokeh.palettes import Spectral10
import pandas as pd

df = pd.read_csv('C:/Users/16049/Documents/HtN2021/trainingSet.csv')

source = ColumnDataSource(df)

# data list
sentiment_list = df.sentiment.to_list()
withhold_list = df.withhold.to_list()
title_list = df.title.to_list()

source = ColumnDataSource(data = dict(
x=sentiment_list,
y=withhold_list,
desc=title_list

))

output_file('clickfait_training_data_visualization.html')

p = figure(
title="Clickfait - Training Data Sample",
plot_width=800,
plot_height=600,
x_axis_label="Sentiment",
y_axis_label="Withholding Information"
)

p.xaxis.axis_label_text_font_size = "15pt"
p.yaxis.axis_label_text_font_size = "15pt"
p.title.text_font_size = '25pt'
p.title.align = 'center'

hover = HoverTool()
hover.tooltips = [
("Title", "@desc"),
("Sentiment", "$x"),
("Withholding Information", "$y")
]
p.add_tools(hover)

p.circle('x', 'y', size=8, color='navy', alpha=0.7, source=source)

show(p)





1 change: 1 addition & 0 deletions trainingSet.json

Large diffs are not rendered by default.