Aan de slagGa gratis aan de slag

Customer support ticket analysis

The customer support team receive tickets through various channels, such as email, chat, and social media. The company wants to automatically extract key entities to categorize and prioritize the tickets appropriately. Your job is to craft a few-shot prompt that helps them achieve that.

You have three sample tickets (ticket_1, ticket_2, and ticket_3) and their corresponding entities (entities_1, entities_2, and entities_3) to inform the model on what to look for and how to display it. You need the model to extract entities from the new ticket_4 string.

The OpenAI package, the ticket_4 string, and the get_response() function have been pre-loaded for you, as well as the ticket and entity variables previously mentioned.

Deze oefening maakt deel uit van de cursus

Prompt Engineering with the OpenAI API

Cursus bekijken

Oefeninstructies

  • Craft a few-shot prompt that uses three tickets and corresponding entities, to extract entities from the new ticket ticket_4.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

client = OpenAI(api_key="")

# Craft a few-shot prompt to get the ticket's entities
prompt = ____

response = get_response(prompt)

print("Ticket: \n", ticket_4)
print("Entities: \n", response)
Code bewerken en uitvoeren