Skip to content
Snippets Groups Projects
Select Git revision
  • 6da406199d906c4bfbe2681839c5b448096dbdce
  • master default protected
  • develop protected
  • develop-0.7.x
  • develop-0.8.0
  • dev_czuk
  • loader
  • kgr10_roberta
  • 14-BiLSTM-CRF-RoBERTa
  • 12-handle-long-sequences
  • 13-flair-embeddings
  • BiLSTM
  • v0.7.0
  • v0.6.1
  • v0.5
  • v0.4.1
  • v0.3
17 results

poleval_ner_test.py

Blame
  • sample_conll.py 723 B
    """A message of shame -- documentation must be completed."""
    
    import poldeepner2.models
    
    ner = poldeepner2.models.load("conll-english-large-sq", device="cuda:0",
                                  resources_path="/tmp")
    
    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))