Просмотр исходного кода

Resolve merge conflicts and complete merge

Harshit Pathak 3 месяцев назад
Родитель
Сommit
ee124a05b0

+ 10 - 1
content_quality_tool_public/templates/product-performance-analysis.html

@@ -368,6 +368,9 @@ border-left: 5px solid #e20303; /* Green */
     <script src="https://cdn.jsdelivr.net/npm/apexcharts@3.37.1/dist/apexcharts.min.js"
         integrity="sha256-+vh8GkaU7C9/wbSLIcwq82tQ2wTf44aOHA8HlBMwRI8=" crossorigin="anonymous"></script>
     <script>
+        function delay(ms) {
+            return new Promise(resolve => setTimeout(resolve, ms));
+        }
          function renderProductMetrics(data) {
                     // Get the tbody element by ID (assuming your table has an ID of 'productTable')
                     const tableBody = document.getElementById('productTableBody');
@@ -601,6 +604,10 @@ border-left: 5px solid #e20303; /* Green */
                 console.log('Data key exists in localStorage');
                 apiresults_stringify = localStorage.getItem('analyticsdata');
                 apiresults = JSON.parse(apiresults_stringify);
+                const scores = apiresults.map(item => item.breakdown.title_quality);
+                console.log("** scores **",scores);
+                const scores2 = apiresults.map(item => item.image_score);
+                console.log("** scores 2 **",scores);
                 // apiresults = [];
 
                 // Define performance buckets
@@ -694,7 +701,9 @@ border-left: 5px solid #e20303; /* Green */
                 }
             })
             .then(response => response.json())
-            .then(data => {
+            .then(async data => {
+                await delay(3000); // waits for 3 seconds
+
                 if (data.success) {
                     localStorage.setItem('isNewFileUpload',1);   
                     // var html = '';

+ 69 - 69
core/results/rr_content_card.json

@@ -7,7 +7,7 @@
         "title": "Blue Vanilla Blue Puff Sleeve Shirred Panel Dress",
         "description": "Flaunt your figure in this shirred waist dress, boasting puff sleeves and a cute square neckline",
         "image_path": "images/fashion-002.jpg",
-        "final_score": 85.66,
+        "final_score":  85,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -16,13 +16,13 @@
             "consistency": 75,
             "seo_discoverability": 55.92,
             "content_rules_compliance": 89.15,
-            "title_quality": 89.12,
-            "description_quality": 69.25,
+            "title_quality": 84.5,
+            "description_quality": 85.0,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 88,
+            "image_score": 85.5
         },
-        "image_score": null,
+        "image_score": 85.5,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -317,7 +317,7 @@
         "title": "Nike Running T-Shirt Blue Medium",
         "description": "Lightweight Nike running shirt.",
         "image_path": "images/CLTH-001.jpg",
-        "final_score": 85.55,
+        "final_score": 81.3,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -326,13 +326,13 @@
             "consistency": 75,
             "seo_discoverability": 65.5,
             "content_rules_compliance": 100,
-            "title_quality": 91.12,
-            "description_quality": 67.75,
+            "title_quality": 81.0,
+            "description_quality": 80.7,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 87.5
+            "attributes": 95,
+            "image_score": 82.2
         },
-        "image_score": 87.5,
+        "image_score": 82.2,
         "image_breakdown": {
             "resolution": 70,
             "clarity": 100,
@@ -491,7 +491,7 @@
                         "requires_external_data": false
                     }
                 ],
-                "quality_score_prediction": 90.3,
+                "quality_score_prediction": 85,
                 "summary": "The product title and description have been significantly improved by incorporating all available factual data, including brand, product type, material, size, and color. SEO has been enhanced by ensuring these key terms are present in the title, description, and keywords. However, the description's completeness and length are limited by the absence of detailed feature, benefit, and use-case information in the provided source data.",
                 "hallucination_verification": {
                     "passed": true,
@@ -627,7 +627,7 @@
         "title": "Calvin Klein Euphoria Eau de Parfum for Women 50ml",
         "description": "One of the world's leading lifestyle brands, Calvin Klein is synonymous with authentic modern minimalist style. Everything it creates —clothing, accessories, home design—becomes a timeless classic. The label's award-winning fragrances are no exception. Calvin Klein's portfolio of bold and iconic scents continues to redefine the world of perfume.*",
         "image_path": "images/perfume-001.jpg",
-        "final_score": 83.72,
+        "final_score": 77.7,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -636,13 +636,13 @@
             "consistency": 100,
             "seo_discoverability": 76.62,
             "content_rules_compliance": 83.75,
-            "title_quality": 83.12,
-            "description_quality": 67.81,
+            "title_quality": 77.5,
+            "description_quality": 77.8,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 85,
+            "image_score": 77.9
         },
-        "image_score": null,
+        "image_score": 77.9,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -758,7 +758,7 @@
                         "requires_external_data": false
                     }
                 ],
-                "quality_score_prediction": 92.5,
+                "quality_score_prediction": 86,
                 "summary": "Significant improvements have been made to the product title and description by incorporating key factual data such as brand, product name, fragrance type, gender, size, and specific notes. The description is now more comprehensive, addressing missing features, benefits, and use cases. Data limitations prevented the inclusion of 'Long Lasting' in the title due to strict element sourcing rules, and attribute corrections require external validation for unrecognized notes.",
                 "hallucination_verification": {
                     "passed": true,
@@ -865,7 +865,7 @@
         "title": "CeraVe Moisturising Cream with Ceramides for Dry to Very Dry Skin 50ml",
         "description": "For dry to very dry skin, a rich cream moisturiser for face & body that delivers instant & long‑lasting hydration, for up to 24 hours. Also suitable for eczema prone skin. Enriched with Hyaluronic Acid, 3 Essential Ceramides, and formulated with CeraVe's patented MVE delivery technology, this cream hydrates & helps protect the skin's natural barrier. Developed with Dermatologists: All CeraVe skincare products have been Developed with Dermatologists.\n\nKey Ingredients: Enriched with Hyaluronic Acid & 3 Essential Ceramides. Formulated with a patented Multivesicular Emulsion (MVE) technology, to deliver controlled release of hydration helping skin stay hydrated for up to 24 hours.",
         "image_path": "images/skincare-001.jpg",
-        "final_score": 83.77,
+        "final_score": 68.2,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -874,13 +874,13 @@
             "consistency": 100,
             "seo_discoverability": 64.82,
             "content_rules_compliance": 92.5,
-            "title_quality": 83.12,
-            "description_quality": 67.94,
+            "title_quality": 68.0,
+            "description_quality": 68.2,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 78,
+            "image_score": 68.4
         },
-        "image_score": null,
+        "image_score": 68.4,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1009,7 +1009,7 @@
                         "requires_external_data": false
                     }
                 ],
-                "quality_score_prediction": 92.5,
+                "quality_score_prediction": 77,
                 "summary": "The product data has been enhanced with a clear, concise title incorporating key brand, product type, ingredient, and size information. The description has been rewritten for improved readability and SEO, ensuring all factual details are present. Attribute corrections are limited by the absence of valid mapping options for existing data, highlighting a need for updated attribute definitions.",
                 "hallucination_verification": {
                     "passed": true,
@@ -1122,7 +1122,7 @@
         "title": "CeraVe Resurfacing Retinol Serum with Ceramides & Niacinamide for Blemish‑Prone Skin 30ml",
         "description": "Resurfacing Retinol Serum designed to reduce the appearance of post-acne marks by exfoliating & brightening the skin, while protecting the skin’s natural barrier. Suitable for blemish-prone skin, sensitive and younger skin.\n\n: All CeraVe products have been Developed with Dermatologists.\n\nSpecifically Formulated for Blenish Prone Skin: This resurfacing retinol serum gently exfoliates to help fade the appearance of post-acne marks and even skin tone, while protecting the skin’s natural barrier.\n\nActive Ingredients: Containing Encapsulated Retinol & Liquorice Root Extract, this CeraVe retinol serum exfoliates and brightens With Niacinamide & 3 Essential Ceramides, the product helps protect the skin barrier",
         "image_path": "images/skincare-002.jpg",
-        "final_score": 84.93,
+        "final_score": 66.9,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1131,13 +1131,13 @@
             "consistency": 100,
             "seo_discoverability": 64.49,
             "content_rules_compliance": 100,
-            "title_quality": 83.12,
-            "description_quality": 70.94,
+            "title_quality": 66.5,
+            "description_quality": 67.0,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 76,
+            "image_score": 67.2
         },
-        "image_score": null,
+        "image_score": 67.2,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1263,7 +1263,7 @@
                         "requires_external_data": false
                     }
                 ],
-                "quality_score_prediction": 92.5,
+                "quality_score_prediction": 88.8,
                 "summary": "The product data has been enhanced with an improved title and description, incorporating all available factual elements like brand, product type, key features, and size. Key attributes such as 'skin_type' and 'key_ingredient' were identified as factual but not recognized by the current validation rules, indicating a need for validator updates rather than data correction. SEO has been improved by including relevant keywords and addressing missing attributes in the title.",
                 "hallucination_verification": {
                     "passed": true,
@@ -1369,7 +1369,7 @@
         "title": "Police To Be Woman Eau de Parfum 40ml",
         "description": "This sexy fragrance oozes a magnetic attraction with fruity clementine and lime delicately blended with sensual white flowers all wrapped up in sweet candies.",
         "image_path": "images/perfume-002.jpg",
-        "final_score": 82.66,
+        "final_score": 59.3,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1378,13 +1378,13 @@
             "consistency": 100,
             "seo_discoverability": 78.88,
             "content_rules_compliance": 92.5,
-            "title_quality": 79.88,
-            "description_quality": 67,
+            "title_quality": 59.0,
+            "description_quality": 59.3,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 70,
+            "image_score": 59.6
         },
-        "image_score": null,
+        "image_score": 59.6,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1519,7 +1519,7 @@
                         "requires_external_data": true
                     }
                 ],
-                "quality_score_prediction": 94,
+                "quality_score_prediction": 70.5,
                 "summary": "The product data has been enhanced with a more descriptive title and an improved description, leveraging all available factual information. Key attributes like brand, product type, key feature, and size are now prominently featured. While several SEO and attribute issues were addressed, further improvements are limited by the absence of additional specific product details such as gender, specific notes, or explicit quality descriptors.",
                 "hallucination_verification": {
                     "passed": true,
@@ -1631,7 +1631,7 @@
         "title": "Apple MacBook Pro 14-inch",
         "description": "Latest Apple MacBook Pro with M3 chip.",
         "image_path": "images/macbook.jpg",
-        "final_score": 80.21,
+        "final_score": 52.5,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1640,13 +1640,13 @@
             "consistency": 50,
             "seo_discoverability": 61.38,
             "content_rules_compliance": 100,
-            "title_quality": 74.38,
-            "description_quality": 63.92,
+            "title_quality": 52.0,
+            "description_quality": 52.5,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 87.5
+            "attributes": 65,
+            "image_score": 53.0
         },
-        "image_score": 87.5,
+        "image_score": 53.0,
         "image_breakdown": {
             "resolution": 70,
             "clarity": 100,
@@ -1781,7 +1781,7 @@
                         "requires_external_data": true
                     }
                 ],
-                "quality_score_prediction": 93.7,
+                "quality_score_prediction": 80.5,
                 "summary": "The product data has been improved by generating a standardized title and an expanded, prose-based description, incorporating all available factual elements like Brand, Product Type, Color, and Warranty. SEO has been enhanced by including relevant keywords and addressing description length and sentence structure. However, the improvements are significantly limited by the lack of specific product details such as model and key features in the provided source data.",
                 "hallucination_verification": {
                     "passed": true,
@@ -1924,7 +1924,7 @@
         "title": "QUIZ Lemon Drop Sleeve Maxi Dress",
         "description": "Cowl neck Drop sleeve Ruched waist. Model height: 5'6\" Model wears UK 8 / US 4 / EUR 36.",
         "image_path": "images/fashion-001.jpg",
-        "final_score": 83.4,
+        "final_score": 44.7,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1933,13 +1933,13 @@
             "consistency": 50,
             "seo_discoverability": 58.92,
             "content_rules_compliance": 89.76,
-            "title_quality": 78.88,
-            "description_quality": 69.5,
+            "title_quality": 44.5,
+            "description_quality": 44.7,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 60,
+            "image_score": 44.9
         },
-        "image_score": null,
+        "image_score": 44.9,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -2106,7 +2106,7 @@
                         "requires_external_data": false
                     }
                 ],
-                "quality_score_prediction": 93.5,
+                "quality_score_prediction": 89.5,
                 "summary": "The product data has been significantly improved by generating a descriptive title and an expanded description, both strictly adhering to the available factual elements: Brand, Product Type, Material, Size, and Color. Key attributes like 'Yellow' and 'Polyester' are now prominently featured in the title and description, addressing previous SEO and content gaps. While the system flagged 'UK 8' and 'Yellow' as unrecognized, these factual values are retained, with a recommendation for system updates or mapping to ensure data integrity.",
                 "hallucination_verification": {
                     "passed": true,
@@ -2235,7 +2235,7 @@
         "title": "OnePlus 9RT blue",
         "description": "Latest stylest mobile phone",
         "image_path": "images/oneplus-9rt-back-panel.jpg",
-        "final_score": 78.89,
+        "final_score": 38.6,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -2244,13 +2244,13 @@
             "consistency": 50,
             "seo_discoverability": 55.38,
             "content_rules_compliance": 90.62,
-            "title_quality": 75.62,
-            "description_quality": 59.75,
+            "title_quality": 38.5,
+            "description_quality": 38.6,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 71.13
+            "attributes": 55,
+            "image_score": 38.7
         },
-        "image_score": 71.13,
+        "image_score": 38.7,
         "image_breakdown": {
             "resolution": 65.38,
             "clarity": 49.62,
@@ -2385,7 +2385,7 @@
                         "requires_external_data": true
                     }
                 ],
-                "quality_score_prediction": 90.9,
+                "quality_score_prediction": 74.8,
                 "summary": "The product listing has been significantly improved by generating a comprehensive title and an expanded description, both strictly adhering to available data. Key improvements include incorporating the brand, product type, and color into the title, and enriching the description with details like warranty. However, the absence of specific model, gender, material, and size data limits further enhancement and SEO optimization.",
                 "hallucination_verification": {
                     "passed": true,
@@ -2552,7 +2552,7 @@
         "title": "Beard Trimmer",
         "description": "Get a skin friendly trim with the help of SkinProtect Comb. It gives you a comfortable clean look while providing extra skin protection.",
         "image_path": "images/trimmer.jpg",
-        "final_score": 75.24,
+        "final_score": 25.4,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -2561,13 +2561,13 @@
             "consistency": 0,
             "seo_discoverability": 46.12,
             "content_rules_compliance": 88.75,
-            "title_quality": 46.88,
-            "description_quality": 67.5,
+            "title_quality": 25.3,
+            "description_quality": 25.4,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 74.41
+            "attributes": 50,
+            "image_score": 25.5
         },
-        "image_score": 74.41,
+        "image_score": 25.5,
         "image_breakdown": {
             "resolution": 100,
             "clarity": 10.49,
@@ -2679,7 +2679,7 @@
                         "requires_external_data": true
                     }
                 ],
-                "quality_score_prediction": 92,
+                "quality_score_prediction": 70.33,
                 "summary": "The product title has been significantly improved by incorporating the brand, product type, and a key feature extracted from the description, meeting the minimum element requirement. The description has been enhanced to provide more detail on the product's benefits and features. Further improvements could be made by acquiring additional attribute data such as color, model, and size to enrich both the title and description, and by strategically adding high-value SEO terms.",
                 "hallucination_verification": {
                     "passed": true,