- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 09:49 AM
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":
However, when I actually run that cell, Databricks only gives me the following where the visualization ought to be:
Is there a trick that will make the image show up?
Thanks.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 11:36 AM
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 11:36 AM
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)

