Recognize Entities DL Pipeline for Swedish - Medium

Description

The entity_recognizer_md is a pretrained pipeline that we can use to process text with a simple pipeline that performs basic processing steps. It performs most of the common text processing tasks on your dataframe

Open in Colab Download Copy S3 URI

How to use


from sparknlp.pretrained import PretrainedPipelinein
pipeline = PretrainedPipeline('entity_recognizer_md', lang = 'sv')
annotations =  pipeline.fullAnnotate(""Hej från John Snow Labs! "")[0]
annotations.keys()


val pipeline = new PretrainedPipeline("entity_recognizer_md", lang = "sv")
val result = pipeline.fullAnnotate("Hej från John Snow Labs! ")(0)



import nlu
text = [""Hej från John Snow Labs! ""]
result_df = nlu.load('sv.ner.md').predict(text)
result_df

Results

|    | document                      | sentence                     | token                                    | embeddings                   | ner                                   | entities            |
|---:|:------------------------------|:-----------------------------|:-----------------------------------------|:-----------------------------|:--------------------------------------|:--------------------|
|  0 | ['Hej från John Snow Labs! '] | ['Hej från John Snow Labs!'] | ['Hej', 'från', 'John', 'Snow', 'Labs!'] | [[0.4006600081920624,.,...]] | ['O', 'O', 'B-PER', 'I-PER', 'I-PER'] | ['John Snow Labs!'] |

Model Information

Model Name: entity_recognizer_md
Type: pipeline
Compatibility: Spark NLP 3.0.0+
License: Open Source
Edition: Official
Language: sv