@@ -2,7 +2,7 @@ async function generate() {
22
33const prefix = ""
44const session = await ai . languageModel . create ( {
5- temperature :0.1 ,
5+ temperature :0 ,
66topK :3 ,
77initialPrompts :[
88{ role :"system" , content :"Given a product description, provide a category name " +
@@ -27,6 +27,8 @@ async function generate() {
2727const tbody = document . getElementById ( 'productTable' ) . getElementsByTagName ( 'tbody' ) [ 0 ] ;
2828tbody . innerHTML = '' ;
2929
30+ // Keep track of categories to avoid synonyms or very similar categories.
31+ // Pre-seed with some of the common ones
3032let categories = new Set ( [ "Clothing" , "Food" , "Home" , "Health" , "Crafts" , "Toys" , "Pets" , "Electronics" , "Office Supplies" ,
3133"Books" , "Tools" , "Beauty" , "Jewelry" , "Furniture" , "Appliances" ] ) ;
3234
@@ -85,7 +87,7 @@ document.getElementById('downloadCsv').addEventListener('click', function() {
8587
8688document . addEventListener ( 'DOMContentLoaded' , async function ( ) {
8789const st = document . getElementById ( ( "status" ) ) ;
88- if ( ! 'ai' in window || ! 'languageModel' in ai ) {
90+ if ( ! ( 'ai' in window ) || ! ( 'languageModel' in ai ) ) {
8991st . textContent = "Unavailable" ;
9092return ;
9193}