Emanuela Boros
commited on
Commit
·
f437981
1
Parent(s):
69c8f9c
added confidence
Browse files- generic_nel.py +4 -6
generic_nel.py
CHANGED
@@ -122,12 +122,10 @@ class NelPipeline(Pipeline):
|
|
122 |
)
|
123 |
# Process the scores for each token
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
# # scores_tensor = scores.clone().detach()
|
130 |
-
probabilities = torch.exp(scores)
|
131 |
# percentages = (probabilities * 100.0).cpu().numpy().tolist()
|
132 |
|
133 |
# # Process each score (logits for the generated tokens)
|
|
|
122 |
)
|
123 |
# Process the scores for each token
|
124 |
|
125 |
+
transition_scores = self.model.compute_transition_scores(
|
126 |
+
outputs.sequences, outputs.scores, normalize_logits=True
|
127 |
+
)
|
128 |
+
|
|
|
|
|
129 |
# percentages = (probabilities * 100.0).cpu().numpy().tolist()
|
130 |
|
131 |
# # Process each score (logits for the generated tokens)
|