tweetpie commited on
Commit
8335a53
·
verified ·
1 Parent(s): 60eb43f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -2
app.py CHANGED
@@ -1,4 +1,42 @@
1
  import streamlit as st
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
+ # Set up the page layout and title
4
+ st.title("Entity and Aspect Analyzer")
5
+
6
+ # Sidebar for model selection
7
+ model_selection = st.sidebar.selectbox(
8
+ "Select a model",
9
+ options=['alm', 'blm'],
10
+ index=0 # Default selection
11
+ )
12
+
13
+ # Set up two columns for inputs
14
+ col1, col2 = st.columns(2)
15
+
16
+ with col1:
17
+ st.header("Entities")
18
+ # Free-text inputs for entities
19
+ pro_entities = st.text_input("Pro Entities", help="Enter pro entities separated by commas")
20
+ anti_entities = st.text_input("Anti Entities", help="Enter anti entities separated by commas")
21
+ neutral_entities = st.text_input("Neutral Entities", help="Enter neutral entities separated by commas")
22
+
23
+ with col2:
24
+ st.header("Aspects")
25
+ # Free-text inputs for aspects
26
+ pro_aspects = st.text_input("Pro Aspects", help="Enter pro aspects separated by commas")
27
+ anti_aspects = st.text_input("Anti Aspects", help="Enter anti aspects separated by commas")
28
+ neutral_aspects = st.text_input("Neutral Aspects", help="Enter neutral aspects separated by commas")
29
+
30
+ # Generate button
31
+ generate_button = st.button("Generate")
32
+
33
+ if generate_button:
34
+ # Here, you can process the inputs or call a model based on the selected 'alm' or 'blm' option
35
+ # For demonstration, we're just displaying the inputs
36
+ st.write(f"Model Selected: {model_selection}")
37
+ st.write(f"Pro Entities: {pro_entities}")
38
+ st.write(f"Anti Entities: {anti_entities}")
39
+ st.write(f"Neutral Entities: {neutral_entities}")
40
+ st.write(f"Pro Aspects: {pro_aspects}")
41
+ st.write(f"Anti Aspects: {anti_aspects}")
42
+ st.write(f"Neutral Aspects: {neutral_aspects}")