Emanuela Boros commited on
Commit
c9bfd8b
1 Parent(s): 0ed70a2

confidence doesnt wokr propeerly

Browse files
Files changed (1) hide show
  1. generic_nel.py +4 -1
generic_nel.py CHANGED
@@ -160,6 +160,9 @@ class NelPipeline(Pipeline):
160
  wikipedia_prediction, enclosed_entity, lOffset, rOffset, percentage = outputs
161
  qid, language = get_wikipedia_page_props(wikipedia_prediction)
162
  title, url = get_wikipedia_title(qid, language="en")
 
 
 
163
  results = [
164
  {
165
  # "id": f"{lOffset}:{rOffset}:{enclosed_entity}:{NEL_MODEL}",
@@ -168,7 +171,7 @@ class NelPipeline(Pipeline):
168
  "wkpedia_pagename": title,
169
  "wkpedia_url": url,
170
  "type": "UNK",
171
- "confidence_nel": round(percentage, 2),
172
  "lOffset": lOffset,
173
  "rOffset": rOffset,
174
  }
 
160
  wikipedia_prediction, enclosed_entity, lOffset, rOffset, percentage = outputs
161
  qid, language = get_wikipedia_page_props(wikipedia_prediction)
162
  title, url = get_wikipedia_title(qid, language="en")
163
+
164
+ percentage = round(percentage, 2)
165
+
166
  results = [
167
  {
168
  # "id": f"{lOffset}:{rOffset}:{enclosed_entity}:{NEL_MODEL}",
 
171
  "wkpedia_pagename": title,
172
  "wkpedia_url": url,
173
  "type": "UNK",
174
+ "confidence_nel": percentage,
175
  "lOffset": lOffset,
176
  "rOffset": rOffset,
177
  }