3 ms·
I think where this thing could help is designing a chatbot system. please list a bunch of weird scenarios a ticket booth chatbot system might encounter and how
by sharemywin 4y ago
I think where this thing could help is designing a chatbot system.
please list a bunch of weird scenarios a ticket booth chatbot system might encounter and how it should recover
A customer asking for a refund for a ticket they lost: The chatbot should direct the customer to contact the company's customer service department for assistance with their refund request.
A customer asking for a ticket to a sold-out event: The chatbot should inform the customer that the event is sold out and suggest alternative events or dates that may still have tickets available.
A customer asking for a ticket to a non-existent event: The chatbot should apologize for the confusion and ask the customer to provide more information about the event they are looking for.
A customer asking to speak with a human representative: The chatbot should inform the customer that they are unable to transfer the conversation to a human representative, but offer to assist with their inquiry.
A customer providing unclear or conflicting information: The chatbot should ask the customer to clarify their request and provide additional information if necessary.
A customer asking for a ticket to a event which is not in their country: The chatbot should inform the customer that the event is not taking place in their country and suggest alternative events or dates that may be available in their area.
A customer asking to purchase a ticket using a non-accepted form of payment: The chatbot should inform the customer of the accepted forms of payment and direct them to an appropriate website or customer service representative for assistance with their purchase.
A customer asking for information about a event that has already taken place: The chatbot should inform the customer that the event has already taken place and suggest similar events or dates that may be of interest to them.
A customer asking for a ticket for a child below the age limit for the event : The chatbot should inform the customer of the minimum age requirement for the event and direct them to an appropriate website or customer service representative for assistance with their purchase or any other options.
- sharemywin 4y agowrite a function in python using nlp and/or string matching to handle these situations and return a string based intent variable Here is an example function in Python that uses natural language processing (NLP) and string matching to handle the scenarios you provided and return a string-based intent variable: python Copy code import re from nltk import word_tokenize from nltk.stem import PorterStemmer from sklearn.feature_extraction.text import TfidfVectorizer def get_intent(message): # List of keywords for each intent refund_keywords = ['refund', 'lost', 'ticket'] soldout_keywords = ['sold out', 'no tickets', 'soldout'] nonexistent_keywords = ['non-existent', 'fake', 'nonexistent'] human_keywords = ['human', 'representative', 'speak'] unclear_keywords = ['unclear', 'confusing', 'conflict'] country_keywords = ['country', 'abroad'] payment_keywords = ['payment', 'form', 'credit'] past_keywords = ['past', 'over', 'finished'] age_keywords = ['child', 'age', 'limit'] # Create a stemmer stemmer = PorterStemmer() # Stem each keyword refund_keywords = [stemmer.stem(word) for word in refund_keywords] soldout_keywords = [stemmer.stem(word) for word in soldout_keywords] nonexistent_keywords = [stemmer.stem(word) for word in nonexistent_keywords] human_keywords = [stemmer.stem(word) for word in human_keywords] unclear_keywords = [stemmer.stem(word) for word in unclear_keywords] country_keywords = [stemmer.stem(word) for word in country_keywords] payment_keywords = [stemmer.stem(word) for word in payment_keywords] past_keywords = [stemmer.stem(word) for word in past_keywords] age_keywords = [stemmer.stem(word) for word in age_keywords] # Create a list of all keywords all_keywords = refund_keywords + soldout_keywords + nonexistent_keywords + human_keywords + unclear_keywords + country_keywords + payment_keywords + past_keywords + age_keywords # Tokenize the message and stem each word message_tokens = [stemmer.stem(word) for word in word_tokenize(message)] # Create a Tf-idf vectorizer and fit it to the message tfidf = TfidfVectorizer(vocabulary=all_keywords) message_tfidf = tfidf.fit_transform([message]) # Get the index of the highest-scoring keyword highest_scoring_index = message_tfidf.argmax() # Use the index to determine the intent if highest_scoring_index < len(refund_keywords): intent = "refund" elif highest_scoring_index < len(refund_keywords) + len(soldout_keywords): intent = "soldout" elif highest_scoring_index < len(refund_keywords) + len(soldout_key
- sharemywin 4y agoHandling conflicts in intent can be challenging, but there are several approaches you can take to resolve them. Here are a few: Prioritize certain intents over others: Depending on the context of your chatbot system, some intents may be more important than others. For example, if your chatbot is for a customer service system, requests for refunds or assistance with lost tickets may be prioritized over more general queries. Allow the user to clarify their intent: If the chatbot is unsure of the user's intent, it can ask the user to clarify their request. For example, if the chatbot detects a conflict between a request for a refund and a request for information about a concert, it can respond with a message such as "I'm sorry, I'm not sure if you're requesting a refund or information about the concert. Could you please clarify what you need help with?" Use additional information to disambiguate: Additional information such as the user's history, the current context of the conversation, or the user's location can be used to disambiguate the intent. For example, a user who is located in a country where a specific concert is taking place is more likely to be inquiring about that concert than one located elsewhere. Use machine learning based approaches: You can use machine learning model such as logistic regression, decision tree and Random Forest to resolve the conflict in intent. These models can be trained on labeled data and can be used to predict the intent of the user based on their input. Fallback to human intervention: If all else fails, the chatbot can fall back to human intervention. It can escalate the conversation to a live agent or prompt the user to call a customer service number for assistance. Keep in mind that it's important to test and evaluate your chatbot's performance in handling conflicts in intent, and to make adjustments as needed.
- potatolicious 4y agoThis is (basically) how voice assistants are structured today, and the results are... lacking. The core issue here is that you're still modeling this like a RPG conversation tree - which is inherently limiting. You can use AI to help beef up the breadth of possible scenarios supported, but ultimately it's still a conversation tree. Take two very plausible real-life conversations that can be had. We'll start with one that's a bit more mechanical and domain-limited: A: "Can I get two tickets to the 8:30 showing of Avatar?" B: "I'm sorry, but that showing is fully sold out. Would you like the 9:30 showing?" A: "No that's too late, what else is showing around that time?" B: "There is a showing of M3gan that starts at 8:40, is that ok?" A: "Yeah, I'll have two tickets for that." So in this case the customer went off-script. Your chatbot may be designed to predict intent and walk through a script - a well-edited and wide script, but the user can walk off the script at any time - in this case making a wholly separate query unrelated to the original ticket purchase. Importantly also that the results of the query are then used to re-contextualize the original intent. This is a very normal conversation that practically no humans would have trouble with - but in a conversation tree-type model breaks very badly. Now let's take it up another level: A: "Can I get two tickets to the 8:30 showing of Avatar?" B: "I'm sorry, but that showing is fully sold out. Would you like the 9:30 showing?" A: "No that's too late, what else is showing around that time?" B: "There is a showing of M3gan that starts at 8:40, is that ok?" A: "I need something kid-friendly unfortunately. What do you have on that front?" B: "Puss in Boots would be good if your kid like animated movies, there's a showing a little before, at 8:20. Is that ok?" A: "Yes, two tickets please." So in this case the user is expecting some type of situational intelligence that merges two areas (ticket buying, movie information and recommendations) and where references to each area must flow smoothly back and forth and inform each other. This level of dynamism is practically impossible to model using conversation tree-type approaches (even AI-assisted conversation trees, which have wider coverage but the same rigid structure). This is a good example of where current approaches to the problem space produce very rigid, mechanical conversation agents that require the user to have deep knowledge of the (expected) conversation structure, which inhibits discovery of new capabilities and also is intimidating for novices who have not yet internalized the expected scripts.