leavoigt commited on
Commit
77a6d9d
1 Parent(s): 1034f64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -37,23 +37,30 @@ group_dict = {
37
  28: 'Small-scale farmers',
38
  29: 'Other'}
39
 
40
- #def predict(text):
41
- # preds = model([text])[0].item()
 
42
  # return group_dict[preds]
43
 
44
-
45
  # App
46
  st.title("Identify references to vulnerable groups.")
47
- st.write("This app allows you to identify whether a text contains any references to vulnerable groups. This can, for example, be used to analyse policy documents.")
 
 
 
 
 
48
 
49
  #col1, col2 = st.columns(2)
50
 
51
  # Create text input box
52
- st.text_area(label='Please enter your text here', height=350)
 
 
53
 
54
  # Create the output box
55
  #output=""
56
- st.text_area(label="Prediction:", height=350)
57
 
58
  # Make predictions
59
  #preds = model(input_text)
 
37
  28: 'Small-scale farmers',
38
  29: 'Other'}
39
 
40
+ # Define prediction function
41
+ def predict(text):
42
+ preds = model([text])[0].item()
43
  # return group_dict[preds]
44
 
 
45
  # App
46
  st.title("Identify references to vulnerable groups.")
47
+
48
+ st.write("""Vulnerable groups encompass various communities and individuals who are disproportionately affected by the impacts of climate change
49
+ due to their socioeconomic status, geographical location, or inherent characteristics. By incorporating the needs and perspectives of these groups
50
+ into national climate policies, governments can ensure equitable outcomes, promote social justice, and strive to build resilience within the most marginalized populations,
51
+ fostering a more sustainable and inclusive society as we navigate the challenges posed by climate change.This app allows you to identify whether a text contains any
52
+ references to vulnerable groups, for example when talking about policy documents.""")
53
 
54
  #col1, col2 = st.columns(2)
55
 
56
  # Create text input box
57
+ input_text = st.text_area(label='Please enter your text here', height=350, value="Example")
58
+
59
+ st.write('Prediction:', run_sentiment_analysis(txt))
60
 
61
  # Create the output box
62
  #output=""
63
+ #st.text_area(label="Prediction:", height=350)
64
 
65
  # Make predictions
66
  #preds = model(input_text)