cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Visualizations not displaying

DavidKxx
New Contributor III

With a copy of notebook https://github.com/JohnSnowLabs/spark-nlp-workshop/blob/master/open-source-nlp/03.0.SparkNLP_Pretrai... imported into Databricks, there's a lovely visualization created by the cell that you can locate by searching on "import NerVisualizer":

DavidKxx_0-1701107229407.png

However, when I actually run that cell, Databricks only gives me the following where the visualization ought to be:

DavidKxx_1-1701107287817.png

Is there a trick that will make the image show up?

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions

DavidKxx
New Contributor III

Here's a solution:  use a parameter (here, `return_html = True`) to get an HTML object back, and then call `displayHTML` to actually display the object.

from sparknlp_display import NerVisualizer

visualiser = NerVisualizer()

for i in text_list:

    light_result = light_model.fullAnnotate(i)
    html = visualiser.display(light_result[0], label_col='ner_chunk', document_col='document', return_html=True)
    displayHTML(html)

  

View solution in original post

1 REPLY 1

DavidKxx
New Contributor III

Here's a solution:  use a parameter (here, `return_html = True`) to get an HTML object back, and then call `displayHTML` to actually display the object.

from sparknlp_display import NerVisualizer

visualiser = NerVisualizer()

for i in text_list:

    light_result = light_model.fullAnnotate(i)
    html = visualiser.display(light_result[0], label_col='ner_chunk', document_col='document', return_html=True)
    displayHTML(html)

  

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.