Comments (3)
@lpdg-pgadkari you can create a map score to differentiate between a thumbs up press and a thumbs down press.
example:
def _submit_feedback(feedback, scores, user_input, answer, cache_db):
score = scores.get(feedback["score"])
if score is not None:
if score == 0:
# insert to negative db
elif score == 1:
# insert to positive db
score_mappings = {"๐": 1, "๐": 0}
feedback = streamlit_feedback(feedback_type="thumbs",
on_submit=_submit_feedback,
key=f"feedback_{i}",
optional_text_label="Please type the answer here if the given answer in not correct",
kwargs={
'scores': score_mappings,
'user_input': user_input,
'answer': answer,
'cache_db': conn
})
from streamlit-feedback.
A couple of solutions,
- The most likely one is to revise your data model. These values probably should be in the same table
- If you want two tables, parameterise your query to either write to
good_responses
orbad_responses
depending on the input
from streamlit-feedback.
Irrespective of whether I write to one table or two I should be able to differentiate between a thumbs up press and a thumbs down press. How do I do that?
For e.g. in the below code using streamlit, I can perform two different based on which button was pressed
st.button("๐", on_click=good_response, type='primary', key=f"thumbs_up_{i}", args=(conn, user_input, answer))
st.button("๐", on_click=bad_response, type='primary', key=f"thumbs_down_{i}", args=(conn, user_input, answer))
I want to save the good responses from the chatbot as it is and give a text field to let the user enter correct response in case the response form OpenAI was not good enough and save it in a table.
from streamlit-feedback.
Related Issues (20)
- Changing BG Color of the Streamlit Feedback Component? HOT 1
- Permanent None feedback HOT 2
- How can I set a default value for the thumbs in streamlit-feedback? HOT 1
- component_value in __init__.py is always None HOT 1
- Why do i have to login on Trubrics? HOT 3
- Is there any way to modify the one-line textbox to a multi-line text area? HOT 2
- Streamlit doesn't persist the feedback submission as highlighted thumbs up/thumbs down
- submit feedback on "Enter"
- Streamlit feedback component is not visible on iOS devices. HOT 1
- Thumb buttons aren't visible with streamlit==1.32.2 HOT 1
- streamlit_feedback disappears within expander HOT 3
- On submit is not working (it is not calling handle_feedback method) HOT 2
- Who is maintaining version 0.1.3? HOT 2
- The feedback gives "Your app is having trouble loading the streamlit_feedback.streamlit_feedback component." HOT 1
- The feedback gives "Your app is having trouble loading the streamlit_feedback.streamlit_feedback component." inconsistancy HOT 3
- When using submit button ! Streamlit chat bot is not showing success message HOT 1
- file_uploader return 400 after user submit feedback
- ๅ้ฆๆ้ฎๅจๅค็จๆท้ฎ็ญๆถ๏ผๅ้ฎ็ญๆ ๆณๆพ็คบๅ้ฆๆ้ฎๅนถๆฅ้ Bad 'setIn' index
- Release package contains built JavaScript code from previous versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamlit-feedback.