Downloads ยท 30 days
16
14% of all-time downloads
smartcat/T5-GenQ-TD-v1
T5-GenQ-TD-v1 is a text generation model from smartcat. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
๐ค โจ ๐ Generate precise, realistic user-focused search queries from product text ๐ ๐ ๐
Downloads ยท 30 days
16
14% of all-time downloads
All-time downloads
118
Public
Parameters
223M
897 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors892 MB ยท 99%
From the Hugging Face model README
๐ค โจ ๐ Generate precise, realistic user-focused search queries from product text ๐ ๐ ๐
This model is designed to improve e-commerce search functionality by generating user-friendly search queries based on product descriptions. It is particularly suited for applications where product descriptions are the primary input, and the goal is to create concise, descriptive queries that align with user search intent.
Note: This evaluation is done after training, based on the test split of the smartcat/Amazon-2023-GenQ dataset.
Use the code below to get started with the model.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("smartcat/T5-GenQ-TD-v1")
tokenizer = AutoTokenizer.from_pretrained("smartcat/T5-GenQ-TD-v1")
description = "Silver-colored cuff with embossed braid pattern. Made of brass, flexible to fit wrist."
inputs = tokenizer(description, return_tensors="pt", padding=True, truncation=True)
generated_ids = model.generate(inputs["input_ids"], max_length=30, num_beams=4, early_stopping=True)
generated_text = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
The model was trained on the smartcat/Amazon-2023-GenQ dataset, which consists of user-like queries generated from product descriptions. The dataset was created using Claude Haiku 3, incorporating key product attributes such as the title, description, and images to ensure relevant and realistic queries. For more information, read the Dataset Card. ๐
A6000 GPU:
ROUGE, or Recall-Oriented Understudy for Gisting Evaluation, is a set of metrics used for evaluating automatic summarization and machine translation in NLP. The metrics compare an automatically produced summary or translation against a reference or a set of references (human-produced) summary or translation. ROUGE metrics range between 0 and 1, with higher scores indicating higher similarity between the automatically produced summary and the reference.
In our evaluation, ROUGE scores are scaled to resemble percentages for better interpretability. The metric used in the training was ROUGE-L.
<table border="1" class="dataframe"> <thead> <tr style="text-align: center;"> <th>Epoch</th> <th>Step</th> <th>Loss</th> <th>Grad Norm</th> <th>Learning Rate</th> <th>Eval Loss</th> <th>ROUGE-1</th> <th>ROUGE-2</th> <th>ROUGE-L</th> <th>ROUGE-Lsum</th> </tr> </thead> <tbody> <tr> <td>1.0</td> <td>4285</td> <td>0.2515</td> <td>1.890405</td> <td>0.000049</td> <td>0.165247</td> <td>76.4578</td> <td>56.4813</td> <td>75.7754</td> <td>75.7835</td> </tr> <tr> <td>2.0</td> <td>8570</td> <td>0.1744</td> <td>1.433518</td> <td>0.000042</td> <td>0.157739</td> <td>77.2138</td> <td>57.4609</td> <td>76.5478</td> <td>76.5589</td> </tr> <tr> <td>3.0</td> <td>12855</td> <td>0.1595</td> <td>1.340541</td> <td>0.000035</td> <td>0.154977</td> <td>77.5761</td> <td>57.9620</td> <td>76.8824</td> <td>76.8854</td> </tr> <tr> <td>4.0</td> <td>17140</td> <td>0.1488</td> <td>1.370982</td> <td>0.000028</td> <td>0.153134</td> <td>77.9366</td> <td>58.5720</td> <td>77.2561</td> <td>77.2692</td> </tr> <tr> <td>5.0</td> <td>21425</td> <td>0.1407</td> <td>1.549360</td> <td>0.000021</td> <td>0.153177</td> <td>78.1102</td> <td>58.7207</td> <td>77.4106</td> <td>77.4241</td> </tr> <tr> <td>6.0</td> <td>25710</td> <td>0.1344</td> <td>1.258538</td> <td>0.000014</td> <td>0.152852</td> <td>78.1691</td> <td>58.8640</td> <td>77.4554</td> <td>77.4651</td> </tr> <tr> <td>7.0</td> <td>29995</td> <td>0.1299</td> <td>1.200458</td> <td>0.000007</td> <td>0.153884</td> <td>78.2001</td> <td>58.8603</td> <td>77.4833</td> <td>77.4984</td> </tr> <tr> <td>8.0</td> <td>34280</td> <td>0.1267</td> <td>1.079393</td> <td>0.000000</td> <td>0.154507</td> <td>78.2570</td> <td>58.9586</td> <td>77.5308</td> <td>77.5466</td> </tr> </tbody> </table> <style> .model-analysis table { width: 100%; border-collapse: collapse; } .model-analysis td { padding: 10px; vertical-align: middle; } .model-analysis img { width: auto; /* Maintain aspect ratio */ display: block; margin: 0 auto; max-height: 750px; /* Default height for most images */ } </style> <div class="model-analysis">checkpoint-34280 (T5-GenQ-TD-v1) significantly outperforms query-gen-msmarco-t5-base-v1 across all ROUGE metrics.
The difference is most notable in ROUGE-2, where checkpoint-34280 achieves 56.24% vs. 15.29% for the baseline model.
These results suggest checkpoint-34280 produces more precise and high-overlap text generations.</td></tr>
</table>
checkpoint-34280 (T5-GenQ-TD-v1) has strong peaks near 100%, indicating high overlap with reference texts.
query-gen-msmarco-t5-base-v1 shows a broader distribution, with peaks at low to mid-range scores (10-40%), suggesting greater variability but lower precision.
ROUGE-2 has a high density at 0% for the baseline model, implying many instances with no bigram overlap.</td></tr> </table>
</details> <details><summary>Histogram comparison </summary> <table style="width:100%"><tr> <td style="width:65%"><img src="histogram_comparison.png" alt="image"></td> <td>checkpoint-34280 (T5-GenQ-TD-v1, blue) shows a steady increase toward high ROUGE scores, peaking at 100%.
query-gen-msmarco-t5-base-v1 (orange) has multiple low-score peaks, particularly in ROUGE-2, reinforcing its lower text overlap performance.
These histograms confirm that checkpoint-34280 consistently generates more accurate outputs.</td></tr>
</table>
Consistent ROUGE Scores (Sizes 2-8):
ROUGE-1, ROUGE-2, ROUGE-L, and ROUGE-LSUM scores remain high and stable across most word sizes.
Sharp Drop at Size 9:
A significant decrease in scores occurs for size 9 words, with negative score differences, suggesting longer phrases are less aligned with reference texts.
Score Differences Stay Near Zero (Sizes 2-8):
Models perform similarly for shorter text spans but diverge at larger word sizes. </td></tr> </table>
</details> <details><summary>Semantic similarity distribution </summary> <table style="width:100%"><tr> <td style="width:65%"><img src="semantic_similarity_distribution.png" alt="image"></td> <td>This histogram visualizes the distribution of cosine similarity scores, which measure the semantic similarity between paired texts (generated query and target query).A strong peak near 1.0 indicates that most pairs are highly semantically similar.
Low similarity scores (0.0โ0.4) are rare, suggesting the dataset consists mostly of highly related text pairs.</td></tr> </table>
</details> <details><summary>Semantic similarity score against ROUGE scores </summary> <table style="width:100%"><tr> <td style="width:65%"><img src="similarity_vs_rouge.png" alt="image"></td> <td> This scatter plot matrix shows the relationship between semantic similarity (cosine similarity) and ROUGE scores:Higher similarity โ Higher ROUGE scores, indicating a positive correlation.
ROUGE-1 & ROUGE-L show the strongest alignment, while ROUGE-2 has greater variance.
Some low-similarity outliers still achieve moderate ROUGE scores, suggesting surface-level overlap without deep semantic alignment.
This analysis helps understand how semantic similarity aligns with n-gram overlap metrics for evaluating text models. </td></tr> </table>
</details> </div>For questions, please open an issue on the GitHub Repository