how can i make my bot to ask feedback from user

Chebolu Sai Manasa 125 Reputation points
2024-02-27T09:47:31.1033333+00:00

i have a chat application that uses azure ai search and azure openai gpt 3.5 so i want my bot to take feedback(like and dislike to each response) from user so that it can learn from feedback. how can i achieve this

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
942 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,894 questions
0 comments No comments
{count} votes

Accepted answer
  1. YutongTie-MSFT 50,811 Reputation points
    2024-03-06T00:09:39.3333333+00:00

    @Chebolu Sai Manasa

    Thanks for reaching out to us, you can store the feedback and use it to fine-tune the model or retrain the model as below steps -

    Reference document for fine-tuning is here - https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/fine-tuning?tabs=turbo%2Cpython&pivots=rest-api

    Here's a basic outline of how you might go about it:

    1. Create the Feedback Mechanism: This might be as simple as having buttons for 'Like' and 'Dislike' that appear after your bot provides a response. Alternatively, you could have your bot directly ask the user for feedback after certain interactions.
    2. Store the Feedback: You'll need to store the feedback you receive in some way. This could be in a database or other storage system. You will want to store both the feedback itself (like or dislike) and the context it was given in (the conversation that led up to it).
    3. Analyze the Feedback: Once you have collected feedback, you can analyze it to understand what users are finding helpful and what they are not. This could involve looking for patterns in the feedback or using machine learning techniques to create a model of what users like and dislike.
    4. Use the Feedback to Train Your Model: You can use the feedback you've collected and analyzed to improve your bot. This might involve retraining your model on new data that includes the feedback, or it might involve making changes to your bot's conversation flow based on what you've learned. Here is a simple example:
    def handle_message(message):  
        bot_response = generate_bot_response(message)  
        show_bot_response(bot_response)  
        show_feedback_request()  
      
    def show_feedback_request():  
        print("Was this response helpful?")  
        print("[1] Yes")  
        print("[2] No")  
      
    def handle_feedback(feedback):  
        if feedback == '1':  
            store_feedback("positive")  
        elif feedback == '2':  
            store_feedback("negative")  
    

    In this example, after each bot response, the user is asked for feedback. Their feedback is then stored for later analysis. Remember, while Azure AI Search and OpenAI GPT-3.5 can generate responses based on input, they can't learn directly from feedback in real-time. You will need to collect this feedback and use it to retrain or refine your models over time.

    Also, while OpenAI's models can generate text based on inputs, they can't be directly trained on new data by end-users. For that kind of functionality, you'd need to use a different kind of model or service that allows for custom training.

    Regards,

    Yutong

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Chebolu Sai Manasa 125 Reputation points
    2024-03-06T04:02:47.9933333+00:00

    i have done 3 steps but i don't know how to do the 4th step because OpenAI GPT-3.5 can't learn directly from feedback in real-time.then how i retrain model based on feedback?or which custom model i should use for my case.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.