MDDDDR commited on
Commit
b2cb0a3
1 Parent(s): 27f6d76

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -6
README.md CHANGED
@@ -44,13 +44,9 @@ tokenized = tokenizer(text, return_tensors='pt')
44
  output = model(**tokenized)
45
 
46
  # result
47
- logits = output['logits']
48
- logits = logits.detach().cpu().numpy()
49
 
50
- # remove start & end tag
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