New Component: Streamlit Text Rating

Hello everyone,

We’re very excited to showcase our first custom streamlit component streamlit-text-rating, which enables us to rate the text content on a Streamlit App.

Installation


Using pip

PyPi Version

You can install using the pip package manager by running

pip install streamlit-text-rating

Alternatively, you could install the latest version directly from Github:

pip install https://github.com/TVS-Motor-Company/streamlit-text-rating/streamlit-text-rating/archive/master.zip

From source

Download the source code by cloning the repository or by pressing ‘Download ZIP’ on this page.

Install by navigating to the proper directory and running:

python setup.py install

Usage


from streamlit_text_rating.st_text_rater import st_text_rater
import streamlit as st
st.title("Awesome App")
for text in ["Is this text helpful?", "Do you like this text?"]:
    response = st_text_rater(text=text)
    # st.write(f"response --> {response}")

Output

Streamlit Text Rating

Thanks,
Naga and Asish

9 Likes

That looks like a really useful widget!

If you haven’t already, please add your component to the tracker to make it more discoverable by others :slight_smile:

Best,
Randy

3 Likes

Thanks a lot, @randyzwitch for the kind words, I add will this to the Streamlit Components - Community Tracker

This looks awesome :exploding_head: what a wonderful idea!

2 Likes

Hi @bnriiitb ,

Great work! Thank you for sharing this component.

Quick question, is it possible to assign a state (already in a :+1: or :-1: state rather than in a Null state by default)?

Thanks.
Avra

@bnriiitb Thanks.
Can we save the option good or bad that user choose?
Is it save the result into database?

Yes, it is possible but we consciously made it null not bias with any default value

Yeah, we have can persist it into the database, in fact, built a component to do the same. We will publish it shortly.