Update README.md
Browse files
README.md
CHANGED
@@ -34,16 +34,16 @@ queries = [
|
|
34 |
"girls sandals",
|
35 |
"backpacks",
|
36 |
"shoes",
|
37 |
-
"mustard
|
38 |
]
|
39 |
documents = [
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
49 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
@@ -74,21 +74,25 @@ queries = [
|
|
74 |
"girls sandals",
|
75 |
"backpacks",
|
76 |
"shoes",
|
77 |
-
"mustard
|
78 |
]
|
79 |
documents = [
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
model = CrossEncoder(model_name, max_length=512)
|
88 |
scores = model.predict([(q, d) for q, d in zip(queries, documents)])
|
89 |
print(scores)
|
90 |
```
|
91 |
|
|
|
|
|
|
|
|
|
92 |
## Training
|
93 |
|
94 |
Trained using `CrossEntropyLoss` using `<query, document>` pairs with `grade` as the label.
|
|
|
34 |
"girls sandals",
|
35 |
"backpacks",
|
36 |
"shoes",
|
37 |
+
"mustard sleeveless gown"
|
38 |
]
|
39 |
documents = [
|
40 |
+
'{"title": "Nike Air Max, with air cushion", "description": "The best shoes you can get", "brand": "Nike", "color": "black"}',
|
41 |
+
'{"title": "Adidas Ultraboost, the best boost you can get", "description": "The shoes that represent the world", "brand": "Adidas", "color": "white"}',
|
42 |
+
'{"title": "Womens sandals", "description": "Sandals: wide width 9", "brand": "Chacos", "color": "blue"}',
|
43 |
+
'{"title": "Girls surf backpack", "description": "The best backpack in town", "brand": "Roxy", "color": "pink"}',
|
44 |
+
'{"title": "Fresh watermelon", "description": "The best fruit in town, all you can eat", "brand": "Fruitsellers Inc.", "color": "green"}',
|
45 |
+
'{"title": "Floral yellow dress with frills and lace", "description": "Brighten up your summers with a gorgeous dress", "brand": "Dressmakers Inc.", "color": "bright yellow"}'
|
46 |
+
]
|
47 |
|
48 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
49 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
74 |
"girls sandals",
|
75 |
"backpacks",
|
76 |
"shoes",
|
77 |
+
"mustard sleeveless gown"
|
78 |
]
|
79 |
documents = [
|
80 |
+
'{"title": "Nike Air Max, with air cushion", "description": "The best shoes you can get", "brand": "Nike", "color": "black"}',
|
81 |
+
'{"title": "Adidas Ultraboost, the best boost you can get", "description": "The shoes that represent the world", "brand": "Adidas", "color": "white"}',
|
82 |
+
'{"title": "Womens sandals", "description": "Sandals: wide width 9", "brand": "Chacos", "color": "blue"}',
|
83 |
+
'{"title": "Girls surf backpack", "description": "The best backpack in town", "brand": "Roxy", "color": "pink"}',
|
84 |
+
'{"title": "Fresh watermelon", "description": "The best fruit in town, all you can eat", "brand": "Fruitsellers Inc.", "color": "green"}',
|
85 |
+
'{"title": "Floral yellow dress with frills and lace", "description": "Brighten up your summers with a gorgeous dress", "brand": "Dressmakers Inc.", "color": "bright yellow"}'
|
86 |
+
]
|
87 |
model = CrossEncoder(model_name, max_length=512)
|
88 |
scores = model.predict([(q, d) for q, d in zip(queries, documents)])
|
89 |
print(scores)
|
90 |
```
|
91 |
|
92 |
+
```md
|
93 |
+
[ 1.1324936 0.51267356 1.039221 1.5969192 -0.8867093 0.5035825 ]
|
94 |
+
```
|
95 |
+
|
96 |
## Training
|
97 |
|
98 |
Trained using `CrossEntropyLoss` using `<query, document>` pairs with `grade` as the label.
|