atrytone commited on
Commit
3c1f754
·
1 Parent(s): 2395fbd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -45,7 +45,7 @@ To create embeddings and for classification:
45
  title = 'MIReAD: simple method for learning scientific representations'
46
  abstract = 'Learning semantically meaningful representations from scientific documents can ...'
47
  text = title + tokenizer.sep_token + abstract
48
- tokens = tokenizer(sents,
49
  max_length=512,
50
  padding=True,
51
  truncation=True,
@@ -54,12 +54,12 @@ tokens = tokenizer(sents,
54
 
55
  # for embeddings
56
  with torch.no_grad():
57
- out = model.bert(**tokens)
58
- feature = out.last_hidden_state[:, 0, :]
59
 
60
  # for classification
61
- out = model(**inputs)
62
- logits = out.logits
63
  ```
64
 
65
  ## Training procedure
 
45
  title = 'MIReAD: simple method for learning scientific representations'
46
  abstract = 'Learning semantically meaningful representations from scientific documents can ...'
47
  text = title + tokenizer.sep_token + abstract
48
+ tokens = tokenizer(text,
49
  max_length=512,
50
  padding=True,
51
  truncation=True,
 
54
 
55
  # for embeddings
56
  with torch.no_grad():
57
+ output = model.bert(**tokens)
58
+ embedding = output.last_hidden_state[:, 0, :]
59
 
60
  # for classification
61
+ output = model(**tokens)
62
+ class = out.logits
63
  ```
64
 
65
  ## Training procedure