Spaces:
Runtime error
Runtime error
Adding plotly plot
Browse files
app.py
CHANGED
@@ -29,20 +29,6 @@ title = "HanmunRoBERTa Century Classifier"
|
|
29 |
st.set_page_config(page_title=title, page_icon="π")
|
30 |
st.title(title)
|
31 |
|
32 |
-
# Checkbox to remove punctuation
|
33 |
-
remove_punct = st.checkbox(label="Remove punctuation", value=True)
|
34 |
-
|
35 |
-
# Text area for user input
|
36 |
-
input_str = st.text_area("Input text", height=275)
|
37 |
-
|
38 |
-
# Remove punctuation if checkbox is selected
|
39 |
-
if remove_punct and input_str:
|
40 |
-
# Specify the characters to remove
|
41 |
-
characters_to_remove = "ββ‘()γγ:\"γΒ·, ?γ" + punctuation
|
42 |
-
translating = str.maketrans('', '', characters_to_remove)
|
43 |
-
input_str = input_str.translate(translating)
|
44 |
-
|
45 |
-
|
46 |
# Create a two-column layout
|
47 |
col1, col2 = st.columns([2, 3]) # Adjust the width ratio as needed
|
48 |
|
@@ -60,8 +46,8 @@ with col1:
|
|
60 |
translating = str.maketrans('', '', characters_to_remove)
|
61 |
input_str = input_str.translate(translating)
|
62 |
|
63 |
-
|
64 |
-
|
65 |
|
66 |
# Button for prediction
|
67 |
classify_button = st.button("Classify")
|
|
|
29 |
st.set_page_config(page_title=title, page_icon="π")
|
30 |
st.title(title)
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# Create a two-column layout
|
33 |
col1, col2 = st.columns([2, 3]) # Adjust the width ratio as needed
|
34 |
|
|
|
46 |
translating = str.maketrans('', '', characters_to_remove)
|
47 |
input_str = input_str.translate(translating)
|
48 |
|
49 |
+
# Display the input text after processing
|
50 |
+
st.write("Processed input:", input_str)
|
51 |
|
52 |
# Button for prediction
|
53 |
classify_button = st.button("Classify")
|