IPython Widgets Separated by Character Rather Than Word
As you can tell in the picture below, the table is separated by characters rather than full words.
def apply(f):
    text = f
    text = re.sub(r'\W+', ' ', text)
    res = LM().check_probabilities(text, topk=20)
    l = str(res)
    paraphrase_widget = widgets.SelectMultiple(
    options=l,
    description='Paraphrases',
    disabled=False,
    layout= widgets.Layout(width='100%')
   )
    display(paraphrase_widget)
    return {&quot;result&quot;: res}


apply(&quot;In order to&quot;)



The issue here is in unpacking pytorch's prediction and passing those results to the widget in proper format (a list of tuples). Here's how you can do that:
# Modify your widget to the following
paraphrase_widget = widgets.SelectMultiple(
      options=res['pred_topk'][2],
      description='Paraphrases',
      disabled=False,
      layout= widgets.Layout(width='100%', height=&quot;300px&quot;)
   )


Here's what this looks like for me:

