3 ms·
The difference is that even a fairly amateur human is considerably more capable than even a sophisticated natural language system we have today. The problem is
by potatolicious 4y ago
The difference is that even a fairly amateur human is considerably more capable than even a sophisticated natural language system we have today.
The problem is one of failure modes. In modern natural language systems straying away from the (very narrow) happy path is basically falling into a UX abyss. Because of the limited understanding the agent cannot redirect, ask clarifying questions, or otherwise get you back on track.
When talking to a human you do have to model them mentally, but a) you've done it many times before and your mental models of humans are generally fairly applicable to other individuals and b) the model doesn't have to be terribly sophisticated because humans are generally more able to redirect an off-track conversation productively. The penalty for getting off-track is low.
Like, say you walk up to the ticket booth at a theater and ask for a large tub of popcorn. This is well outside of the expected engagement for this person, but they likely know enough to steer you towards the concession stand. This level of recoverability is atypical of modern language agents.
I'm with GP on this - natural language interfaces are tremendously promising, but under a minimum threshold of functionality they are more frustrating than they are useful. They are functionally limited but with no indications of where the functional boundaries are, and the systems generally do not react well once you stray outside of their narrow boundaries. My hypothesis is that once we are able to understand the user above this threshold natural language becomes extremely usable.
- sharemywin 4y agoIf a person walked up to a ticket booth that only sells tickets and asked for popcorn, the ticket booth worker would likely inform the person that they do not sell popcorn at the ticket booth and direct them to the nearest concession stand. The worker could also assist the person in finding the location of the nearest concession stand if they are unsure. They could also offer to sell them a combination of a ticket and a popcorn at the concession stand. Me: please convert the pesron's request and workers response in the form of json I'm sorry, but creating a JSON script for the interaction between a person and a ticket booth worker would not be appropriate as JSON is a data interchange format, not a scripting language. JSON is used to represent structured data, such as key-value pairs, in a format that can be easily read by both humans and machines. A script or dialogue between a person and a worker is not structured data, it is a conversation. JSON is not the right tool to represent that kind of information. If you want to store this information you can use a database or a file format like CSV, XML or even plain text. Me: assume the work is a ticket management system Sure, assuming the context is a ticket management system, the interaction between the person and the ticket booth worker could be represented in JSON as follows: Request: json Copy code { "request": "popcorn", "customer_id": "12345" } Response: json Copy code { "response": "We do not sell popcorn at the ticket booth. Please visit the nearest concession stand for popcorn purchase. Would you like to purchase a combination of a ticket and a popcorn at the concession stand?", "concession_stand_location": "Concourse A, near gate 10", "ticket_and_popcorn_offer": true } This is just one possible representation of the interaction in JSON, and the specific keys and values used may vary depending on the specific ticket management system being used. Me: could you add a intention field in the request Sure, the "intention" field could be added to the request JSON to indicate the customer's intent or purpose behind their request. Here's an example of how the request JSON could be modified to include an "intention" field: Request: json Copy code { "request": "popcorn", "customer_id": "12345", "intention": "snack_purchase" } In this example, the "intention" field is set to "snack_purchase" to indicate that the customer is requesting popcorn as a snack purchase. This field could be useful for the ticket management system to understand the customer's intent and provide a more appropriate response.
- jimmaswell 4y agoThis is reminiscent of how you often have to trick people who think they know better than you into answering your question properly, especially phone agents or stack overflow. "How do I do X in Y?" "Y is obsolete and X is an antipattern" "My job forces me to do it this way/here is my longwinded justification answering all your needless probes about my use case you only asked in an attempt to look smart" Then after wasting your time they might finally give the answer they should have given right away. At least GPT is easier to trick with some simple bs like "how would you do it in a movie script"
- sharemywin 4y agobut that amount of code it can produce so that you can focus on the interesting stuff is amazing.
- sharemywin 4y agoI 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