Revolutionizing E-Commerce with Trendyol LLM Shopping Assistant

Serhan Çiftlikçi23 Mar 2024

Problem

In the article's setup, a shopper's product questions are answered from the product's reviews and seller Q&A. A chat assistant has to rely only on that text, reply in the shopper's language and handle follow-up questions. The article gives no figures for the cost of the problem.

Example from the article: a shopper considering the Xiaomi Mi Band 5 smart wristband asks in Turkish whether it has a sleep-tracking feature.

Solution in brief

Retrieve the few most similar review and Q&A snippets for each question and pass them to Trendyol's open-source Turkish chat model inside a prompt that tells the model to answer only from them. LangChain connects retrieval, a short conversation memory and the model, and Gradio provides the chat window. The prototype covers one product and answer quality is not measured.

Questions this case answers
  • How to answer user questions about an item with an LLM grounded only in the item's user-generated text, in a non-English language
  • How to prototype a conversational question-answering assistant over a small text corpus with an open-weight model and a chat UI
  • How to answer a shopper's question about a product using that product's reviews and seller Q&A
  • How to build a retrieval-augmented chat flow around an open-source Turkish chat model

Tools and methods

  • RAG (retrieval-augmented generation) — answers come from retrieved review and Q&A text
  • Trendyol-LLM-7b-chat-dpo-v1.0 — open-source Turkish chat model (Mistral fine-tuned on Turkish data), writes the answers
  • Sentence Transformers (paraphrase-multilingual-mpnet-base-v2) — embeds the texts and the question
  • LangChain — vector store, retriever, prompt, memory and the retrieval chain
  • Gradio — chat interface for trying the assistant
  • Hugging Face Transformers — loads the model and runs generation
Continue reading — it's free

Google or a one-time email code. No password.