Hello. Is there a way to clear a “text_input”?
I created a “Question-Answering” App (this consists of loading a “context” and asking a question, an already trained HuggingFace model returns one or more answers). In my App the context (which is a document) is chosen with a “selectbox” and the question is defined in a “text_input”, after pressing “Enter” a “st.form” is executed showing several answers, each one accompanied of a “checkbox” so that the user can validate the result and update a dataset internally (which will help in the future to create a better model to our specific area). Validation is registered when clicking on “st.form_submit_button”.
I would like that after clicking on “st.form_submit_button” the “text_input” can be cleared for a new query. I tried to achieve that with various approaches but was unsuccessful. I tried putting a “key” to the “text_input” so that its value is modified to empty ("") when the button “st.form_submit_button” was executed with a “callback”, this “callback” would modify the “key” of “text_input” to: “”, but it doesn’t work. I tried also using “st.empty” it also doesn’t work correctly, clean once and not clean the next and so on.
I would appreciate any suggestions. Thank you.