Teaching computers to recognize humor

Detecting comic product-related questions could improve customer engagement and Amazon recommendations.

Amazon product pages include sections in which customers can both ask and answer questions, and like most community-access online forums, they’ve become fertile ground for comedy. A banana slicer, for instance, which is slightly curved to fit the shape of a banana, prompts the question “What if the banana bends the other direction?”, while almost all of the roughly 100 questions about canned unicorn meat are jokes.

Unicorn meat.jpg
The “canned unicorn meat” sold on Amazon is a food tin with a dismembered stuffed unicorn inside. Almost all of its product-related questions are jokes.
credit: ThinkGeek

Providing new opportunities for creative self-expression is one of the delights of building an online community like Amazon’s. But for customers in a hurry to extract essential information about products — and for automated systems that use question-and-answer data to improve Amazon’s recommendation engine — it would be useful to be able to distinguish comic from serious questions.

In a paper presented (virtually) at this year’s SIGIR, the Association for Computing Machinery’s annual conference on information retrieval, my colleagues — Yftah Ziser and Elad Kravi — and I described a new approach to humor detection in product question answering. In experiments, we compared our system to four baselines, and it reduced the error rate of the best-performing of them by 5.4% and 18.3% on two different data sets.

Our system leverages two insights from humor theory. One is that humor is often the result of incongruity — a mismatch between two conceptions of a topic. For instance, the question “Does this make espresso?” might be reasonable when applied to a high-end coffee machine, but applied to a Swiss Army knife, it’s probably a joke.

The other insight is that humor often has a subjective tone, an indication of the speaker’s sentiment or emotional state. For instance, one question asked about the Amazon Echo Show was the comic question “Will this help me find the meaning of life?”, which has a more subjective tone than the question “Can it connect to music speakers?”

The model

The inputs to our system are a question extracted from an Amazon product page and the associated product title. Both the title and the question pass to an incongruity detection module, which scores them according to incongruity, and the question passes to a subjectivity module, which scores it according to subjectivity.

Humor model.png
The architecture of our humor detection network, with pretrained modules for recognizing incongruity and subjectivity.

Those scores are concatenated with ordinary word embeddings — vector representations that capture semantic information about the inputs — before passing to a classifier, which makes the ultimate decision about whether the question is comic.

Before training the network as a whole, we pretrain the incongruity and subjectivity modules on automatically labeled data. For the incongruity module, we create positive (incongruous) examples by pairing product names with questions extracted from other products’ pages. Negative (congruous) examples simply pair product names with questions extracted from the associated pages, as the large majority of questions are serious in intent.

For the subjectivity model, we extract positive examples (examples that use subjective language) from product reviews and negative examples from seller-provided product descriptions, which tend to be more objective.

The data sets

After we’ve pretrained the incongruity and subjectivity modules on the automatically generated data, we freeze their parameters and train the network as a whole on a more carefully curated data set. To produce this data set, we created a simple interface that presented crowd workers with product names, product images, and associated questions, and we asked them to click a radio button to assess the question as humorous or not.

Annotation interface.png
The interface that we designed to let crowd workers assess the humor of questions extracted from Amazon product pages.

Initially, each question was assessed by three crowd workers, and the number of assessments increased, to a maximum of seven, until there was at least 70% agreement on the question label. The high agreement among annotators (Fleiss’s kappa of 0.67 among the first three annotators and an average agreement level of 89.5% among all annotators) indicates great consistency in people’s judgments about humorous content.

Past research has shown that using machine learning to train humor recognition models runs the risk of domain bias. In our case, rather than learning to recognize characteristics of humorous questions, a model might just learn to recognize products — such as canned unicorn meat — that tend to provoke humorous responses.

To test for product bias, we created two data sets. One paired each positive (humorous) example with a negative (serious) example drawn at random from a different product page, and the other matched each humorous example with a serious example drawn from the same product page.

The second data set featured the same number of comic and serious examples for every product included, so the model couldn’t simply learn to recognize products that invited comic questions. We refer to this as the unbiased data set, the other as the biased data set.

Then we used both data sets to train the four baseline models and our model. On the unbiased data set, our model achieved an accuracy rate of 84.4%, a 5.4% error reduction over the best-performing baseline.

On the biased data set, our model’s accuracy exceeds 90.8%. The improvement comes from allowing the model to recognize products that invite comic questions. Whether that improvement will generalize to other test sets, or whether it will prove more practical to focus on unbiased training data — where detection accuracy is relatively lower — is a question for further study.

Recognizing humor is a difficult AI challenge, but meeting it will ensure that the Amazon Store remains a place where customers can find useful product information quickly and have some fun while they’re at it.

Related content

US, NJ, Newark
Employer: Audible, Inc. Title: Data Scientist II Location: One Washington Park, Newark, NJ, 07102 Duties: Design and implement scalable and reliable approaches to support or automate decision making throughout the business. Apply a range of data science techniques and tools combined with subject matter expertise to solve difficult business problems and cases in which the solution approach is unclear. Acquire data by building the necessary SQL / ETL queries. Import processes through various company specific interfaces for accessing RedShift, and S3 / edX storage systems. Build relationships with stakeholders and counterparts, and communicate model outputs, observations, and key performance indicators (KPIs) to the management to develop sustainable and consumable products. Explore and analyze data by inspecting univariate distributions and multivariate interactions, constructing appropriate transformations, and tracking down the source and meaning of anomalies. Build production-ready models using statistical modeling, mathematical modeling, econometric modeling, machine learning algorithms, network modeling, social network modeling, natural language processing, or genetic algorithms. Validate models against alternative approaches, expected and observed outcome, and other business defined key performance indicators. Implement models that comply with evaluations of the computational demands, accuracy, and reliability of the relevant ETL processes at various stages of production. Position reports into Newark, NJ office; however, telecommuting from a home office may be allowed. Requirements: Requires a Master’s in Statistics, Computer Science, Data Science, Machine Learning, Applied Math, Operations Research, Economics, or a related field plus two (2) years of experience as a Data Scientist, Data Engineer, or other occupation/position/job title involving research and data analysis. Experience may be gained concurrently and must include one (1) year in each of the following: - Building statistical models and machine learning models using large datasets from multiple resources - Working with Customer, Content, or Product data modeling and extraction - Using database technologies such as SQL or ETL - Applying specialized modelling software including Python, R, SAS, MATLAB, or Stata. Alternatively, will accept a Bachelor's and four (4) years of experience. Multiple positions. Apply online: www.amazon.jobs Job Code: ADBL157. We are open to hiring candidates to work out of one of the following locations: Newark, NJ, USA
US, CA, Pasadena
The Amazon Web Services (AWS) Center for Quantum Computing (CQC) is a multi-disciplinary team of scientists, engineers, and technicians on a mission to develop a fault-tolerant quantum computer. You will be joining a team located in Pasadena, CA that conducts materials research to improve the performance of quantum processors. We are looking to hire a Quantum Research Scientist who will apply their expertise in materials characterization to the optimization of fabricated superconducting quantum devices. In this role, you are expected to lead and assist research projects that are aligned with our Center’s technical roadmap. You will develop new ideas and design experiments aimed at identifying the most promising material systems, characterization techniques, and integration processes for superconducting circuit applications. Key job responsibilities - Conduct experimental studies on the fundamental properties of superconducting, semiconducting, and dielectric thin films - Develop and implement multi-technique materials characterization workflows for thin films and devices, with a focus on the surfaces and interfaces - Work closely with other research scientists on the Materials team to develop material processes directed toward optimizing thin film properties, controlling the surface chemistry and morphology, and impacting device performance - Identify materials properties (chemical, structural, electronic, electrical) that can be a reliable proxy for the performance of superconducting qubits and microwave resonators - Communicate engineering and scientific findings to teammates, the broader CQC and, when appropriate, publish findings in scientific journals A day in the life AWS Utility Computing (UC) provides product innovations — from foundational services such as Amazon’s Simple Storage Service (S3) and Amazon Elastic Compute Cloud (EC2), to consistently released new product innovations that continue to set AWS’s services and features apart in the industry. As a member of the UC organization, you’ll support the development and management of Compute, Database, Storage, Internet of Things (Iot), Platform, and Productivity Apps services in AWS, including support for customers who require specialized security solutions for their cloud services. Diverse Experiences AWS values diverse experiences. Even if you do not meet all of the qualifications and skills listed in the job description, we encourage candidates to apply. If your career is just starting, hasn’t followed a traditional path, or includes alternative experiences, don’t let it stop you from applying. Why AWS? Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform. We pioneered cloud computing and never stopped innovating — that’s why customers from the most successful startups to Global 500 companies trust our robust suite of products and services to power their businesses. Inclusive Team Culture Here at AWS, it’s in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (gender diversity) conferences, inspire us to never stop embracing our uniqueness. Mentorship & Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve in the cloud. Hybrid Work We value innovation and recognize this sometimes requires uninterrupted time to focus on a build. We also value in-person collaboration and time spent face-to-face. Our team affords employees options to work in the office every day or in a flexible, hybrid work model near one of our U.S. Amazon offices. About the team Our team contributes to the fabrication of processors and other hardware that enable quantum computing technologies. Doing that necessitates the development of materials with tailored properties for superconducting circuits. Research Scientists and Engineers on the Materials team operate deposition and characterization systems in order to develop and optimize thin film processes for use in these devices. They work alongside other Research Scientists and Engineers to help deliver fabricated devices for quantum computing experiments. We are open to hiring candidates to work out of one of the following locations: Pasadena, CA, USA
US, CA, Sunnyvale
Help re-invent how millions of people watch TV! Fire TV remains the #1 best-selling streaming media player in the US. Our goal is to be the global leader in delivering entertainment inside and outside the home, with the broadest selection of content, devices and experiences for customers. Our science team works at the intersection of Recommender Systems, Information Retrieval, Machine Learning and Natural Language Understanding. We leverage techniques from all these fields to create novel algorithms that allow our customers to engage with the right content at the right time. Our work directly contributes to making our devices delightful to use and indispensable for the household. Key job responsibilities - Drive new initiatives applying Machine Learning techniques to improve our recommendation, search and entity matching algorithms - Perform hands-on data analysis and modeling with large data sets to develop insights that increase device usage and customer experience - Design and run A/B experiments, evaluate the impact of your optimizations and communicate your results to various business stakeholders - Work closely with product managers and software engineers to design experiments and implement end-to-end solutions - Setup and monitor alarms to detect anomalous data patterns and perform root cause analyses to explain and address them - Be a member of the Amazon-wide Machine Learning Community, participating in internal and external MeetUps, Hackathons and Conferences - Help attract and recruit technical talent; mentor junior scientists We are open to hiring candidates to work out of one of the following locations: Sunnyvale, CA, USA
US, NY, New York
Amazon is looking for a Senior Applied Scientist to help build the next generation of sourcing and vendor experience systems. The Optimal Sourcing Systems (OSS) owns the optimization of inventory sourcing and the orchestration of inbound flows from vendors worldwide. We source inventory from thousands of vendors for millions of products globally while orchestrating the inbound flow for billions of units. Our goals are to increase reliable access to supply, improve supply chain-driven vendor experience, and reduce end-to-end supply chain costs, all in service of maximizing Long-Term Free Cash Flow (LTFCF) for Amazon. As a Senior Applied Scientist, you will work with software engineers, product managers, and business teams to understand the business problems and requirements, distill that understanding to crisply define the problem, and design and develop innovative solutions to address them. Our team is highly cross-functional and employs a wide array of scientific tools and techniques to solve key challenges, including optimization, causal inference, and machine learning/deep learning. Some critical research areas in our space include modeling buying decisions under high uncertainty, vendors' behavior and incentives, supply risk and enhancing visibility and reliability of inbound signals. Key job responsibilities You will be a science tech leader for the team. As a Senior Applied Scientist you will: - Lead a team of scientists to innovate on state-of-the-art sourcing systems. - Set the scientific strategic vision for the team. You lead the decomposition of problems and development of roadmaps to execute on it. - Set an example for other scientists with exemplary scientific analyses; maintainable, extensible, and well-tested code; and simple, intuitive, and effective solutions. - Influence team business and engineering strategies. - Exercise sound judgment to prioritize between short-term vs. long-term and business vs. technology needs. - Communicate clearly and effectively with stakeholders to drive alignment and build consensus on key initiatives. - Foster collaborations between scientists across Amazon researching similar or related problems. - Actively engage in the development of others, both within and outside the team. - Engage with the broader scientific community through presentations, publications, and patents. To help describe some of our challenges, we created a short video about SCOT at Amazon: http://bit.ly/amazon-scot About the team Supply Chain Optimization Technologies (SCOT) owns Amazon's global inventory planning systems. We decide what, when, where, and how much we should buy to meet Amazon's business goals and to make our customers happy. We decide how to place and move inventory within Amazon's fulfillment network. We do this for hundreds of millions of items and hundreds of product lines worth billions of dollars worldwide. Check our website if you are curious to learn more about the breadth of problems we tackle: https://www.amazon.science/tag/supply-chain-optimization-technologies We are open to hiring candidates to work out of one of the following locations: Bellevue, WA, USA | New York, NY, USA
US, WA, Seattle
Come be a part of a rapidly expanding $35 billion dollar global business. At Amazon Business, a fast-growing startup passionate about building solutions, we set out every day to innovate and disrupt the status quo. We stand at the intersection of tech & retail in the B2B space developing innovative purchasing and procurement solutions to help businesses and organizations thrive. At Amazon Business, we strive to be the most recognized and preferred strategic partner for smart business buying. Bring your insight, imagination and a healthy disregard for the impossible. Join us in building and celebrating the value of Amazon Business to buyers and sellers of all sizes and industries. Unlock your career potential. We are seeking a Senior Applied Scientist who has a solid background in applied Machine Learning and Data Science, deep passion for building data-driven products, ability to formulate data insights and scientific vision, and has a proven track record of executing complex projects and delivering business impact. Key job responsibilities • Data driven insights to accelerate acquisition of new members. • Grow benefits adoption based on customer segment, vertical, and drive customers to their "aha moment". • Work closely with software engineering teams to drive model implementations and new feature creations. • Establish scalable, efficient, automated processes for large scale data analyses, model development, model validation and model implementation • Advance team's engineering craftsmanship and drive continued scientific innovation as a thought leader and practitioner. • Mentor junior scientists, provide technical and career development guidance. About the team The Marketing Science team applies scientific methods and research techniques to enhance our understanding of AB consumer behavior, market trends, and the effectiveness of marketing strategies. Our goal is to develop and advance theories and models that can be used to make informed decisions in marketing and to provide insights into consumer decision-making processes. Additionally, we seek to identify and explore emerging trends and technologies in marketing, and to develop innovative approaches for addressing the challenges and opportunities in the field. We are open to hiring candidates to work out of one of the following locations: Seattle, WA, USA
US, WA, Seattle
Are you fascinated by the power of Natural Language Processing (NLP) and Large Language Models (LLM) to transform the way we interact with technology? Are you fascinated by the use of Generative AI to build an advertiser facing solution that predict problems and coach users while they solve real word problems? Are you passionate about applying advanced machine learning techniques to solve complex challenges in the customer service space? If so, Amazon's Support Product & Services (SP&S) team has an exciting opportunity for you as an Applied Scientist. Key job responsibilities • Apply your expertise in LLM models to design, develop, and implement scalable machine learning solutions that address complex language-related challenges in the advertising support center domain. • Use Transformers and apply other NLP techniques like Sentence embeddings, Dimensionality reduction, clustering and topic modeling to identify customer intents and utterances. • Use services like AWS Lex, AWS Bedrock etc. to develop advertising facing solutions • Work closely with teams of scientists and software engineers to drive real-time model implementations and deliver novel and highly impactful solutions. • Automating feedback loops for algorithms in production. • Setup and monitor alarms to detect anomalous data patterns and perform root cause analyses to explain and address them. • Be a member of the Amazon-wide Machine Learning Community, participating in internal and external MeetUps, Hackathons and Conferences. A day in the life You will work closely with a cross functional team of Software Engineers, Product Owners, Data Scientists, and Contact Center experts. You will research and investigate the latest options in industry to apply machine learning and generative AI to real world problems. You will work backwards from customer problems and collaborate with stakeholders to determine how to scale new technology and integrate with complicated help channels used by advertisers everyday. About the team SP&S team provides solutions and libraries that are leveraged by teams all across Amazon Advertising to provide timely and personalized help. The team aims to predict Advertisers problems and proactively surface intelligent guidance to customers at the right time. As a AS, you will help the team to achieve its vision of building and implementing the next generation of Contact Center technology. You will build/leverage LLMs to train them on advertising support domain knowledge and work shoulder to shoulder with stakeholders to externalize to users in novel ways. We are open to hiring candidates to work out of one of the following locations: Seattle, WA, USA
SG, Singapore
Do you want to contribute to a team working on cutting edge technology, solve new problems that didn’t exist before, and have the ability to see the impact of your successes? Amazon is shaping the future of digital video entertainment. We seek experienced data scientists who can apply the latest research, state-of-the-art algorithms and machine learning to solve core problems in the video streaming space for Amazon. This is an exciting opportunity for candidates with a deep understanding of large data sets and structures, customer behavior and signals, machine learning algorithms and production pipelines. If you are passionate about solving complex problems in a challenging environment, we would love to talk with you. We are looking for a seasoned data scientist who can help us scale our video streaming and advertising business. He/She will develop and build machine learning models using large data-sets to improve our customer and advertiser experience, and will work closely with technology teams in deploying the models to production. He/She will work in a highly collaborative environment with some of the best engineers, marketers and product managers, and be part of a rapidly growing initiative which is going to become a huge area of growth for Amazon's Advertising business and pioneer the usage of new technology at Amazon scale. Key job responsibilities - Engage in advanced data analysis to uncover trends and correlations. Utilize statistical methods and tools to drive insightful recommendations for business strategies and process improvements. - Use the data insights to design, develop and build scalable and advanced machine learning models, algorithms and implement them in production through robust systems and architectures - Work closely with stakeholders across various departments including product, business analytics, marketing, operations and tech teams and influence business strategy - Be abreast of the advanced research and techniques in the deep-learning and artificial intelligence space, and conduct experiments to give the best output - Identify, develop, manage, and execute data analyses to uncover areas of opportunity and present business recommendations to drive cost benefit analysis and go/no-go decisions on various initiatives - Develop a roadmap and metrics to measure progress of the initiative they own - Lead initiatives for full-scale automation in collaboration with data engineering teams, enhancing data accuracy and operational efficiency We are open to hiring candidates to work out of one of the following locations: Singapore, SGP
SG, Singapore
Do you want to contribute to a team working on cutting edge technology, solve new problems that didn’t exist before, and have the ability to see the impact of your successes? Amazon is shaping the future of digital video entertainment. We seek experienced data scientists who can apply the latest research, state-of-the-art algorithms and machine learning to solve core problems in the video streaming space for Amazon. This is an exciting opportunity for candidates with a deep understanding of large data sets and structures, customer behavior and signals, machine learning algorithms and production pipelines. If you are passionate about solving complex problems in a challenging environment, we would love to talk with you. We are looking for a seasoned data scientist who can help us scale our video streaming and advertising business. He/She will develop and build machine learning models using large data-sets to improve our customer and advertiser experience, and will work closely with technology teams in deploying the models to production. He/She will work in a highly collaborative environment with some of the best engineers, marketers and product managers, and be part of a rapidly growing initiative which is going to become a huge area of growth for Amazon's Advertising business and pioneer the usage of new technology at Amazon scale. Key job responsibilities - Engage in advanced data analysis to uncover trends and correlations. Utilize statistical methods and tools to drive insightful recommendations for business strategies and process improvements. - Use the data insights to design, develop and build scalable and advanced machine learning models, algorithms and implement them in production through robust systems and architectures - Work closely with stakeholders across various departments including product, business analytics, marketing, operations and tech teams and influence business strategy - Be abreast of the advanced research and techniques in the deep-learning and artificial intelligence space, and conduct experiments to give the best output - Identify, develop, manage, and execute data analyses to uncover areas of opportunity and present business recommendations to drive cost benefit analysis and go/no-go decisions on various initiatives - Develop a roadmap and metrics to measure progress of the initiative they own - Lead initiatives for full-scale automation in collaboration with data engineering teams, enhancing data accuracy and operational efficiency We are open to hiring candidates to work out of one of the following locations: Singapore, SGP
SG, Singapore
Do you want to contribute to a team working on cutting edge technology, solve new problems that didn’t exist before, and have the ability to see the impact of your successes? Amazon is shaping the future of digital video entertainment. We seek experienced data scientists who can apply the latest research, state-of-the-art algorithms and machine learning to solve core problems in the video streaming space for Amazon. This is an exciting opportunity for candidates with a deep understanding of large data sets and structures, customer behavior and signals, machine learning algorithms and production pipelines. If you are passionate about solving complex problems in a challenging environment, we would love to talk with you. We are looking for a seasoned data scientist who can help us scale our video streaming and advertising business. He/She will develop and build machine learning models using large data-sets to improve our customer and advertiser experience, and will work closely with technology teams in deploying the models to production. He/She will work in a highly collaborative environment with some of the best engineers, marketers and product managers, and be part of a rapidly growing initiative which is going to become a huge area of growth for Amazon's Advertising business and pioneer the usage of new technology at Amazon scale. Key job responsibilities - Engage in advanced data analysis to uncover trends and correlations. Utilize statistical methods and tools to drive insightful recommendations for business strategies and process improvements. - Use the data insights to design, develop and build scalable and advanced machine learning models, algorithms and implement them in production through robust systems and architectures - Work closely with stakeholders across various departments including product, business analytics, marketing, operations and tech teams and influence business strategy - Be abreast of the advanced research and techniques in the deep-learning and artificial intelligence space, and conduct experiments to give the best output - Identify, develop, manage, and execute data analyses to uncover areas of opportunity and present business recommendations to drive cost benefit analysis and go/no-go decisions on various initiatives - Develop a roadmap and metrics to measure progress of the initiative they own - Lead initiatives for full-scale automation in collaboration with data engineering teams, enhancing data accuracy and operational efficiency We are open to hiring candidates to work out of one of the following locations: Singapore, SGP
US, WA, Seattle
Amazon brings buyers and sellers together. Our retail customers depend on us to give them access to every product at the best possible price. Our sellers depend on us to give them a platform to launch their business into every home and marketplace. Making this happen is the mission of every scientist in North America Stores (NAS) organization. To this end, the Science team is tasked with: · Building and deploying AI / ML models that lead to exponential growth of the business. · Organizing available data sources, and creating detailed dictionaries of data that can be used in future analyses. · Partnering with product teams in evaluating the financial and operational impact of new product offerings. · Partnering with science teams across other organizations to develop state of the art algorithms and models. · Carrying out independent data-backed initiatives that can be leveraged later on in the fields of network organization, costing and financial modeling of processes. · Publishing papers in both internal and external conferences / journals. In order to execute the above mandate we are on the look out for smart and qualified Applied Scientists who will own projects in partnership with product and research teams as well as operate autonomously on independent initiatives that are expected to unlock benefits in the future. A past background in Artificial Intelligence is necessary, along with advanced proficiency in programming languages such as Python and C++. Key job responsibilities As an Applied Scientist, you are able to use a range of artificial intelligence and operations research methodologies to solve challenging business problems when the solution is unclear. You have a combination of business acumen, broad knowledge of statistics, deep understanding of ML algorithms, and an analytical mindset. You thrive in a collaborative environment, and are passionate about learning. Our team utilizes a variety of AWS tools such as Redshift, Sagemaker, Lambda, S3, and EC2 with a variety of skillsets in Tabular ML, NLP, Generative AI, Forecasting, Probabilistic ML and Causal ML. You will bring knowledge in many of these domains along with your own specialties and skill-sets. We are open to hiring candidates to work out of one of the following locations: Atlanta, GA, USA | Seattle, WA, USA