Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,15 +42,16 @@ st.subheader('Amazon Sentiment Analysis using FineTuned :red[GPT-2] Pre-Trained
|
|
| 42 |
@st.cache_resource(experimental_allow_widgets=True)
|
| 43 |
def load_model():
|
| 44 |
sentiment_model = pipeline(model="ashok2216/gpt2-amazon-sentiment-classifier")
|
| 45 |
-
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'
|
| 46 |
-
url = st.text_input("Amazon product link", sample_url)
|
| 47 |
-
st.button("Re-run")
|
| 48 |
-
st.write("Done")
|
| 49 |
-
st.subheader('', divider='rainbow')
|
| 50 |
return sentiment_model
|
| 51 |
|
| 52 |
model = load_model()
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
try:
|
| 55 |
all_reviews = scrape_all_pages(url)
|
| 56 |
# Convert to DataFrame for further analysis
|
|
|
|
| 42 |
@st.cache_resource(experimental_allow_widgets=True)
|
| 43 |
def load_model():
|
| 44 |
sentiment_model = pipeline(model="ashok2216/gpt2-amazon-sentiment-classifier")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
return sentiment_model
|
| 46 |
|
| 47 |
model = load_model()
|
| 48 |
|
| 49 |
+
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'
|
| 50 |
+
url = st.text_input("Amazon product link", sample_url)
|
| 51 |
+
st.button("Re-run")
|
| 52 |
+
st.write("Done")
|
| 53 |
+
st.subheader('', divider='rainbow')
|
| 54 |
+
|
| 55 |
try:
|
| 56 |
all_reviews = scrape_all_pages(url)
|
| 57 |
# Convert to DataFrame for further analysis
|