cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

Visualizations not displaying

DavidKxx
Contributor

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
Contributor

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
Contributor

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)

  

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group