npedrazzini commited on
Commit
9a87d6b
·
verified ·
1 Parent(s): da1a8f5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -76,9 +76,7 @@ from continuous_time_embedding import load_continuous_time_model
76
  tokenizer, model = load_continuous_time_model(REPO_ID)
77
  device = next(model.parameters()).device
78
  ```
79
-
80
- ### Check changes in top mask prediction or in token probability
81
-
82
 
83
  ```python
84
  def predict_masked(sentence, year, top_k=5):
@@ -121,7 +119,11 @@ def get_target_word_probability(sentence, target_word, year):
121
 
122
  prob = math.exp(logprob_sum) if len(target_ids) == 1 else None
123
  return prob, logprob_sum
 
124
 
 
 
 
125
  ### Example 1: fill-mask, top predictions at different years
126
  sentence = "The [MASK] arrived on time."
127
  for year in [1800, 1810, 1820, 1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910, 1920]:
 
76
  tokenizer, model = load_continuous_time_model(REPO_ID)
77
  device = next(model.parameters()).device
78
  ```
79
+ ### Basic functions to get top mask predictions and token probability
 
 
80
 
81
  ```python
82
  def predict_masked(sentence, year, top_k=5):
 
119
 
120
  prob = math.exp(logprob_sum) if len(target_ids) == 1 else None
121
  return prob, logprob_sum
122
+ ```
123
 
124
+ ### Check changes in top mask prediction or in token probability
125
+
126
+ ```python
127
  ### Example 1: fill-mask, top predictions at different years
128
  sentence = "The [MASK] arrived on time."
129
  for year in [1800, 1810, 1820, 1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910, 1920]: