SlowGuess/NAACL_2021_OCR huggingface dataset:
Ohad Rozen $^{1*}$ , David Carmel $^{2}$ , Avihai Mejer $^{2}$ , Vitaly Mirkis $^{2}$ , and Yftah Ziser $^{3\dagger}$ $^{1}$ Computer Science Department, Bar-Ilan University, Ramat-Gan, Israel  
 $^{2}$ Amazon  
 $^{3}$ Facebook
ohadrozen@gmail.com, {dacarmel, amejer, vitamin}@amazon.com, yftahz@fb.com
Predicting the answer to a product-related question is an emerging field of research that recently attracted a lot of attention. Answering subjective and opinion-based questions is most challenging due to the dependency on customer-generated content. Previous works mostly focused on review-aware answer prediction; however, these approaches fail for new or unpopular products, having no (or only a few) reviews at hand. In this work, we propose a novel and complementary approach for predicting the answer for such questions, based on the answers for similar questions asked on similar products. We measure the contextual similarity between products based on the answers they provide for the same question. A mixture-of-expert framework is used to predict the answer by aggregating the answers from contextually similar products. Empirical results demonstrate that our model outperforms strong baselines on some segments of questions, namely those that have roughly ten or more similar resolved questions in the corpus. We additionally publish two large-scale datasets<sup>1</sup> used in this work, one is of similar product question pairs, and the second is of product question-answer pairs.
Product-related Question Answering (PQA) is a popular and essential service provided by many e-commerce websites, letting consumers ask product related questions to be answered by other consumers based on their experience. The large archive of accumulated resolved questions can be further utilized by customers to support their purchase journey and automatic product question answering tools (e.g. Jeon et al. (2005); Cui et al. (2017);
Carmel et al. (2018)). However, there are many unanswered questions on these websites, either because a newly issued question has not attracted the community attention yet, or because of many other reasons (Park et al., 2015). This may frustrate ecommerce users, in particular when their purchase decision depends on the question's answer. Automatic PQA may assist the customers and the sellers by answering these unanswered questions, based on various diversified resources.
Previous PQA approaches leverage product specifications and description information (Cui et al., 2017; Lai et al., 2018; Gao et al., 2019), as well as customer-reviews (Yu et al., 2012; McAuley and Yang, 2016; Yu and Lam, 2018; Das et al., 2019; Fan et al., 2019; Chen et al., 2019; Deng et al., 2020), for answering product related questions. However, there are two notable shortcomings to these two approaches. Product information can typically address questions about product features and functionality, but can't address complex and subjective questions such as opinion question (Is it good for a 10 year old?), advice-seeking question (What is the color that best fit my pink dress?), or unique usage questions (Can I play FIFA 2018 on this laptop?). Customer-reviews, on the other hand, can partially address this kind of questions (Wan and McAuley, 2016), yet there are many products with few or no reviews available, either because they are new on the site or are less popular.
We propose a novel and complementary approach for answering product-related questions based on a large corpus of PQA. Given an unanswered product question, we seek similar resolved questions about similar products and leverage their existing answers to predict the answer for the customer's question. We call our method SimBA
*Work carried out during an internship at Amazon.
† Work carried out while working at Amazon.
<sup>1</sup>The datasets are freely available at https://registry.opendra AWS under the names Amazon-PQSim and Amazon-PQA.
2We consider questions similar if they have the same semantic intent. For example, can I wash this?, Is the product washable?, Is it ok to clean it with water? are all considered as similar questions when asked in context of a similar product.
Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 242-253 June 6-11, 2021. ©2021 Association for Computational Linguistics
(Similarity Based Answer Prediction). For example, the answer for the question "Will these jeans shrink after a wash?", asked about a new pair of jeans on the website, may be predicted based on the answers for similar questions asked about other jeans that share properties such as fabric material, brand, or style. An example is shown in Table 1. The main hypothesis we explore in this work is whether the answer to a product question can be predicted, based on the answers for similar questions about similar products, and how reliable this prediction is.
As our method relies on the existing PQA corpus, it addresses the two mentioned shortcomings of the previous approaches. First, it can address a variety of product-related questions that are common in PQA, including subjective and usage questions. Second, our method can provide answers to new or less popular products as it leverages an existing set of similar questions from other similar products.
A key element of our proposed method is a novel concept that we refer to as Contextual Product Similarity, which determines whether two products are similar in the context of a specific question. For example, two smart-watches may be similar with regards to their texting capability but different with regards to sleep monitoring. In Section 3 we formally define this concept and propose a prediction model for measuring contextual similarity between products, with respect to a given question. Additionally, we describe an efficient method to train this model by leveraging an existing PQA corpus.
Another appealing property of SimBA is its ability to support the predicted answer by providing the list of highly similar questions upon which the answer was predicted, hence increasing users' confidence and enhancing user engagement.
Our main contributions are: (a) A novel PQA method that overcomes several shortcomings of previous methods. (b) A novel concept of Contextual Product Similarity and an effective way to automatically collect annotations to train this model. (c) Finally, publishing two large scale datasets, one is a question similarity data set and the second is a large-scale Amazon product questions and answers dataset, details are provided in Section 4.
Empirical evaluation of our method demonstrates that it outperforms a strong baseline in some question segments, and that a hybrid model is effective in all the vast majority of the questions.
Product: Dickies Men's Jeans,  $100\%$  Cotton.
Q: Will these shrink after a wash?
Predicted answer: No
Similar Product 1: Eddie Bauer Men's Jeans,  $100\%$  Cotton.
Q: Do these shrink when you wash and dry them?
Similar Product 2: Timberland PRO Men's Jean,  $99\%$
Cotton,  $1\%$  Polyurethane.
Q: Was there any shrinkage after washing?
A: No shrinkage
Similar Product 3: Levi's Men's Jeans,  $98\%$  Cotton,
2% Elastane.
Q: Do these shrink at all during washing/drying?
A: They have not shrunk
Table 1: Answer prediction example based on similar questions asked about similar products. The answer for all contextually-similar products is 'no' therefore we predict the answer 'no' for the target question.
Automatic aswering product related questions has become a permanent service provided by many ecommerce websites and services (Cui et al., 2017; Carmel et al., 2018). Questions are typically answered based on product details from the catalog, existing Q&A's on the site, and customer reviews. Each of these resources, used for answer generation, has been studied extensively by the research community recently, probably due to the complexity of this task, the availability of appropriate datasets (McAuley, 2016), and the emergent increase in on-line shopping usage.
Lai et al. (2018) built a question answering system based on product facts and specifications. They trained a question answering system by transfer learning from a large-scale Amazon dataset to the Home Depot domain. Gao et al. (2019) generated an answer from product attributes and reviews using adversarial learning model which is composed of three components: a question-aware review representation module, a key-value attribute graph, and a seq2seq model for answer generation. Yu et al. (2012) answered opinion questions by exploiting hierarchical organization of consumer reviews, where reviews were organized according to the product aspects.
The publication of Amazon datasets of reviews<sup>3</sup> and Q&As (McAuley, 2016), triggered a flood of studies on review-aware answer prediction and generation. McAuley and Yang (2016) formulated the review based question answering task as a mixture-of-experts framework — each review is an "expert"
<sup>3</sup>https://nijianmo.github.io/amazon/index.html
that votes on the answer to a yes/no question. Their model learns to identify 'relevant' reviews based on those that vote correctly. In a following work, Wan and McAuley (2016) observed that questions have multiple, often divergent, answers, and the full spectrum of answers should be further utilized to train the answering system.
Chen et al. (2019) described a multi-task attention mechanism which exploits large amounts of Q&As, and a few manually labeled reviews, for answer prediction. Fan et al. (2019) proposed a neural architecture, directly fed by the raw text of the question and reviews, to mark review segment as the final answer, in a reading comprehension fashion. Das et al. (2019) learned an adversarial network for inferring reviews which best answer a question, or augment a given answer. Deng et al. (2020) incorporated opinion mining into the review-based answer generation. Yu and Lam (2018) generated aspect-specific representation for questions and reviews for answer prediction for yes-no questions. Yu et al. (2018) used transfer learning from a resource-rich source domain to a resource-poor target domain, by simultaneously learning shared representations of questions and reviews in a unified framework of both domains.
All this line of works assume the existence of rich set of product reviews to be used for question answering. This solution fails when no reviews are available. The challenge of review generation for a given product, while utilizing similar products' reviews, was addressed by Park et al. (2015). For a given product they extracted useful sentences from the reviews of other similar products. Similarly, (Pourgholamali, 2016) mined relevant content for a product from various content resources available for similar products. Both works focused on the extraction of general useful product related information rather than answering a specific product question, as in our case. Second, the product-similarity methods they considered rely on product specifications and description, and do not depend on the question to be answered, while our method considers a specific question at hand when estimating contextual product similarity.
3 Similarity-Based Answer Prediction
In this section, we introduce the Similarity-Based Answer-prediction (SimBA) method for predicting the answer for a product question, based on the answers for other similar product questions. We
Figure 1: Overview of SimBA answer prediction framework. (1) K siblings to the product question are retrieved from corpus by AKNN. (2) Siblings are filtered by the Q2Q model keeping only twins. (3) Twins are scored by the CPS model. (4) A Mixture of Experts model uses these votes to predict the answer.
restrict our study to yes/no questions only, due to their popularity in the PQA domain (54% on our PQA dataset), and following common practices in answer prediction studies (McAuley and Yang, 2016; Yu and Lam, 2018). Figure 1 presents our prediction framework and its main components.
Formally, a question-product-answer tuple is denoted by  $r_j = (q_j, p_j, a_j)$ , where  $a_j \in \{yes', no'\}$ .  $C = \{r_j\}_{j=1}^N$  is the set of  $N$  tuples of a given product category.  $r_t = (qt, pt, ?)^4$  is the target record of an unanswered question  $qt$ , asked about product  $pt$ . We treat  $C$  as the knowledge-base we use for answering  $qt$ .
Given a target record  $r_t$ , in order to predict its answer  $a_t$ , we first retrieve a set of records from  $C$  with the most similar questions to  $q_t$  (Figure 1, stage 1). We denote the retrieved records as siblings of  $r_t$ . We then filter the siblings by applying a Question-to-Question similarity (Q2Q) model, keeping only records with highly similar questions which are expected to have the same question intent as of  $q_t$ , (Figure 1, stage 2). We denote these records as twins of  $r_t$ . We then apply our Contextual Product Similarity (CPS) model to measure the contextual similarity between  $r_t$  and its twins (Figure 1, stage 3). The CPS similarity score is used to weight the twins by considering them as voters, applying a mixture-of-experts model over their answers for the final answer prediction (Figure 1, stage 4). More details about the model's components, the training processes, and other specifications, are described in the following.
3.1 Sibling Retrieval
Given a target record  $r_t$ , and a corpus of product-question-answer records  $C$ , our first goal is to re
4The answer for the target record is unknown.
trive all records with a question having the same intent as of  $q_{t}$ . As  $C$  might be very large, applying a complex neural model to measure the similarity of each question in  $C$  to  $q_{t}$  is often infeasible. We therefore apply a two step retrieval process. In a preliminary offline step, we index the records in  $C$  by creating embedding vectors for their questions, using a pre-trained encoder. For retrieval, done both during training and inference, we similarly embed the question  $q_{t}$  into vector  $e_{t}$ . We then use a fast Approximate K Nearest Neighbors (AKNN) search to retrieve  $K$  records, with the most similar questions, based on the cosine similarity between  $e_{t}$  and the embedding vectors of the questions in  $C$ . We denote the set of retrieved siblings of  $r_{t}$  by  $S(r_{t})$ .
3.2 Twin detection
The retrieved sibling records are those with the most similar questions to the target question. In the second step of the retrieval process, we enhance our record selection by applying a highly accurate transformer-based Question-to-Question (Q2Q) classifier (See Section 5.1), which we train over our question to question similarity dataset (Section 4.1). The  $Q2Q(q_{t},q_{k})$  classifier predicts the similarity between a target question  $q_{t}$  and each of the questions  $q_{k}$  in  $S(r_{t})$ . A record  $r_k$  is considered a twin of  $r_t$  if  $Q2Q(q_{t},q_{k}) > \gamma$ , where  $0.5\leq \gamma \leq 1.0$  is a hyper-parameter of the system. We denote the set of twins of  $r_t$  by  $T(r_{t})$ .
3.3 Contextual Product Similarity (CPS)
We consider products  $p_1$  and  $p_2$  to be contextually similar, with respect to a yes/no question  $q$ , if the answer to  $q$  on both products is the same. Given a pair of twin records  $(r_1, r_2)$ , our CPS model is aims to predict the contextual similarity between them, i.e. whether their (highly similar) questions have the same answer.
Since  $r_1$  and  $r_2$  are twins, their questions are expected to have the same intent; yet, they might be phrased differently. To avoid losing any information, we provide both questions as input to the CPS model, during training and during inference time.
CPS Model Architecture Figure 2 depicts the CPS model for predicting the contextual similarity
Figure 2: The Contextual Product Similarity (CPS) model. The target question-product pair  $(q_{t}, p_{t})$  and the twin question-product pair  $(q_{j}, p_{j})$  are encoded using a transformer encoder, while the questions attend the product text. The texts of both products are coupled and also encoded, allowing the two product text attend each other. The three output vectors are then concatenated and classified using an MLP classifier.
between a target record  $r_t$ , and one of its twins - record  $r_j$ . For each record, the question-product pair is embedded using a pre-trained transformer encoder, allowing the product textual content and the question text attend each other:
$$
\mathbf {H _ {t}} = E n c o d e r (q _ {t}, p _ {t}), \quad \mathbf {H _ {j}} = E n c o d e r (q _ {j}, p _ {j})
$$
The two models share weights to avoid over-fitting and for more efficient learning. A second encoder embeds the textual content of both products, encapsulating the similarity between them:
$$
\mathbf {H} _ {\mathbf {t j}} = E n c o d e r (p _ {t}, p _ {j})
$$
Then, a one hidden MLP layer takes the concatenation of the three embedding vectors, to predict the probability of  $a_{t} = a_{j}$
$$
\begin{array}{l} \psi_ {t j} = C P S \left(r _ {t}, r _ {j}\right) = P \left(a _ {t} = a _ {j} \mid r _ {t}, r _ {j}\right) \tag {1} \\ = M L P \left(\mathbf {H} _ {\mathbf {t}} \oplus \mathbf {H} _ {\mathbf {j}} \oplus \mathbf {H} _ {\mathbf {t j}}\right) \\ \end{array}
$$
Another key advantage of the CPS model is its ability to be trained on a large scale, without human annotations, by simply yielding the training labels directly from the polarity between the answers of twin pairs extracted from our training data. For any pair of twins  $(r_i, r_j)$ :
$$
\operatorname {l a b e l} \left(r _ {i}, r _ {j}\right) = \left\{ \begin{array}{l l} \text {s i m i l a r ,} & a _ {i} = a _ {j} \\ \text {d i f f e r e n t ,} & a _ {i} \neq a _ {j} \end{array} \right. \tag {2}
$$
<sup>5</sup>By design, both products belong to the same product category  $C$ , which prevents comparing unrelated products. For example, comparing an airhorn and a computer fan in the context of the question is it loud is therefore prevented.
The product textual content can be accumulated from several resources. In our experiments, we restrict the product content to its title and bullet points.
Question 1	Question 2	Label
Can this be used with regular light bulbs?	Can i put a regular light bulb in this?	Similar
Can i use these labels in a laser printer?	Can this be used in laser printer?	Similar
Does the hat have an adjustable strap inside?	Does the hat adjust inside?	Similar
Can this organizer hold sleeved cards?	Can it hold cards with sleeves on them?	Similar
Does this phone have bluetooth?	Does the phone have gps?	Different
Can just two player play this game	Whats the length of play of this game?	Different
Is there a diffuser for this dryer?	Can this go in the dryer?	Different
What material is the neck strap made of?	Does this come with a neck strap?	Different
Table 2: Examples from Amazon-PQSim Dataset. Each example consists of a user-generated question pair and a human-annotated label for their similarity.
3.4 Mixture of Experts
A mixture of experts is a widely-used method to combine the outputs of several classifiers by associating a weighted confidence score with each classifier (Jacobs et al., 1991). In our setting, experts are individual twins that lend support for or against a particular answer for a question. Each twin is weighted by its contextual similarity to the target record  $r_t$ , as predicted by the CPS model.
Given a target record  $r_t$ , the weight of each of its twins,  $r_j \in T(r_t)$  is determined by
$$
\lambda (r _ {j}) = \max (\psi_ {t j} ^ {2}, w _ {m i n})
$$
where  $\psi_{tj} = CPS(r_t,r_j)$ , and  $0\leq w_{min}\leq 0.5$  is a lower weight-limit; a hyper-parameter that we tune on the development set.
The predicted class of  $a_{t}$  is therefore derived by
$$
\operatorname {P r e d} \left(a _ {t} \mid r _ {t}\right) = \operatorname {s i g n} \left(\sum_ {r _ {j} \in T (r _ {t})} \lambda \left(r _ {j}\right) \delta \left(a _ {j}\right)\right) \tag {3}
$$
where positive/negative Pred indicates 'yes'/no' respectively, and  $\delta (a) = \left\{ \begin{array}{ll} + 1, & a = \text{'yes'}\\ -1, & a = \text{'no'} \end{array} \right.$
Our methodology can be easily expanded to incorporate more answer predictors (voters) of different types into SimBA. An example for such an expansion is described at Section 5.3.
We introduce two new datasets to experiment with our answer prediction approach: 1) The Amazon Product Question Similarity (Amazon-PQSim) dataset which is used to train our Q2Q model; 2) The Amazon Product Question Answers (AmazonPQA) dataset of product related Q&As, used for training the SimBA model.
4.1 Amazon-PQSim Dataset
We collected a first-of-a-kind question-to-question similarity dataset of product-question pairs from the Amazon website (Amazon-PQSim. See Table 2 for examples). Unlike the Quora dataset of general question pairs $^{8}$ , product questions are asked in the context of a designated product page. This makes them unique and different from questions asked in other domains. For example, the question Is it waterproof?, when appears on the Fitbit Flyer detailed page, should implicitly be interpreted as Is Fitbit Flyer waterproof?.
The following steps were taken for the data collection: (a) randomly sampling product-questions from the Amazon website. (b) filtering out some of these questions (e.g., non-English questions, for more details, see Appendix A). (c) For each of the remaining questions, we retrieved up to three candidate similar questions from the collection. A question is paired with the original question if the Jaccard similarity among them is in the range of  $[0.3, 0.5]$ . We ignore highly similar questions ( $>0.5$ ) since we don't want nearly verbatim pairs in our dataset, as well as dissimilar pairs ( $<0.3$ ). (d) Finally we used the Appen crowd-sourcing platform<sup>9</sup> for manual annotation of question pairs similarity<sup>10</sup>. Each question pair was labeled by at least three judges, and up to seven, until reaching agreement of  $70\%$  or more.
The above steps resulted in a nearly balanced dataset (1.08 positive-negative ratio) of more than 180K product question pairs with judges agreement of  $70\%$  or more, and among them about 90K question pairs have perfect judges agreement (1.14
<sup>7</sup>We tried using the CPS raw score for all twins, i.e.  $w_{min} = 0$ , however, using a fine-tuned minimal weight yielded better results.
<sup>8</sup>https://www.kaggle.com/c/quora-question-pairs  
<sup>9</sup>https://appen.com
<sup>10</sup>As the questions are asked in context of a specific product, they are often written in an anaphoric form (e.g. Is it waterproof?). To keep our dataset general, we instructed the judges to accept such questions as if they included the actual related product name. For example, the pair Is it waterproof? and Is this Fitbit waterproof? were labeled as similar.
positive-negative ratio).
4.2 Amazon-PQA Dataset
We collected a large corpus of product questions and answers from the Amazon website, similar to the popular Amazon Q&A dataset (McAuley, 2016). Since our answer prediction method directly utilizes an existing corpus of resolved questions, we aim to collect all available questions per narrow sub-category instead of a sample of questions across broad categories by the popular Amazon Q&A dataset. For example, instead of sampling from the broad Electronics category, we collect all questions under the narrower Monitors and Receivers categories.
Raw Data Extraction We collected all product questions, with their answers, from 100 subcategories, available on the Amazon website in August 2020. Overall, 10M questions were collected, with 20.7M answers, on 1.5M products. For full statistics of the raw data, see Table 7 in Appendix A.
Yes/No Question Classification We followed (He and Dai, 2011) for detecting Yes/No questions using simple heuristics. See Appendix A for details.