Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,23 +37,30 @@ group_dict = {
|
|
37 |
28: 'Small-scale farmers',
|
38 |
29: 'Other'}
|
39 |
|
40 |
-
#
|
41 |
-
|
|
|
42 |
# return group_dict[preds]
|
43 |
|
44 |
-
|
45 |
# App
|
46 |
st.title("Identify references to vulnerable groups.")
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
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)
|