Introduction of Amazon-Cup-Cross-Encoder-Regression
Model Details of Amazon-Cup-Cross-Encoder-Regression
This model is actually very accurate for this rerank products given one query, intuitively inspired by information retrieval techniques. In 2019, Nils Reimers and Iryna Gurevych introduced a new transformers model called Sentence-BERT, Sentence Embeddings using Siamese BERT-Networks. The model is introduced by this paper
https://doi.org/10.48550/arxiv.1908.10084
.
This new Sentence-BERT model is modified on the BERT model by adding a pooling operation to the output of BERT model. In such a way, it can output a fixed size of the sentence embedding to calculate cosine similarity, and so on. To obtain a meaningful sentence embedding in a sentence vector space where similar or pairwise sentence embedding are close, they created a triplet network to modify the BERT model as the architecture below figure.
Download and Use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("LiYuan/Amazon-Cup-Cross-Encoder-Regression")
model = AutoModelForSequenceClassification.from_pretrained("LiYuan/Amazon-Cup-Cross-Encoder-Regression")
As we can observe from above figure, a pooling layer is added on the top of each BERT Model to obtain the sentence embedding $u$ and $v$. Finally, the cosine similarity between $u$ and $v$ can be computed to compare with the true score or make them semantically meaningful, then the mean square error loss, which is the objective function, can be backpropagated through this BERT network model to update the weights.
In our amazon case, the query is sentence A and concatenated product attributes are sentence B. We also stratified split the merged set into
571,223
rows for training,
500
rows for validation,
3,000
rows for test. We limited the output score between 0 and 1. The following scores represent the degree of relevance between the query and the product attributes in light of Amazon KDD Cup website; however, this can be adjusted to improve the model performance.
1: exact
0.1: substitute
0.01: complement
0: irrelevance
For this regression model, we used Pearson correlation coefficient and Spearman's rank correlation coefficient} to measure the model performance. If the correlation coefficient is high, the model performs well. The validation Pearson is \textbf{0.5670} and validation Spearman is \textbf{0.5662}. This is not bad result.
We also evaluated the model on the test set. We got
0.5321
for Pearson and
0.5276
for Spearman. These results from the test evaluation have results similar to those of the validation set, suggesting that the model has a good generalization.
Finally, once we have this fine-tuned Cross-Encoder Regression model, given a new query and its matched product list, we can feed them into this model to get the output score to rerank them so that this can improve the customer online shopping experience.
Runs of LiYuan Amazon-Cup-Cross-Encoder-Regression on huggingface.co
56
Total runs
0
24-hour runs
4
3-day runs
-3
7-day runs
12
30-day runs
More Information About Amazon-Cup-Cross-Encoder-Regression huggingface.co Model
More Amazon-Cup-Cross-Encoder-Regression license Visit here:
Amazon-Cup-Cross-Encoder-Regression huggingface.co is an AI model on huggingface.co that provides Amazon-Cup-Cross-Encoder-Regression's model effect (), which can be used instantly with this LiYuan Amazon-Cup-Cross-Encoder-Regression model. huggingface.co supports a free trial of the Amazon-Cup-Cross-Encoder-Regression model, and also provides paid use of the Amazon-Cup-Cross-Encoder-Regression. Support call Amazon-Cup-Cross-Encoder-Regression model through api, including Node.js, Python, http.
Amazon-Cup-Cross-Encoder-Regression huggingface.co is an online trial and call api platform, which integrates Amazon-Cup-Cross-Encoder-Regression's modeling effects, including api services, and provides a free online trial of Amazon-Cup-Cross-Encoder-Regression, you can try Amazon-Cup-Cross-Encoder-Regression online for free by clicking the link below.
LiYuan Amazon-Cup-Cross-Encoder-Regression online free url in huggingface.co:
Amazon-Cup-Cross-Encoder-Regression is an open source model from GitHub that offers a free installation service, and any user can find Amazon-Cup-Cross-Encoder-Regression on GitHub to install. At the same time, huggingface.co provides the effect of Amazon-Cup-Cross-Encoder-Regression install, users can directly use Amazon-Cup-Cross-Encoder-Regression installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Amazon-Cup-Cross-Encoder-Regression install url in huggingface.co: