Commit ·
68baec0
1
Parent(s): 5811ae7
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,5 +9,64 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
+
# Dynamic NLP Model Movie-Recommender-system With Sentiment Analysis
|
| 13 |
+
<a href = 'https://huggingface.co/spaces/TusharNautiyal/Dynamic-Movie-Recommender-With-Sentiment-Analysis'/>***Check Deployment***</a>
|
| 14 |
+
|
| 15 |
+
<a href="https://www.linkedin.com/in/tusharnautiyal/"> <img src = "https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"/></a> <img src = "https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue"/> <img src = "https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=Streamlit&logoColor=white"/>
|
| 16 |
+
|
| 17 |
+
Content Based Movie Recommender System Using NLP Dynamic model selection between Bert Pre Trained Model , Bag of Words, TF-IDF, Word2Vec, And TF-IDF+Word2Vec on TMDB Dataset.
|
| 18 |
+
This movie recommender was created to better understand each and every NLP model based recommendation working and effective ness based on multiple paramenters.
|
| 19 |
+
For each movie you can also enter a review on which a Sentiment Analysis model will work and tell if your review was a good or bad one.
|
| 20 |
+
Sometimes if not able to find movie recommendation just try to refresh and do it again one more time or change the name to a similar name of a moive.
|
| 21 |
+
If you like this repository do star it.
|
| 22 |
+
# How to Use
|
| 23 |
+
Models are loaded using cloud pickle and **session states** are used to stop model from getting downloaded again and again this increases loading speed and loading times. App is created using **streamlit**. Below is a quick demonstration of how it works.
|
| 24 |
+
|
| 25 |
+
***Run This command in CLI***
|
| 26 |
+
|
| 27 |
+
```
|
| 28 |
+
streamlit run app.py
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
**Recommender Demo**:
|
| 32 |
+
|
| 33 |
+
https://user-images.githubusercontent.com/74553737/193135421-80a4c790-d14e-4322-982c-36ec7a16aea9.mp4
|
| 34 |
+
|
| 35 |
+
Sometimes index are not found because either the movie poster is not avalible in the api or the name of the movie was not able to found try to add some variations in your name for eg pirates, carrabiean, sea, monster words that can be in a movie.
|
| 36 |
+
|
| 37 |
+
**Sentiment Analysis Demo**:
|
| 38 |
+
|
| 39 |
+
https://user-images.githubusercontent.com/74553737/193136299-185453fa-3235-49a3-99df-c7c2f45ff19c.mp4
|
| 40 |
+
|
| 41 |
+
Try to write review with more words for better sentiment analysis recommender 20-50 words. We have trained model on **random forest** as it was giving good accuracy and **Tf-idf** vecotrizer for sentiment analysis model. For more you can check the notebook.
|
| 42 |
+
|
| 43 |
+
# Understanding TF-IDF with Word2Vec Embeddings.
|
| 44 |
+
|
| 45 |
+
**TF-IDF** is a term frequency-inverse document frequency. It helps to calculate the importance of a given word relative to other words in the document and in the corpus. It calculates in two quantities, TF and IDF. Combining two will give a TF-IDF score.
|
| 46 |
+
|
| 47 |
+
Calculate the TF-IDF vector for each word in corpus. Let’s call the **TF-IDF** vectors as ***tf1, tf2, tf3, ... and so on*** till n.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
|
| 51 |
+
After that we can Calculate the **Word2Vec** for each word in the description lets call it as ***W2V1,W2V2,W2V3..........and so on*** till n.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
**Multiply** the ***TF-IDF*** score and ***Word2Vec vector*** representation of each word and **sum** all of it.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
Then **divide** the total by sum of TF-IDF vectors.These will be our new vectors that we will use for our cosine similarity to create a recommender model.
|
| 62 |
+
|
| 63 |
+
Considering each word with i and total words as n. **The Complete Formula will be**
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
|
| 67 |
+
/ This sign means divide and this Formula image was created using atomurl.net. For more detailed understanding on ***tf-idf+word2vec*** ***Follow me on medium*** where i have posted a full article on it. <a href = 'https://medium.com/@tsa.vevo.music'><img src = 'https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white'/></a>
|
| 68 |
+
|
| 69 |
+
# Updates
|
| 70 |
+
This project is deployed on hugging face spaces here is the link for the deployed applications <a href = 'https://huggingface.co/spaces/TusharNautiyal/Dynamic-Movie-Recommender-With-Sentiment-Analysis'/>***Check Deployment***</a>
|
| 71 |
|
| 72 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|