MCPcopy Create free account
hub / github.com/brightmart/text_classification / get_label_using_logits

Function get_label_using_logits

a08_predict_ensemble.py:186–193  ·  view source on GitHub ↗
(logits,vocabulary_index2word_label,top_number=5)

Source from the content-addressed store, hash-verified

184
185# get label using logits
186def get_label_using_logits(logits,vocabulary_index2word_label,top_number=5):
187 index_list=np.argsort(logits)[-top_number:] #print("sum_p", np.sum(1.0 / (1 + np.exp(-logits))))
188 index_list=index_list[::-1]
189 label_list=[]
190 for index in index_list:
191 label=vocabulary_index2word_label[index]
192 label_list.append(label) #('get_label_using_logits.label_list:', [u'-3423450385060590478', u'2838091149470021485', u'-3174907002942471215', u'-1812694399780494968', u'6815248286057533876'])
193 return label_list
194
195# get label using logits
196def get_label_using_logits_with_value(logits,vocabulary_index2word_label,top_number=5):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected