Recognize Entities OntoNotes - BERT Large

Description

A pre-trained pipeline containing NerDl Model. The NER model trained on OntoNotes 5.0 with bert_large_cased embeddings. It can extract up to following 18 entities:

Predicted Entities

CARDINAL, DATE, EVENT, FAC, GPE, LANGUAGE, LAW, LOC, MONEY, NORP, ORDINAL, ORG, PERCENT, PERSON, PRODUCT, QUANTITY, TIME, WORK_OF_ART.

Live Demo Download Copy S3 URI

How to use

from sparknlp.pretrained import PretrainedPipeline

pipeline = PretrainedPipeline('onto_recognize_entities_bert_large')

result = pipeline.annotate("Johnson first entered politics when elected in 2001 as a member of Parliament. He then served eight years as the mayor of London, from 2008 to 2016, before rejoining Parliament.")
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val pipeline = new PretrainedPipeline("onto_recognize_entities_bert_large")

val result = pipeline.annotate("Johnson first entered politics when elected in 2001 as a member of Parliament. He then served eight years as the mayor of London, from 2008 to 2016, before rejoining Parliament.")
import nlu

text = ["""Johnson first entered politics when elected in 2001 as a member of Parliament. He then served eight years as the mayor of London, from 2008 to 2016, before rejoining Parliament."""]
ner_df = nlu.load('en.ner.onto.bert.large').predict(text, output_level='chunk')
ner_df[["entities", "entities_class"]]

Results

+------------+---------+
|chunk       |ner_label|
+------------+---------+
|Johnson     |PERSON   |
|first       |ORDINAL  |
|2001        |DATE     |
|Parliament  |ORG      |
|eight years |DATE     |
|London      |GPE      |
|2008 to 2016|DATE     |
|Parliament  |ORG      |
+------------+---------+

Model Information

Model Name: onto_recognize_entities_bert_large
Type: pipeline
Compatibility: Spark NLP 2.7.0+
Edition: Official
Language: en

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • Tokenizer
  • BertEmbeddings
  • NerDLModel
  • NerConverter