0.5: pred = 'light' else: pred = 'dark' html += "

Based on the description, the model believes that t" /> 0.5: pred = 'light' else: pred = 'dark' html += "

Based on the description, the model believes that t" /> 0.5: pred = 'light' else: pred = 'dark' html += "

Based on the description, the model believes that t"/>

How do I display <IPython.core.display.HTML object> in Pycharm IDE

353 Views Asked by At

Here is my code:

html = ""
if y_pred[0]>0.5:
  pred = 'light'
else:
  pred = 'dark'
html += "<span><h3>Based on the description, the model believes that this is a {} coffee roast. 
".format(pred)
html += "<small><br>Confidence: {:.0f}%<br><br></small></h3></span>".format(abs(((y_pred[0] 
[0]*100)-50)*2))
for j,i in enumerate(tokenizer.sequences_to_texts(Xtst)[0].split()):
  html += "<span style='background-color:rgba({},0,150,{})'>{} 
  </span>".format(heatmap[math.floor(j/norm_len)]*255,heatmap[math.floor(j/norm_len)]-0.3,i)
HTML(html)
plt.show()

This does not give any output. How do I view it on my Pycharm IDE?

0

There are 0 best solutions below