Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def run():
|
|
| 31 |
st.write("# Restaurant review analysis")
|
| 32 |
start_year = st.sidebar.slider('Year', 2016, 2023, 2017)
|
| 33 |
smooth = st.sidebar.selectbox('Rolling window', [7, 14, 30, 60, 90], index=2)
|
| 34 |
-
reviews = pd.read_pickle('reviews')
|
| 35 |
trend = pd.DataFrame(
|
| 36 |
{'sentiment': (reviews.groupby('period')['s'].sum().rolling(smooth).sum()/reviews.groupby('period')['s'].count().rolling(30).sum()),
|
| 37 |
'emotion': (reviews.groupby('period')['s'].count().rolling(smooth).sum()/reviews.groupby('period')['starRating'].count().rolling(30).sum()),
|
|
@@ -50,7 +50,7 @@ def run():
|
|
| 50 |
)
|
| 51 |
st.write(trend)
|
| 52 |
|
| 53 |
-
absa = pd.read_pickle('stats')
|
| 54 |
cols = st.sidebar.multiselect('customer view point', options=['food', 'service', 'atmosphere', 'staff', 'dish', 'price', 'restaurant', 'owner', 'cuisine', 'rice', 'drinks'], default=['food', 'service', 'price'])
|
| 55 |
|
| 56 |
|
|
|
|
| 31 |
st.write("# Restaurant review analysis")
|
| 32 |
start_year = st.sidebar.slider('Year', 2016, 2023, 2017)
|
| 33 |
smooth = st.sidebar.selectbox('Rolling window', [7, 14, 30, 60, 90], index=2)
|
| 34 |
+
reviews = pd.read_pickle('reviews.bin')
|
| 35 |
trend = pd.DataFrame(
|
| 36 |
{'sentiment': (reviews.groupby('period')['s'].sum().rolling(smooth).sum()/reviews.groupby('period')['s'].count().rolling(30).sum()),
|
| 37 |
'emotion': (reviews.groupby('period')['s'].count().rolling(smooth).sum()/reviews.groupby('period')['starRating'].count().rolling(30).sum()),
|
|
|
|
| 50 |
)
|
| 51 |
st.write(trend)
|
| 52 |
|
| 53 |
+
absa = pd.read_pickle('stats.bin')
|
| 54 |
cols = st.sidebar.multiselect('customer view point', options=['food', 'service', 'atmosphere', 'staff', 'dish', 'price', 'restaurant', 'owner', 'cuisine', 'rice', 'drinks'], default=['food', 'service', 'price'])
|
| 55 |
|
| 56 |
|