From d01104ff82d4c3535543c192a0284bf6c16fde16 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:56:41 +0530 Subject: [PATCH 01/23] Create dataset.csv --- models/Review_sentiment/data/dataset.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 models/Review_sentiment/data/dataset.csv diff --git a/models/Review_sentiment/data/dataset.csv b/models/Review_sentiment/data/dataset.csv new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/models/Review_sentiment/data/dataset.csv @@ -0,0 +1 @@ + From 0a8ec4c2e20d17820b544e16fa443975bb5ed96b Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:03:20 +0530 Subject: [PATCH 02/23] Add files via upload --- dataset.csv | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 dataset.csv diff --git a/dataset.csv b/dataset.csv new file mode 100644 index 00000000..9b52774b --- /dev/null +++ b/dataset.csv @@ -0,0 +1,103 @@ +text,sentiment +I love this product! It's fantastic.,1 +This is the worst experience ever.,0 +Absolutely fantastic service!,1 +Not worth the money.,0 +I'm so happy with my purchase!,1 +Terrible customer support.,0 +This is the best thing I've ever bought!,1 +I hate this! So disappointing.,0 +Highly recommend this to everyone!,1 +Will never buy this again.,0 +This has changed my life for the better.,1 +"Awful experience, I want a refund.",0 +Great quality for the price.,1 +"Too good to be true, but it is!",1 +Very unsatisfied with my order.,0 +I am thrilled with my purchase!,1 +Do not waste your money on this.,0 +Such a wonderful experience!,1 +Will not recommend to friends.,0 +Perfect! Exactly what I wanted.,1 +"Terrible product, do not buy.",0 +I couldn't be happier with my purchase!,1 +"The quality is amazing, highly recommend!",1 +"Very disappointed, it broke after one use.",0 +Best purchase I’ve made all year!,1 +"Awful service, I will not be returning.",0 +"This is an absolute gem, I love it!",1 +"Not what I expected at all, very misleading.",0 +Fantastic! I use it every day.,1 +"I had high hopes, but I'm let down.",0 +Such a great value for the money!,1 +"Really poor quality, I'm returning it.",0 +This makes my life so much easier!,1 +I would give this 0 stars if I could.,0 +I'm impressed with the quality!,1 +"Never again, I'm so upset with this purchase.",0 +Great customer service experience!,1 +"Disappointing, did not meet expectations.",0 +I'm absolutely in love with this!,1 +"Terrible experience, will not recommend.",0 +Best decision I ever made!,1 +"Awful, I should have read the reviews first.",0 +"Such a handy tool, I recommend it!",1 +"Not worth the hype, very disappointing.",0 +I'm so glad I bought this!,1 +Will never purchase from here again.,0 +"Brilliant product, works perfectly!",1 +"Really bad experience, I regret it.",1 +"This is a lifesaver, I love it!",1 +"Very dissatisfied, it does not work as promised.",0 +"Fantastic results, I'm very pleased!",1 +"Absolutely terrible, I want my money back.",0 +"Excellent value, I would buy again!,1",1 +"Awful, it broke after one day.",0 +Thrilled with this purchase!,1 +"Not what I expected at all, I'm disappointed.,0",0 +Best thing I've bought this year!,1 +I will never buy this brand again.,0 +Such a wonderful addition to my life!,1 +"Terrible product, completely useless.",0 +Love this! It exceeded my expectations.,1 +Very unhappy with my purchase.,0 +"Great product, I use it daily",1 +Complete waste of money.,0 +"I'm so impressed, thank you!",1 +"Disappointed, it didn't live up to the hype",0 +This is everything I wanted,1 +Never buying from this company again.,0 +"Fantastic quality, highly recommend!",1 +"Really bad experience, never again.",0 +"Absolutely love it, will buy again!",1 +"Very disappointed, not worth it at all",0 +This is just perfect for me,1 +"Awful service, I'm very upset.",0 +"Great results, very satisfied!",1 +"I was misled, it's not what I expected.",0 +"Such a helpful product, I love it!",1 +"Very unhappy with this, it doesn't work.",0 +This is a must-have for anyone!,1 +"Completely unsatisfied, do not recommend.",0 +I'll definitely buy this again!,1 +"Very bad quality, I'm returning it.",0 +"Wonderful product, I'm very happy",1 +"Not worth the price, very disappointed",0 +"Exceptional product, I love it",1 +"Awful purchase, I regret it",0 +"Fantastic service, I will return",1 +"Very unsatisfied, it broke so fast",0 +This has been a game changer for me!,1 +"Total waste of money, very unhappy.",0 +Great experience from start to finish!,1 +"Very unhappy, I expected better.,0",0 +Absolutely perfect for my needs!,1 +"Will not buy this again, I'm let down.",0 +I would recommend this to anyone!,1 +"Very bad experience, don't buy this.",0 +Great product! Works like a charm.,1 +I'm really disappointed in this purchase.,0 +Highly recommend this to anyone looking!,1 +"Terrible, it broke right away.",0 +Super happy with my decision to buy this!,1 +Very disappointed with the quality.,0 From f8fe50a7cb098716901a09dc30c8f710abcdaba5 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:05:39 +0530 Subject: [PATCH 03/23] Delete dataset.csv --- dataset.csv | 103 ---------------------------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 dataset.csv diff --git a/dataset.csv b/dataset.csv deleted file mode 100644 index 9b52774b..00000000 --- a/dataset.csv +++ /dev/null @@ -1,103 +0,0 @@ -text,sentiment -I love this product! It's fantastic.,1 -This is the worst experience ever.,0 -Absolutely fantastic service!,1 -Not worth the money.,0 -I'm so happy with my purchase!,1 -Terrible customer support.,0 -This is the best thing I've ever bought!,1 -I hate this! So disappointing.,0 -Highly recommend this to everyone!,1 -Will never buy this again.,0 -This has changed my life for the better.,1 -"Awful experience, I want a refund.",0 -Great quality for the price.,1 -"Too good to be true, but it is!",1 -Very unsatisfied with my order.,0 -I am thrilled with my purchase!,1 -Do not waste your money on this.,0 -Such a wonderful experience!,1 -Will not recommend to friends.,0 -Perfect! Exactly what I wanted.,1 -"Terrible product, do not buy.",0 -I couldn't be happier with my purchase!,1 -"The quality is amazing, highly recommend!",1 -"Very disappointed, it broke after one use.",0 -Best purchase I’ve made all year!,1 -"Awful service, I will not be returning.",0 -"This is an absolute gem, I love it!",1 -"Not what I expected at all, very misleading.",0 -Fantastic! I use it every day.,1 -"I had high hopes, but I'm let down.",0 -Such a great value for the money!,1 -"Really poor quality, I'm returning it.",0 -This makes my life so much easier!,1 -I would give this 0 stars if I could.,0 -I'm impressed with the quality!,1 -"Never again, I'm so upset with this purchase.",0 -Great customer service experience!,1 -"Disappointing, did not meet expectations.",0 -I'm absolutely in love with this!,1 -"Terrible experience, will not recommend.",0 -Best decision I ever made!,1 -"Awful, I should have read the reviews first.",0 -"Such a handy tool, I recommend it!",1 -"Not worth the hype, very disappointing.",0 -I'm so glad I bought this!,1 -Will never purchase from here again.,0 -"Brilliant product, works perfectly!",1 -"Really bad experience, I regret it.",1 -"This is a lifesaver, I love it!",1 -"Very dissatisfied, it does not work as promised.",0 -"Fantastic results, I'm very pleased!",1 -"Absolutely terrible, I want my money back.",0 -"Excellent value, I would buy again!,1",1 -"Awful, it broke after one day.",0 -Thrilled with this purchase!,1 -"Not what I expected at all, I'm disappointed.,0",0 -Best thing I've bought this year!,1 -I will never buy this brand again.,0 -Such a wonderful addition to my life!,1 -"Terrible product, completely useless.",0 -Love this! It exceeded my expectations.,1 -Very unhappy with my purchase.,0 -"Great product, I use it daily",1 -Complete waste of money.,0 -"I'm so impressed, thank you!",1 -"Disappointed, it didn't live up to the hype",0 -This is everything I wanted,1 -Never buying from this company again.,0 -"Fantastic quality, highly recommend!",1 -"Really bad experience, never again.",0 -"Absolutely love it, will buy again!",1 -"Very disappointed, not worth it at all",0 -This is just perfect for me,1 -"Awful service, I'm very upset.",0 -"Great results, very satisfied!",1 -"I was misled, it's not what I expected.",0 -"Such a helpful product, I love it!",1 -"Very unhappy with this, it doesn't work.",0 -This is a must-have for anyone!,1 -"Completely unsatisfied, do not recommend.",0 -I'll definitely buy this again!,1 -"Very bad quality, I'm returning it.",0 -"Wonderful product, I'm very happy",1 -"Not worth the price, very disappointed",0 -"Exceptional product, I love it",1 -"Awful purchase, I regret it",0 -"Fantastic service, I will return",1 -"Very unsatisfied, it broke so fast",0 -This has been a game changer for me!,1 -"Total waste of money, very unhappy.",0 -Great experience from start to finish!,1 -"Very unhappy, I expected better.,0",0 -Absolutely perfect for my needs!,1 -"Will not buy this again, I'm let down.",0 -I would recommend this to anyone!,1 -"Very bad experience, don't buy this.",0 -Great product! Works like a charm.,1 -I'm really disappointed in this purchase.,0 -Highly recommend this to anyone looking!,1 -"Terrible, it broke right away.",0 -Super happy with my decision to buy this!,1 -Very disappointed with the quality.,0 From c4eb957ddc4e20111f4218d08ac9e7e09c491e7f Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:06:02 +0530 Subject: [PATCH 04/23] Update dataset.csv --- models/Review_sentiment/data/dataset.csv | 103 +++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/models/Review_sentiment/data/dataset.csv b/models/Review_sentiment/data/dataset.csv index 8b137891..212a04e2 100644 --- a/models/Review_sentiment/data/dataset.csv +++ b/models/Review_sentiment/data/dataset.csv @@ -1 +1,104 @@ +text,sentiment +I love this product! It's fantastic.,1 +This is the worst experience ever.,0 +Absolutely fantastic service!,1 +Not worth the money.,0 +I'm so happy with my purchase!,1 +Terrible customer support.,0 +This is the best thing I've ever bought!,1 +I hate this! So disappointing.,0 +Highly recommend this to everyone!,1 +Will never buy this again.,0 +This has changed my life for the better.,1 +"Awful experience, I want a refund.",0 +Great quality for the price.,1 +"Too good to be true, but it is!",1 +Very unsatisfied with my order.,0 +I am thrilled with my purchase!,1 +Do not waste your money on this.,0 +Such a wonderful experience!,1 +Will not recommend to friends.,0 +Perfect! Exactly what I wanted.,1 +"Terrible product, do not buy.",0 +I couldn't be happier with my purchase!,1 +"The quality is amazing, highly recommend!",1 +"Very disappointed, it broke after one use.",0 +Best purchase I’ve made all year!,1 +"Awful service, I will not be returning.",0 +"This is an absolute gem, I love it!",1 +"Not what I expected at all, very misleading.",0 +Fantastic! I use it every day.,1 +"I had high hopes, but I'm let down.",0 +Such a great value for the money!,1 +"Really poor quality, I'm returning it.",0 +This makes my life so much easier!,1 +I would give this 0 stars if I could.,0 +I'm impressed with the quality!,1 +"Never again, I'm so upset with this purchase.",0 +Great customer service experience!,1 +"Disappointing, did not meet expectations.",0 +I'm absolutely in love with this!,1 +"Terrible experience, will not recommend.",0 +Best decision I ever made!,1 +"Awful, I should have read the reviews first.",0 +"Such a handy tool, I recommend it!",1 +"Not worth the hype, very disappointing.",0 +I'm so glad I bought this!,1 +Will never purchase from here again.,0 +"Brilliant product, works perfectly!",1 +"Really bad experience, I regret it.",1 +"This is a lifesaver, I love it!",1 +"Very dissatisfied, it does not work as promised.",0 +"Fantastic results, I'm very pleased!",1 +"Absolutely terrible, I want my money back.",0 +"Excellent value, I would buy again!,1",1 +"Awful, it broke after one day.",0 +Thrilled with this purchase!,1 +"Not what I expected at all, I'm disappointed.,0",0 +Best thing I've bought this year!,1 +I will never buy this brand again.,0 +Such a wonderful addition to my life!,1 +"Terrible product, completely useless.",0 +Love this! It exceeded my expectations.,1 +Very unhappy with my purchase.,0 +"Great product, I use it daily",1 +Complete waste of money.,0 +"I'm so impressed, thank you!",1 +"Disappointed, it didn't live up to the hype",0 +This is everything I wanted,1 +Never buying from this company again.,0 +"Fantastic quality, highly recommend!",1 +"Really bad experience, never again.",0 +"Absolutely love it, will buy again!",1 +"Very disappointed, not worth it at all",0 +This is just perfect for me,1 +"Awful service, I'm very upset.",0 +"Great results, very satisfied!",1 +"I was misled, it's not what I expected.",0 +"Such a helpful product, I love it!",1 +"Very unhappy with this, it doesn't work.",0 +This is a must-have for anyone!,1 +"Completely unsatisfied, do not recommend.",0 +I'll definitely buy this again!,1 +"Very bad quality, I'm returning it.",0 +"Wonderful product, I'm very happy",1 +"Not worth the price, very disappointed",0 +"Exceptional product, I love it",1 +"Awful purchase, I regret it",0 +"Fantastic service, I will return",1 +"Very unsatisfied, it broke so fast",0 +This has been a game changer for me!,1 +"Total waste of money, very unhappy.",0 +Great experience from start to finish!,1 +"Very unhappy, I expected better.,0",0 +Absolutely perfect for my needs!,1 +"Will not buy this again, I'm let down.",0 +I would recommend this to anyone!,1 +"Very bad experience, don't buy this.",0 +Great product! Works like a charm.,1 +I'm really disappointed in this purchase.,0 +Highly recommend this to anyone looking!,1 +"Terrible, it broke right away.",0 +Super happy with my decision to buy this!,1 +Very disappointed with the quality.,0 From 2989b5e0ac72b5b73fd8583df1f7f8064a54ac03 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:06:26 +0530 Subject: [PATCH 05/23] Delete models/Review_sentiment/data/dataset.csv --- models/Review_sentiment/data/dataset.csv | 104 ----------------------- 1 file changed, 104 deletions(-) delete mode 100644 models/Review_sentiment/data/dataset.csv diff --git a/models/Review_sentiment/data/dataset.csv b/models/Review_sentiment/data/dataset.csv deleted file mode 100644 index 212a04e2..00000000 --- a/models/Review_sentiment/data/dataset.csv +++ /dev/null @@ -1,104 +0,0 @@ -text,sentiment -I love this product! It's fantastic.,1 -This is the worst experience ever.,0 -Absolutely fantastic service!,1 -Not worth the money.,0 -I'm so happy with my purchase!,1 -Terrible customer support.,0 -This is the best thing I've ever bought!,1 -I hate this! So disappointing.,0 -Highly recommend this to everyone!,1 -Will never buy this again.,0 -This has changed my life for the better.,1 -"Awful experience, I want a refund.",0 -Great quality for the price.,1 -"Too good to be true, but it is!",1 -Very unsatisfied with my order.,0 -I am thrilled with my purchase!,1 -Do not waste your money on this.,0 -Such a wonderful experience!,1 -Will not recommend to friends.,0 -Perfect! Exactly what I wanted.,1 -"Terrible product, do not buy.",0 -I couldn't be happier with my purchase!,1 -"The quality is amazing, highly recommend!",1 -"Very disappointed, it broke after one use.",0 -Best purchase I’ve made all year!,1 -"Awful service, I will not be returning.",0 -"This is an absolute gem, I love it!",1 -"Not what I expected at all, very misleading.",0 -Fantastic! I use it every day.,1 -"I had high hopes, but I'm let down.",0 -Such a great value for the money!,1 -"Really poor quality, I'm returning it.",0 -This makes my life so much easier!,1 -I would give this 0 stars if I could.,0 -I'm impressed with the quality!,1 -"Never again, I'm so upset with this purchase.",0 -Great customer service experience!,1 -"Disappointing, did not meet expectations.",0 -I'm absolutely in love with this!,1 -"Terrible experience, will not recommend.",0 -Best decision I ever made!,1 -"Awful, I should have read the reviews first.",0 -"Such a handy tool, I recommend it!",1 -"Not worth the hype, very disappointing.",0 -I'm so glad I bought this!,1 -Will never purchase from here again.,0 -"Brilliant product, works perfectly!",1 -"Really bad experience, I regret it.",1 -"This is a lifesaver, I love it!",1 -"Very dissatisfied, it does not work as promised.",0 -"Fantastic results, I'm very pleased!",1 -"Absolutely terrible, I want my money back.",0 -"Excellent value, I would buy again!,1",1 -"Awful, it broke after one day.",0 -Thrilled with this purchase!,1 -"Not what I expected at all, I'm disappointed.,0",0 -Best thing I've bought this year!,1 -I will never buy this brand again.,0 -Such a wonderful addition to my life!,1 -"Terrible product, completely useless.",0 -Love this! It exceeded my expectations.,1 -Very unhappy with my purchase.,0 -"Great product, I use it daily",1 -Complete waste of money.,0 -"I'm so impressed, thank you!",1 -"Disappointed, it didn't live up to the hype",0 -This is everything I wanted,1 -Never buying from this company again.,0 -"Fantastic quality, highly recommend!",1 -"Really bad experience, never again.",0 -"Absolutely love it, will buy again!",1 -"Very disappointed, not worth it at all",0 -This is just perfect for me,1 -"Awful service, I'm very upset.",0 -"Great results, very satisfied!",1 -"I was misled, it's not what I expected.",0 -"Such a helpful product, I love it!",1 -"Very unhappy with this, it doesn't work.",0 -This is a must-have for anyone!,1 -"Completely unsatisfied, do not recommend.",0 -I'll definitely buy this again!,1 -"Very bad quality, I'm returning it.",0 -"Wonderful product, I'm very happy",1 -"Not worth the price, very disappointed",0 -"Exceptional product, I love it",1 -"Awful purchase, I regret it",0 -"Fantastic service, I will return",1 -"Very unsatisfied, it broke so fast",0 -This has been a game changer for me!,1 -"Total waste of money, very unhappy.",0 -Great experience from start to finish!,1 -"Very unhappy, I expected better.,0",0 -Absolutely perfect for my needs!,1 -"Will not buy this again, I'm let down.",0 -I would recommend this to anyone!,1 -"Very bad experience, don't buy this.",0 -Great product! Works like a charm.,1 -I'm really disappointed in this purchase.,0 -Highly recommend this to anyone looking!,1 -"Terrible, it broke right away.",0 -Super happy with my decision to buy this!,1 -Very disappointed with the quality.,0 - From 3e3009e852e6359cdf185e7168dfc651ef24e56a Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:08:33 +0530 Subject: [PATCH 06/23] Create predict.py --- models/Review_sentiments/predict.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 models/Review_sentiments/predict.py diff --git a/models/Review_sentiments/predict.py b/models/Review_sentiments/predict.py new file mode 100644 index 00000000..ecdbc552 --- /dev/null +++ b/models/Review_sentiments/predict.py @@ -0,0 +1,17 @@ +# models/tweet_sentiment_analysis/predict.py + +import joblib +import pandas as pd + +# Load the model and vectorizer +model = joblib.load('model.pkl') +vectorizer = joblib.load('vectorizer.pkl') + +def predict_sentiment(tweet): + # Transform the input tweet + tweet_vectorized = vectorizer.transform([tweet]) + + # Make prediction + prediction = model.predict(tweet_vectorized)[0] + + return "Positive" if prediction == 1 else "Negative" From 36aaf71563108a4654678dc9a42919005dee84c9 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:10:05 +0530 Subject: [PATCH 07/23] Create dataset.csv --- models/Review_sentiments/data/dataset.csv | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 models/Review_sentiments/data/dataset.csv diff --git a/models/Review_sentiments/data/dataset.csv b/models/Review_sentiments/data/dataset.csv new file mode 100644 index 00000000..e211145d --- /dev/null +++ b/models/Review_sentiments/data/dataset.csv @@ -0,0 +1,103 @@ + +"I love this product! It's fantastic.",1 +"This is the worst experience ever.",0 +"Absolutely fantastic service!",1 +"Not worth the money.",0 +"I'm so happy with my purchase!",1 +"Terrible customer support.",0 +"This is the best thing I've ever bought!",1 +"I hate this! So disappointing.",0 +"Highly recommend this to everyone!",1 +"Will never buy this again.",0 +"This has changed my life for the better.",1 +"Awful experience, I want a refund.",0 +"Great quality for the price.",1 +"Too good to be true, but it is!",1 +"Very unsatisfied with my order.",0 +"I am thrilled with my purchase!",1 +"Do not waste your money on this.",0 +"Such a wonderful experience!",1 +"Will not recommend to friends.",0 +"Perfect! Exactly what I wanted.",1 +"Terrible product, do not buy.",0 +"I couldn't be happier with my purchase!",1 +"The quality is amazing, highly recommend!",1 +"Very disappointed, it broke after one use.",0 +"Best purchase I’ve made all year!",1 +"Awful service, I will not be returning.",0 +"This is an absolute gem, I love it!",1 +"Not what I expected at all, very misleading.",0 +"Fantastic! I use it every day.",1 +"I had high hopes, but I'm let down.",0 +"Such a great value for the money!",1 +"Really poor quality, I'm returning it.",0 +"This makes my life so much easier!",1 +"I would give this 0 stars if I could.",0 +"I'm impressed with the quality!",1 +"Never again, I'm so upset with this purchase.",0 +"Great customer service experience!",1 +"Disappointing, did not meet expectations.",0 +"I'm absolutely in love with this!",1 +"Terrible experience, will not recommend.",0 +"Best decision I ever made!",1 +"Awful, I should have read the reviews first.",0 +"Such a handy tool, I recommend it!",1 +"Not worth the hype, very disappointing.",0 +"I'm so glad I bought this!",1 +"Will never purchase from here again.",0 +"Brilliant product, works perfectly!",1 +"Really bad experience, I regret it.",0 +"This is a lifesaver, I love it!",1 +"Very dissatisfied, it does not work as promised.",0 +"Fantastic results, I'm very pleased!",1 +"Absolutely terrible, I want my money back.",0 +"Excellent value, I would buy again!",1 +"Awful, it broke after one day.",0 +"Thrilled with this purchase!",1 +"Not what I expected at all, I'm disappointed.",0 +"Best thing I've bought this year!",1 +"I will never buy this brand again.",0 +"Such a wonderful addition to my life!",1 +"Terrible product, completely useless.",0 +"Love this! It exceeded my expectations.",1 +"Very unhappy with my purchase.",0 +"Great product, I use it daily!",1 +"Complete waste of money.",0 +"I'm so impressed, thank you!",1 +"Disappointed, it didn't live up to the hype.",0 +"This is everything I wanted!",1 +"Never buying from this company again.",0 +"Fantastic quality, highly recommend!",1 +"Really bad experience, never again.",0 +"Absolutely love it, will buy again!",1 +"Very disappointed, not worth it at all.",0 +"This is just perfect for me!",1 +"Awful service, I'm very upset.",0 +"Great results, very satisfied!",1 +"I was misled, it's not what I expected.",0 +"Such a helpful product, I love it!",1 +"Very unhappy with this, it doesn't work.",0 +"This is a must-have for anyone!",1 +"Completely unsatisfied, do not recommend.",0 +"I'll definitely buy this again!",1 +"Very bad quality, I'm returning it.",0 +"Wonderful product, I'm very happy!",1 +"Not worth the price, very disappointed.",0 +"Exceptional product, I love it!",1 +"Awful purchase, I regret it.",0 +"Fantastic service, I will return!",1 +"Very unsatisfied, it broke so fast.",0 +"This has been a game changer for me!",1 +"Total waste of money, very unhappy.",0 +"Great experience from start to finish!",1 +"Very unhappy, I expected better.",0 +"Absolutely perfect for my needs!",1 +"Will not buy this again, I'm let down.",0 +"I would recommend this to anyone!",1 +"Very bad experience, don't buy this.",0 +"Great product! Works like a charm.",1 +"I'm really disappointed in this purchase.",0 +"Highly recommend this to anyone looking!",1 +"Terrible, it broke right away.",0 +"Super happy with my decision to buy this!",1 +"Very disappointed with the quality.",0 From d463061bc3ae4036ab72f60b258f07723fde4eae Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:10:38 +0530 Subject: [PATCH 08/23] Update dataset.csv --- models/Review_sentiments/data/dataset.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/Review_sentiments/data/dataset.csv b/models/Review_sentiments/data/dataset.csv index e211145d..3eea33f1 100644 --- a/models/Review_sentiments/data/dataset.csv +++ b/models/Review_sentiments/data/dataset.csv @@ -1,4 +1,4 @@ - +text,sentiment "I love this product! It's fantastic.",1 "This is the worst experience ever.",0 "Absolutely fantastic service!",1 From 20b8aa0332570d433ec60f0c24350c12d63ced11 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:12:37 +0530 Subject: [PATCH 09/23] Create model.pkl --- models/Review_sentiments/saved_models/model.pkl | 1 + 1 file changed, 1 insertion(+) create mode 100644 models/Review_sentiments/saved_models/model.pkl diff --git a/models/Review_sentiments/saved_models/model.pkl b/models/Review_sentiments/saved_models/model.pkl new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/models/Review_sentiments/saved_models/model.pkl @@ -0,0 +1 @@ + From d25e45e7f285aae7b6ec85ac1145c009d62c2f25 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:14:16 +0530 Subject: [PATCH 10/23] Add files via upload --- .../Review_sentiments/saved_models/model (2).pkl | Bin 0 -> 2143 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 models/Review_sentiments/saved_models/model (2).pkl diff --git a/models/Review_sentiments/saved_models/model (2).pkl b/models/Review_sentiments/saved_models/model (2).pkl new file mode 100644 index 0000000000000000000000000000000000000000..d802953426597d9f6eb171c35766bac3e9f488cd GIT binary patch literal 2143 zcmaJ@eN+@x6yF6G5J{2BiVy-!@hHopRFvfl(al`XS|WbeG|LVlZmYoO4!U8U`qRZ#Hq0n)to*v@xhClrm4 zN{;0uYBq!amkbdsex-*t7G`IC0GGlDg(oL|5h|6+MI-##C9(~WrZ@DFlGlJrFKzcVNbxBeqX z@;~k@k}-`H1)bmrcn@|JU`Ep?tKXjv_KJ>du0O-&z? zY`J>lOpXN&9k=aGP&m=C#T~I*GONJX;-%A$1yloBLT3S^X#?NImHc^YW*v%I5+Cer z?gVyfT*X7H8xYlaLett`08)BtC3 zT>HL03#vE~ez@;xD@u)_4leAd1M<@zO#>&=zzRjVqSLVle7kYJBx-#VND)Wo=VG;J zWZ$8AGrY~HsOS6AZe=eDR=(F{SmQ*({*XTFL(`lVx1YE3tNFoG>QG)6fx`1FD5ury z$Njfk&_}Up(VGs}fZz`LP)giMRO$F}$iBTEoXy7T=Z`mowL!&2SNkpC7xly0h7AqC zF}M2pZM}71*%z?v^UOwY`#@07m9HAXCj-mV2IX5p>En+v4$O(dDpLaAJ!(gm!LpUT z@&PcGYmgt>Z$@FElS;6Aifz!2Rw(|p*!J@ur1GG_QAn04U?2UH{sAhNl0(QTunD#~` zDqbMoB`T~zWvPiF!zn%PdJNjyzF7VKDNr1jTfcm+73`NQ9YvWnfY!F3`&itEwnk5u zhcP!$QkC?HfuI&-l+CR7%B@DiJX~4PKb(H^G;)3)nAU%=69|3TdU*A<{;5{*;_^pA zN_Qf(m}#nx$ZUBq7X_RCJRe{M5it>oGV&A<>J`jx|AsECMN@sU=0#oa0_8D-9tTqE z(Txjb&uyO23GPy&qmdb>!MXEu!`h{Gcb$d#Dz$N+J?7s8vMSas^q*{X8e7zlGH^tUkYGvBHx>E3q@HJCSf$F|#1chCeoxv>=p^;>C zjv9QAzr6z0qQ!Pu`>Ua?=!Gf2`tOO&MRxkryH9ys1Pgw?Q{^c=i34_KvdyzeKpH*l7d8{)PJPkO}9v?}NMczmM>j+z0gNeGsc) jx6Lj+0d@onIR4n^X9LFHrmjx{P7*DBMmh_cRMNize8>Lm literal 0 HcmV?d00001 From c9e15b2b75bbe7850456fbaba852a5d149f67de7 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:15:14 +0530 Subject: [PATCH 11/23] Delete models/Review_sentiments/saved_models/model.pkl --- models/Review_sentiments/saved_models/model.pkl | 1 - 1 file changed, 1 deletion(-) delete mode 100644 models/Review_sentiments/saved_models/model.pkl diff --git a/models/Review_sentiments/saved_models/model.pkl b/models/Review_sentiments/saved_models/model.pkl deleted file mode 100644 index 8b137891..00000000 --- a/models/Review_sentiments/saved_models/model.pkl +++ /dev/null @@ -1 +0,0 @@ - From 8e8e06ea7793200df2354a05fbdf4dca170a2da2 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:15:33 +0530 Subject: [PATCH 12/23] Add files via upload --- .../saved_models/vectorizer.pkl | Bin 0 -> 6539 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 models/Review_sentiments/saved_models/vectorizer.pkl diff --git a/models/Review_sentiments/saved_models/vectorizer.pkl b/models/Review_sentiments/saved_models/vectorizer.pkl new file mode 100644 index 0000000000000000000000000000000000000000..4a779390997eddc23f381281b8f46593a932e247 GIT binary patch literal 6539 zcma)=O>i7X6@abTnf=pGBs<|J4mdwR?1Tu%IEhFMmZOB=C>FsO8HmEBXQpSTt@+FR zXtjnU4iHB&69Q!H@M~N-QUz26Zcs%P2cU{7ZaKgOE>sb?P+XzPyxHy7yKg9!&_T1) z-+SG!U%&46dM@af-_-UD{_+FKy2n`@%sZT=SSfMR~Zjl>V>fEzXCg?Yg!??)n zNg4|aM5oIiQHNO;XePx=(J_9f9^N;T>=**xpY3Fic(fHkD+iCjwZKPU=91 zb$FC=?w)*hun=d!j>LhU##X{T;NI%qw&mWw<=(NK&jiZ;4os_9zLx9IMW@L3oeQCJ zbADi4ClVH{eUZMr#vZ^XERf~e*JfMEi|KlOfBBI`r9|&{L|jWH`e}bU3h42 z@mCLAyEOUZ*5cuGwe{9BGm4|!+cSTA`0qE)s`l!8wO{1;{D1pFIkcl{AM)LvsE5y; z_3?ctdyu1ib-e03%HgxxFZNf}!*6_W% z3H4r;M?HL^->T!_J3dh!pXk4Zvwz(F*~yw3uPTpnI1a`?+Kn9b@QLG~9=78XIX*A{ zdQRr8*^W%#oedr*kh9@1zIXn<`6ESU=5vnN>0v3fpu4OT@O2al(1F|)sYV=&X%eX#SRNn zmZZXx_s_DH*h?e3wUm@*v7W7A+ZxGh- z!f<`$l1~$;F<%;PkoIQk#=`SB8vkWN^`1ywsdt4C%}4isfwVWHEVkUTMjS4TM`$DA z@rJMvZW5@&j>1k~CB(?0grf^D5!8eLjfDwS)o{G$2yOFCD6Rz5$jI*_9OmbFQu8t) zwIIX+839JX!A`033_&$BL;K%JfWf*<1X8C)&?MiqcvKeu3=KI#1R7AG+ZojF!}*;f zQ1`+OoY@&ldJxA_=Np97WA0=s`ky6i$`%RKqoIJ?1xCc}L_+Vm4ErqzX_mgWMtVmH z)s$9?wAY{(m1gP`K)o)(*9b65|D&HjNKi}oaHUBSW&0-xHd2=b>$215399wOOoFQf zG_4Gd@3QnC`u{zIHj)gy6{ADGM4;}2s#JTL5|^oETOy5dw5u*cd^#QQ`^J z*{2B6vPkx|P1<$0yfF>u^B5tTjmOUWNxRX5BN0_zBS;6&p~*ia#PH#y!i9Q@APw^7 zaD0ojH?jaOIdF{|!j}oGo4mYiN+uJsOh-CICEE8e(V8BG^yqB7gNPV#O;yL-_XyI@ zjn?o9LK<+eI1umB9EU*7M`O;C_O>q)xcm?9>%%F2j_?NGgf9UqbA5=wdby=lXn&J1 zBZ50VjwuMzOl+Sa?T`rJ^FuIlN=mR{hdjYmx|5*tdjM{uZxd3U9|=oE;s|Bv`-p^I zb}N1M0YWr}?M>3&gaZ)Vruthaw3db#vR@@Y?}i~BVaF&*;|yJLkq|h*aXsHbfNpZN zm1haj)ZY6#Y1e&b;~<}*qz|7Oqz8ULNs?KZZNErJs}}}v;V-MhVc5J*aGRM)=w&Ha zkt4Ax{cs^q620c&C>_-k_YkV7lle4hZ`<4vffyU@0O4@Vj)Lj}LHbzkyql2rz?5;# zdBTlu44=#7>_19T8m20FzC@4~!griO^=OjznyIR_X$ow0G94tK0eJ;VaSYLz!U#6? zC_-HVA>Trd!y_#utYwzPml&n$8woBCrga?hI|Q}l@uNEK5^Tg!0i(M%2+~WLd>9&VaGVLHqLNk9mAW<&5Enwb%3I3iX%XMvz5vu#lpK5~U72-Q8|;Qm=5q*amx z5-4t>PZC^%;#2l`f&kdV9LKtWk}gx{^@D^opp=DgkT}x22!x9hQ+3onf@+X2r4ipE z06u#{0zgN8o-o5_>*{P=B?w9hbuz3GQis43%D}q_10Sl3-IIhEFfaHrI@}uXCa4X! zBM9fQ-Mydi@;j;rHI`J)32dUWq&E`^;XDej?-Nvm@IN3t+MWi zdzUKG?=hHKs-NH>{ Date: Mon, 21 Oct 2024 21:18:19 +0530 Subject: [PATCH 13/23] Update predict.py --- models/Review_sentiments/predict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/Review_sentiments/predict.py b/models/Review_sentiments/predict.py index ecdbc552..f4132eb2 100644 --- a/models/Review_sentiments/predict.py +++ b/models/Review_sentiments/predict.py @@ -4,7 +4,7 @@ import pandas as pd # Load the model and vectorizer -model = joblib.load('model.pkl') +model = joblib.load('model (2).pkl') vectorizer = joblib.load('vectorizer.pkl') def predict_sentiment(tweet): From 7353cf983a1f2c8caf96bdc81ecaf59c768e93de Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:20:14 +0530 Subject: [PATCH 14/23] Create review_sentiments.json --- form_configs/review_sentiments.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 form_configs/review_sentiments.json diff --git a/form_configs/review_sentiments.json b/form_configs/review_sentiments.json new file mode 100644 index 00000000..8cd0bddc --- /dev/null +++ b/form_configs/review_sentiments.json @@ -0,0 +1,11 @@ +{ + "title": "Review Sentiments", + "fields": [ + { + "name": "Review", + "label": "Enter Review", + "type": "text", + "required": true + } + ] +} From 16251dbbef622768102e481b16faf23df861bae1 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:23:50 +0530 Subject: [PATCH 15/23] Update pages.json --- pages/pages.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pages/pages.json b/pages/pages.json index e52400f7..826164ef 100644 --- a/pages/pages.json +++ b/pages/pages.json @@ -150,6 +150,17 @@ "type": "model_details" } ] +}, + + { + "pages": [ + { + "name": "Review Sentiment", + "icon": "speech-bubble", + "path": "review_sentiment_calculator.py" + } + ] } + } From d0f8eaa7b4c8cb07416c8e360de997d485bebde4 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:24:47 +0530 Subject: [PATCH 16/23] Update pages.json --- pages/pages.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/pages.json b/pages/pages.json index 826164ef..d3f500b4 100644 --- a/pages/pages.json +++ b/pages/pages.json @@ -152,14 +152,14 @@ ] }, - { - "pages": [ - { - "name": "Review Sentiment", - "icon": "speech-bubble", - "path": "review_sentiment_calculator.py" - } - ] +{ + "pages": [ + { + "name": "Review Sentiment", + "icon": "speech-bubble", + "path": "review_sentiment_calculator.py" + } + ] } From 4a48bde397e91f2a687b31bb1821c5ded19f40a7 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:28:06 +0530 Subject: [PATCH 17/23] Create review_sentiment_calculator.py --- pages/review_sentiment_calculator.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/review_sentiment_calculator.py diff --git a/pages/review_sentiment_calculator.py b/pages/review_sentiment_calculator.py new file mode 100644 index 00000000..c4b5f036 --- /dev/null +++ b/pages/review_sentiment_calculator.py @@ -0,0 +1,20 @@ +import streamlit as st +import json +from models.Review_sentiments.predict import predict_sentiment + +# Load form configuration +with open("form_configs/review_sentiments.json", "r") as f: + form_config = json.load(f) + +st.title(form_config['title']) + +# Generate form based on config +input_data = {} +for field in form_config['fields']: + if field['type'] == 'text': + input_data[field['name']] = st.text_area(field['label'], height=100) + +# Submit button +if st.button("Predict"): + result = predict_sentiment(input_data['review']) + st.write(f"Prediction: {result}") From 2d758f20e153dbbc0c52e7254ef786c219b472f8 Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:29:05 +0530 Subject: [PATCH 18/23] Update review_sentiment_calculator.py --- pages/review_sentiment_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/review_sentiment_calculator.py b/pages/review_sentiment_calculator.py index c4b5f036..dc62886f 100644 --- a/pages/review_sentiment_calculator.py +++ b/pages/review_sentiment_calculator.py @@ -16,5 +16,5 @@ # Submit button if st.button("Predict"): - result = predict_sentiment(input_data['review']) + result = predict_sentiment(input_data['text']) st.write(f"Prediction: {result}") From 2f524564da0f454de38a988c6c3206c148d101ec Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:35:06 +0530 Subject: [PATCH 19/23] Update App.py --- App.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/App.py b/App.py index cc5ab1aa..c75223e8 100644 --- a/App.py +++ b/App.py @@ -119,4 +119,20 @@ """ Many struggle with summarizing large texts or learning from lengthy materials. This model simplifies the process, offering concise summaries that enhance understanding and speed up learning—perfect for students and professionals alike. """ - ) \ No newline at end of file + ) + +#Reviews Sentiments section +from pages.page_handler import handle_page + +# List of available pages +PAGES = { + "Reviews Sentiment": "pages/review_sentiment_calculator.py", + # Add more pages as needed +} + +# Sidebar for navigation +st.sidebar.title("Navigation") +selection = st.sidebar.radio("Go to", list(PAGES.keys())) + +# Handle page rendering +handle_page(PAGES[selection]) From 97b36bff4b5770bea69ccd37f6c888314e05895a Mon Sep 17 00:00:00 2001 From: Yash Bhatnagar <128145391+Yash-Bhatnagar-02@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:36:40 +0530 Subject: [PATCH 20/23] Update App.py --- App.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/App.py b/App.py index c75223e8..f4b9366a 100644 --- a/App.py +++ b/App.py @@ -124,15 +124,11 @@ #Reviews Sentiments section from pages.page_handler import handle_page -# List of available pages PAGES = { "Reviews Sentiment": "pages/review_sentiment_calculator.py", - # Add more pages as needed } -# Sidebar for navigation st.sidebar.title("Navigation") selection = st.sidebar.radio("Go to", list(PAGES.keys())) -# Handle page rendering handle_page(PAGES[selection]) From c787eb397d066bc59f8e6059d620fb87e838cab3 Mon Sep 17 00:00:00 2001 From: Yashasvini Sharma <100478608+yashasvini121@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:15:39 +0530 Subject: [PATCH 21/23] Update Review_Sentiments.py Page --- pages/Review_Sentiments.py | 25 +++++++++++++++++++++++++ pages/review_sentiment_calculator.py | 20 -------------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 pages/Review_Sentiments.py delete mode 100644 pages/review_sentiment_calculator.py diff --git a/pages/Review_Sentiments.py b/pages/Review_Sentiments.py new file mode 100644 index 00000000..df253ca6 --- /dev/null +++ b/pages/Review_Sentiments.py @@ -0,0 +1,25 @@ +import streamlit as st +import json +from models.review_sentiments.predict import predict_sentiment + +# Load form configuration +with open("form_configs/review_sentiments.json") as f: + form_config = json.load(f) + +st.title("Review Sentiments") + +# Generate form based on custom form config +input_data = { + field_data["field_name"]: st.text_area(field_name, height=100) + for field_name, field_data in form_config["Review Sentiments Form"].items() + if field_data["type"] == "text" +} + +# Submit button +if st.button("Predict"): + review = input_data.get("review", "").strip() + if review: + result = predict_sentiment(review) + st.write(f"Prediction: {result}") + else: + st.warning("Please enter a review before predicting.") diff --git a/pages/review_sentiment_calculator.py b/pages/review_sentiment_calculator.py deleted file mode 100644 index dc62886f..00000000 --- a/pages/review_sentiment_calculator.py +++ /dev/null @@ -1,20 +0,0 @@ -import streamlit as st -import json -from models.Review_sentiments.predict import predict_sentiment - -# Load form configuration -with open("form_configs/review_sentiments.json", "r") as f: - form_config = json.load(f) - -st.title(form_config['title']) - -# Generate form based on config -input_data = {} -for field in form_config['fields']: - if field['type'] == 'text': - input_data[field['name']] = st.text_area(field['label'], height=100) - -# Submit button -if st.button("Predict"): - result = predict_sentiment(input_data['text']) - st.write(f"Prediction: {result}") From d719f91f70dc523b768708a8cbc478873d431f17 Mon Sep 17 00:00:00 2001 From: Yashasvini Sharma <100478608+yashasvini121@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:17:22 +0530 Subject: [PATCH 22/23] Update review_sentiments.json --- form_configs/review_sentiments.json | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/form_configs/review_sentiments.json b/form_configs/review_sentiments.json index 8cd0bddc..03474436 100644 --- a/form_configs/review_sentiments.json +++ b/form_configs/review_sentiments.json @@ -1,11 +1,9 @@ { - "title": "Review Sentiments", - "fields": [ - { - "name": "Review", - "label": "Enter Review", - "type": "text", - "required": true - } - ] + "Review Sentiments Form": { + "Review": { + "field_name": "review", + "type": "text", + "required": true + } + } } From 7baf52c669d949bedb78d5499d407a0c5f9accbf Mon Sep 17 00:00:00 2001 From: Yashasvini Sharma <100478608+yashasvini121@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:25:03 +0530 Subject: [PATCH 23/23] Fix model path in predict.py --- models/Review_sentiments/predict.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/Review_sentiments/predict.py b/models/Review_sentiments/predict.py index f4132eb2..ec44cb23 100644 --- a/models/Review_sentiments/predict.py +++ b/models/Review_sentiments/predict.py @@ -1,11 +1,11 @@ -# models/tweet_sentiment_analysis/predict.py - import joblib import pandas as pd # Load the model and vectorizer -model = joblib.load('model (2).pkl') -vectorizer = joblib.load('vectorizer.pkl') +model = joblib.load("models/review_sentiments/saved_models/model (2).pkl") +vectorizer = joblib.load( + "models/review_sentiments/saved_models/vectorizer.pkl" +) def predict_sentiment(tweet): # Transform the input tweet