├── datasets └── info.txt ├── templates ├── info.txt ├── home.html ├── genre.html ├── genres.html └── recommend.html ├── static ├── fonts │ ├── info.txt │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── image.jpg ├── loader.gif ├── blog.min.js ├── autocomplete.js ├── style.css ├── blog.min.css ├── recommend.js ├── popper.min.js └── font-awesome.min.css ├── .ipynb_checkpoints ├── info.txt ├── sentiment.ipynb └── preprocessing 2.ipynb ├── Procfile ├── nlp_model.pkl ├── tranform.pkl ├── flow-diagram.JPG ├── requirements.txt ├── README.md └── main.py /datasets/info.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/info.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /static/fonts/info.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/info.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn main:app -------------------------------------------------------------------------------- /nlp_model.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/nlp_model.pkl -------------------------------------------------------------------------------- /tranform.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/tranform.pkl -------------------------------------------------------------------------------- /flow-diagram.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/flow-diagram.JPG -------------------------------------------------------------------------------- /static/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/image.jpg -------------------------------------------------------------------------------- /static/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/loader.gif -------------------------------------------------------------------------------- /static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikita9604/Movie-Recommendation-Website/HEAD/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==2.2.5 2 | gunicorn==22.0.0 3 | Jinja2==3.1.6 4 | MarkupSafe==1.1.1 5 | Werkzeug==3.1.4 6 | numpy>=1.9.2 7 | scipy>=0.15.1 8 | nltk==3.9 9 | scikit-learn>=0.18 10 | pandas>=0.19 11 | beautifulsoup4==4.9.1 12 | jsonschema==3.2.0 13 | tmdbv3api==1.6.1 14 | lxml==4.9.1 15 | urllib3==2.6.0 16 | requests==2.32.4 17 | pickleshare==0.7.5 18 | ipykernel==5.3.4 19 | ipython==8.10.0 20 | ipython-genutils==0.2.0 21 | -------------------------------------------------------------------------------- /static/blog.min.js: -------------------------------------------------------------------------------- 1 | !function(i){"use strict";i("body").on("input propertychange",".floating-label-form-group",function(o){i(this).toggleClass("floating-label-form-group-with-value",!!i(o.target).val())}).on("focus",".floating-label-form-group",function(){i(this).addClass("floating-label-form-group-with-focus")}).on("blur",".floating-label-form-group",function(){i(this).removeClass("floating-label-form-group-with-focus")});if(i(window).width()>1170){var o=i("#mainNav").height();i(window).on("scroll",{previousTop:0},function(){var s=i(window).scrollTop();s0&&i("#mainNav").hasClass("is-fixed")?i("#mainNav").addClass("is-visible"):i("#mainNav").removeClass("is-visible is-fixed"):s>this.previousTop&&(i("#mainNav").removeClass("is-visible"),s>o&&!i("#mainNav").hasClass("is-fixed")&&i("#mainNav").addClass("is-fixed")),this.previousTop=s})}}(jQuery); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Movie Recommendation System (Website) 2 | Movie Recommendation System created using Collaborative Filtering (Website) and Content based Filtering (Jupyter Notebook). 3 | 4 | ### Objectives 5 | 6 | 1. To create a movie recommendation system using Collaborative Filtering and machine learning algorithms such as K Nearest Neighbours. 7 | 2. The system should recommend movies based on the movie title entered by the user. 8 | 3. The system should also be able to recommend movies on the basis of 'genre only' and 'genre and year' entered. 9 | 4. The system should apply sentiment analysis to categorize user comments on a particular movie. 10 | 5. Additional Content Based Filtering is performed (can be seen [here](Recommovie_9604_Notebook.ipynb)) using Neural Network to perform Matrix Factorization. 11 | 12 | ### Dataset can be accessed from [here](https://grouplens.org/datasets/movielens/). 13 | For redcuing the deployment time, data exploration followed by feature selection is done on the complete dataset. 14 | 15 | ### Installation 16 | 1. In the shell/cmd, cd to the directory where requirements.txt is located. 17 | 2. activate your virtualenv. (if any) 18 | 3. run: ``` pip install -r requirements.txt ``` 19 | 20 | ### Flow Diagram 21 |
22 | 23 |
24 | 25 | 26 | ### Deployment 27 | - The application deployed can be accessed and tested directly from [here](https://recomovie-9604.herokuapp.com/) or https://recomovie-9604.herokuapp.com/ 28 | - Currently the links are working perfectly and can be checked through. 29 | 30 | ### References 31 | - https://github.com/kishan0725/AJAX-Movie-Recommendation-System-with-Sentiment-Analysis 32 | 33 | NOTE* - This project is implemented with additional features and changes done to the reference link mentioned above. 34 | -------------------------------------------------------------------------------- /static/autocomplete.js: -------------------------------------------------------------------------------- 1 | new autoComplete({ 2 | data: { // Data src [Array, Function, Async] | (REQUIRED) 3 | src: films, 4 | }, 5 | selector: "#autoComplete", // Input field selector | (Optional) 6 | threshold: 2, // Min. Chars length to start Engine | (Optional) 7 | debounce: 100, // Post duration for engine to start | (Optional) 8 | searchEngine: "strict", // Search Engine type/mode | (Optional) 9 | resultsList: { // Rendered results list object | (Optional) 10 | render: true, 11 | container: source => { 12 | source.setAttribute("id", "food_list"); 13 | }, 14 | destination: document.querySelector("#autoComplete"), 15 | position: "afterend", 16 | element: "ul" 17 | }, 18 | maxResults: 5, // Max. number of rendered results | (Optional) 19 | highlight: true, // Highlight matching results | (Optional) 20 | resultItem: { // Rendered result item | (Optional) 21 | content: (data, source) => { 22 | source.innerHTML = data.match; 23 | }, 24 | element: "li" 25 | }, 26 | noResults: () => { // Action script on noResults | (Optional) 27 | const result = document.createElement("li"); 28 | result.setAttribute("class", "no_result"); 29 | result.setAttribute("tabindex", "1"); 30 | result.innerHTML = "No Results"; 31 | document.querySelector("#autoComplete_list").appendChild(result); 32 | }, 33 | onSelection: feedback => { // Action script onSelection event | (Optional) 34 | document.getElementById('autoComplete').value = feedback.selection.value; 35 | } 36 | }); -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RecoMovie 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 54 |
55 |





56 |

RecoMovie

57 |
58 | 59 |
60 |
61 | 62 |
63 |

64 |
65 |
66 | 67 |
68 |
69 | 70 |
71 |

Sorry! The movie you requested is not in our database. 72 | Please check the spelling or try with other movies!

73 |
74 | 75 |
76 |
77 |

78 |
79 |
80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /templates/genre.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RecoMovie 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 47 | 48 | 49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | 60 |
61 |

RECOMMENDED MOVIES FOR YOU

62 | {% for key, value in gename.items() %} 63 |
Genre - {{ value }}

64 | {% endfor %} 65 |
66 |
67 | 68 |
69 |
70 | 71 | 72 | {% for key, value in result.items() %} 73 | 74 | 75 | 76 | {% endfor %} 77 | 78 |
{{ value }}
79 |
80 |
81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /static/style.css: -------------------------------------------------------------------------------- 1 | .movie { 2 | color: #fff; 3 | margin-left: auto; 4 | margin-right: auto; 5 | resize: none; 6 | } 7 | 8 | .movie-content { 9 | display: flex; 10 | flex-wrap: wrap; 11 | justify-content:space-around; 12 | } 13 | 14 | .movie-content > div { 15 | margin:20px; 16 | } 17 | 18 | .btn-block{ 19 | width: 15%; 20 | text-align: center; 21 | margin-left: auto; 22 | margin-right: auto; 23 | color: #e4e0e0; 24 | } 25 | 26 | #content { 27 | background-image: url("../static/image.jpg"); 28 | background-color: #181818; 29 | font-family: 'Noto Sans JP', sans-serif; 30 | } 31 | 32 | #details { 33 | margin-left: 50px; 34 | } 35 | 36 | .footer { 37 | color: #e4e0e0; 38 | text-align:right; 39 | position: fixed; 40 | bottom: 20px; 41 | right: 20px; 42 | width: 100%; 43 | } 44 | 45 | h1 { 46 | font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 47 | color: #e50914; 48 | font-weight: bold; 49 | margin-top: 30px; 50 | text-shadow: #000000 0px 0px 13px; 51 | } 52 | 53 | .github-corner:hover .octo-arm { 54 | animation: octocat-wave 560ms ease-in-out; 55 | } 56 | 57 | @keyframes octocat-wave { 58 | 0%, 59 | 100% { 60 | transform: rotate(0) 61 | } 62 | 63 | 20%, 64 | 60% { 65 | transform: rotate(-25deg) 66 | } 67 | 68 | 40%, 69 | 80% { 70 | transform: rotate(10deg) 71 | } 72 | } 73 | 74 | #autoComplete { 75 | background-position: 98% ; 76 | } 77 | 78 | #name { 79 | color: white; 80 | padding: 1px; 81 | } 82 | 83 | h6 { 84 | margin-bottom: 20px; 85 | } 86 | 87 | @media only screen and (max-width: 650px) { 88 | #mcontent { 89 | display: block; 90 | } 91 | .poster-lg { 92 | display: none; 93 | } 94 | #details { 95 | margin-left: 30px; 96 | } 97 | #loader { 98 | display: none; 99 | position: fixed; 100 | z-index: 100; 101 | left: 0; 102 | top:0; 103 | width: 100%; 104 | height: 100%; 105 | background-image: url("../static/loader.gif"); 106 | background-size: 40%; 107 | background-position: 50% 50%; 108 | background-color: rgba(255, 255, 255, 1); 109 | background-repeat: no-repeat; 110 | -webkit-transition: background-image 0.2s ease-in-out; 111 | transition: background-image 0.2s ease-in-out; 112 | } 113 | 114 | #loader-text { 115 | vertical-align: middle; 116 | color:white; 117 | } 118 | 119 | #autoComplete { 120 | background-position: 97% ; 121 | } 122 | 123 | svg[data-toggle=tooltip] { 124 | width: 50px; 125 | height: 50px; 126 | } 127 | } 128 | 129 | @media only screen and (max-width: 991px) { 130 | .modal-body{ 131 | display: block; 132 | } 133 | .profile-pic { 134 | margin-left: auto; 135 | margin-right: auto; 136 | display: block; 137 | margin-bottom: 20px; 138 | } 139 | } 140 | @media only screen and (min-width: 992px) { 141 | .modal-body { 142 | display: flex; 143 | } 144 | } 145 | 146 | @media only screen and (min-width: 651px) { 147 | .poster-sm { 148 | display: none; 149 | } 150 | 151 | #mcontent { 152 | display: flex; 153 | flex-wrap: nowrap; 154 | } 155 | 156 | #loader { 157 | display: none; 158 | position: fixed; 159 | z-index: 100; 160 | left: 0; 161 | top:0; 162 | width: 100%; 163 | height: 100%; 164 | background-image: url("../static/loader.gif"); 165 | background-size: 20%; 166 | background-position: 50% 50%; 167 | background-color: rgba(255, 255, 255, 1); 168 | background-repeat: no-repeat; 169 | -webkit-transition: background-image 0.2s ease-in-out; 170 | transition: background-image 0.2s ease-in-out; 171 | } 172 | 173 | #loader-text { 174 | vertical-align: middle; 175 | color:white; 176 | } 177 | 178 | } 179 | 180 | .poster{ 181 | -webkit-box-shadow: 0px 1px 15px 4px rgba(250,250,250,1); 182 | -moz-box-shadow: 0px 1px 15px 4px rgba(250,250,250,1); 183 | box-shadow: 0px 1px 15px 4px rgba(250,250,250,1); 184 | } 185 | 186 | .card:hover { 187 | cursor: pointer; 188 | } 189 | 190 | .castcard:hover { 191 | cursor: pointer; 192 | } 193 | 194 | .cast-img { 195 | filter: brightness(100%); 196 | -moz-transition: all 0.75s ease; 197 | -webkit-transition: all 0.75s ease; 198 | transition: all 0.75s ease; 199 | } 200 | 201 | 202 | .cast-img:hover { 203 | filter: brightness(50%); 204 | -moz-transition: all 0.75s ease; 205 | -webkit-transition: all 0.75s ease; 206 | transition: all 0.75s ease; 207 | } 208 | 209 | .fig { 210 | display: flex; 211 | align-items: center; 212 | justify-content: center; 213 | backdrop-filter: brightness(50%); 214 | position: absolute; 215 | bottom: 0px; 216 | top: 0px; 217 | right: 0px; 218 | left: 0px; 219 | opacity: 0; 220 | -moz-transition: all 0.75s ease; 221 | -webkit-transition: all 0.75s ease; 222 | transition: all 0.75s ease; 223 | } 224 | 225 | .fig:hover { 226 | opacity: 1; 227 | backdrop-filter:br; 228 | -moz-transition: all 0.75s ease; 229 | -webkit-transition: all 0.75s ease; 230 | transition: all 0.75s ease; 231 | } 232 | 233 | .card-btn { 234 | border-radius: 20px; 235 | } 236 | 237 | .imghvr { 238 | position: relative; 239 | } 240 | 241 | .table td { 242 | border-color: white; 243 | border-style:solid; 244 | border-width:1px; 245 | } 246 | 247 | .fail { 248 | display: none; 249 | color: white; 250 | } 251 | -------------------------------------------------------------------------------- /templates/genres.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RecoMovie 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 48 | 49 | 50 | 51 |
52 |





53 |

Recommend based on Genre & Year

54 |
55 |
56 | 57 |
58 |
59 | 60 |
61 | 62 |
63 |
64 | 65 |
66 |

67 |
68 |
69 |
70 | 71 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from flask import Flask, render_template, request 4 | from sklearn.feature_extraction.text import CountVectorizer 5 | from sklearn.metrics.pairwise import cosine_similarity 6 | import json 7 | import bs4 as bs 8 | import urllib.request 9 | import pickle 10 | import requests 11 | from IPython.display import HTML 12 | 13 | # load the nlp model and tfidf vectorizer from disk 14 | filename = 'nlp_model.pkl' 15 | clf = pickle.load(open(filename, 'rb')) 16 | vectorizer = pickle.load(open('tranform.pkl','rb')) 17 | 18 | def create_similarity(): 19 | data = pd.read_csv('main_data.csv') 20 | # creating a count matrix 21 | cv = CountVectorizer() 22 | count_matrix = cv.fit_transform(data['comb']) 23 | # creating a similarity score matrix 24 | similarity = cosine_similarity(count_matrix) 25 | return data,similarity 26 | 27 | def rcmd(m): 28 | m = m.lower() 29 | try: 30 | data.head() 31 | similarity.shape 32 | except: 33 | data, similarity = create_similarity() 34 | if m not in data['movie_title'].unique(): 35 | return('Sorry! The movie you requested is not in our database. Please check the spelling or try with some other movies') 36 | else: 37 | i = data.loc[data['movie_title']==m].index[0] 38 | lst = list(enumerate(similarity[i])) 39 | lst = sorted(lst, key = lambda x:x[1] ,reverse=True) 40 | lst = lst[1:11] # excluding first item since it is the requested movie itself 41 | l = [] 42 | for i in range(len(lst)): 43 | a = lst[i][0] 44 | l.append(data['movie_title'][a]) 45 | return l 46 | 47 | # converting list of string to list (eg. "["abc","def"]" to ["abc","def"]) 48 | def convert_to_list(my_list): 49 | my_list = my_list.split('","') 50 | my_list[0] = my_list[0].replace('["','') 51 | my_list[-1] = my_list[-1].replace('"]','') 52 | return my_list 53 | 54 | def get_suggestions(): 55 | data = pd.read_csv('main_data.csv') 56 | return list(data['movie_title'].str.capitalize()) 57 | ''' 58 | def best_movies_by_genre(genre,top_n): 59 | movie_score = pd.read_csv('movie_score.csv') 60 | return pd.DataFrame(movie_score.loc[(movie_score[genre]==1)].sort_values(['weighted_score'],ascending=False)[['title']][:top_n]) 61 | ''' 62 | 63 | def best_movies_by_genre(genre,top_n,year = 1920): 64 | movie_score = pd.read_csv('movie_score.csv') 65 | movie_score['year'] = movie_score['title'].apply(lambda _ : int(_[-5:-1])) 66 | if year == '': 67 | year = 1920 68 | movie_score = movie_score[movie_score['year'] >= int(year)] 69 | return pd.DataFrame(movie_score.loc[(movie_score[genre]==1)].sort_values(['weighted_score'],ascending=False)[['title','count','mean','weighted_score']][:top_n]) 70 | 71 | app = Flask(__name__) 72 | 73 | @app.route("/") 74 | @app.route("/home") 75 | def home(): 76 | suggestions = get_suggestions() 77 | return render_template('home.html',suggestions=suggestions) 78 | 79 | @app.route("/genres") 80 | def genres(): 81 | return render_template('genres.html') 82 | 83 | @app.route("/genre", methods = ['GET','POST']) 84 | def genre(): 85 | if request.method == 'POST': 86 | result = request.form 87 | print(result['Genre']) 88 | print(type(result['Genre'])) 89 | df = best_movies_by_genre(result['Genre'],10,result['Year']) 90 | df.reset_index(inplace=True) 91 | df = df.drop(labels='index', axis=1) 92 | html = HTML(df.to_html(classes='table table-striped')) 93 | dummy = {} 94 | for i in range(len(df['title'].tolist())): 95 | dummy[i] = df['title'].tolist()[i] 96 | return render_template('genre.html',result = dummy, gename = {1:result['Genre']}) 97 | else: 98 | return render_template('index.html') 99 | 100 | @app.route("/similarity",methods=["POST"]) 101 | def similarity(): 102 | movie = request.form['name'] 103 | rc = rcmd(movie) 104 | if type(rc)==type('string'): 105 | return rc 106 | else: 107 | m_str="---".join(rc) 108 | return m_str 109 | 110 | @app.route("/recommend",methods=["POST"]) 111 | def recommend(): 112 | # getting data from AJAX request 113 | title = request.form['title'] 114 | cast_ids = request.form['cast_ids'] 115 | cast_names = request.form['cast_names'] 116 | cast_chars = request.form['cast_chars'] 117 | cast_bdays = request.form['cast_bdays'] 118 | cast_bios = request.form['cast_bios'] 119 | cast_places = request.form['cast_places'] 120 | cast_profiles = request.form['cast_profiles'] 121 | imdb_id = request.form['imdb_id'] 122 | poster = request.form['poster'] 123 | genres = request.form['genres'] 124 | overview = request.form['overview'] 125 | vote_average = request.form['rating'] 126 | vote_count = request.form['vote_count'] 127 | release_date = request.form['release_date'] 128 | runtime = request.form['runtime'] 129 | status = request.form['status'] 130 | rec_movies = request.form['rec_movies'] 131 | rec_posters = request.form['rec_posters'] 132 | 133 | # get movie suggestions for auto complete 134 | suggestions = get_suggestions() 135 | 136 | # call the convert_to_list function for every string that needs to be converted to list 137 | rec_movies = convert_to_list(rec_movies) 138 | rec_posters = convert_to_list(rec_posters) 139 | cast_names = convert_to_list(cast_names) 140 | cast_chars = convert_to_list(cast_chars) 141 | cast_profiles = convert_to_list(cast_profiles) 142 | cast_bdays = convert_to_list(cast_bdays) 143 | cast_bios = convert_to_list(cast_bios) 144 | cast_places = convert_to_list(cast_places) 145 | 146 | # convert string to list (eg. "[1,2,3]" to [1,2,3]) 147 | cast_ids = cast_ids.split(',') 148 | cast_ids[0] = cast_ids[0].replace("[","") 149 | cast_ids[-1] = cast_ids[-1].replace("]","") 150 | 151 | # rendering the string to python string 152 | for i in range(len(cast_bios)): 153 | cast_bios[i] = cast_bios[i].replace(r'\n', '\n').replace(r'\"','\"') 154 | 155 | # combining multiple lists as a dictionary which can be passed to the html file so that it can be processed easily and the order of information will be preserved 156 | movie_cards = {rec_posters[i]: rec_movies[i] for i in range(len(rec_posters))} 157 | 158 | casts = {cast_names[i]:[cast_ids[i], cast_chars[i], cast_profiles[i]] for i in range(len(cast_profiles))} 159 | 160 | cast_details = {cast_names[i]:[cast_ids[i], cast_profiles[i], cast_bdays[i], cast_places[i], cast_bios[i]] for i in range(len(cast_places))} 161 | 162 | # web scraping to get user reviews from IMDB site 163 | sauce = urllib.request.urlopen('https://www.imdb.com/title/{}/reviews?ref_=tt_ov_rt'.format(imdb_id)).read() 164 | soup = bs.BeautifulSoup(sauce,'lxml') 165 | soup_result = soup.find_all("div",{"class":"text show-more__control"}) 166 | 167 | reviews_list = [] # list of reviews 168 | reviews_status = [] # list of comments (good or bad) 169 | for reviews in soup_result: 170 | if reviews.string: 171 | reviews_list.append(reviews.string) 172 | # passing the review to our model 173 | movie_review_list = np.array([reviews.string]) 174 | movie_vector = vectorizer.transform(movie_review_list) 175 | pred = clf.predict(movie_vector) 176 | reviews_status.append('Good' if pred else 'Bad') 177 | 178 | # combining reviews and comments into a dictionary 179 | movie_reviews = {reviews_list[i]: reviews_status[i] for i in range(len(reviews_list))} 180 | 181 | # passing all the data to the html file 182 | return render_template('recommend.html',title=title,poster=poster,overview=overview,vote_average=vote_average, 183 | vote_count=vote_count,release_date=release_date,runtime=runtime,status=status,genres=genres, 184 | movie_cards=movie_cards,reviews=movie_reviews,casts=casts,cast_details=cast_details) 185 | 186 | if __name__ == '__main__': 187 | app.run(debug=True) 188 | -------------------------------------------------------------------------------- /templates/recommend.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NEW 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |

{{title}}

27 |
28 |
29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 |
TITLE:  {{title}}
42 |
OVERVIEW:

       {{overview}}
43 |
RATING:  {{vote_average}}/10 ({{vote_count}} votes)
44 |
GENRE:  {{genres}}
45 |
RELEASE DATE:  {{release_date}}
46 |
RUNTIME:  {{runtime}}
47 |
STATUS:  {{status}}
48 |
49 |
50 |
51 |
52 | 109 | 110 | 111 | {% if movie_cards|length > 1 %} 112 | 113 | 114 |
115 |

RECOMMENDED MOVIES FOR YOU

(Click any of the movies to get recommendation)
116 |
117 | 118 |
119 | {% for poster, title in movie_cards.items() if not movie_cards.hidden %} 120 |
121 |
122 | {{title}} - poster 123 |
124 | 125 |
126 |
127 |
128 |
{{title|capitalize}}
129 |
130 |
131 | {% endfor %} 132 |
133 | 134 | {% endif %} 135 | 136 |
137 | {% if reviews %} 138 |

USER REVIEWS

139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | {% for review, status in reviews.items() if not reviews.hidden %} 150 | 151 | 152 | 161 | 162 | {% endfor %} 163 | 164 |
CommentsSentiments
{{review}}
153 | {{status}} : 154 | {% if status =='Good' %} 155 | 😃 156 | {% else %} 157 | 😖 158 | {% endif %} 159 |
160 |
165 |
166 | {% else %} 167 |
168 |

This movie is not released yet. Stay tuned!

169 |
170 | {% endif %} 171 |
172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /static/blog.min.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-size:20px; 3 | color:#333; 4 | font-family:Lora,'Times New Roman',serif 5 | }p{ 6 | line-height:1.5; 7 | margin:30px 0 8 | }p a{text-decoration:underline} 9 | 10 | h1,h2,h3,h4,h5,h6{ 11 | font-weight:800; 12 | font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif} 13 | a{ 14 | color:#333; 15 | -webkit-transition:all .2s; 16 | -moz-transition:all .2s; 17 | transition:all .2s 18 | } 19 | a:focus,a:hover{ 20 | color:#0085a1 21 | } 22 | a img:focus,a img:hover{ 23 | cursor:zoom-in 24 | } 25 | blockquote{ 26 | font-style:italic;color:#777 27 | } 28 | .section-heading{ 29 | font-size:36px; 30 | font-weight:700; 31 | margin-top:60px 32 | } 33 | .caption{ 34 | font-size:14px; 35 | font-style:italic; 36 | display:block; 37 | margin:0; 38 | padding:10px; 39 | text-align:center; 40 | border-bottom-right-radius:5px; 41 | border-bottom-left-radius:5px 42 | } 43 | ::-moz-selection{ 44 | color:#fff; 45 | background:#0085a1; 46 | text-shadow:none 47 | } 48 | ::selection{ 49 | color:#fff; 50 | background:#0085a1; 51 | text-shadow:none 52 | } 53 | img::selection{color:#fff;background:0 0} 54 | img::-moz-selection{color:#fff;background:0 0} 55 | body{-webkit-tap-highlight-color:#0085a1} 56 | #mainNav{position:absolute;border-bottom:1px solid #eee;background-color:#fff; 57 | font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif} 58 | #mainNav .navbar-brand{font-weight:800;color:#777} 59 | #mainNav .navbar-toggler{font-size:12px;font-weight:800;padding:13px;text-transform:uppercase;color:#777} 60 | #mainNav .navbar-nav>li.nav-item>a{font-size:12px;font-weight:800;letter-spacing:1px;text-transform:uppercase} 61 | 62 | @media only screen and (min-width:992px) 63 | {#mainNav{border-bottom:1px solid transparent;background:0 0} 64 | #mainNav .navbar-brand{padding:15px 20px;color:#fff} 65 | #mainNav .navbar-brand:focus,#mainNav .navbar-brand:hover{color:rgba(255,255,255,.8)} 66 | #mainNav .navbar-nav>li.nav-item>a{padding:15px 20px;color:#fff} 67 | #mainNav .navbar-nav>li.nav-item>a:focus,#mainNav .navbar-nav>li.nav-item>a:hover{color:rgba(255,255,255,.8)}} 68 | 69 | @media only screen and (min-width:1170px) 70 | {#mainNav{-webkit-transition:background-color .2s;-moz-transition:background-color .2s;transition:background-color .2s;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden} 71 | #mainNav.is-fixed{position:fixed;top:-77px;-webkit-transition:-webkit-transform .2s;-moz-transition:-moz-transform .2s;transition:transform .2s;border-bottom:1px solid #fff;background-color:rgba(255,255,255,.9)} 72 | #mainNav.is-fixed .navbar-brand{color:#333} 73 | #mainNav.is-fixed .navbar-brand:focus,#mainNav.is-fixed .navbar-brand:hover{color:#0085a1} 74 | #mainNav.is-fixed .navbar-nav>li.nav-item>a{color:#333} 75 | #mainNav.is-fixed .navbar-nav>li.nav-item>a:focus,#mainNav.is-fixed .navbar-nav>li.nav-item>a:hover{color:#0085a1} 76 | #mainNav.is-visible{-webkit-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);-o-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}} 77 | header.masthead{margin-bottom:50px;background:no-repeat center center;background-color:#777;background-attachment:scroll;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover} 78 | header.masthead .page-heading,header.masthead .post-heading,header.masthead .site-heading{padding:200px 0 150px;color:#fff} 79 | 80 | @media only screen and (min-width:768px) 81 | {header.masthead .page-heading,header.masthead .post-heading,header.masthead .site-heading{padding:200px 0}} 82 | header.masthead .page-heading,header.masthead .site-heading{text-align:center} 83 | header.masthead .page-heading h1,header.masthead .site-heading h1{font-size:50px;margin-top:0} 84 | header.masthead .page-heading .subheading,header.masthead .site-heading .subheading{font-size:24px;font-weight:300;line-height:1.1;display:block;margin:10px 0 0;font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif} 85 | 86 | @media only screen and (min-width:768px) 87 | {header.masthead .page-heading h1,header.masthead .site-heading h1{font-size:80px}} 88 | header.masthead .post-heading h1{font-size:35px} 89 | header.masthead .post-heading .meta,header.masthead .post-heading .subheading{line-height:1.1;display:block} 90 | header.masthead .post-heading .subheading{font-size:24px;font-weight:600;margin:10px 0 30px;font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif} 91 | header.masthead .post-heading .meta{font-size:20px;font-weight:300;font-style:italic;font-family:Lora,'Times New Roman',serif} 92 | header.masthead .post-heading .meta a{color:#fff} 93 | 94 | @media only screen and (min-width:768px) 95 | {header.masthead .post-heading h1{font-size:55px} 96 | header.masthead .post-heading .subheading{font-size:30px}} 97 | .post-preview>a{color:#333} 98 | .post-preview>a:focus,.post-preview>a:hover{text-decoration:none;color:#0085a1} 99 | .post-preview>a>.post-title{font-size:30px;margin-top:30px;margin-bottom:10px} 100 | .post-preview>a>.post-subtitle{font-weight:300;margin:0 0 10px} 101 | .post-preview>.post-meta{font-size:18px;font-style:italic;margin-top:0;color:#777} 102 | .post-preview>.post-meta>a{text-decoration:none;color:#333} 103 | .post-preview>.post-meta>a:focus,.post-preview>.post-meta>a:hover{text-decoration:underline;color:#0085a1} 104 | 105 | @media only screen and (min-width:768px) 106 | {.post-preview>a>.post-title{font-size:36px}} 107 | 108 | .floating-label-form-group{font-size:14px;position:relative;margin-bottom:0;padding-bottom:.5em;border-bottom:1px solid #eee} 109 | .floating-label-form-group input,.floating-label-form-group textarea{font-size:1.5em;position:relative;z-index:1;padding:0;resize:none;border:none;border-radius:0;background:0 0;box-shadow:none!important;font-family:Lora,'Times New Roman',serif} 110 | .floating-label-form-group input::-webkit-input-placeholder,.floating-label-form-group textarea::-webkit-input-placeholder{color:#777;font-family:Lora,'Times New Roman',serif} 111 | .floating-label-form-group label{font-size:.85em;line-height:1.764705882em;position:relative;z-index:0;top:2em;display:block;margin:0;-webkit-transition:top .3s ease,opacity .3s ease;-moz-transition:top .3s ease,opacity .3s ease;-ms-transition:top .3s ease,opacity .3s ease;transition:top .3s ease,opacity .3s ease;vertical-align:middle;vertical-align:baseline;opacity:0} 112 | .floating-label-form-group .help-block{margin:15px 0} 113 | .floating-label-form-group-with-value label{top:0;opacity:1} 114 | .floating-label-form-group-with-focus label{color:#0085a1} 115 | form .form-group:first-child .floating-label-form-group{border-top:1px solid #eee} 116 | 117 | footer{padding:50px 0 65px} 118 | footer .list-inline{margin:0;padding:0} 119 | footer .copyright{font-size:14px;margin-bottom:0;text-align:center} 120 | .btn{font-size:14px;font-weight:800;padding:15px 25px;letter-spacing:1px;text-transform:uppercase;border-radius:0;font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif} 121 | .btn-primary{color:#fff;border-color:#0085a1;background-color:#0085a1} 122 | .btn-primary.focus,.btn-primary:focus{color:#fff;border-color:#001c22;background-color:#005b6e} 123 | .btn-primary:hover{color:#fff;border-color:#005264;background-color:#005b6e} 124 | .btn-primary.active,.btn-primary:active,.open>.btn-primary.dropdown-toggle{color:#fff;border-color:#005264;background-color:#005b6e} 125 | .btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.btn-primary.dropdown-toggle.focus,.open>.btn-primary.dropdown-toggle:focus,.open>.btn-primary.dropdown-toggle:hover{color:#fff;border-color:#001c22;background-color:#003d4a} 126 | .btn-primary.active,.btn-primary:active,.open>.btn-primary.dropdown-toggle{background-image:none} 127 | .btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{border-color:#0085a1;background-color:#0085a1} 128 | .btn-primary .badge{color:#0085a1;background-color:#fff}.btn-lg{font-size:16px;padding:25px 35px} 129 | .btn-default:focus,.btn-default:hover{color:#fff;border:1px solid #0085a1;background-color:#0085a1} -------------------------------------------------------------------------------- /static/recommend.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | // Button will be disabled until we type anything inside the input field 3 | const source = document.getElementById('autoComplete'); 4 | const inputHandler = function(e) { 5 | if(e.target.value==""){ 6 | $('.movie-button').attr('disabled', true); 7 | } 8 | else{ 9 | $('.movie-button').attr('disabled', false); 10 | } 11 | } 12 | source.addEventListener('input', inputHandler); 13 | 14 | $('.movie-button').on('click',function(){ 15 | var my_api_key = 'db8f439a389abd6b57de74d3f74d1e6a'; 16 | var title = $('.movie').val(); 17 | if (title=="") { 18 | $('.results').css('display','none'); 19 | $('.fail').css('display','block'); 20 | } 21 | else{ 22 | load_details(my_api_key,title); 23 | } 24 | }); 25 | }); 26 | 27 | // will be invoked when clicking on the recommended movies 28 | function recommendcard(e){ 29 | var my_api_key = 'db8f439a389abd6b57de74d3f74d1e6a'; 30 | var title = e.getAttribute('title'); 31 | load_details(my_api_key,title); 32 | } 33 | 34 | // get the basic details of the movie from the API (based on the name of the movie) 35 | function load_details(my_api_key,title){ 36 | $.ajax({ 37 | type: 'GET', 38 | url:'https://api.themoviedb.org/3/search/movie?api_key='+my_api_key+'&query='+title, 39 | 40 | success: function(movie){ 41 | if(movie.results.length<1){ 42 | $('.fail').css('display','block'); 43 | $('.results').css('display','none'); 44 | $("#loader").delay(500).fadeOut(); 45 | } 46 | else{ 47 | $("#loader").fadeIn(); 48 | $('.fail').css('display','none'); 49 | $('.results').delay(1000).css('display','block'); 50 | var movie_id = movie.results[0].id; 51 | var movie_title = movie.results[0].original_title; 52 | movie_recs(movie_title,movie_id,my_api_key); 53 | } 54 | }, 55 | error: function(){ 56 | alert('Invalid Request'); 57 | $("#loader").delay(500).fadeOut(); 58 | }, 59 | }); 60 | } 61 | 62 | // passing the movie name to get the similar movies from python's flask 63 | function movie_recs(movie_title,movie_id,my_api_key){ 64 | $.ajax({ 65 | type:'POST', 66 | url:"/similarity", 67 | data:{'name':movie_title}, 68 | success: function(recs){ 69 | if(recs=="Sorry! The movie you requested is not in our database. Please check the spelling or try with some other movies"){ 70 | $('.fail').css('display','block'); 71 | $('.results').css('display','none'); 72 | $("#loader").delay(500).fadeOut(); 73 | } 74 | else { 75 | $('.fail').css('display','none'); 76 | $('.results').css('display','block'); 77 | var movie_arr = recs.split('---'); 78 | var arr = []; 79 | for(const movie in movie_arr){ 80 | arr.push(movie_arr[movie]); 81 | } 82 | get_movie_details(movie_id,my_api_key,arr,movie_title); 83 | } 84 | }, 85 | error: function(){ 86 | alert("error recs"); 87 | $("#loader").delay(500).fadeOut(); 88 | }, 89 | }); 90 | } 91 | 92 | // get all the details of the movie using the movie id. 93 | function get_movie_details(movie_id,my_api_key,arr,movie_title) { 94 | $.ajax({ 95 | type:'GET', 96 | url:'https://api.themoviedb.org/3/movie/'+movie_id+'?api_key='+my_api_key, 97 | success: function(movie_details){ 98 | show_details(movie_details,arr,movie_title,my_api_key,movie_id); 99 | }, 100 | error: function(){ 101 | alert("API Error!"); 102 | $("#loader").delay(500).fadeOut(); 103 | }, 104 | }); 105 | } 106 | 107 | // passing all the details to python's flask for displaying and scraping the movie reviews using imdb id 108 | function show_details(movie_details,arr,movie_title,my_api_key,movie_id){ 109 | var imdb_id = movie_details.imdb_id; 110 | var poster = 'https://image.tmdb.org/t/p/original'+movie_details.poster_path; 111 | var overview = movie_details.overview; 112 | var genres = movie_details.genres; 113 | var rating = movie_details.vote_average; 114 | var vote_count = movie_details.vote_count; 115 | var release_date = new Date(movie_details.release_date); 116 | var runtime = parseInt(movie_details.runtime); 117 | var status = movie_details.status; 118 | var genre_list = [] 119 | for (var genre in genres){ 120 | genre_list.push(genres[genre].name); 121 | } 122 | var my_genre = genre_list.join(", "); 123 | if(runtime%60==0){ 124 | runtime = Math.floor(runtime/60)+" hour(s)" 125 | } 126 | else { 127 | runtime = Math.floor(runtime/60)+" hour(s) "+(runtime%60)+" min(s)" 128 | } 129 | arr_poster = get_movie_posters(arr,my_api_key); 130 | 131 | movie_cast = get_movie_cast(movie_id,my_api_key); 132 | 133 | ind_cast = get_individual_cast(movie_cast,my_api_key); 134 | 135 | details = { 136 | 'title':movie_title, 137 | 'cast_ids':JSON.stringify(movie_cast.cast_ids), 138 | 'cast_names':JSON.stringify(movie_cast.cast_names), 139 | 'cast_chars':JSON.stringify(movie_cast.cast_chars), 140 | 'cast_profiles':JSON.stringify(movie_cast.cast_profiles), 141 | 'cast_bdays':JSON.stringify(ind_cast.cast_bdays), 142 | 'cast_bios':JSON.stringify(ind_cast.cast_bios), 143 | 'cast_places':JSON.stringify(ind_cast.cast_places), 144 | 'imdb_id':imdb_id, 145 | 'poster':poster, 146 | 'genres':my_genre, 147 | 'overview':overview, 148 | 'rating':rating, 149 | 'vote_count':vote_count.toLocaleString(), 150 | 'release_date':release_date.toDateString().split(' ').slice(1).join(' '), 151 | 'runtime':runtime, 152 | 'status':status, 153 | 'rec_movies':JSON.stringify(arr), 154 | 'rec_posters':JSON.stringify(arr_poster), 155 | } 156 | 157 | $.ajax({ 158 | type:'POST', 159 | data:details, 160 | url:"/recommend", 161 | dataType: 'html', 162 | complete: function(){ 163 | $("#loader").delay(500).fadeOut(); 164 | }, 165 | success: function(response) { 166 | $('.results').html(response); 167 | $('#autoComplete').val(''); 168 | $(window).scrollTop(0); 169 | } 170 | }); 171 | } 172 | 173 | // get the details of individual cast 174 | function get_individual_cast(movie_cast,my_api_key) { 175 | cast_bdays = []; 176 | cast_bios = []; 177 | cast_places = []; 178 | for(var cast_id in movie_cast.cast_ids){ 179 | $.ajax({ 180 | type:'GET', 181 | url:'https://api.themoviedb.org/3/person/'+movie_cast.cast_ids[cast_id]+'?api_key='+my_api_key, 182 | async:false, 183 | success: function(cast_details){ 184 | cast_bdays.push((new Date(cast_details.birthday)).toDateString().split(' ').slice(1).join(' ')); 185 | cast_bios.push(cast_details.biography); 186 | cast_places.push(cast_details.place_of_birth); 187 | } 188 | }); 189 | } 190 | return {cast_bdays:cast_bdays,cast_bios:cast_bios,cast_places:cast_places}; 191 | } 192 | 193 | // getting the details of the cast for the requested movie 194 | function get_movie_cast(movie_id,my_api_key){ 195 | cast_ids= []; 196 | cast_names = []; 197 | cast_chars = []; 198 | cast_profiles = []; 199 | 200 | top_10 = [0,1,2,3,4,5,6,7,8,9]; 201 | $.ajax({ 202 | type:'GET', 203 | url:"https://api.themoviedb.org/3/movie/"+movie_id+"/credits?api_key="+my_api_key, 204 | async:false, 205 | success: function(my_movie){ 206 | if(my_movie.cast.length>=10){ 207 | top_cast = [0,1,2,3,4,5,6,7,8,9]; 208 | } 209 | else { 210 | top_cast = [0,1,2,3,4]; 211 | } 212 | for(var my_cast in top_cast){ 213 | cast_ids.push(my_movie.cast[my_cast].id) 214 | cast_names.push(my_movie.cast[my_cast].name); 215 | cast_chars.push(my_movie.cast[my_cast].character); 216 | cast_profiles.push("https://image.tmdb.org/t/p/original"+my_movie.cast[my_cast].profile_path); 217 | } 218 | }, 219 | error: function(){ 220 | alert("Invalid Request!"); 221 | $("#loader").delay(500).fadeOut(); 222 | } 223 | }); 224 | 225 | return {cast_ids:cast_ids,cast_names:cast_names,cast_chars:cast_chars,cast_profiles:cast_profiles}; 226 | } 227 | 228 | // getting posters for all the recommended movies 229 | function get_movie_posters(arr,my_api_key){ 230 | var arr_poster_list = [] 231 | for(var m in arr) { 232 | $.ajax({ 233 | type:'GET', 234 | url:'https://api.themoviedb.org/3/search/movie?api_key='+my_api_key+'&query='+arr[m], 235 | async: false, 236 | success: function(m_data){ 237 | arr_poster_list.push('https://image.tmdb.org/t/p/original'+m_data.results[0].poster_path); 238 | }, 239 | error: function(){ 240 | alert("Invalid Request!"); 241 | $("#loader").delay(500).fadeOut(); 242 | }, 243 | }) 244 | } 245 | return arr_poster_list; 246 | } 247 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/sentiment.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 15, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "import nltk\n", 12 | "from nltk.corpus import stopwords\n", 13 | "from sklearn.feature_extraction.text import TfidfVectorizer\n", 14 | "from sklearn.model_selection import train_test_split\n", 15 | "from sklearn import naive_bayes\n", 16 | "from sklearn.metrics import roc_auc_score,accuracy_score\n", 17 | "import pickle" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 2, 23 | "metadata": {}, 24 | "outputs": [ 25 | { 26 | "name": "stderr", 27 | "output_type": "stream", 28 | "text": [ 29 | "[nltk_data] Downloading package stopwords to\n", 30 | "[nltk_data] C:\\Users\\kishan\\AppData\\Roaming\\nltk_data...\n", 31 | "[nltk_data] Unzipping corpora\\stopwords.zip.\n" 32 | ] 33 | }, 34 | { 35 | "data": { 36 | "text/plain": [ 37 | "True" 38 | ] 39 | }, 40 | "execution_count": 2, 41 | "metadata": {}, 42 | "output_type": "execute_result" 43 | } 44 | ], 45 | "source": [ 46 | "nltk.download(\"stopwords\")" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 3, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "dataset = pd.read_csv('reviews.txt',sep = '\\t', names =['Reviews','Comments'])" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 4, 61 | "metadata": {}, 62 | "outputs": [ 63 | { 64 | "data": { 65 | "text/html": [ 66 | "
\n", 67 | "\n", 80 | "\n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | "
ReviewsComments
01The Da Vinci Code book is just awesome.
11this was the first clive cussler i've ever rea...
21i liked the Da Vinci Code a lot.
31i liked the Da Vinci Code a lot.
41I liked the Da Vinci Code but it ultimatly did...
.........
69130Brokeback Mountain was boring.
69140So Brokeback Mountain was really depressing.
69150As I sit here, watching the MTV Movie Awards, ...
69160Ok brokeback mountain is such a horrible movie.
69170Oh, and Brokeback Mountain was a terrible movie.
\n", 146 | "

6918 rows × 2 columns

\n", 147 | "
" 148 | ], 149 | "text/plain": [ 150 | " Reviews Comments\n", 151 | "0 1 The Da Vinci Code book is just awesome.\n", 152 | "1 1 this was the first clive cussler i've ever rea...\n", 153 | "2 1 i liked the Da Vinci Code a lot.\n", 154 | "3 1 i liked the Da Vinci Code a lot.\n", 155 | "4 1 I liked the Da Vinci Code but it ultimatly did...\n", 156 | "... ... ...\n", 157 | "6913 0 Brokeback Mountain was boring.\n", 158 | "6914 0 So Brokeback Mountain was really depressing.\n", 159 | "6915 0 As I sit here, watching the MTV Movie Awards, ...\n", 160 | "6916 0 Ok brokeback mountain is such a horrible movie.\n", 161 | "6917 0 Oh, and Brokeback Mountain was a terrible movie.\n", 162 | "\n", 163 | "[6918 rows x 2 columns]" 164 | ] 165 | }, 166 | "execution_count": 4, 167 | "metadata": {}, 168 | "output_type": "execute_result" 169 | } 170 | ], 171 | "source": [ 172 | "dataset" 173 | ] 174 | }, 175 | { 176 | "cell_type": "code", 177 | "execution_count": 5, 178 | "metadata": {}, 179 | "outputs": [], 180 | "source": [ 181 | "stopset = set(stopwords.words('english'))" 182 | ] 183 | }, 184 | { 185 | "cell_type": "code", 186 | "execution_count": 6, 187 | "metadata": {}, 188 | "outputs": [], 189 | "source": [ 190 | "vectorizer = TfidfVectorizer(use_idf = True,lowercase = True, strip_accents='ascii',stop_words=stopset)" 191 | ] 192 | }, 193 | { 194 | "cell_type": "code", 195 | "execution_count": 16, 196 | "metadata": {}, 197 | "outputs": [], 198 | "source": [ 199 | "X = vectorizer.fit_transform(dataset.Comments)\n", 200 | "y = dataset.Reviews\n", 201 | "pickle.dump(vectorizer, open('tranform.pkl', 'wb'))" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 17, 207 | "metadata": {}, 208 | "outputs": [], 209 | "source": [ 210 | "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=42)" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 18, 216 | "metadata": {}, 217 | "outputs": [ 218 | { 219 | "data": { 220 | "text/plain": [ 221 | "MultinomialNB()" 222 | ] 223 | }, 224 | "execution_count": 18, 225 | "metadata": {}, 226 | "output_type": "execute_result" 227 | } 228 | ], 229 | "source": [ 230 | "clf = naive_bayes.MultinomialNB()\n", 231 | "clf.fit(X_train,y_train)" 232 | ] 233 | }, 234 | { 235 | "cell_type": "code", 236 | "execution_count": 19, 237 | "metadata": {}, 238 | "outputs": [ 239 | { 240 | "data": { 241 | "text/plain": [ 242 | "97.47109826589595" 243 | ] 244 | }, 245 | "execution_count": 19, 246 | "metadata": {}, 247 | "output_type": "execute_result" 248 | } 249 | ], 250 | "source": [ 251 | "accuracy_score(y_test,clf.predict(X_test))*100" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": 20, 257 | "metadata": {}, 258 | "outputs": [ 259 | { 260 | "data": { 261 | "text/plain": [ 262 | "MultinomialNB()" 263 | ] 264 | }, 265 | "execution_count": 20, 266 | "metadata": {}, 267 | "output_type": "execute_result" 268 | } 269 | ], 270 | "source": [ 271 | "clf = naive_bayes.MultinomialNB()\n", 272 | "clf.fit(X,y)" 273 | ] 274 | }, 275 | { 276 | "cell_type": "code", 277 | "execution_count": 21, 278 | "metadata": {}, 279 | "outputs": [ 280 | { 281 | "data": { 282 | "text/plain": [ 283 | "98.77167630057804" 284 | ] 285 | }, 286 | "execution_count": 21, 287 | "metadata": {}, 288 | "output_type": "execute_result" 289 | } 290 | ], 291 | "source": [ 292 | "accuracy_score(y_test,clf.predict(X_test))*100" 293 | ] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "execution_count": 22, 298 | "metadata": {}, 299 | "outputs": [], 300 | "source": [ 301 | "filename = 'nlp_model.pkl'\n", 302 | "pickle.dump(clf, open(filename, 'wb'))" 303 | ] 304 | } 305 | ], 306 | "metadata": { 307 | "kernelspec": { 308 | "display_name": "Python 3", 309 | "language": "python", 310 | "name": "python3" 311 | }, 312 | "language_info": { 313 | "codemirror_mode": { 314 | "name": "ipython", 315 | "version": 3 316 | }, 317 | "file_extension": ".py", 318 | "mimetype": "text/x-python", 319 | "name": "python", 320 | "nbconvert_exporter": "python", 321 | "pygments_lexer": "ipython3", 322 | "version": "3.8.3" 323 | } 324 | }, 325 | "nbformat": 4, 326 | "nbformat_minor": 4 327 | } 328 | -------------------------------------------------------------------------------- /static/popper.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Federico Zivolo 2017 3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var f=a.commonAncestorContainer;if(e!==f&&t!==f||i.contains(n))return p(f)?f:r(f);var l=s(e);return l.host?d(l.host,t):d(e,s(t).host)}function a(e){var t=1=o.clientWidth&&i>=o.clientHeight}),f=0i[e]&&!t.escapeWithReference&&(n=z(p[o],i[e]-('right'===e?p.width:p.height))),pe({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=se({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=V,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var o=t.element;if('string'==typeof o){if(o=e.instance.popper.querySelector(o),!o)return e;}else if(!e.instance.popper.contains(o))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var i=e.placement.split('-')[0],n=e.offsets,r=n.popper,p=n.reference,s=-1!==['left','right'].indexOf(i),d=s?'height':'width',a=s?'top':'left',f=s?'left':'top',l=s?'bottom':'right',m=O(o)[d];p[l]-mr[l]&&(e.offsets.popper[a]+=p[a]+m-r[l]);var h=p[a]+p[d]/2-m/2,g=h-c(e.offsets.popper)[a];return g=_(z(r[d]-m,g),0),e.arrowElement=o,e.offsets.arrow={},e.offsets.arrow[a]=Math.round(g),e.offsets.arrow[f]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=L(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case fe.FLIP:p=[i,n];break;case fe.CLOCKWISE:p=K(i);break;case fe.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=L(i);var a=e.offsets.popper,f=e.offsets.reference,l=V,m='left'===i&&l(a.right)>l(f.left)||'right'===i&&l(a.left)l(f.top)||'bottom'===i&&l(a.top)l(o.right),g=l(a.top)l(o.bottom),b='left'===i&&h||'right'===i&&c||'top'===i&&g||'bottom'===i&&u,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&h||y&&'end'===r&&c||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),w&&(r=j(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=se({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[t]-(s?n[p?'width':'height']:0),e.placement=L(t),e.offsets.popper=c(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightli{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} 5 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/preprocessing 2.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np\nimport pandas as pd","execution_count":38,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"credits = pd.read_csv('credits.csv')","execution_count":39,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"credits","execution_count":40,"outputs":[{"output_type":"execute_result","execution_count":40,"data":{"text/plain":" cast \\\n0 [{'cast_id': 14, 'character': 'Woody (voice)', 'credit_id': '52fe4284c3... \n1 [{'cast_id': 1, 'character': 'Alan Parrish', 'credit_id': '52fe44bfc3a3... \n2 [{'cast_id': 2, 'character': 'Max Goldman', 'credit_id': '52fe466a92514... \n3 [{'cast_id': 1, 'character': \"Savannah 'Vannah' Jackson\", 'credit_id': ... \n4 [{'cast_id': 1, 'character': 'George Banks', 'credit_id': '52fe44959251... \n... ... \n45471 [{'cast_id': 0, 'character': '', 'credit_id': '5894a909925141427e0079a5... \n45472 [{'cast_id': 1002, 'character': 'Sister Angela', 'credit_id': '52fe4af1... \n45473 [{'cast_id': 6, 'character': 'Emily Shaw', 'credit_id': '52fe4776c3a368... \n45474 [{'cast_id': 2, 'character': '', 'credit_id': '52fe4ea59251416c7515d7d5... \n45475 [] \n\n crew \\\n0 [{'credit_id': '52fe4284c3a36847f8024f49', 'department': 'Directing', '... \n1 [{'credit_id': '52fe44bfc3a36847f80a7cd1', 'department': 'Production', ... \n2 [{'credit_id': '52fe466a9251416c75077a89', 'department': 'Directing', '... \n3 [{'credit_id': '52fe44779251416c91011acb', 'department': 'Directing', '... \n4 [{'credit_id': '52fe44959251416c75039ed7', 'department': 'Sound', 'gend... \n... ... \n45471 [{'credit_id': '5894a97d925141426c00818c', 'department': 'Directing', '... \n45472 [{'credit_id': '52fe4af1c3a36847f81e9b15', 'department': 'Directing', '... \n45473 [{'credit_id': '52fe4776c3a368484e0c8387', 'department': 'Directing', '... \n45474 [{'credit_id': '533bccebc3a36844cf0011a7', 'department': 'Directing', '... \n45475 [{'credit_id': '593e676c92514105b702e68e', 'department': 'Directing', '... \n\n id \n0 862 \n1 8844 \n2 15602 \n3 31357 \n4 11862 \n... ... \n45471 439050 \n45472 111109 \n45473 67758 \n45474 227506 \n45475 461257 \n\n[45476 rows x 3 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
castcrewid
0[{'cast_id': 14, 'character': 'Woody (voice)', 'credit_id': '52fe4284c3...[{'credit_id': '52fe4284c3a36847f8024f49', 'department': 'Directing', '...862
1[{'cast_id': 1, 'character': 'Alan Parrish', 'credit_id': '52fe44bfc3a3...[{'credit_id': '52fe44bfc3a36847f80a7cd1', 'department': 'Production', ...8844
2[{'cast_id': 2, 'character': 'Max Goldman', 'credit_id': '52fe466a92514...[{'credit_id': '52fe466a9251416c75077a89', 'department': 'Directing', '...15602
3[{'cast_id': 1, 'character': \"Savannah 'Vannah' Jackson\", 'credit_id': ...[{'credit_id': '52fe44779251416c91011acb', 'department': 'Directing', '...31357
4[{'cast_id': 1, 'character': 'George Banks', 'credit_id': '52fe44959251...[{'credit_id': '52fe44959251416c75039ed7', 'department': 'Sound', 'gend...11862
............
45471[{'cast_id': 0, 'character': '', 'credit_id': '5894a909925141427e0079a5...[{'credit_id': '5894a97d925141426c00818c', 'department': 'Directing', '...439050
45472[{'cast_id': 1002, 'character': 'Sister Angela', 'credit_id': '52fe4af1...[{'credit_id': '52fe4af1c3a36847f81e9b15', 'department': 'Directing', '...111109
45473[{'cast_id': 6, 'character': 'Emily Shaw', 'credit_id': '52fe4776c3a368...[{'credit_id': '52fe4776c3a368484e0c8387', 'department': 'Directing', '...67758
45474[{'cast_id': 2, 'character': '', 'credit_id': '52fe4ea59251416c7515d7d5...[{'credit_id': '533bccebc3a36844cf0011a7', 'department': 'Directing', '...227506
45475[][{'credit_id': '593e676c92514105b702e68e', 'department': 'Directing', '...461257
\n

45476 rows × 3 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"meta = pd.read_csv('movies_metadata.csv')","execution_count":41,"outputs":[{"output_type":"stream","text":"/opt/conda/lib/python3.7/site-packages/IPython/core/interactiveshell.py:3063: DtypeWarning: Columns (10) have mixed types.Specify dtype option on import or set low_memory=False.\n interactivity=interactivity, compiler=compiler, result=result)\n","name":"stderr"}]},{"metadata":{"trusted":true},"cell_type":"code","source":"meta['release_date'] = pd.to_datetime(meta['release_date'], errors='coerce')","execution_count":42,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"\nmeta['year'] = meta['release_date'].dt.year","execution_count":43,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"meta['year'].value_counts().sort_index()","execution_count":44,"outputs":[{"output_type":"execute_result","execution_count":44,"data":{"text/plain":"1874.0 1\n1878.0 1\n1883.0 1\n1887.0 1\n1888.0 2\n ... \n2015.0 1905\n2016.0 1604\n2017.0 532\n2018.0 5\n2020.0 1\nName: year, Length: 135, dtype: int64"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"# Getting only 2017 movies as we already have movies up to the year 2016 in preprocessing 1 file. \n# We don't have enough data for the movies from 2018, 2019 and 2020. \n# We'll deal with it in the upcoming preprocessing files\nnew_meta = meta.loc[meta.year == 2017,['genres','id','title','year']]","execution_count":45,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"\nnew_meta","execution_count":46,"outputs":[{"output_type":"execute_result","execution_count":46,"data":{"text/plain":" genres \\\n26560 [{'id': 12, 'name': 'Adventure'}, {'id': 28, 'name': 'Action'}, {'id': ... \n26561 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n26565 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n26566 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n30536 [{'id': 14, 'name': 'Fantasy'}, {'id': 28, 'name': 'Action'}, {'id': 12... \n... ... \n45398 [{'id': 10749, 'name': 'Romance'}, {'id': 35, 'name': 'Comedy'}] \n45417 [{'id': 80, 'name': 'Crime'}, {'id': 35, 'name': 'Comedy'}, {'id': 28, ... \n45437 [{'id': 10751, 'name': 'Family'}, {'id': 16, 'name': 'Animation'}, {'id... \n45453 [{'id': 80, 'name': 'Crime'}, {'id': 18, 'name': 'Drama'}, {'id': 53, '... \n45465 [] \n\n id title year \n26560 166426 Pirates of the Caribbean: Dead Men Tell No Tales 2017.0 \n26561 141052 Justice League 2017.0 \n26565 284053 Thor: Ragnarok 2017.0 \n26566 283995 Guardians of the Galaxy Vol. 2 2017.0 \n30536 245842 The King's Daughter 2017.0 \n... ... ... ... \n45398 468707 Thick Lashes of Lauri Mäntyvaara 2017.0 \n45417 461297 Cop and a Half: New Recruit 2017.0 \n45437 455661 In a Heartbeat 2017.0 \n45453 404604 Mom 2017.0 \n45465 461257 Queerama 2017.0 \n\n[532 rows x 4 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
genresidtitleyear
26560[{'id': 12, 'name': 'Adventure'}, {'id': 28, 'name': 'Action'}, {'id': ...166426Pirates of the Caribbean: Dead Men Tell No Tales2017.0
26561[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...141052Justice League2017.0
26565[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...284053Thor: Ragnarok2017.0
26566[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...283995Guardians of the Galaxy Vol. 22017.0
30536[{'id': 14, 'name': 'Fantasy'}, {'id': 28, 'name': 'Action'}, {'id': 12...245842The King's Daughter2017.0
...............
45398[{'id': 10749, 'name': 'Romance'}, {'id': 35, 'name': 'Comedy'}]468707Thick Lashes of Lauri Mäntyvaara2017.0
45417[{'id': 80, 'name': 'Crime'}, {'id': 35, 'name': 'Comedy'}, {'id': 28, ...461297Cop and a Half: New Recruit2017.0
45437[{'id': 10751, 'name': 'Family'}, {'id': 16, 'name': 'Animation'}, {'id...455661In a Heartbeat2017.0
45453[{'id': 80, 'name': 'Crime'}, {'id': 18, 'name': 'Drama'}, {'id': 53, '...404604Mom2017.0
45465[]461257Queerama2017.0
\n

532 rows × 4 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"new_meta['id'] = new_meta['id'].astype(int)","execution_count":47,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data = pd.merge(new_meta, credits, on='id')","execution_count":48,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"pd.set_option('display.max_colwidth', 75)\ndata","execution_count":49,"outputs":[{"output_type":"execute_result","execution_count":49,"data":{"text/plain":" genres \\\n0 [{'id': 12, 'name': 'Adventure'}, {'id': 28, 'name': 'Action'}, {'id': ... \n1 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n2 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n3 [{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ... \n4 [{'id': 14, 'name': 'Fantasy'}, {'id': 28, 'name': 'Action'}, {'id': 12... \n.. ... \n526 [{'id': 10749, 'name': 'Romance'}, {'id': 35, 'name': 'Comedy'}] \n527 [{'id': 80, 'name': 'Crime'}, {'id': 35, 'name': 'Comedy'}, {'id': 28, ... \n528 [{'id': 10751, 'name': 'Family'}, {'id': 16, 'name': 'Animation'}, {'id... \n529 [{'id': 80, 'name': 'Crime'}, {'id': 18, 'name': 'Drama'}, {'id': 53, '... \n530 [] \n\n id title year \\\n0 166426 Pirates of the Caribbean: Dead Men Tell No Tales 2017.0 \n1 141052 Justice League 2017.0 \n2 284053 Thor: Ragnarok 2017.0 \n3 283995 Guardians of the Galaxy Vol. 2 2017.0 \n4 245842 The King's Daughter 2017.0 \n.. ... ... ... \n526 468707 Thick Lashes of Lauri Mäntyvaara 2017.0 \n527 461297 Cop and a Half: New Recruit 2017.0 \n528 455661 In a Heartbeat 2017.0 \n529 404604 Mom 2017.0 \n530 461257 Queerama 2017.0 \n\n cast \\\n0 [{'cast_id': 1, 'character': 'Captain Jack Sparrow', 'credit_id': '52fe... \n1 [{'cast_id': 2, 'character': 'Bruce Wayne / Batman', 'credit_id': '535e... \n2 [{'cast_id': 0, 'character': 'Thor Odinson', 'credit_id': '545d46a80e0a... \n3 [{'cast_id': 3, 'character': 'Peter Quill / Star-Lord', 'credit_id': '5... \n4 [{'cast_id': 0, 'character': 'King Louis XIV', 'credit_id': '5431dd580e... \n.. ... \n526 [{'cast_id': 0, 'character': 'Satu', 'credit_id': '597e2086c3a368544001... \n527 [{'cast_id': 0, 'character': 'Detective Simmons', 'credit_id': '593ba04... \n528 [] \n529 [{'cast_id': 1, 'character': 'Devki Sabarwal', 'credit_id': '577809adc3... \n530 [] \n\n crew \n0 [{'credit_id': '52fe4c9cc3a36847f8236a65', 'department': 'Production', ... \n1 [{'credit_id': '55ef66dbc3a3686f1700a52d', 'department': 'Production', ... \n2 [{'credit_id': '56a93fa4c3a36872db001e7a', 'department': 'Writing', 'ge... \n3 [{'credit_id': '59171547925141583c0315a6', 'department': 'Sound', 'gend... \n4 [{'credit_id': '5431de49c3a36825d300007e', 'department': 'Directing', '... \n.. ... \n526 [{'credit_id': '597e22f69251415d7801c74a', 'department': 'Directing', '... \n527 [{'credit_id': '593ba0c29251410593009be3', 'department': 'Writing', 'ge... \n528 [{'credit_id': '5981a15c92514151e0011b51', 'department': 'Sound', 'gend... \n529 [{'credit_id': '58ee55bbc3a3683df500bd0f', 'department': 'Sound', 'gend... \n530 [{'credit_id': '593e676c92514105b702e68e', 'department': 'Directing', '... \n\n[531 rows x 6 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
genresidtitleyearcastcrew
0[{'id': 12, 'name': 'Adventure'}, {'id': 28, 'name': 'Action'}, {'id': ...166426Pirates of the Caribbean: Dead Men Tell No Tales2017.0[{'cast_id': 1, 'character': 'Captain Jack Sparrow', 'credit_id': '52fe...[{'credit_id': '52fe4c9cc3a36847f8236a65', 'department': 'Production', ...
1[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...141052Justice League2017.0[{'cast_id': 2, 'character': 'Bruce Wayne / Batman', 'credit_id': '535e...[{'credit_id': '55ef66dbc3a3686f1700a52d', 'department': 'Production', ...
2[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...284053Thor: Ragnarok2017.0[{'cast_id': 0, 'character': 'Thor Odinson', 'credit_id': '545d46a80e0a...[{'credit_id': '56a93fa4c3a36872db001e7a', 'department': 'Writing', 'ge...
3[{'id': 28, 'name': 'Action'}, {'id': 12, 'name': 'Adventure'}, {'id': ...283995Guardians of the Galaxy Vol. 22017.0[{'cast_id': 3, 'character': 'Peter Quill / Star-Lord', 'credit_id': '5...[{'credit_id': '59171547925141583c0315a6', 'department': 'Sound', 'gend...
4[{'id': 14, 'name': 'Fantasy'}, {'id': 28, 'name': 'Action'}, {'id': 12...245842The King's Daughter2017.0[{'cast_id': 0, 'character': 'King Louis XIV', 'credit_id': '5431dd580e...[{'credit_id': '5431de49c3a36825d300007e', 'department': 'Directing', '...
.....................
526[{'id': 10749, 'name': 'Romance'}, {'id': 35, 'name': 'Comedy'}]468707Thick Lashes of Lauri Mäntyvaara2017.0[{'cast_id': 0, 'character': 'Satu', 'credit_id': '597e2086c3a368544001...[{'credit_id': '597e22f69251415d7801c74a', 'department': 'Directing', '...
527[{'id': 80, 'name': 'Crime'}, {'id': 35, 'name': 'Comedy'}, {'id': 28, ...461297Cop and a Half: New Recruit2017.0[{'cast_id': 0, 'character': 'Detective Simmons', 'credit_id': '593ba04...[{'credit_id': '593ba0c29251410593009be3', 'department': 'Writing', 'ge...
528[{'id': 10751, 'name': 'Family'}, {'id': 16, 'name': 'Animation'}, {'id...455661In a Heartbeat2017.0[][{'credit_id': '5981a15c92514151e0011b51', 'department': 'Sound', 'gend...
529[{'id': 80, 'name': 'Crime'}, {'id': 18, 'name': 'Drama'}, {'id': 53, '...404604Mom2017.0[{'cast_id': 1, 'character': 'Devki Sabarwal', 'credit_id': '577809adc3...[{'credit_id': '58ee55bbc3a3683df500bd0f', 'department': 'Sound', 'gend...
530[]461257Queerama2017.0[][{'credit_id': '593e676c92514105b702e68e', 'department': 'Directing', '...
\n

531 rows × 6 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"# evaluates an expression node or a string containing a Python literal or container display\nimport ast\ndata['genres'] = data['genres'].map(lambda x: ast.literal_eval(x))\ndata['cast'] = data['cast'].map(lambda x: ast.literal_eval(x))\ndata['crew'] = data['crew'].map(lambda x: ast.literal_eval(x))","execution_count":50,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def make_genresList(x):\n gen = []\n st = \" \"\n for i in x:\n if i.get('name') == 'Science Fiction':\n scifi = 'Sci-Fi'\n gen.append(scifi)\n else:\n gen.append(i.get('name'))\n if gen == []:\n return np.NaN\n else:\n return (st.join(gen))","execution_count":51,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['genres_list'] = data['genres'].map(lambda x: make_genresList(x))","execution_count":52,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['genres_list']","execution_count":53,"outputs":[{"output_type":"execute_result","execution_count":53,"data":{"text/plain":"0 Adventure Action Fantasy Comedy\n1 Action Adventure Fantasy Sci-Fi\n2 Action Adventure Fantasy Sci-Fi\n3 Action Adventure Comedy Sci-Fi\n4 Fantasy Action Adventure\n ... \n526 Romance Comedy\n527 Crime Comedy Action Family\n528 Family Animation Romance Comedy\n529 Crime Drama Thriller\n530 NaN\nName: genres_list, Length: 531, dtype: object"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"def get_actor1(x):\n casts = []\n for i in x:\n casts.append(i.get('name'))\n if casts == []:\n return np.NaN\n else:\n return (casts[0])","execution_count":54,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['actor_1_name'] = data['cast'].map(lambda x: get_actor1(x))","execution_count":55,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def get_actor2(x):\n casts = []\n for i in x:\n casts.append(i.get('name'))\n if casts == [] or len(casts)<=1:\n return np.NaN\n else:\n return (casts[1])","execution_count":56,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['actor_2_name'] = data['cast'].map(lambda x: get_actor2(x))","execution_count":57,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['actor_2_name']","execution_count":58,"outputs":[{"output_type":"execute_result","execution_count":58,"data":{"text/plain":"0 Javier Bardem\n1 Henry Cavill\n2 Tom Hiddleston\n3 Zoe Saldana\n4 William Hurt\n ... \n526 Rosa Honkonen\n527 Wallace Shawn\n528 NaN\n529 Sajal Ali\n530 NaN\nName: actor_2_name, Length: 531, dtype: object"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"def get_actor3(x):\n casts = []\n for i in x:\n casts.append(i.get('name'))\n if casts == [] or len(casts)<=2:\n return np.NaN\n else:\n return (casts[2])","execution_count":59,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['actor_3_name'] = data['cast'].map(lambda x: get_actor3(x))","execution_count":60,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['actor_3_name']","execution_count":61,"outputs":[{"output_type":"execute_result","execution_count":61,"data":{"text/plain":"0 Geoffrey Rush\n1 Gal Gadot\n2 Cate Blanchett\n3 Dave Bautista\n4 Benjamin Walker\n ... \n526 Tiitus Rantala\n527 Gina Holden\n528 NaN\n529 Akshaye Khanna\n530 NaN\nName: actor_3_name, Length: 531, dtype: object"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"def get_directors(x):\n dt = []\n st = \" \"\n for i in x:\n if i.get('job') == 'Director':\n dt.append(i.get('name'))\n if dt == []:\n return np.NaN\n else:\n return (st.join(dt))","execution_count":62,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['director_name'] = data['crew'].map(lambda x: get_directors(x))","execution_count":63,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"data['director_name']","execution_count":64,"outputs":[{"output_type":"execute_result","execution_count":64,"data":{"text/plain":"0 Joachim Rønning Espen Sandberg\n1 Zack Snyder\n2 Taika Waititi\n3 James Gunn\n4 Sean McNamara\n ... \n526 Hannaleena Hauru\n527 Jonathan A. Rosenbaum\n528 Beth David Esteban Bravo\n529 Ravi Udyawar\n530 Daisy Asquith\nName: director_name, Length: 531, dtype: object"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie = data.loc[:,['director_name','actor_1_name','actor_2_name','actor_3_name','genres_list','title']]","execution_count":65,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie","execution_count":66,"outputs":[{"output_type":"execute_result","execution_count":66,"data":{"text/plain":" director_name actor_1_name actor_2_name \\\n0 Joachim Rønning Espen Sandberg Johnny Depp Javier Bardem \n1 Zack Snyder Ben Affleck Henry Cavill \n2 Taika Waititi Chris Hemsworth Tom Hiddleston \n3 James Gunn Chris Pratt Zoe Saldana \n4 Sean McNamara Pierce Brosnan William Hurt \n.. ... ... ... \n526 Hannaleena Hauru Inka Haapamäki Rosa Honkonen \n527 Jonathan A. Rosenbaum Lou Diamond Phillips Wallace Shawn \n528 Beth David Esteban Bravo NaN NaN \n529 Ravi Udyawar Sridevi Kapoor Sajal Ali \n530 Daisy Asquith NaN NaN \n\n actor_3_name genres_list \\\n0 Geoffrey Rush Adventure Action Fantasy Comedy \n1 Gal Gadot Action Adventure Fantasy Sci-Fi \n2 Cate Blanchett Action Adventure Fantasy Sci-Fi \n3 Dave Bautista Action Adventure Comedy Sci-Fi \n4 Benjamin Walker Fantasy Action Adventure \n.. ... ... \n526 Tiitus Rantala Romance Comedy \n527 Gina Holden Crime Comedy Action Family \n528 NaN Family Animation Romance Comedy \n529 Akshaye Khanna Crime Drama Thriller \n530 NaN NaN \n\n title \n0 Pirates of the Caribbean: Dead Men Tell No Tales \n1 Justice League \n2 Thor: Ragnarok \n3 Guardians of the Galaxy Vol. 2 \n4 The King's Daughter \n.. ... \n526 Thick Lashes of Lauri Mäntyvaara \n527 Cop and a Half: New Recruit \n528 In a Heartbeat \n529 Mom \n530 Queerama \n\n[531 rows x 6 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenres_listtitle
0Joachim Rønning Espen SandbergJohnny DeppJavier BardemGeoffrey RushAdventure Action Fantasy ComedyPirates of the Caribbean: Dead Men Tell No Tales
1Zack SnyderBen AffleckHenry CavillGal GadotAction Adventure Fantasy Sci-FiJustice League
2Taika WaititiChris HemsworthTom HiddlestonCate BlanchettAction Adventure Fantasy Sci-FiThor: Ragnarok
3James GunnChris PrattZoe SaldanaDave BautistaAction Adventure Comedy Sci-FiGuardians of the Galaxy Vol. 2
4Sean McNamaraPierce BrosnanWilliam HurtBenjamin WalkerFantasy Action AdventureThe King's Daughter
.....................
526Hannaleena HauruInka HaapamäkiRosa HonkonenTiitus RantalaRomance ComedyThick Lashes of Lauri Mäntyvaara
527Jonathan A. RosenbaumLou Diamond PhillipsWallace ShawnGina HoldenCrime Comedy Action FamilyCop and a Half: New Recruit
528Beth David Esteban BravoNaNNaNNaNFamily Animation Romance ComedyIn a Heartbeat
529Ravi UdyawarSridevi KapoorSajal AliAkshaye KhannaCrime Drama ThrillerMom
530Daisy AsquithNaNNaNNaNNaNQueerama
\n

531 rows × 6 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie.isna().sum()","execution_count":67,"outputs":[{"output_type":"execute_result","execution_count":67,"data":{"text/plain":"director_name 4\nactor_1_name 22\nactor_2_name 55\nactor_3_name 70\ngenres_list 7\ntitle 0\ndtype: int64"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie = movie.dropna(how='any')","execution_count":68,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie.isna().sum()","execution_count":69,"outputs":[{"output_type":"execute_result","execution_count":69,"data":{"text/plain":"director_name 0\nactor_1_name 0\nactor_2_name 0\nactor_3_name 0\ngenres_list 0\ntitle 0\ndtype: int64"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie = movie.rename(columns={'genres_list':'genres'})\nmovie = movie.rename(columns={'title':'movie_title'})","execution_count":70,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie['movie_title'] = movie['movie_title'].str.lower()","execution_count":71,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie['comb'] = movie['actor_1_name'] + ' ' + movie['actor_2_name'] + ' '+ movie['actor_3_name'] + ' '+ movie['director_name'] +' ' + movie['genres']","execution_count":72,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie","execution_count":73,"outputs":[{"output_type":"execute_result","execution_count":73,"data":{"text/plain":" director_name actor_1_name \\\n0 Joachim Rønning Espen Sandberg Johnny Depp \n1 Zack Snyder Ben Affleck \n2 Taika Waititi Chris Hemsworth \n3 James Gunn Chris Pratt \n4 Sean McNamara Pierce Brosnan \n.. ... ... \n524 Jim Strouse Jessica Williams \n525 Farhad Mann Adelaide Kane \n526 Hannaleena Hauru Inka Haapamäki \n527 Jonathan A. Rosenbaum Lou Diamond Phillips \n529 Ravi Udyawar Sridevi Kapoor \n\n actor_2_name actor_3_name \\\n0 Javier Bardem Geoffrey Rush \n1 Henry Cavill Gal Gadot \n2 Tom Hiddleston Cate Blanchett \n3 Zoe Saldana Dave Bautista \n4 William Hurt Benjamin Walker \n.. ... ... \n524 Chris O'Dowd Keith Stanfield \n525 Benjamin Hollingsworth Jean Louisa Kelly \n526 Rosa Honkonen Tiitus Rantala \n527 Wallace Shawn Gina Holden \n529 Sajal Ali Akshaye Khanna \n\n genres \\\n0 Adventure Action Fantasy Comedy \n1 Action Adventure Fantasy Sci-Fi \n2 Action Adventure Fantasy Sci-Fi \n3 Action Adventure Comedy Sci-Fi \n4 Fantasy Action Adventure \n.. ... \n524 Romance Comedy \n525 Romance \n526 Romance Comedy \n527 Crime Comedy Action Family \n529 Crime Drama Thriller \n\n movie_title \\\n0 pirates of the caribbean: dead men tell no tales \n1 justice league \n2 thor: ragnarok \n3 guardians of the galaxy vol. 2 \n4 the king's daughter \n.. ... \n524 the incredible jessica james \n525 can't buy my love \n526 thick lashes of lauri mäntyvaara \n527 cop and a half: new recruit \n529 mom \n\n comb \n0 Johnny Depp Javier Bardem Geoffrey Rush Joachim Rønning Espen Sandberg ... \n1 Ben Affleck Henry Cavill Gal Gadot Zack Snyder Action Adventure Fantasy... \n2 Chris Hemsworth Tom Hiddleston Cate Blanchett Taika Waititi Action Adve... \n3 Chris Pratt Zoe Saldana Dave Bautista James Gunn Action Adventure Comed... \n4 Pierce Brosnan William Hurt Benjamin Walker Sean McNamara Fantasy Actio... \n.. ... \n524 Jessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy \n525 Adelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance \n526 Inka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co... \n527 Lou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr... \n529 Sridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller \n\n[458 rows x 7 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenresmovie_titlecomb
0Joachim Rønning Espen SandbergJohnny DeppJavier BardemGeoffrey RushAdventure Action Fantasy Comedypirates of the caribbean: dead men tell no talesJohnny Depp Javier Bardem Geoffrey Rush Joachim Rønning Espen Sandberg ...
1Zack SnyderBen AffleckHenry CavillGal GadotAction Adventure Fantasy Sci-Fijustice leagueBen Affleck Henry Cavill Gal Gadot Zack Snyder Action Adventure Fantasy...
2Taika WaititiChris HemsworthTom HiddlestonCate BlanchettAction Adventure Fantasy Sci-Fithor: ragnarokChris Hemsworth Tom Hiddleston Cate Blanchett Taika Waititi Action Adve...
3James GunnChris PrattZoe SaldanaDave BautistaAction Adventure Comedy Sci-Figuardians of the galaxy vol. 2Chris Pratt Zoe Saldana Dave Bautista James Gunn Action Adventure Comed...
4Sean McNamaraPierce BrosnanWilliam HurtBenjamin WalkerFantasy Action Adventurethe king's daughterPierce Brosnan William Hurt Benjamin Walker Sean McNamara Fantasy Actio...
........................
524Jim StrouseJessica WilliamsChris O'DowdKeith StanfieldRomance Comedythe incredible jessica jamesJessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy
525Farhad MannAdelaide KaneBenjamin HollingsworthJean Louisa KellyRomancecan't buy my loveAdelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance
526Hannaleena HauruInka HaapamäkiRosa HonkonenTiitus RantalaRomance Comedythick lashes of lauri mäntyvaaraInka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co...
527Jonathan A. RosenbaumLou Diamond PhillipsWallace ShawnGina HoldenCrime Comedy Action Familycop and a half: new recruitLou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr...
529Ravi UdyawarSridevi KapoorSajal AliAkshaye KhannaCrime Drama ThrillermomSridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller
\n

458 rows × 7 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"old = pd.read_csv('data.csv')","execution_count":74,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"old","execution_count":75,"outputs":[{"output_type":"execute_result","execution_count":75,"data":{"text/plain":" director_name actor_1_name actor_2_name \\\n0 James Cameron CCH Pounder Joel David Moore \n1 Gore Verbinski Johnny Depp Orlando Bloom \n2 Sam Mendes Christoph Waltz Rory Kinnear \n3 Christopher Nolan Tom Hardy Christian Bale \n4 Doug Walker Doug Walker Rob Walker \n... ... ... ... \n5038 Scott Smith Eric Mabius Daphne Zuniga \n5039 unknown Natalie Zea Valorie Curry \n5040 Benjamin Roberds Eva Boehnke Maxwell Moody \n5041 Daniel Hsia Alan Ruck Daniel Henney \n5042 Jon Gunn John August Brian Herzlinger \n\n actor_3_name genres \\\n0 Wes Studi Action Adventure Fantasy Sci-Fi \n1 Jack Davenport Action Adventure Fantasy \n2 Stephanie Sigman Action Adventure Thriller \n3 Joseph Gordon-Levitt Action Thriller \n4 unknown Documentary \n... ... ... \n5038 Crystal Lowe Comedy Drama \n5039 Sam Underwood Crime Drama Mystery Thriller \n5040 David Chandler Drama Horror Thriller \n5041 Eliza Coupe Comedy Drama Romance \n5042 Jon Gunn Documentary \n\n movie_title \n0 avatar \n1 pirates of the caribbean: at world's end \n2 spectre \n3 the dark knight rises \n4 star wars: episode vii - the force awakens  \n... ... \n5038 signed sealed delivered \n5039 the following  \n5040 a plague so pleasant \n5041 shanghai calling \n5042 my date with drew \n\n[5043 rows x 6 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenresmovie_title
0James CameronCCH PounderJoel David MooreWes StudiAction Adventure Fantasy Sci-Fiavatar
1Gore VerbinskiJohnny DeppOrlando BloomJack DavenportAction Adventure Fantasypirates of the caribbean: at world's end
2Sam MendesChristoph WaltzRory KinnearStephanie SigmanAction Adventure Thrillerspectre
3Christopher NolanTom HardyChristian BaleJoseph Gordon-LevittAction Thrillerthe dark knight rises
4Doug WalkerDoug WalkerRob WalkerunknownDocumentarystar wars: episode vii - the force awakens
.....................
5038Scott SmithEric MabiusDaphne ZunigaCrystal LoweComedy Dramasigned sealed delivered
5039unknownNatalie ZeaValorie CurrySam UnderwoodCrime Drama Mystery Thrillerthe following
5040Benjamin RoberdsEva BoehnkeMaxwell MoodyDavid ChandlerDrama Horror Thrillera plague so pleasant
5041Daniel HsiaAlan RuckDaniel HenneyEliza CoupeComedy Drama Romanceshanghai calling
5042Jon GunnJohn AugustBrian HerzlingerJon GunnDocumentarymy date with drew
\n

5043 rows × 6 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"old['comb'] = old['actor_1_name'] + ' ' + old['actor_2_name'] + ' '+ old['actor_3_name'] + ' '+ old['director_name'] +' ' + old['genres']","execution_count":77,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"old","execution_count":78,"outputs":[{"output_type":"execute_result","execution_count":78,"data":{"text/plain":" director_name actor_1_name actor_2_name \\\n0 James Cameron CCH Pounder Joel David Moore \n1 Gore Verbinski Johnny Depp Orlando Bloom \n2 Sam Mendes Christoph Waltz Rory Kinnear \n3 Christopher Nolan Tom Hardy Christian Bale \n4 Doug Walker Doug Walker Rob Walker \n... ... ... ... \n5038 Scott Smith Eric Mabius Daphne Zuniga \n5039 unknown Natalie Zea Valorie Curry \n5040 Benjamin Roberds Eva Boehnke Maxwell Moody \n5041 Daniel Hsia Alan Ruck Daniel Henney \n5042 Jon Gunn John August Brian Herzlinger \n\n actor_3_name genres \\\n0 Wes Studi Action Adventure Fantasy Sci-Fi \n1 Jack Davenport Action Adventure Fantasy \n2 Stephanie Sigman Action Adventure Thriller \n3 Joseph Gordon-Levitt Action Thriller \n4 unknown Documentary \n... ... ... \n5038 Crystal Lowe Comedy Drama \n5039 Sam Underwood Crime Drama Mystery Thriller \n5040 David Chandler Drama Horror Thriller \n5041 Eliza Coupe Comedy Drama Romance \n5042 Jon Gunn Documentary \n\n movie_title \\\n0 avatar \n1 pirates of the caribbean: at world's end \n2 spectre \n3 the dark knight rises \n4 star wars: episode vii - the force awakens  \n... ... \n5038 signed sealed delivered \n5039 the following  \n5040 a plague so pleasant \n5041 shanghai calling \n5042 my date with drew \n\n comb \n0 CCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F... \n1 Johnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur... \n2 Christoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu... \n3 Tom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ... \n4 Doug Walker Rob Walker unknown Doug Walker Documentary \n... ... \n5038 Eric Mabius Daphne Zuniga Crystal Lowe Scott Smith Comedy Drama \n5039 Natalie Zea Valorie Curry Sam Underwood unknown Crime Drama Mystery Thr... \n5040 Eva Boehnke Maxwell Moody David Chandler Benjamin Roberds Drama Horror ... \n5041 Alan Ruck Daniel Henney Eliza Coupe Daniel Hsia Comedy Drama Romance \n5042 John August Brian Herzlinger Jon Gunn Jon Gunn Documentary \n\n[5043 rows x 7 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenresmovie_titlecomb
0James CameronCCH PounderJoel David MooreWes StudiAction Adventure Fantasy Sci-FiavatarCCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F...
1Gore VerbinskiJohnny DeppOrlando BloomJack DavenportAction Adventure Fantasypirates of the caribbean: at world's endJohnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur...
2Sam MendesChristoph WaltzRory KinnearStephanie SigmanAction Adventure ThrillerspectreChristoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu...
3Christopher NolanTom HardyChristian BaleJoseph Gordon-LevittAction Thrillerthe dark knight risesTom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ...
4Doug WalkerDoug WalkerRob WalkerunknownDocumentarystar wars: episode vii - the force awakensDoug Walker Rob Walker unknown Doug Walker Documentary
........................
5038Scott SmithEric MabiusDaphne ZunigaCrystal LoweComedy Dramasigned sealed deliveredEric Mabius Daphne Zuniga Crystal Lowe Scott Smith Comedy Drama
5039unknownNatalie ZeaValorie CurrySam UnderwoodCrime Drama Mystery Thrillerthe followingNatalie Zea Valorie Curry Sam Underwood unknown Crime Drama Mystery Thr...
5040Benjamin RoberdsEva BoehnkeMaxwell MoodyDavid ChandlerDrama Horror Thrillera plague so pleasantEva Boehnke Maxwell Moody David Chandler Benjamin Roberds Drama Horror ...
5041Daniel HsiaAlan RuckDaniel HenneyEliza CoupeComedy Drama Romanceshanghai callingAlan Ruck Daniel Henney Eliza Coupe Daniel Hsia Comedy Drama Romance
5042Jon GunnJohn AugustBrian HerzlingerJon GunnDocumentarymy date with drewJohn August Brian Herzlinger Jon Gunn Jon Gunn Documentary
\n

5043 rows × 7 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"new = old.append(movie)","execution_count":79,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"new","execution_count":80,"outputs":[{"output_type":"execute_result","execution_count":80,"data":{"text/plain":" director_name actor_1_name actor_2_name \\\n0 James Cameron CCH Pounder Joel David Moore \n1 Gore Verbinski Johnny Depp Orlando Bloom \n2 Sam Mendes Christoph Waltz Rory Kinnear \n3 Christopher Nolan Tom Hardy Christian Bale \n4 Doug Walker Doug Walker Rob Walker \n.. ... ... ... \n524 Jim Strouse Jessica Williams Chris O'Dowd \n525 Farhad Mann Adelaide Kane Benjamin Hollingsworth \n526 Hannaleena Hauru Inka Haapamäki Rosa Honkonen \n527 Jonathan A. Rosenbaum Lou Diamond Phillips Wallace Shawn \n529 Ravi Udyawar Sridevi Kapoor Sajal Ali \n\n actor_3_name genres \\\n0 Wes Studi Action Adventure Fantasy Sci-Fi \n1 Jack Davenport Action Adventure Fantasy \n2 Stephanie Sigman Action Adventure Thriller \n3 Joseph Gordon-Levitt Action Thriller \n4 unknown Documentary \n.. ... ... \n524 Keith Stanfield Romance Comedy \n525 Jean Louisa Kelly Romance \n526 Tiitus Rantala Romance Comedy \n527 Gina Holden Crime Comedy Action Family \n529 Akshaye Khanna Crime Drama Thriller \n\n movie_title \\\n0 avatar \n1 pirates of the caribbean: at world's end \n2 spectre \n3 the dark knight rises \n4 star wars: episode vii - the force awakens  \n.. ... \n524 the incredible jessica james \n525 can't buy my love \n526 thick lashes of lauri mäntyvaara \n527 cop and a half: new recruit \n529 mom \n\n comb \n0 CCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F... \n1 Johnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur... \n2 Christoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu... \n3 Tom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ... \n4 Doug Walker Rob Walker unknown Doug Walker Documentary \n.. ... \n524 Jessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy \n525 Adelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance \n526 Inka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co... \n527 Lou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr... \n529 Sridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller \n\n[5501 rows x 7 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenresmovie_titlecomb
0James CameronCCH PounderJoel David MooreWes StudiAction Adventure Fantasy Sci-FiavatarCCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F...
1Gore VerbinskiJohnny DeppOrlando BloomJack DavenportAction Adventure Fantasypirates of the caribbean: at world's endJohnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur...
2Sam MendesChristoph WaltzRory KinnearStephanie SigmanAction Adventure ThrillerspectreChristoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu...
3Christopher NolanTom HardyChristian BaleJoseph Gordon-LevittAction Thrillerthe dark knight risesTom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ...
4Doug WalkerDoug WalkerRob WalkerunknownDocumentarystar wars: episode vii - the force awakensDoug Walker Rob Walker unknown Doug Walker Documentary
........................
524Jim StrouseJessica WilliamsChris O'DowdKeith StanfieldRomance Comedythe incredible jessica jamesJessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy
525Farhad MannAdelaide KaneBenjamin HollingsworthJean Louisa KellyRomancecan't buy my loveAdelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance
526Hannaleena HauruInka HaapamäkiRosa HonkonenTiitus RantalaRomance Comedythick lashes of lauri mäntyvaaraInka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co...
527Jonathan A. RosenbaumLou Diamond PhillipsWallace ShawnGina HoldenCrime Comedy Action Familycop and a half: new recruitLou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr...
529Ravi UdyawarSridevi KapoorSajal AliAkshaye KhannaCrime Drama ThrillermomSridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller
\n

5501 rows × 7 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"new.drop_duplicates(subset =\"movie_title\", keep = 'last', inplace = True)","execution_count":81,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"new","execution_count":82,"outputs":[{"output_type":"execute_result","execution_count":82,"data":{"text/plain":" director_name actor_1_name actor_2_name \\\n0 James Cameron CCH Pounder Joel David Moore \n1 Gore Verbinski Johnny Depp Orlando Bloom \n2 Sam Mendes Christoph Waltz Rory Kinnear \n3 Christopher Nolan Tom Hardy Christian Bale \n4 Doug Walker Doug Walker Rob Walker \n.. ... ... ... \n524 Jim Strouse Jessica Williams Chris O'Dowd \n525 Farhad Mann Adelaide Kane Benjamin Hollingsworth \n526 Hannaleena Hauru Inka Haapamäki Rosa Honkonen \n527 Jonathan A. Rosenbaum Lou Diamond Phillips Wallace Shawn \n529 Ravi Udyawar Sridevi Kapoor Sajal Ali \n\n actor_3_name genres \\\n0 Wes Studi Action Adventure Fantasy Sci-Fi \n1 Jack Davenport Action Adventure Fantasy \n2 Stephanie Sigman Action Adventure Thriller \n3 Joseph Gordon-Levitt Action Thriller \n4 unknown Documentary \n.. ... ... \n524 Keith Stanfield Romance Comedy \n525 Jean Louisa Kelly Romance \n526 Tiitus Rantala Romance Comedy \n527 Gina Holden Crime Comedy Action Family \n529 Akshaye Khanna Crime Drama Thriller \n\n movie_title \\\n0 avatar \n1 pirates of the caribbean: at world's end \n2 spectre \n3 the dark knight rises \n4 star wars: episode vii - the force awakens  \n.. ... \n524 the incredible jessica james \n525 can't buy my love \n526 thick lashes of lauri mäntyvaara \n527 cop and a half: new recruit \n529 mom \n\n comb \n0 CCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F... \n1 Johnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur... \n2 Christoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu... \n3 Tom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ... \n4 Doug Walker Rob Walker unknown Doug Walker Documentary \n.. ... \n524 Jessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy \n525 Adelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance \n526 Inka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co... \n527 Lou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr... \n529 Sridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller \n\n[5364 rows x 7 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
director_nameactor_1_nameactor_2_nameactor_3_namegenresmovie_titlecomb
0James CameronCCH PounderJoel David MooreWes StudiAction Adventure Fantasy Sci-FiavatarCCH Pounder Joel David Moore Wes Studi James Cameron Action Adventure F...
1Gore VerbinskiJohnny DeppOrlando BloomJack DavenportAction Adventure Fantasypirates of the caribbean: at world's endJohnny Depp Orlando Bloom Jack Davenport Gore Verbinski Action Adventur...
2Sam MendesChristoph WaltzRory KinnearStephanie SigmanAction Adventure ThrillerspectreChristoph Waltz Rory Kinnear Stephanie Sigman Sam Mendes Action Adventu...
3Christopher NolanTom HardyChristian BaleJoseph Gordon-LevittAction Thrillerthe dark knight risesTom Hardy Christian Bale Joseph Gordon-Levitt Christopher Nolan Action ...
4Doug WalkerDoug WalkerRob WalkerunknownDocumentarystar wars: episode vii - the force awakensDoug Walker Rob Walker unknown Doug Walker Documentary
........................
524Jim StrouseJessica WilliamsChris O'DowdKeith StanfieldRomance Comedythe incredible jessica jamesJessica Williams Chris O'Dowd Keith Stanfield Jim Strouse Romance Comedy
525Farhad MannAdelaide KaneBenjamin HollingsworthJean Louisa KellyRomancecan't buy my loveAdelaide Kane Benjamin Hollingsworth Jean Louisa Kelly Farhad Mann Romance
526Hannaleena HauruInka HaapamäkiRosa HonkonenTiitus RantalaRomance Comedythick lashes of lauri mäntyvaaraInka Haapamäki Rosa Honkonen Tiitus Rantala Hannaleena Hauru Romance Co...
527Jonathan A. RosenbaumLou Diamond PhillipsWallace ShawnGina HoldenCrime Comedy Action Familycop and a half: new recruitLou Diamond Phillips Wallace Shawn Gina Holden Jonathan A. Rosenbaum Cr...
529Ravi UdyawarSridevi KapoorSajal AliAkshaye KhannaCrime Drama ThrillermomSridevi Kapoor Sajal Ali Akshaye Khanna Ravi Udyawar Crime Drama Thriller
\n

5364 rows × 7 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"new.to_csv('new_data.csv',index=False)","execution_count":85,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.7.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":4} --------------------------------------------------------------------------------