Esempio n. 1
0
 def test_chunk_embeds(self):
     pdf = get_sample_pdf()
     res = nlu.load('embed_chunk',
                    verbose=True).predict("What a wondful day!")
     print(res)
     res = nlu.load('en.embed_chunk', verbose=True).predict(pdf)
     print(res)
Esempio n. 2
0
 def test_ngram(self):
     pdf = get_sample_pdf()
     # res = nlu.load('ngram',verbose=True).predict(pdf )
     pipe = nlu.load('ngram',verbose=True)
     # print(res['ngrams'])
     print("PIPE", pipe)
     res = nlu.load('en.ngram',verbose=True).predict(pdf)
     print(res['ngrams'])
    def test_pdf_column_prediction(self):
        pdf = get_sample_pdf()
        res = nlu.load('sentiment',
                       verbose=True).predict(pdf['text'],
                                             output_level='sentence')
        # res = nlu.load('bert',verbose=True).predict('@Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix. You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision. While it remains a burden assiduously avoided, it is not unexpected, and thus not beyond a measure of control. Which has led you, inexorably, here.', output_level='sentence')

        print(res)
        print(res['sentiment'])

        print(res.dtypes)
Esempio n. 4
0
 def test_xx_bert(self):
     pdf = get_sample_pdf()
     res = nlu.load('xx.embed_sentence',verbose=True).predict(pdf )
     print(res)
Esempio n. 5
0
 def test_e2e(self):
     pdf = get_sample_pdf()
     res = nlu.load('en.classify.e2e',verbose=True).predict(pdf )
     print(res)
Esempio n. 6
0
 def test_embed_sentence_bert(self):
     pdf = get_sample_pdf()
     res = nlu.load('en.embed_sentence.biobert.pubmed_base_cased',verbose=True).predict(pdf )
     print(res)
Esempio n. 7
0
 def test_embed_sentence_bert(self):
     pdf = get_sample_pdf()
     res = nlu.load('en.embed_sentence.small_bert_L2_128',verbose=True).predict(pdf )
     print(res)
Esempio n. 8
0
 def test_electra(self):
     pdf = get_sample_pdf()
     res = nlu.load('en.embed.electra',verbose=True).predict(pdf )
     print(res)
Esempio n. 9
0
 def test_auto_sentence_embed_elmo(self): # TODO  WIP
     pdf = get_sample_pdf()
     res = nlu.load('embed_sentence.elmo',verbose=True).predict(pdf )
     print(res)
Esempio n. 10
0
 def test_text_matcher(self):
     pdf = get_sample_pdf()
     res = nlu.load('match.text',verbose=True).predict(pdf )
     print(res)
Esempio n. 11
0
 def test_norm(self):
     pdf = get_sample_pdf()
     res = nlu.load('norm',verbose=True).predict(pdf, output_positions=True )
     print(res)
Esempio n. 12
0
 def test_stem(self):
     pdf = get_sample_pdf()
     res = nlu.load('stem',verbose=True).predict(pdf )
     print(res)
     res = nlu.load('en.stem',verbose=True).predict(pdf)
     print(res)