Update README.md
Browse files
README.md
CHANGED
@@ -44,13 +44,9 @@ tokenized = tokenizer(text, return_tensors='pt')
|
|
44 |
output = model(**tokenized)
|
45 |
|
46 |
# result
|
47 |
-
|
48 |
-
logits = logits.detach().cpu().numpy()
|
49 |
|
50 |
-
#
|
51 |
-
pred = [p for p in np.argmax(logits, axis=2)][0][1:-1]
|
52 |
-
|
53 |
-
# Check pred
|
54 |
for txt, pred in zip(tokenizer.tokenize(text), pred):
|
55 |
print("{}\t{}".format(id2tag[pred], txt))
|
56 |
# B_MT ▁mental
|
|
|
44 |
output = model(**tokenized)
|
45 |
|
46 |
# result
|
47 |
+
pred = np.argmax(output[0].cpu().detach().numpy(), axis=2)[0][1:-1]
|
|
|
48 |
|
49 |
+
# check pred
|
|
|
|
|
|
|
50 |
for txt, pred in zip(tokenizer.tokenize(text), pred):
|
51 |
print("{}\t{}".format(id2tag[pred], txt))
|
52 |
# B_MT ▁mental
|