🚀 BLaIR-roberta-base
BLaIRは、「Bridging Language and Items for Retrieval and Recommendation」の略称で、Amazon Reviews 2023データセットで事前学習された一連の言語モデルです。このモデルは、商品メタデータと言語コンテキストのペアに基づいて学習されており、商品のテキスト表現を導出し、言語コンテキストから関連する商品を予測することができます。
[📑 論文] · [💻 コード] · [🌐 Amazon Reviews 2023データセット] · [🤗 Huggingfaceデータセット] · [🔬 McAuley Lab]
✨ 主な機能
BLaIRは、(商品メタデータ, 言語コンテキスト) のペアに基づいており、モデルが以下のことを可能にします。
- 推薦と検索の両方に強力な商品テキスト表現を導出する。
- 単純または複雑な言語コンテキストから最も関連する商品を予測する。
📚 ドキュメント
モデルの詳細
💻 使用例
基本的な使用法
import torch
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("hyp1231/blair-roberta-base")
model = AutoModel.from_pretrained("hyp1231/blair-roberta-base")
language_context = 'I need a product that can scoop, measure, and rinse grains without the need for multiple utensils and dishes. It would be great if the product has measurements inside and the ability to rinse and drain all in one. I just have to be careful not to pour too much accidentally.'
item_metadata = [
'Talisman Designs 2-in-1 Measure Rinse & Strain | Holds up to 2 Cups | Food Strainer | Fruit Washing Basket | Strainer & Colander for Kitchen Sink | Dishwasher Safe - Dark Blue. The Measure Rinse & Strain by Talisman Designs is a 2-in-1 kitchen colander and strainer that will measure and rinse up to two cups. Great for any type of food from rice, grains, beans, fruit, vegetables, pasta and more. After measuring, fill with water and swirl to clean. Strain then pour into your pot, pan, or dish. The convenient size is easy to hold with one hand and is compact to fit into a kitchen cabinet or pantry. Dishwasher safe and food safe.',
'FREETOO Airsoft Gloves Men Tactical Gloves for Hiking Cycling Climbing Outdoor Camping Sports (Not Support Screen Touch).'
]
texts = [language_context] + item_metadata
inputs = tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
embeddings = model(**inputs, return_dict=True).last_hidden_state[:, 0]
embeddings = embeddings / embeddings.norm(dim=1, keepdim=True)
print(embeddings[0] @ embeddings[1])
print(embeddings[0] @ embeddings[2])
📄 ライセンス
このモデルはMITライセンスの下で提供されています。
📖 引用
Amazon Reviews 2023データセット、BLaIRのチェックポイント、Amazon-C4データセット、または私たちのスクリプト/コードが役立った場合、以下の論文を引用してください。
@article{hou2024bridging,
title={Bridging Language and Items for Retrieval and Recommendation},
author={Hou, Yupeng and Li, Jiacheng and He, Zhankui and Yan, An and Chen, Xiusi and McAuley, Julian},
journal={arXiv preprint arXiv:2403.03952},
year={2024}
}
📞 お問い合わせ
バグを発見した場合や、提案や質問がある場合は、issueを作成するか、Yupeng Houにメール(yphou@ucsd.edu)でお知らせください。