Select Git revision
sample_conll.py NaN GiB
import poldeepner2
ner = poldeepner2.load("../poldeepner2_models/dev/conll_en_context/model_union_128_101_v_001", device="cpu")
ner.model.config.sequence_generator = "single"
sentences = ["""(CNN)In a new criminal court case against a woman alleged to
have entered the US Capitol on January 6, the FBI noted that a tipster
raised the possibility of a laptop being stolen from House Speaker Nancy
Pelosi's office to potentially sell to Russia."""]
for sentence in sentences:
print("-" * 20)
print(sentence)
for name in ner.process_text(sentence):
name_range = "%d:%d" % (name.start, name.end)
print("%-8s %-20s %s" % (name_range, name.label, name.text))