Update README.md
Browse files
README.md
CHANGED
|
@@ -52,12 +52,12 @@ Before classifying the input sequence, the phrase needs to be processed with the
|
|
| 52 |
from transformers import BertModel, BertTokenizer
|
| 53 |
|
| 54 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
| 55 |
-
input = "Short, sleeveless dress in an airy
|
| 56 |
|
| 57 |
texts = self.tokenizer(batch, padding='max_length', max_length = 512, truncation=True,return_tensors="pt")
|
| 58 |
input_ids = texts["input_ids"]
|
| 59 |
attention_mask = texts["attention_mask"]
|
| 60 |
|
| 61 |
output = model(input_ids, attention_mask)
|
| 62 |
-
class = output.argmax(dim=1)
|
| 63 |
```
|
|
|
|
| 52 |
from transformers import BertModel, BertTokenizer
|
| 53 |
|
| 54 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
| 55 |
+
input = "Short, sleeveless dress in an airy cotton weave that is open at the back with a tie."
|
| 56 |
|
| 57 |
texts = self.tokenizer(batch, padding='max_length', max_length = 512, truncation=True,return_tensors="pt")
|
| 58 |
input_ids = texts["input_ids"]
|
| 59 |
attention_mask = texts["attention_mask"]
|
| 60 |
|
| 61 |
output = model(input_ids, attention_mask)
|
| 62 |
+
class = output.argmax(dim=1) # should be 13 (Dress)
|
| 63 |
```
|