Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,9 @@ from data_cleaning import preprocess
|
|
| 5 |
from transformers import pipeline
|
| 6 |
from data_integration import scrape_all_pages
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
# Example usage:-
|
| 11 |
sample_url = 'https://www.amazon.in/Dell-Inspiron-i7-1255U-Processor-Platinum/product-reviews/B0C9F142V6/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&reviewerType=all_reviews'
|
| 12 |
url = st.text_input("Amazon product link", sample_url)
|
|
@@ -17,7 +18,7 @@ all_reviews = scrape_all_pages(url)
|
|
| 17 |
reviews = pd.DataFrame(all_reviews)
|
| 18 |
reviews['processed_text'] = reviews['content'].apply(preprocess)
|
| 19 |
|
| 20 |
-
st.dataframe(reviews, use_container_width=True)
|
| 21 |
# st.markdown(sentiment_model(['It is Super!']))
|
| 22 |
|
| 23 |
sentiments = []
|
|
@@ -29,6 +30,6 @@ for text in reviews['processed_text']:
|
|
| 29 |
sentiments.append(output)
|
| 30 |
|
| 31 |
reviews['sentiments'] = sentiments
|
| 32 |
-
|
| 33 |
st.dataframe(reviews, use_container_width=True)
|
| 34 |
# sns.countplot(reviews['sentiments'])
|
|
|
|
| 5 |
from transformers import pipeline
|
| 6 |
from data_integration import scrape_all_pages
|
| 7 |
|
| 8 |
+
st.title('Amazon Sentiment Analysis using FineTuned :blue[GPT-2] Pre-Trained Model :robot:')
|
| 9 |
|
| 10 |
+
sentiment_model = pipeline(model="ashok2216/gpt2-amazon-sentiment-classifier")
|
| 11 |
# Example usage:-
|
| 12 |
sample_url = 'https://www.amazon.in/Dell-Inspiron-i7-1255U-Processor-Platinum/product-reviews/B0C9F142V6/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&reviewerType=all_reviews'
|
| 13 |
url = st.text_input("Amazon product link", sample_url)
|
|
|
|
| 18 |
reviews = pd.DataFrame(all_reviews)
|
| 19 |
reviews['processed_text'] = reviews['content'].apply(preprocess)
|
| 20 |
|
| 21 |
+
# st.dataframe(reviews, use_container_width=True)
|
| 22 |
# st.markdown(sentiment_model(['It is Super!']))
|
| 23 |
|
| 24 |
sentiments = []
|
|
|
|
| 30 |
sentiments.append(output)
|
| 31 |
|
| 32 |
reviews['sentiments'] = sentiments
|
| 33 |
+
st.title(':rainbow[Output]')
|
| 34 |
st.dataframe(reviews, use_container_width=True)
|
| 35 |
# sns.countplot(reviews['sentiments'])
|