anonymise_this / app.py
EC2 Default User
first
e387f6f
raw
history blame
742 Bytes
import streamlit as st
import logging
# Render Streamlit page
st.title("Anonymise your text!")
st.markdown(
"This mini-app anonymises text using Bert. You can find the code on [GitHub(WIP)](#)"
)
# Configure logger
logging.basicConfig(format="\n%(asctime)s\n%(message)s", level=logging.INFO, force=True)
def anonymise_text(text: str, metadata: str = "", white_listed_words: str = ""):
st.session_state.text_anon = "this is anonymised"
if "text" not in st.session_state:
st.session_state.text = ""
if "text_error" not in st.session_state:
st.session_state.text_error = ""
if "text_anon" not in st.session_state:
st.session_state.text_anon = ""
if "n_requests" not in st.session_state:
st.session_state.n_requests = 0