camivasz commited on
Commit
d6e88b4
1 Parent(s): 7cbb868

add header image

Browse files
Files changed (2) hide show
  1. app.py +5 -5
  2. electronic.png +0 -0
app.py CHANGED
@@ -6,6 +6,7 @@ import pandas as pd
6
  import faiss
7
  import hdbscan
8
  from sklearn.feature_extraction.text import CountVectorizer
 
9
 
10
  from src.modelling.topics.topic_extractor import (
11
  TopicExtractionConfig, TopicExtractor
@@ -28,6 +29,8 @@ def get_prompt_without_reviews(title):
28
  return f"""We are doing a marketing research analysis, in particular we are trying to understand what users thing about a particular market in order to generate tips for future sellers.
29
  In particular, we are interesting to analyze the market for "{title}"
30
 
 
 
31
  Can you write some recomendations about how can we disrupt this market? Try to propose the necesary methodology to create a breaking product."""
32
 
33
 
@@ -64,19 +67,15 @@ This doesn't mean you make a mistake, I search amazon products and try to extrac
64
 
65
  TEST_MODE = False
66
 
67
-
68
  def setup_palm():
69
  palm.configure(api_key=os.environ.get('PALM_TOKEN'))
70
 
71
-
72
  @st.cache_data
73
  def load_data():
74
  reviews = pd.read_csv("data/filtered_reviews.csv").set_index("reviewID")
75
  products = pd.read_csv("data/products.csv")
76
-
77
  return reviews, products
78
 
79
-
80
  def load_uncached_models():
81
  topic_extraction_config = TopicExtractionConfig(
82
  vectorizer_model=CountVectorizer(
@@ -166,6 +165,8 @@ def render_search():
166
  Render the search form in the sidebar.
167
  """
168
  with st.sidebar:
 
 
169
  query = st.text_input(
170
  label="What kind of product are you trying to sell?",
171
  placeholder="Your magic idea goes here ✨",
@@ -197,7 +198,6 @@ def render_search():
197
 
198
 
199
  def render_palm_results():
200
- # TODO: temporal
201
  st.write("# ALMond recommendations")
202
  st.write(st.session_state.palm_output)
203
 
 
6
  import faiss
7
  import hdbscan
8
  from sklearn.feature_extraction.text import CountVectorizer
9
+ from PIL import image
10
 
11
  from src.modelling.topics.topic_extractor import (
12
  TopicExtractionConfig, TopicExtractor
 
29
  return f"""We are doing a marketing research analysis, in particular we are trying to understand what users thing about a particular market in order to generate tips for future sellers.
30
  In particular, we are interesting to analyze the market for "{title}"
31
 
32
+ Take into account what customers are saying in the internet about these products. How are their reviews? How is the distribution of the product? What characteristics do they value the most?
33
+
34
  Can you write some recomendations about how can we disrupt this market? Try to propose the necesary methodology to create a breaking product."""
35
 
36
 
 
67
 
68
  TEST_MODE = False
69
 
 
70
  def setup_palm():
71
  palm.configure(api_key=os.environ.get('PALM_TOKEN'))
72
 
 
73
  @st.cache_data
74
  def load_data():
75
  reviews = pd.read_csv("data/filtered_reviews.csv").set_index("reviewID")
76
  products = pd.read_csv("data/products.csv")
 
77
  return reviews, products
78
 
 
79
  def load_uncached_models():
80
  topic_extraction_config = TopicExtractionConfig(
81
  vectorizer_model=CountVectorizer(
 
165
  Render the search form in the sidebar.
166
  """
167
  with st.sidebar:
168
+ image = Image.open('electronic.png')
169
+ st.image(image)
170
  query = st.text_input(
171
  label="What kind of product are you trying to sell?",
172
  placeholder="Your magic idea goes here ✨",
 
198
 
199
 
200
  def render_palm_results():
 
201
  st.write("# ALMond recommendations")
202
  st.write(st.session_state.palm_output)
203
 
electronic.png ADDED