Is there a way to open an interactive text editor in streamlit or using streamlit components?

I am currently building a quick pipeline to fix transcribed data in Urdu, my local language. It is a transcription task where my data is in the cloud - I run an audio file and it’s transcript opens up after which I can fix it.
I want this to be done entirely in the browser - I currently use Jupyter/IPython Audio to show the audio clip and open a unicode editor to label it. Can streamlit help in someway that I could just simply do all this one browser window? Edit the text within a browser.

Hey @Moughees_Ahmed, welcome to the community!

Maybe you could try @okld’s https://github.com/Ghasel/streamlit-ace ? It has a plain text language, so you can put the transcript as the initial placeholder, edit it in the Ace editor and get back the text value inside Streamlit.

Yeah that works - how can I loop around multiple text files - for the placeholder?

If I recall correctly you can change the key argument (with the name of file for example) whenever you change the initial text to remount the component with the new placeholder. Then you could try adding a Streamlit button underneath the Ace editor to pass to the next file (and if needed pass the list of files and current file position in cache to remember it between sessions)

1 Like

Also need a way to run the audio - A.txt and A.wav for instance would be two things I would be working alongside.

st.audio should do the trick. You can then download audio files from somewhere or provide your own through a file uploader.

Amazing. Just need to figure out how to loop around files in that case.

1 Like

Good luck! Keep us informed :slight_smile: this app looks amazing!

SO I have been able to loop around and add audio but I am only lacking one functionality - I want to have button to go to the next file and save it.

How do I go about that?